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
4 define i32 @TestComp128GT(fp128 %d1, fp128 %d2) {
6 %cmp = fcmp ogt fp128 %d1, %d2
7 %conv = zext i1 %cmp to i32
9 ; CHECK-LABEL: TestComp128GT:
10 ; CHECK: callq __gttf2
12 ; CHECK: movzbl %al, %eax
16 define i32 @TestComp128GE(fp128 %d1, fp128 %d2) {
18 %cmp = fcmp oge fp128 %d1, %d2
19 %conv = zext i1 %cmp to i32
21 ; CHECK-LABEL: TestComp128GE:
22 ; CHECK: callq __getf2
23 ; CHECK: testl %eax, %eax
25 ; CHECK: movzbl %al, %eax
29 define i32 @TestComp128LT(fp128 %d1, fp128 %d2) {
31 %cmp = fcmp olt fp128 %d1, %d2
32 %conv = zext i1 %cmp to i32
34 ; CHECK-LABEL: TestComp128LT:
35 ; CHECK: callq __lttf2
36 ; CHECK-NEXT: shrl $31, %eax
39 ; The 'shrl' is a special optimization in llvm to combine
40 ; the effect of 'fcmp olt' and 'zext'. The main purpose is
41 ; to test soften call to __lttf2.
44 define i32 @TestComp128LE(fp128 %d1, fp128 %d2) {
46 %cmp = fcmp ole fp128 %d1, %d2
47 %conv = zext i1 %cmp to i32
49 ; CHECK-LABEL: TestComp128LE:
50 ; CHECK: callq __letf2
51 ; CHECK-NEXT: testl %eax, %eax
53 ; CHECK: movzbl %al, %eax
57 define i32 @TestComp128EQ(fp128 %d1, fp128 %d2) {
59 %cmp = fcmp oeq fp128 %d1, %d2
60 %conv = zext i1 %cmp to i32
62 ; CHECK-LABEL: TestComp128EQ:
63 ; CHECK: callq __eqtf2
64 ; CHECK-NEXT: testl %eax, %eax
66 ; CHECK: movzbl %al, %eax
70 define i32 @TestComp128NE(fp128 %d1, fp128 %d2) {
72 %cmp = fcmp une fp128 %d1, %d2
73 %conv = zext i1 %cmp to i32
75 ; CHECK-LABEL: TestComp128NE:
76 ; CHECK: callq __netf2
77 ; CHECK-NEXT: testl %eax, %eax
79 ; CHECK: movzbl %al, %eax
83 define fp128 @TestMax(fp128 %x, fp128 %y) {
85 %cmp = fcmp ogt fp128 %x, %y
86 %cond = select i1 %cmp, fp128 %x, fp128 %y
88 ; CHECK-LABEL: TestMax:
91 ; CHECK: callq __gttf2
92 ; CHECK: movaps {{.*}}, %xmm0
93 ; CHECK: testl %eax, %eax
94 ; CHECK: movaps {{.*}}, %xmm0