r199399 - SPARCv9 implements long double as an IEEE quad.
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Jan 16 08:43:20 PST 2014
Author: stoklund
Date: Thu Jan 16 10:43:19 2014
New Revision: 199399
URL: http://llvm.org/viewvc/llvm-project?rev=199399&view=rev
Log:
SPARCv9 implements long double as an IEEE quad.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/sparcv9-abi.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=199399&r1=199398&r2=199399&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jan 16 10:43:19 2014
@@ -4532,6 +4532,12 @@ public:
UIntMaxType = UnsignedLong;
}
Int64Type = IntMaxType;
+
+ // The SPARCv8 System V ABI has long double 128-bits in size, but 64-bit
+ // aligned. The SPARCv9 SCD 2.4.1 says 16-byte aligned.
+ LongDoubleWidth = 128;
+ LongDoubleAlign = 128;
+ LongDoubleFormat = &llvm::APFloat::IEEEquad;
}
virtual void getTargetDefines(const LangOptions &Opts,
Modified: cfe/trunk/test/CodeGen/sparcv9-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sparcv9-abi.c?rev=199399&r1=199398&r2=199399&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/sparcv9-abi.c (original)
+++ cfe/trunk/test/CodeGen/sparcv9-abi.c Thu Jan 16 10:43:19 2014
@@ -18,6 +18,9 @@ long long f_int_3(long long x) { return
// CHECK-LABEL: define signext i8 @f_int_4(i8 signext %x)
char f_int_4(char x) { return x; }
+// CHECK-LABEL: define fp128 @f_ld(fp128 %x)
+long double f_ld(long double x) { return x; }
+
// Small structs are passed in registers.
struct small {
int *a, *b;
More information about the cfe-commits
mailing list