1 ; Test an i32 0/-1 SELECTCCC for every floating-point condition.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6 define i32 @f1(float %a, float %b) {
9 ; CHECK-NEXT: afi %r2, -268435456
10 ; CHECK-NEXT: sra %r2, 31
12 %cond = fcmp oeq float %a, %b
13 %res = select i1 %cond, i32 -1, i32 0
18 define i32 @f2(float %a, float %b) {
21 ; CHECK-NEXT: xilf %r2, 268435456
22 ; CHECK-NEXT: afi %r2, -268435456
23 ; CHECK-NEXT: sra %r2, 31
25 %cond = fcmp olt float %a, %b
26 %res = select i1 %cond, i32 -1, i32 0
31 define i32 @f3(float %a, float %b) {
34 ; CHECK-NEXT: afi %r2, -536870912
35 ; CHECK-NEXT: sra %r2, 31
37 %cond = fcmp ole float %a, %b
38 %res = select i1 %cond, i32 -1, i32 0
43 define i32 @f4(float %a, float %b) {
46 ; CHECK-NEXT: xilf %r2, 268435456
47 ; CHECK-NEXT: afi %r2, 1342177280
48 ; CHECK-NEXT: sra %r2, 31
50 %cond = fcmp ogt float %a, %b
51 %res = select i1 %cond, i32 -1, i32 0
56 define i32 @f5(float %a, float %b) {
59 ; CHECK-NEXT: xilf %r2, 4294967295
60 ; CHECK-NEXT: sll %r2, 3
61 ; CHECK-NEXT: sra %r2, 31
63 %cond = fcmp oge float %a, %b
64 %res = select i1 %cond, i32 -1, i32 0
69 define i32 @f6(float %a, float %b) {
72 ; CHECK-NEXT: afi %r2, 268435456
73 ; CHECK-NEXT: sll %r2, 2
74 ; CHECK-NEXT: sra %r2, 31
76 %cond = fcmp one float %a, %b
77 %res = select i1 %cond, i32 -1, i32 0
81 ; Test CC in { 0, 1, 2 }
82 define i32 @f7(float %a, float %b) {
85 ; CHECK-NEXT: afi %r2, -805306368
86 ; CHECK-NEXT: sra %r2, 31
88 %cond = fcmp ord float %a, %b
89 %res = select i1 %cond, i32 -1, i32 0
94 define i32 @f8(float %a, float %b) {
97 ; CHECK-NEXT: afi %r2, 1342177280
98 ; CHECK-NEXT: sra %r2, 31
100 %cond = fcmp uno float %a, %b
101 %res = select i1 %cond, i32 -1, i32 0
105 ; Test CC in { 0, 3 }
106 define i32 @f9(float %a, float %b) {
109 ; CHECK-NEXT: afi %r2, -268435456
110 ; CHECK-NEXT: sll %r2, 2
111 ; CHECK-NEXT: sra %r2, 31
113 %cond = fcmp ueq float %a, %b
114 %res = select i1 %cond, i32 -1, i32 0
118 ; Test CC in { 1, 3 }
119 define i32 @f10(float %a, float %b) {
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 -1, i32 0
130 ; Test CC in { 0, 1, 3 }
131 define i32 @f11(float %a, float %b) {
134 ; CHECK-NEXT: xilf %r2, 268435456
135 ; CHECK-NEXT: afi %r2, -805306368
136 ; CHECK-NEXT: sra %r2, 31
138 %cond = fcmp ule float %a, %b
139 %res = select i1 %cond, i32 -1, i32 0
143 ; Test CC in { 2, 3 }
144 define i32 @f12(float %a, float %b) {
147 ; CHECK-NEXT: sll %r2, 2
148 ; CHECK-NEXT: sra %r2, 31
150 %cond = fcmp ugt float %a, %b
151 %res = select i1 %cond, i32 -1, i32 0
155 ; Test CC in { 0, 2, 3 }
156 define i32 @f13(float %a, float %b) {
159 ; CHECK-NEXT: xilf %r2, 268435456
160 ; CHECK-NEXT: afi %r2, 1879048192
161 ; CHECK-NEXT: sra %r2, 31
163 %cond = fcmp uge float %a, %b
164 %res = select i1 %cond, i32 -1, i32 0
168 ; Test CC in { 1, 2, 3 }
169 define i32 @f14(float %a, float %b) {
172 ; CHECK-NEXT: afi %r2, 1879048192
173 ; CHECK-NEXT: sra %r2, 31
175 %cond = fcmp une float %a, %b
176 %res = select i1 %cond, i32 -1, i32 0