1 ; Test SETCC with an i64 result for every floating-point condition.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
6 define i64 @f1(float %a, float %b) {
8 ; CHECK: ipm [[REG:%r[0-5]]]
9 ; CHECK-NEXT: afi [[REG]], -268435456
10 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
12 %cond = fcmp oeq float %a, %b
13 %res = zext i1 %cond to i64
18 define i64 @f2(float %a, float %b) {
20 ; CHECK: ipm [[REG:%r[0-5]]]
21 ; CHECK-NEXT: xilf [[REG]], 268435456
22 ; CHECK-NEXT: afi [[REG]], -268435456
23 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
25 %cond = fcmp olt float %a, %b
26 %res = zext i1 %cond to i64
31 define i64 @f3(float %a, float %b) {
33 ; CHECK: ipm [[REG:%r[0-5]]]
34 ; CHECK-NEXT: afi [[REG]], -536870912
35 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
37 %cond = fcmp ole float %a, %b
38 %res = zext i1 %cond to i64
43 define i64 @f4(float %a, float %b) {
45 ; CHECK: ipm [[REG:%r[0-5]]]
46 ; CHECK-NEXT: xilf [[REG]], 268435456
47 ; CHECK-NEXT: afi [[REG]], 1342177280
48 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
50 %cond = fcmp ogt float %a, %b
51 %res = zext i1 %cond to i64
56 define i64 @f5(float %a, float %b) {
58 ; CHECK: ipm [[REG:%r[0-5]]]
59 ; CHECK-NEXT: xilf [[REG]], 4294967295
60 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
62 %cond = fcmp oge float %a, %b
63 %res = zext i1 %cond to i64
68 define i64 @f6(float %a, float %b) {
70 ; CHECK: ipm [[REG:%r[0-5]]]
71 ; CHECK-NEXT: afi [[REG]], 268435456
72 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 35
74 %cond = fcmp one float %a, %b
75 %res = zext i1 %cond to i64
79 ; Test CC in { 0, 1, 2 }
80 define i64 @f7(float %a, float %b) {
82 ; CHECK: ipm [[REG:%r[0-5]]]
83 ; CHECK-NEXT: afi [[REG]], -805306368
84 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
86 %cond = fcmp ord float %a, %b
87 %res = zext i1 %cond to i64
92 define i64 @f8(float %a, float %b) {
94 ; CHECK: ipm [[REG:%r[0-5]]]
95 ; CHECK-NEXT: afi [[REG]], 1342177280
96 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
98 %cond = fcmp uno float %a, %b
99 %res = zext i1 %cond to i64
103 ; Test CC in { 0, 3 }
104 define i64 @f9(float %a, float %b) {
106 ; CHECK: ipm [[REG:%r[0-5]]]
107 ; CHECK-NEXT: afi [[REG]], -268435456
108 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 35
110 %cond = fcmp ueq float %a, %b
111 %res = zext i1 %cond to i64
115 ; Test CC in { 1, 3 }
116 define i64 @f10(float %a, float %b) {
118 ; CHECK: ipm [[REG:%r[0-5]]]
119 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
121 %cond = fcmp ult float %a, %b
122 %res = zext i1 %cond to i64
126 ; Test CC in { 0, 1, 3 }
127 define i64 @f11(float %a, float %b) {
129 ; CHECK: ipm [[REG:%r[0-5]]]
130 ; CHECK-NEXT: xilf [[REG]], 268435456
131 ; CHECK-NEXT: afi [[REG]], -805306368
132 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
134 %cond = fcmp ule float %a, %b
135 %res = zext i1 %cond to i64
139 ; Test CC in { 2, 3 }
140 define i64 @f12(float %a, float %b) {
142 ; CHECK: ipm [[REG:%r[0-5]]]
143 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 35
145 %cond = fcmp ugt float %a, %b
146 %res = zext i1 %cond to i64
150 ; Test CC in { 0, 2, 3 }
151 define i64 @f13(float %a, float %b) {
153 ; CHECK: ipm [[REG:%r[0-5]]]
154 ; CHECK-NEXT: xilf [[REG]], 268435456
155 ; CHECK-NEXT: afi [[REG]], 1879048192
156 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
158 %cond = fcmp uge float %a, %b
159 %res = zext i1 %cond to i64
163 ; Test CC in { 1, 2, 3 }
164 define i64 @f14(float %a, float %b) {
166 ; CHECK: ipm [[REG:%r[0-5]]]
167 ; CHECK-NEXT: afi [[REG]], 1879048192
168 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
170 %cond = fcmp une float %a, %b
171 %res = zext i1 %cond to i64