1 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx \
2 ; RUN: -enable-legalize-types-checking | FileCheck %s
3 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx \
4 ; RUN: -enable-legalize-types-checking | FileCheck %s
6 ; Check all soft floating point library function calls.
8 @vf64 = common global double 0.000000e+00, align 8
9 @vf128 = common global fp128 0xL00000000000000000000000000000000, align 16
11 define void @Test128Add(fp128 %d1, fp128 %d2) {
13 %add = fadd fp128 %d1, %d2
14 store fp128 %add, fp128* @vf128, align 16
16 ; CHECK-LABEL: Test128Add:
17 ; CHECK: callq __addtf3
18 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
22 define void @Test128_1Add(fp128 %d1){
24 %0 = load fp128, fp128* @vf128, align 16
25 %add = fadd fp128 %0, %d1
26 store fp128 %add, fp128* @vf128, align 16
28 ; CHECK-LABEL: Test128_1Add:
29 ; CHECK: movaps %xmm0, %xmm1
30 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
31 ; CHECK-NEXT: callq __addtf3
32 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
36 define void @Test128Sub(fp128 %d1, fp128 %d2){
38 %sub = fsub fp128 %d1, %d2
39 store fp128 %sub, fp128* @vf128, align 16
41 ; CHECK-LABEL: Test128Sub:
42 ; CHECK: callq __subtf3
43 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
47 define void @Test128_1Sub(fp128 %d1){
49 %0 = load fp128, fp128* @vf128, align 16
50 %sub = fsub fp128 %0, %d1
51 store fp128 %sub, fp128* @vf128, align 16
53 ; CHECK-LABEL: Test128_1Sub:
54 ; CHECK: movaps %xmm0, %xmm1
55 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
56 ; CHECK-NEXT: callq __subtf3
57 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
61 define void @Test128Mul(fp128 %d1, fp128 %d2){
63 %mul = fmul fp128 %d1, %d2
64 store fp128 %mul, fp128* @vf128, align 16
66 ; CHECK-LABEL: Test128Mul:
67 ; CHECK: callq __multf3
68 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
72 define void @Test128_1Mul(fp128 %d1){
74 %0 = load fp128, fp128* @vf128, align 16
75 %mul = fmul fp128 %0, %d1
76 store fp128 %mul, fp128* @vf128, align 16
78 ; CHECK-LABEL: Test128_1Mul:
79 ; CHECK: movaps %xmm0, %xmm1
80 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
81 ; CHECK-NEXT: callq __multf3
82 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
86 define void @Test128Div(fp128 %d1, fp128 %d2){
88 %div = fdiv fp128 %d1, %d2
89 store fp128 %div, fp128* @vf128, align 16
91 ; CHECK-LABEL: Test128Div:
92 ; CHECK: callq __divtf3
93 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)
97 define void @Test128_1Div(fp128 %d1){
99 %0 = load fp128, fp128* @vf128, align 16
100 %div = fdiv fp128 %0, %d1
101 store fp128 %div, fp128* @vf128, align 16
103 ; CHECK-LABEL: Test128_1Div:
104 ; CHECK: movaps %xmm0, %xmm1
105 ; CHECK-NEXT: movaps vf128(%rip), %xmm0
106 ; CHECK-NEXT: callq __divtf3
107 ; CHECK-NEXT: movaps %xmm0, vf128(%rip)