• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-linux-android -mattr=+mmx -enable-legalize-types-checking | FileCheck %s
2;
3; D31946
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.
6
7declare fp128 @llvm.fabs.f128(fp128)
8declare fp128 @llvm.copysign.f128(fp128, fp128)
9
10define 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
14  ret fp128 %res
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
20; CHECK-NEXT # %bb.1:
21; CHECK-NEXT   movaps .LCPI0_0(%rip), %xmm0
22; CHECK-NEXT .LBB0_2:
23; CHECK-NEXT   addq $32, %rsp
24; CHECK-NEXT   popq %rbx
25; CHECK-NEXT   retq
26}
27
28define fp128 @TestFabs(fp128 %a) {
29  %res = call fp128 @llvm.fabs.f128(fp128 %a)
30  ret fp128 %res
31; CHECK-LABEL: TestFabs:
32; CHECK      andps .LCPI1_0(%rip), %xmm0
33; CHECK-NEXT retq
34}
35
36define fp128 @TestCopysign(fp128 %a, fp128 %b) {
37  %res = call fp128 @llvm.copysign.f128(fp128 %a, fp128 %b)
38  ret fp128 %res
39; CHECK-LABEL: TestCopysign:
40; CHECK      andps .LCPI2_1(%rip), %xmm0
41; CHECK-NEXT orps %xmm1, %xmm0
42; CHECK-NEXT retq
43}
44
45define fp128 @TestFneg(fp128 %a) {
46  %mul = fmul fp128 %a, %a
47  %res = fsub fp128 0xL00000000000000008000000000000000, %mul
48  ret fp128 %res
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
54; CHECK-NEXT retq
55}
56