Question about sizeof(long double) on Win64

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about sizeof(long double) on Win64

John Wiegley
My team has been working on Win64 support, and we've learned that sizeof(long
double) is 8 bytes under Visual Studio (cl.exe), but 16 bytes under Clang with
-triple x86_64-win-pc32.  Would the following change to the constructor for
WindowsX86_64TargetInfo be considered appropriate?  I imagine no one has run
into this discrepancy because people aren't using Win64 support much?

If this is an OK change to make, let me know and I'll commit.

Thanks, John

diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 683174e..4726b55 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -1589,6 +1589,8 @@ public:
     WCharType = UnsignedShort;
     LongWidth = LongAlign = 32;
     DoubleAlign = LongLongAlign = 64;
+    LongDoubleWidth = 64;
+    LongDoubleAlign = 64;
     IntMaxType = SignedLongLong;
     UIntMaxType = UnsignedLongLong;
     Int64Type = SignedLongLong;
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about sizeof(long double) on Win64

Eli Friedman
On Tue, Mar 22, 2011 at 1:53 PM, John Wiegley <[hidden email]> wrote:
> My team has been working on Win64 support, and we've learned that sizeof(long
> double) is 8 bytes under Visual Studio (cl.exe), but 16 bytes under Clang with
> -triple x86_64-win-pc32.  Would the following change to the constructor for
> WindowsX86_64TargetInfo be considered appropriate?  I imagine no one has run
> into this discrepancy because people aren't using Win64 support much?
>
> If this is an OK change to make, let me know and I'll commit.

The idea is fine, but not the implementation; should be fixed with r128110.

-Eli

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev