]> granicus.if.org Git - clang/commitdiff
SPARCv9 implements long double as an IEEE quad.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 16 Jan 2014 16:43:19 +0000 (16:43 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 16 Jan 2014 16:43:19 +0000 (16:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199399 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGen/sparcv9-abi.c

index 629b540a14e6073a6f1927d42682611c7ba3c6c6..65864cd1d0387abf84ea19fbf29edc0d0b294743 100644 (file)
@@ -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,
index 4ba4be852fe851eac50c0828ca93d8d2850622a0..d4fff81ab6ef4ac53b01f870379c2965d6e593d6 100644 (file)
@@ -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;