r245459 - According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 19 10:02:32 PDT 2015


Author: yrnkrn
Date: Wed Aug 19 12:02:32 2015
New Revision: 245459

URL: http://llvm.org/viewvc/llvm-project?rev=245459&view=rev
Log:
According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.
See
 https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html


Added:
    cfe/trunk/test/CodeGen/mingw-long-double-size.c
Modified:
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=245459&r1=245458&r2=245459&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Aug 19 12:02:32 2015
@@ -3785,7 +3785,8 @@ class MinGWX86_32TargetInfo : public Win
 public:
   MinGWX86_32TargetInfo(const llvm::Triple &Triple)
       : WindowsX86_32TargetInfo(Triple) {
-    LongDoubleWidth = LongDoubleAlign = 128;
+    LongDoubleWidth = 96;
+    LongDoubleAlign = 128;
     LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
   }
   void getTargetDefines(const LangOptions &Opts,

Added: cfe/trunk/test/CodeGen/mingw-long-double-size.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mingw-long-double-size.c?rev=245459&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/mingw-long-double-size.c (added)
+++ cfe/trunk/test/CodeGen/mingw-long-double-size.c Wed Aug 19 12:02:32 2015
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -triple i686-pc-windows-gnu -S %s  -o - | FileCheck %s -check-prefix=CHECK_I686
+// CHECK_I686: lda,12
+// RUN: %clang_cc1 -triple x86_64-pc-windows-gnu -S %s  -o - | FileCheck %s -check-prefix=CHECK_X86_64
+// CHECK_X86_64: lda,16
+long double lda;




More information about the cfe-commits mailing list