r252156 - [x86] Additional small fix for MCU psABI support
Andrey Bokhanko via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 5 04:43:12 PST 2015
Author: asbokhan
Date: Thu Nov 5 06:43:09 2015
New Revision: 252156
URL: http://llvm.org/viewvc/llvm-project?rev=252156&view=rev
Log:
[x86] Additional small fix for MCU psABI support
This patch fixes one more thing in MCU psABI support: LongDoubleWidth should be set to 64.
Differential Revision: http://reviews.llvm.org/D14285
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=252156&r1=252155&r2=252156&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Nov 5 06:43:09 2015
@@ -2335,8 +2335,7 @@ class X86TargetInfo : public TargetInfo
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 @@ public:
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) |
Modified: cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c?rev=252156&r1=252155&r2=252156&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-arguments-iamcu.c Thu Nov 5 06:43:09 2015
@@ -57,6 +57,6 @@ st12_t retLargeStruct(int i1, st12_t r)
// 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; }
More information about the cfe-commits
mailing list