1; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s 2; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s 3 4; Check all soft floating point library function calls. 5 6@vf64 = common global double 0.000000e+00, align 8 7@vf128 = common global fp128 0xL00000000000000000000000000000000, align 16 8 9define void @Test128Add(fp128 %d1, fp128 %d2) { 10entry: 11 %add = fadd fp128 %d1, %d2 12 store fp128 %add, fp128* @vf128, align 16 13 ret void 14; CHECK-LABEL: Test128Add: 15; CHECK: callq __addtf3 16; CHECK-NEXT: movaps %xmm0, vf128(%rip) 17; CHECK: retq 18} 19 20define void @Test128_1Add(fp128 %d1){ 21entry: 22 %0 = load fp128, fp128* @vf128, align 16 23 %add = fadd fp128 %0, %d1 24 store fp128 %add, fp128* @vf128, align 16 25 ret void 26; CHECK-LABEL: Test128_1Add: 27; CHECK: movaps %xmm0, %xmm1 28; CHECK-NEXT: movaps vf128(%rip), %xmm0 29; CHECK-NEXT: callq __addtf3 30; CHECK-NEXT: movaps %xmm0, vf128(%rip) 31; CHECK: retq 32} 33 34define void @Test128Sub(fp128 %d1, fp128 %d2){ 35entry: 36 %sub = fsub fp128 %d1, %d2 37 store fp128 %sub, fp128* @vf128, align 16 38 ret void 39; CHECK-LABEL: Test128Sub: 40; CHECK: callq __subtf3 41; CHECK-NEXT: movaps %xmm0, vf128(%rip) 42; CHECK: retq 43} 44 45define void @Test128_1Sub(fp128 %d1){ 46entry: 47 %0 = load fp128, fp128* @vf128, align 16 48 %sub = fsub fp128 %0, %d1 49 store fp128 %sub, fp128* @vf128, align 16 50 ret void 51; CHECK-LABEL: Test128_1Sub: 52; CHECK: movaps %xmm0, %xmm1 53; CHECK-NEXT: movaps vf128(%rip), %xmm0 54; CHECK-NEXT: callq __subtf3 55; CHECK-NEXT: movaps %xmm0, vf128(%rip) 56; CHECK: retq 57} 58 59define void @Test128Mul(fp128 %d1, fp128 %d2){ 60entry: 61 %mul = fmul fp128 %d1, %d2 62 store fp128 %mul, fp128* @vf128, align 16 63 ret void 64; CHECK-LABEL: Test128Mul: 65; CHECK: callq __multf3 66; CHECK-NEXT: movaps %xmm0, vf128(%rip) 67; CHECK: retq 68} 69 70define void @Test128_1Mul(fp128 %d1){ 71entry: 72 %0 = load fp128, fp128* @vf128, align 16 73 %mul = fmul fp128 %0, %d1 74 store fp128 %mul, fp128* @vf128, align 16 75 ret void 76; CHECK-LABEL: Test128_1Mul: 77; CHECK: movaps %xmm0, %xmm1 78; CHECK-NEXT: movaps vf128(%rip), %xmm0 79; CHECK-NEXT: callq __multf3 80; CHECK-NEXT: movaps %xmm0, vf128(%rip) 81; CHECK: retq 82} 83 84define void @Test128Div(fp128 %d1, fp128 %d2){ 85entry: 86 %div = fdiv fp128 %d1, %d2 87 store fp128 %div, fp128* @vf128, align 16 88 ret void 89; CHECK-LABEL: Test128Div: 90; CHECK: callq __divtf3 91; CHECK-NEXT: movaps %xmm0, vf128(%rip) 92; CHECK: retq 93} 94 95define void @Test128_1Div(fp128 %d1){ 96entry: 97 %0 = load fp128, fp128* @vf128, align 16 98 %div = fdiv fp128 %0, %d1 99 store fp128 %div, fp128* @vf128, align 16 100 ret void 101; CHECK-LABEL: Test128_1Div: 102; CHECK: movaps %xmm0, %xmm1 103; CHECK-NEXT: movaps vf128(%rip), %xmm0 104; CHECK-NEXT: callq __divtf3 105; CHECK-NEXT: movaps %xmm0, vf128(%rip) 106; CHECK: retq 107} 108