1 ; Test an i32 0/-1 SELECTCCC for every floating-point condition.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Test CC in { 1, 2, 3 }
6 define i32 @f1(float %a, float %b) {
9 ; CHECK-NEXT: afi %r2, 1879048192
10 ; CHECK-NEXT: sra %r2, 31
12 %cond = fcmp oeq float %a, %b
13 %res = select i1 %cond, i32 0, i32 -1
17 ; Test CC in { 0, 2, 3 }
18 define i32 @f2(float %a, float %b) {
21 ; CHECK-NEXT: xilf %r2, 268435456
22 ; CHECK-NEXT: afi %r2, 1879048192
23 ; CHECK-NEXT: sra %r2, 31
25 %cond = fcmp olt float %a, %b
26 %res = select i1 %cond, i32 0, i32 -1
31 define i32 @f3(float %a, float %b) {
34 ; CHECK-NEXT: sll %r2, 2
35 ; CHECK-NEXT: sra %r2, 31
37 %cond = fcmp ole float %a, %b
38 %res = select i1 %cond, i32 0, i32 -1
42 ; Test CC in { 0, 1, 3 }
43 define i32 @f4(float %a, float %b) {
46 ; CHECK-NEXT: xilf %r2, 268435456
47 ; CHECK-NEXT: afi %r2, -805306368
48 ; CHECK-NEXT: sra %r2, 31
50 %cond = fcmp ogt float %a, %b
51 %res = select i1 %cond, i32 0, i32 -1
56 define i32 @f5(float %a, float %b) {
59 ; CHECK-NEXT: sll %r2, 3
60 ; CHECK-NEXT: sra %r2, 31
62 %cond = fcmp oge float %a, %b
63 %res = select i1 %cond, i32 0, i32 -1
68 define i32 @f6(float %a, float %b) {
71 ; CHECK-NEXT: afi %r2, -268435456
72 ; CHECK-NEXT: sll %r2, 2
73 ; CHECK-NEXT: sra %r2, 31
75 %cond = fcmp one float %a, %b
76 %res = select i1 %cond, i32 0, i32 -1
81 define i32 @f7(float %a, float %b) {
84 ; CHECK-NEXT: afi %r2, 1342177280
85 ; CHECK-NEXT: sra %r2, 31
87 %cond = fcmp ord float %a, %b
88 %res = select i1 %cond, i32 0, i32 -1
92 ; Test CC in { 0, 1, 2 }
93 define i32 @f8(float %a, float %b) {
96 ; CHECK-NEXT: afi %r2, -805306368
97 ; CHECK-NEXT: sra %r2, 31
99 %cond = fcmp uno float %a, %b
100 %res = select i1 %cond, i32 0, i32 -1
104 ; Test CC in { 1, 2 }
105 define i32 @f9(float %a, float %b) {
108 ; CHECK-NEXT: afi %r2, 268435456
109 ; CHECK-NEXT: sll %r2, 2
110 ; CHECK-NEXT: sra %r2, 31
112 %cond = fcmp ueq float %a, %b
113 %res = select i1 %cond, i32 0, i32 -1
117 ; Test CC in { 0, 2 }
118 define i32 @f10(float %a, float %b) {
121 ; CHECK-NEXT: xilf %r2, 4294967295
122 ; CHECK-NEXT: sll %r2, 3
123 ; CHECK-NEXT: sra %r2, 31
125 %cond = fcmp ult float %a, %b
126 %res = select i1 %cond, i32 0, i32 -1
131 define i32 @f11(float %a, float %b) {
134 ; CHECK-NEXT: xilf %r2, 268435456
135 ; CHECK-NEXT: afi %r2, 1342177280
136 ; CHECK-NEXT: sra %r2, 31
138 %cond = fcmp ule float %a, %b
139 %res = select i1 %cond, i32 0, i32 -1
143 ; Test CC in { 0, 1 }
144 define i32 @f12(float %a, float %b) {
147 ; CHECK-NEXT: afi %r2, -536870912
148 ; CHECK-NEXT: sra %r2, 31
150 %cond = fcmp ugt float %a, %b
151 %res = select i1 %cond, i32 0, i32 -1
156 define i32 @f13(float %a, float %b) {
159 ; CHECK-NEXT: xilf %r2, 268435456
160 ; CHECK-NEXT: afi %r2, -268435456
161 ; CHECK-NEXT: sra %r2, 31
163 %cond = fcmp uge float %a, %b
164 %res = select i1 %cond, i32 0, i32 -1
169 define i32 @f14(float %a, float %b) {
172 ; CHECK-NEXT: afi %r2, -268435456
173 ; CHECK-NEXT: sra %r2, 31
175 %cond = fcmp une float %a, %b
176 %res = select i1 %cond, i32 0, i32 -1