2014-03-18 22:07:45 +00:00
|
|
|
Pull in r199399 from upstream clang trunk (by Jakob Stoklund Olesen):
|
|
|
|
|
|
|
|
SPARCv9 implements long double as an IEEE quad.
|
|
|
|
|
2014-05-24 22:27:31 +00:00
|
|
|
Introduced here: http://svnweb.freebsd.org/changeset/base/262262
|
2014-03-18 22:07:45 +00:00
|
|
|
|
|
|
|
Index: tools/clang/test/CodeGen/sparcv9-abi.c
|
|
|
|
===================================================================
|
|
|
|
--- tools/clang/test/CodeGen/sparcv9-abi.c
|
|
|
|
+++ tools/clang/test/CodeGen/sparcv9-abi.c
|
|
|
|
@@ -18,6 +18,9 @@ long long f_int_3(long long x) { return x; }
|
|
|
|
// 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;
|
|
|
|
Index: tools/clang/lib/Basic/Targets.cpp
|
|
|
|
===================================================================
|
|
|
|
--- tools/clang/lib/Basic/Targets.cpp
|
|
|
|
+++ tools/clang/lib/Basic/Targets.cpp
|
|
|
|
@@ -4529,6 +4529,12 @@ class SparcV9TargetInfo : public SparcTargetInfo {
|
|
|
|
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,
|