[PATCH] D14285: [x86] Additional small fix for MCU psABI support

Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 04:45:33 PST 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL252156: [x86] Additional small fix for MCU psABI support (authored by asbokhan).

Changed prior to commit:
  http://reviews.llvm.org/D14285?vs=39063&id=39347#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14285

Files:
  cfe/trunk/lib/Basic/Targets.cpp
  cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c

Index: cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c
===================================================================
--- cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c
+++ cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c
@@ -57,6 +57,6 @@
 // CHECK-LABEL: define i32 @varArgs(i32 inreg %i1, ...)
 int varArgs(int i1, ...) { return i1; }
 
-// CHECK-LABEL: define double @longDoubleArg(double %ld1)
+// CHECK-LABEL: define double @longDoubleArg(double inreg %ld1)
 long double longDoubleArg(long double ld1) { return ld1; }
 
Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -2335,8 +2335,7 @@
 public:
   X86TargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) {
     BigEndian = false;
-    LongDoubleFormat = Triple.isOSIAMCU() ? &llvm::APFloat::IEEEdouble
-                                          : &llvm::APFloat::x87DoubleExtended;
+    LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
   }
   unsigned getFloatEvalMethod() const override {
     // X87 evaluates with 80 bits "long double" precision.
@@ -3624,6 +3623,11 @@
     IntPtrType = SignedInt;
     RegParmMax = 3;
 
+    if (getTriple().isOSIAMCU()) {
+      LongDoubleWidth = 64;
+      LongDoubleFormat = &llvm::APFloat::IEEEdouble;
+    }
+
     // Use fpret for all types.
     RealTypeUsesObjCFPRet = ((1 << TargetInfo::Float) |
                              (1 << TargetInfo::Double) |


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14285.39347.patch
Type: text/x-patch
Size: 1510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151105/9a2333fb/attachment.bin>


More information about the cfe-commits mailing list