]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / patches / patch-r262262-clang-r199399-sparc.diff
1 Pull in r199399 from upstream clang trunk (by Jakob Stoklund Olesen):
2
3   SPARCv9 implements long double as an IEEE quad.
4
5 Introduced here: http://svnweb.freebsd.org/changeset/base/262262
6
7 Index: tools/clang/test/CodeGen/sparcv9-abi.c
8 ===================================================================
9 --- tools/clang/test/CodeGen/sparcv9-abi.c
10 +++ tools/clang/test/CodeGen/sparcv9-abi.c
11 @@ -18,6 +18,9 @@ long long f_int_3(long long x) { return x; }
12  // CHECK-LABEL: define signext i8 @f_int_4(i8 signext %x)
13  char f_int_4(char x) { return x; }
14  
15 +// CHECK-LABEL: define fp128 @f_ld(fp128 %x)
16 +long double f_ld(long double x) { return x; }
17 +
18  // Small structs are passed in registers.
19  struct small {
20    int *a, *b;
21 Index: tools/clang/lib/Basic/Targets.cpp
22 ===================================================================
23 --- tools/clang/lib/Basic/Targets.cpp
24 +++ tools/clang/lib/Basic/Targets.cpp
25 @@ -4529,6 +4529,12 @@ class SparcV9TargetInfo : public SparcTargetInfo {
26        UIntMaxType = UnsignedLong;
27      }
28      Int64Type = IntMaxType;
29 +
30 +    // The SPARCv8 System V ABI has long double 128-bits in size, but 64-bit
31 +    // aligned. The SPARCv9 SCD 2.4.1 says 16-byte aligned.
32 +    LongDoubleWidth = 128;
33 +    LongDoubleAlign = 128;
34 +    LongDoubleFormat = &llvm::APFloat::IEEEquad;
35    }
36  
37    virtual void getTargetDefines(const LangOptions &Opts,