1 ; RUN: llc < %s -mtriple=x86_64-linux-android -mattr=+mmx -enable-legalize-types-checking | FileCheck %s
4 ; Check that we dont end up with the ""LLVM ERROR: Cannot select" error.
5 ; Additionally ensure that the output code actually put fp128 values in SSE registers.
7 declare fp128 @llvm.fabs.f128(fp128)
8 declare fp128 @llvm.copysign.f128(fp128, fp128)
10 define fp128 @TestSelect(fp128 %a, fp128 %b) {
11 %cmp = fcmp ogt fp128 %a, %b
12 %sub = fsub fp128 %a, %b
13 %res = select i1 %cmp, fp128 %sub, fp128 0xL00000000000000000000000000000000
15 ; CHECK-LABEL: TestSelect:
16 ; CHECK movaps 16(%rsp), %xmm1
17 ; CHECK-NEXT callq __subtf3
18 ; CHECK-NEXT testl %ebx, %ebx
19 ; CHECK-NEXT jg .LBB0_2
21 ; CHECK-NEXT movaps .LCPI0_0(%rip), %xmm0
23 ; CHECK-NEXT addq $32, %rsp
24 ; CHECK-NEXT popq %rbx
28 define fp128 @TestFabs(fp128 %a) {
29 %res = call fp128 @llvm.fabs.f128(fp128 %a)
31 ; CHECK-LABEL: TestFabs:
32 ; CHECK andps .LCPI1_0(%rip), %xmm0
36 define fp128 @TestCopysign(fp128 %a, fp128 %b) {
37 %res = call fp128 @llvm.copysign.f128(fp128 %a, fp128 %b)
39 ; CHECK-LABEL: TestCopysign:
40 ; CHECK andps .LCPI2_1(%rip), %xmm0
41 ; CHECK-NEXT orps %xmm1, %xmm0
45 define fp128 @TestFneg(fp128 %a) {
46 %mul = fmul fp128 %a, %a
47 %res = fsub fp128 0xL00000000000000008000000000000000, %mul
49 ; CHECK-LABEL: TestFneg:
50 ; CHECK movaps %xmm0, %xmm1
51 ; CHECK-NEXT callq __multf3
52 ; CHECK-NEXT xorps .LCPI3_0(%rip), %xmm0
53 ; CHECK-NEXT popq %rax