llvm.org GIT mirror llvm / 998b18c
AMDGPU: setcc test cleanup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290306 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 3 years ago
2 changed file(s) with 337 addition(s) and 327 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck -check-prefix=SI -check-prefix=FUNC %s
1 ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=R600 --check-prefix=FUNC %s
0 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
1 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s
22
33 declare i32 @llvm.r600.read.tidig.x() nounwind readnone
44
66 ; R600-DAG: SETE_INT * T{{[0-9]+\.[XYZW]}}, KC0[3].X, KC0[3].Z
77 ; R600-DAG: SETE_INT * T{{[0-9]+\.[XYZW]}}, KC0[2].W, KC0[3].Y
88
9 define void @setcc_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b) {
9 ; GCN-DAG: v_cmp_eq_u32_e32
10 ; GCN-DAG: v_cmp_eq_u32_e64
11 define void @setcc_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b) #0 {
1012 %result = icmp eq <2 x i32> %a, %b
1113 %sext = sext <2 x i1> %result to <2 x i32>
1214 store <2 x i32> %sext, <2 x i32> addrspace(1)* %out
1921 ; R600-DAG: SETE_INT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
2022 ; R600-DAG: SETE_INT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
2123
22 define void @setcc_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
24 ; GCN: v_cmp_eq_u32_e32
25 ; GCN: v_cmp_eq_u32_e64
26 ; GCN: v_cmp_eq_u32_e64
27 ; GCN: v_cmp_eq_u32_e64
28 define void @setcc_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) #0 {
2329 %b_ptr = getelementptr <4 x i32>, <4 x i32> addrspace(1)* %in, i32 1
24 %a = load <4 x i32>, <4 x i32> addrspace(1) * %in
25 %b = load <4 x i32>, <4 x i32> addrspace(1) * %b_ptr
30 %a = load <4 x i32>, <4 x i32> addrspace(1)* %in
31 %b = load <4 x i32>, <4 x i32> addrspace(1)* %b_ptr
2632 %result = icmp eq <4 x i32> %a, %b
2733 %sext = sext <4 x i1> %result to <4 x i32>
2834 store <4 x i32> %sext, <4 x i32> addrspace(1)* %out
3541
3642 ; FUNC-LABEL: {{^}}f32_oeq:
3743 ; R600: SETE_DX10
38 ; SI: v_cmp_eq_f32
39 define void @f32_oeq(i32 addrspace(1)* %out, float %a, float %b) {
44 ; GCN: v_cmp_eq_f32
45 define void @f32_oeq(i32 addrspace(1)* %out, float %a, float %b) #0 {
4046 entry:
4147 %0 = fcmp oeq float %a, %b
4248 %1 = sext i1 %0 to i32
4652
4753 ; FUNC-LABEL: {{^}}f32_ogt:
4854 ; R600: SETGT_DX10
49 ; SI: v_cmp_gt_f32
50 define void @f32_ogt(i32 addrspace(1)* %out, float %a, float %b) {
55 ; GCN: v_cmp_gt_f32
56 define void @f32_ogt(i32 addrspace(1)* %out, float %a, float %b) #0 {
5157 entry:
5258 %0 = fcmp ogt float %a, %b
5359 %1 = sext i1 %0 to i32
5763
5864 ; FUNC-LABEL: {{^}}f32_oge:
5965 ; R600: SETGE_DX10
60 ; SI: v_cmp_ge_f32
61 define void @f32_oge(i32 addrspace(1)* %out, float %a, float %b) {
66 ; GCN: v_cmp_ge_f32
67 define void @f32_oge(i32 addrspace(1)* %out, float %a, float %b) #0 {
6268 entry:
6369 %0 = fcmp oge float %a, %b
6470 %1 = sext i1 %0 to i32
6874
6975 ; FUNC-LABEL: {{^}}f32_olt:
7076 ; R600: SETGT_DX10
71 ; SI: v_cmp_lt_f32
72 define void @f32_olt(i32 addrspace(1)* %out, float %a, float %b) {
77 ; GCN: v_cmp_lt_f32
78 define void @f32_olt(i32 addrspace(1)* %out, float %a, float %b) #0 {
7379 entry:
7480 %0 = fcmp olt float %a, %b
7581 %1 = sext i1 %0 to i32
7985
8086 ; FUNC-LABEL: {{^}}f32_ole:
8187 ; R600: SETGE_DX10
82 ; SI: v_cmp_le_f32
83 define void @f32_ole(i32 addrspace(1)* %out, float %a, float %b) {
88 ; GCN: v_cmp_le_f32
89 define void @f32_ole(i32 addrspace(1)* %out, float %a, float %b) #0 {
8490 entry:
8591 %0 = fcmp ole float %a, %b
8692 %1 = sext i1 %0 to i32
96102 ; R600-DAG: AND_INT
97103 ; R600-DAG: SETNE_INT
98104
99 ; SI: v_cmp_lg_f32_e32 vcc
100 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
101 define void @f32_one(i32 addrspace(1)* %out, float %a, float %b) {
105 ; GCN: v_cmp_lg_f32_e32 vcc
106 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
107 define void @f32_one(i32 addrspace(1)* %out, float %a, float %b) #0 {
102108 entry:
103109 %0 = fcmp one float %a, %b
104110 %1 = sext i1 %0 to i32
111117 ; R600-DAG: SETE_DX10
112118 ; R600-DAG: AND_INT
113119 ; R600-DAG: SETNE_INT
114 ; SI: v_cmp_o_f32
115 define void @f32_ord(i32 addrspace(1)* %out, float %a, float %b) {
120 ; GCN: v_cmp_o_f32
121 define void @f32_ord(i32 addrspace(1)* %out, float %a, float %b) #0 {
116122 entry:
117123 %0 = fcmp ord float %a, %b
118124 %1 = sext i1 %0 to i32
128134 ; R600-DAG: OR_INT
129135 ; R600-DAG: SETNE_INT
130136
131 ; SI: v_cmp_nlg_f32_e32 vcc
132 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
133 define void @f32_ueq(i32 addrspace(1)* %out, float %a, float %b) {
137 ; GCN: v_cmp_nlg_f32_e32 vcc
138 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
139 define void @f32_ueq(i32 addrspace(1)* %out, float %a, float %b) #0 {
134140 entry:
135141 %0 = fcmp ueq float %a, %b
136142 %1 = sext i1 %0 to i32
141147 ; FUNC-LABEL: {{^}}f32_ugt:
142148 ; R600: SETGE
143149 ; R600: SETE_DX10
144 ; SI: v_cmp_nle_f32_e32 vcc
145 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
146 define void @f32_ugt(i32 addrspace(1)* %out, float %a, float %b) {
150 ; GCN: v_cmp_nle_f32_e32 vcc
151 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
152 define void @f32_ugt(i32 addrspace(1)* %out, float %a, float %b) #0 {
147153 entry:
148154 %0 = fcmp ugt float %a, %b
149155 %1 = sext i1 %0 to i32
155161 ; R600: SETGT
156162 ; R600: SETE_DX10
157163
158 ; SI: v_cmp_nlt_f32_e32 vcc
159 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
160 define void @f32_uge(i32 addrspace(1)* %out, float %a, float %b) {
164 ; GCN: v_cmp_nlt_f32_e32 vcc
165 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
166 define void @f32_uge(i32 addrspace(1)* %out, float %a, float %b) #0 {
161167 entry:
162168 %0 = fcmp uge float %a, %b
163169 %1 = sext i1 %0 to i32
169175 ; R600: SETGE
170176 ; R600: SETE_DX10
171177
172 ; SI: v_cmp_nge_f32_e32 vcc
173 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
174 define void @f32_ult(i32 addrspace(1)* %out, float %a, float %b) {
178 ; GCN: v_cmp_nge_f32_e32 vcc
179 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
180 define void @f32_ult(i32 addrspace(1)* %out, float %a, float %b) #0 {
175181 entry:
176182 %0 = fcmp ult float %a, %b
177183 %1 = sext i1 %0 to i32
183189 ; R600: SETGT
184190 ; R600: SETE_DX10
185191
186 ; SI: v_cmp_ngt_f32_e32 vcc
187 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
188 define void @f32_ule(i32 addrspace(1)* %out, float %a, float %b) {
192 ; GCN: v_cmp_ngt_f32_e32 vcc
193 ; GCN-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
194 define void @f32_ule(i32 addrspace(1)* %out, float %a, float %b) #0 {
189195 entry:
190196 %0 = fcmp ule float %a, %b
191197 %1 = sext i1 %0 to i32
195201
196202 ; FUNC-LABEL: {{^}}f32_une:
197203 ; R600: SETNE_DX10
198 ; SI: v_cmp_neq_f32
199 define void @f32_une(i32 addrspace(1)* %out, float %a, float %b) {
204 ; GCN: v_cmp_neq_f32
205 define void @f32_une(i32 addrspace(1)* %out, float %a, float %b) #0 {
200206 entry:
201207 %0 = fcmp une float %a, %b
202208 %1 = sext i1 %0 to i32
209215 ; R600: SETNE_DX10
210216 ; R600: OR_INT
211217 ; R600: SETNE_INT
212 ; SI: v_cmp_u_f32
213 define void @f32_uno(i32 addrspace(1)* %out, float %a, float %b) {
218 ; GCN: v_cmp_u_f32
219 define void @f32_uno(i32 addrspace(1)* %out, float %a, float %b) #0 {
214220 entry:
215221 %0 = fcmp uno float %a, %b
216222 %1 = sext i1 %0 to i32
224230
225231 ; FUNC-LABEL: {{^}}i32_eq:
226232 ; R600: SETE_INT
227 ; SI: v_cmp_eq_u32
228 define void @i32_eq(i32 addrspace(1)* %out, i32 %a, i32 %b) {
233 ; GCN: v_cmp_eq_u32
234 define void @i32_eq(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
229235 entry:
230236 %0 = icmp eq i32 %a, %b
231237 %1 = sext i1 %0 to i32
235241
236242 ; FUNC-LABEL: {{^}}i32_ne:
237243 ; R600: SETNE_INT
238 ; SI: v_cmp_ne_u32
239 define void @i32_ne(i32 addrspace(1)* %out, i32 %a, i32 %b) {
244 ; GCN: v_cmp_ne_u32
245 define void @i32_ne(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
240246 entry:
241247 %0 = icmp ne i32 %a, %b
242248 %1 = sext i1 %0 to i32
246252
247253 ; FUNC-LABEL: {{^}}i32_ugt:
248254 ; R600: SETGT_UINT
249 ; SI: v_cmp_gt_u32
250 define void @i32_ugt(i32 addrspace(1)* %out, i32 %a, i32 %b) {
255 ; GCN: v_cmp_gt_u32
256 define void @i32_ugt(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
251257 entry:
252258 %0 = icmp ugt i32 %a, %b
253259 %1 = sext i1 %0 to i32
257263
258264 ; FUNC-LABEL: {{^}}i32_uge:
259265 ; R600: SETGE_UINT
260 ; SI: v_cmp_ge_u32
261 define void @i32_uge(i32 addrspace(1)* %out, i32 %a, i32 %b) {
266 ; GCN: v_cmp_ge_u32
267 define void @i32_uge(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
262268 entry:
263269 %0 = icmp uge i32 %a, %b
264270 %1 = sext i1 %0 to i32
268274
269275 ; FUNC-LABEL: {{^}}i32_ult:
270276 ; R600: SETGT_UINT
271 ; SI: v_cmp_lt_u32
272 define void @i32_ult(i32 addrspace(1)* %out, i32 %a, i32 %b) {
277 ; GCN: v_cmp_lt_u32
278 define void @i32_ult(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
273279 entry:
274280 %0 = icmp ult i32 %a, %b
275281 %1 = sext i1 %0 to i32
279285
280286 ; FUNC-LABEL: {{^}}i32_ule:
281287 ; R600: SETGE_UINT
282 ; SI: v_cmp_le_u32
283 define void @i32_ule(i32 addrspace(1)* %out, i32 %a, i32 %b) {
288 ; GCN: v_cmp_le_u32
289 define void @i32_ule(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
284290 entry:
285291 %0 = icmp ule i32 %a, %b
286292 %1 = sext i1 %0 to i32
290296
291297 ; FUNC-LABEL: {{^}}i32_sgt:
292298 ; R600: SETGT_INT
293 ; SI: v_cmp_gt_i32
294 define void @i32_sgt(i32 addrspace(1)* %out, i32 %a, i32 %b) {
299 ; GCN: v_cmp_gt_i32
300 define void @i32_sgt(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
295301 entry:
296302 %0 = icmp sgt i32 %a, %b
297303 %1 = sext i1 %0 to i32
301307
302308 ; FUNC-LABEL: {{^}}i32_sge:
303309 ; R600: SETGE_INT
304 ; SI: v_cmp_ge_i32
305 define void @i32_sge(i32 addrspace(1)* %out, i32 %a, i32 %b) {
310 ; GCN: v_cmp_ge_i32
311 define void @i32_sge(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
306312 entry:
307313 %0 = icmp sge i32 %a, %b
308314 %1 = sext i1 %0 to i32
312318
313319 ; FUNC-LABEL: {{^}}i32_slt:
314320 ; R600: SETGT_INT
315 ; SI: v_cmp_lt_i32
316 define void @i32_slt(i32 addrspace(1)* %out, i32 %a, i32 %b) {
321 ; GCN: v_cmp_lt_i32
322 define void @i32_slt(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
317323 entry:
318324 %0 = icmp slt i32 %a, %b
319325 %1 = sext i1 %0 to i32
323329
324330 ; FUNC-LABEL: {{^}}i32_sle:
325331 ; R600: SETGE_INT
326 ; SI: v_cmp_le_i32
327 define void @i32_sle(i32 addrspace(1)* %out, i32 %a, i32 %b) {
332 ; GCN: v_cmp_le_i32
333 define void @i32_sle(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
328334 entry:
329335 %0 = icmp sle i32 %a, %b
330336 %1 = sext i1 %0 to i32
334340
335341 ; FIXME: This does 4 compares
336342 ; FUNC-LABEL: {{^}}v3i32_eq:
337 ; SI-DAG: v_cmp_eq_u32
338 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
339 ; SI-DAG: v_cmp_eq_u32
340 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
341 ; SI-DAG: v_cmp_eq_u32
342 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
343 ; SI: s_endpgm
344 define void @v3i32_eq(<3 x i32> addrspace(1)* %out, <3 x i32> addrspace(1)* %ptra, <3 x i32> addrspace(1)* %ptrb) {
343 ; GCN-DAG: v_cmp_eq_u32
344 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
345 ; GCN-DAG: v_cmp_eq_u32
346 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
347 ; GCN-DAG: v_cmp_eq_u32
348 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
349 ; GCN: s_endpgm
350 define void @v3i32_eq(<3 x i32> addrspace(1)* %out, <3 x i32> addrspace(1)* %ptra, <3 x i32> addrspace(1)* %ptrb) #0 {
345351 %tid = call i32 @llvm.r600.read.tidig.x() nounwind readnone
346352 %gep.a = getelementptr <3 x i32>, <3 x i32> addrspace(1)* %ptra, i32 %tid
347353 %gep.b = getelementptr <3 x i32>, <3 x i32> addrspace(1)* %ptrb, i32 %tid
355361 }
356362
357363 ; FUNC-LABEL: {{^}}v3i8_eq:
358 ; SI-DAG: v_cmp_eq_u32
359 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
360 ; SI-DAG: v_cmp_eq_u32
361 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
362 ; SI-DAG: v_cmp_eq_u32
363 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
364 ; SI: s_endpgm
365 define void @v3i8_eq(<3 x i8> addrspace(1)* %out, <3 x i8> addrspace(1)* %ptra, <3 x i8> addrspace(1)* %ptrb) {
364 ; GCN-DAG: v_cmp_eq_u32
365 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
366 ; GCN-DAG: v_cmp_eq_u32
367 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
368 ; GCN-DAG: v_cmp_eq_u32
369 ; GCN-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
370 ; GCN: s_endpgm
371 define void @v3i8_eq(<3 x i8> addrspace(1)* %out, <3 x i8> addrspace(1)* %ptra, <3 x i8> addrspace(1)* %ptrb) #0 {
366372 %tid = call i32 @llvm.r600.read.tidig.x() nounwind readnone
367373 %gep.a = getelementptr <3 x i8>, <3 x i8> addrspace(1)* %ptra, i32 %tid
368374 %gep.b = getelementptr <3 x i8>, <3 x i8> addrspace(1)* %ptrb, i32 %tid
377383
378384 ; Make sure we don't try to emit i1 setcc ops
379385 ; FUNC-LABEL: setcc-i1
380 ; SI: s_and_b32 [[AND:s[0-9]+]], s{{[0-9]+}}, 1
381 ; SI: s_cmp_eq_u32 [[AND]], 0
382 define void @setcc-i1(i32 %in) {
386 ; GCN: s_and_b32 [[AND:s[0-9]+]], s{{[0-9]+}}, 1
387 ; GCN: s_cmp_eq_u32 [[AND]], 0
388 define void @setcc-i1(i32 %in) #0 {
383389 %and = and i32 %in, 1
384390 %cmp = icmp eq i32 %and, 0
385391 br i1 %cmp, label %endif, label %if
390396 }
391397
392398 ; FUNC-LABEL: setcc-i1-and-xor
393 ; SI-DAG: v_cmp_ge_f32_e64 [[A:s\[[0-9]+:[0-9]+\]]], s{{[0-9]+}}, 0{{$}}
394 ; SI-DAG: v_cmp_le_f32_e64 [[B:s\[[0-9]+:[0-9]+\]]], s{{[0-9]+}}, 1.0
395 ; SI: s_and_b64 s[2:3], [[A]], [[B]]
399 ; GCN-DAG: v_cmp_ge_f32_e64 [[A:s\[[0-9]+:[0-9]+\]]], s{{[0-9]+}}, 0{{$}}
400 ; GCN-DAG: v_cmp_le_f32_e64 [[B:s\[[0-9]+:[0-9]+\]]], s{{[0-9]+}}, 1.0
401 ; GCN: s_and_b64 s[2:3], [[A]], [[B]]
396402 define void @setcc-i1-and-xor(i32 addrspace(1)* %out, float %cond) #0 {
397403 bb0:
398404 %tmp5 = fcmp oge float %cond, 0.000000e+00
408414 bb2:
409415 ret void
410416 }
417
418 attributes #0 = { nounwind }
None ;RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
1 ;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
0 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s| FileCheck -check-prefix=GCN -check-prefix=SI %s
1 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
22
33 ; XXX: Merge this into setcc, once R600 supports 64-bit operations
44
66 ;; Double comparisons
77 ;;;==========================================================================;;;
88
9 ; FUNC-LABEL: {{^}}f64_oeq:
10 ; SI: v_cmp_eq_f64
11 define void @f64_oeq(i32 addrspace(1)* %out, double %a, double %b) {
12 entry:
13 %0 = fcmp oeq double %a, %b
14 %1 = sext i1 %0 to i32
15 store i32 %1, i32 addrspace(1)* %out
16 ret void
17 }
18
19 ; FUNC-LABEL: {{^}}f64_ogt:
20 ; SI: v_cmp_gt_f64
21 define void @f64_ogt(i32 addrspace(1)* %out, double %a, double %b) {
22 entry:
23 %0 = fcmp ogt double %a, %b
24 %1 = sext i1 %0 to i32
25 store i32 %1, i32 addrspace(1)* %out
26 ret void
27 }
28
29 ; FUNC-LABEL: {{^}}f64_oge:
30 ; SI: v_cmp_ge_f64
31 define void @f64_oge(i32 addrspace(1)* %out, double %a, double %b) {
32 entry:
33 %0 = fcmp oge double %a, %b
34 %1 = sext i1 %0 to i32
35 store i32 %1, i32 addrspace(1)* %out
36 ret void
37 }
38
39 ; FUNC-LABEL: {{^}}f64_olt:
40 ; SI: v_cmp_lt_f64
41 define void @f64_olt(i32 addrspace(1)* %out, double %a, double %b) {
42 entry:
43 %0 = fcmp olt double %a, %b
44 %1 = sext i1 %0 to i32
45 store i32 %1, i32 addrspace(1)* %out
46 ret void
47 }
48
49 ; FUNC-LABEL: {{^}}f64_ole:
50 ; SI: v_cmp_le_f64
51 define void @f64_ole(i32 addrspace(1)* %out, double %a, double %b) {
52 entry:
53 %0 = fcmp ole double %a, %b
54 %1 = sext i1 %0 to i32
55 store i32 %1, i32 addrspace(1)* %out
56 ret void
57 }
58
59 ; FUNC-LABEL: {{^}}f64_one:
60 ; SI: v_cmp_lg_f64_e32 vcc
61 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
62 define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) {
63 entry:
64 %0 = fcmp one double %a, %b
65 %1 = sext i1 %0 to i32
66 store i32 %1, i32 addrspace(1)* %out
67 ret void
68 }
69
70 ; FUNC-LABEL: {{^}}f64_ord:
71 ; SI: v_cmp_o_f64
72 define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) {
73 entry:
74 %0 = fcmp ord double %a, %b
75 %1 = sext i1 %0 to i32
76 store i32 %1, i32 addrspace(1)* %out
77 ret void
78 }
79
80 ; FUNC-LABEL: {{^}}f64_ueq:
81 ; SI: v_cmp_nlg_f64_e32 vcc
82 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
83 define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
84 entry:
85 %0 = fcmp ueq double %a, %b
86 %1 = sext i1 %0 to i32
87 store i32 %1, i32 addrspace(1)* %out
88 ret void
89 }
90
91 ; FUNC-LABEL: {{^}}f64_ugt:
92
93 ; SI: v_cmp_nle_f64_e32 vcc
94 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
95 define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) {
96 entry:
97 %0 = fcmp ugt double %a, %b
98 %1 = sext i1 %0 to i32
99 store i32 %1, i32 addrspace(1)* %out
100 ret void
101 }
102
103 ; FUNC-LABEL: {{^}}f64_uge:
104 ; SI: v_cmp_nlt_f64_e32 vcc
105 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
106 define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) {
107 entry:
108 %0 = fcmp uge double %a, %b
109 %1 = sext i1 %0 to i32
110 store i32 %1, i32 addrspace(1)* %out
111 ret void
112 }
113
114 ; FUNC-LABEL: {{^}}f64_ult:
115 ; SI: v_cmp_nge_f64_e32 vcc
116 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
117 define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) {
118 entry:
119 %0 = fcmp ult double %a, %b
120 %1 = sext i1 %0 to i32
121 store i32 %1, i32 addrspace(1)* %out
122 ret void
123 }
124
125 ; FUNC-LABEL: {{^}}f64_ule:
126 ; SI: v_cmp_ngt_f64_e32 vcc
127 ; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
128 define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) {
129 entry:
130 %0 = fcmp ule double %a, %b
131 %1 = sext i1 %0 to i32
132 store i32 %1, i32 addrspace(1)* %out
133 ret void
134 }
135
136 ; FUNC-LABEL: {{^}}f64_une:
137 ; SI: v_cmp_neq_f64
138 define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) {
139 entry:
140 %0 = fcmp une double %a, %b
141 %1 = sext i1 %0 to i32
142 store i32 %1, i32 addrspace(1)* %out
143 ret void
144 }
145
146 ; FUNC-LABEL: {{^}}f64_uno:
147 ; SI: v_cmp_u_f64
148 define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) {
149 entry:
150 %0 = fcmp uno double %a, %b
151 %1 = sext i1 %0 to i32
152 store i32 %1, i32 addrspace(1)* %out
9 ; GCN-LABEL: {{^}}f64_oeq:
10 ; GCN: v_cmp_eq_f64
11 define void @f64_oeq(i32 addrspace(1)* %out, double %a, double %b) #0 {
12 entry:
13 %tmp0 = fcmp oeq double %a, %b
14 %tmp1 = sext i1 %tmp0 to i32
15 store i32 %tmp1, i32 addrspace(1)* %out
16 ret void
17 }
18
19 ; GCN-LABEL: {{^}}f64_ogt:
20 ; GCN: v_cmp_gt_f64
21 define void @f64_ogt(i32 addrspace(1)* %out, double %a, double %b) #0 {
22 entry:
23 %tmp0 = fcmp ogt double %a, %b
24 %tmp1 = sext i1 %tmp0 to i32
25 store i32 %tmp1, i32 addrspace(1)* %out
26 ret void
27 }
28
29 ; GCN-LABEL: {{^}}f64_oge:
30 ; GCN: v_cmp_ge_f64
31 define void @f64_oge(i32 addrspace(1)* %out, double %a, double %b) #0 {
32 entry:
33 %tmp0 = fcmp oge double %a, %b
34 %tmp1 = sext i1 %tmp0 to i32
35 store i32 %tmp1, i32 addrspace(1)* %out
36 ret void
37 }
38
39 ; GCN-LABEL: {{^}}f64_olt:
40 ; GCN: v_cmp_lt_f64
41 define void @f64_olt(i32 addrspace(1)* %out, double %a, double %b) #0 {
42 entry:
43 %tmp0 = fcmp olt double %a, %b
44 %tmp1 = sext i1 %tmp0 to i32
45 store i32 %tmp1, i32 addrspace(1)* %out
46 ret void
47 }
48
49 ; GCN-LABEL: {{^}}f64_ole:
50 ; GCN: v_cmp_le_f64
51 define void @f64_ole(i32 addrspace(1)* %out, double %a, double %b) #0 {
52 entry:
53 %tmp0 = fcmp ole double %a, %b
54 %tmp1 = sext i1 %tmp0 to i32
55 store i32 %tmp1, i32 addrspace(1)* %out
56 ret void
57 }
58
59 ; GCN-LABEL: {{^}}f64_one:
60 ; GCN: v_cmp_lg_f64_e32 vcc
61 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
62 define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) #0 {
63 entry:
64 %tmp0 = fcmp one double %a, %b
65 %tmp1 = sext i1 %tmp0 to i32
66 store i32 %tmp1, i32 addrspace(1)* %out
67 ret void
68 }
69
70 ; GCN-LABEL: {{^}}f64_ord:
71 ; GCN: v_cmp_o_f64
72 define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) #0 {
73 entry:
74 %tmp0 = fcmp ord double %a, %b
75 %tmp1 = sext i1 %tmp0 to i32
76 store i32 %tmp1, i32 addrspace(1)* %out
77 ret void
78 }
79
80 ; GCN-LABEL: {{^}}f64_ueq:
81 ; GCN: v_cmp_nlg_f64_e32 vcc
82 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
83 define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) #0 {
84 entry:
85 %tmp0 = fcmp ueq double %a, %b
86 %tmp1 = sext i1 %tmp0 to i32
87 store i32 %tmp1, i32 addrspace(1)* %out
88 ret void
89 }
90
91 ; GCN-LABEL: {{^}}f64_ugt:
92
93 ; GCN: v_cmp_nle_f64_e32 vcc
94 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
95 define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) #0 {
96 entry:
97 %tmp0 = fcmp ugt double %a, %b
98 %tmp1 = sext i1 %tmp0 to i32
99 store i32 %tmp1, i32 addrspace(1)* %out
100 ret void
101 }
102
103 ; GCN-LABEL: {{^}}f64_uge:
104 ; GCN: v_cmp_nlt_f64_e32 vcc
105 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
106 define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) #0 {
107 entry:
108 %tmp0 = fcmp uge double %a, %b
109 %tmp1 = sext i1 %tmp0 to i32
110 store i32 %tmp1, i32 addrspace(1)* %out
111 ret void
112 }
113
114 ; GCN-LABEL: {{^}}f64_ult:
115 ; GCN: v_cmp_nge_f64_e32 vcc
116 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
117 define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) #0 {
118 entry:
119 %tmp0 = fcmp ult double %a, %b
120 %tmp1 = sext i1 %tmp0 to i32
121 store i32 %tmp1, i32 addrspace(1)* %out
122 ret void
123 }
124
125 ; GCN-LABEL: {{^}}f64_ule:
126 ; GCN: v_cmp_ngt_f64_e32 vcc
127 ; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
128 define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) #0 {
129 entry:
130 %tmp0 = fcmp ule double %a, %b
131 %tmp1 = sext i1 %tmp0 to i32
132 store i32 %tmp1, i32 addrspace(1)* %out
133 ret void
134 }
135
136 ; GCN-LABEL: {{^}}f64_une:
137 ; GCN: v_cmp_neq_f64
138 define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) #0 {
139 entry:
140 %tmp0 = fcmp une double %a, %b
141 %tmp1 = sext i1 %tmp0 to i32
142 store i32 %tmp1, i32 addrspace(1)* %out
143 ret void
144 }
145
146 ; GCN-LABEL: {{^}}f64_uno:
147 ; GCN: v_cmp_u_f64
148 define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) #0 {
149 entry:
150 %tmp0 = fcmp uno double %a, %b
151 %tmp1 = sext i1 %tmp0 to i32
152 store i32 %tmp1, i32 addrspace(1)* %out
153153 ret void
154154 }
155155
157157 ;; 64-bit integer comparisons
158158 ;;;==========================================================================;;;
159159
160 ; FUNC-LABEL: {{^}}i64_eq:
161 ; SI: v_cmp_eq_u64
162 define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) {
163 entry:
164 %0 = icmp eq i64 %a, %b
165 %1 = sext i1 %0 to i32
166 store i32 %1, i32 addrspace(1)* %out
167 ret void
168 }
169
170 ; FUNC-LABEL: {{^}}i64_ne:
171 ; SI: v_cmp_ne_u64
172 define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) {
173 entry:
174 %0 = icmp ne i64 %a, %b
175 %1 = sext i1 %0 to i32
176 store i32 %1, i32 addrspace(1)* %out
177 ret void
178 }
179
180 ; FUNC-LABEL: {{^}}i64_ugt:
181 ; SI: v_cmp_gt_u64
182 define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
183 entry:
184 %0 = icmp ugt i64 %a, %b
185 %1 = sext i1 %0 to i32
186 store i32 %1, i32 addrspace(1)* %out
187 ret void
188 }
189
190 ; FUNC-LABEL: {{^}}i64_uge:
191 ; SI: v_cmp_ge_u64
192 define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
193 entry:
194 %0 = icmp uge i64 %a, %b
195 %1 = sext i1 %0 to i32
196 store i32 %1, i32 addrspace(1)* %out
197 ret void
198 }
199
200 ; FUNC-LABEL: {{^}}i64_ult:
201 ; SI: v_cmp_lt_u64
202 define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) {
203 entry:
204 %0 = icmp ult i64 %a, %b
205 %1 = sext i1 %0 to i32
206 store i32 %1, i32 addrspace(1)* %out
207 ret void
208 }
209
210 ; FUNC-LABEL: {{^}}i64_ule:
211 ; SI: v_cmp_le_u64
212 define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) {
213 entry:
214 %0 = icmp ule i64 %a, %b
215 %1 = sext i1 %0 to i32
216 store i32 %1, i32 addrspace(1)* %out
217 ret void
218 }
219
220 ; FUNC-LABEL: {{^}}i64_sgt:
221 ; SI: v_cmp_gt_i64
222 define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
223 entry:
224 %0 = icmp sgt i64 %a, %b
225 %1 = sext i1 %0 to i32
226 store i32 %1, i32 addrspace(1)* %out
227 ret void
228 }
229
230 ; FUNC-LABEL: {{^}}i64_sge:
231 ; SI: v_cmp_ge_i64
232 define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
233 entry:
234 %0 = icmp sge i64 %a, %b
235 %1 = sext i1 %0 to i32
236 store i32 %1, i32 addrspace(1)* %out
237 ret void
238 }
239
240 ; FUNC-LABEL: {{^}}i64_slt:
241 ; SI: v_cmp_lt_i64
242 define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
243 entry:
244 %0 = icmp slt i64 %a, %b
245 %1 = sext i1 %0 to i32
246 store i32 %1, i32 addrspace(1)* %out
247 ret void
248 }
249
250 ; FUNC-LABEL: {{^}}i64_sle:
251 ; SI: v_cmp_le_i64
252 define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) {
253 entry:
254 %0 = icmp sle i64 %a, %b
255 %1 = sext i1 %0 to i32
256 store i32 %1, i32 addrspace(1)* %out
257 ret void
258 }
160 ; GCN-LABEL: {{^}}i64_eq:
161 ; GCN: v_cmp_eq_u64
162 define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
163 entry:
164 %tmp0 = icmp eq i64 %a, %b
165 %tmp1 = sext i1 %tmp0 to i32
166 store i32 %tmp1, i32 addrspace(1)* %out
167 ret void
168 }
169
170 ; GCN-LABEL: {{^}}i64_ne:
171 ; GCN: v_cmp_ne_u64
172 define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
173 entry:
174 %tmp0 = icmp ne i64 %a, %b
175 %tmp1 = sext i1 %tmp0 to i32
176 store i32 %tmp1, i32 addrspace(1)* %out
177 ret void
178 }
179
180 ; GCN-LABEL: {{^}}i64_ugt:
181 ; GCN: v_cmp_gt_u64
182 define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
183 entry:
184 %tmp0 = icmp ugt i64 %a, %b
185 %tmp1 = sext i1 %tmp0 to i32
186 store i32 %tmp1, i32 addrspace(1)* %out
187 ret void
188 }
189
190 ; GCN-LABEL: {{^}}i64_uge:
191 ; GCN: v_cmp_ge_u64
192 define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
193 entry:
194 %tmp0 = icmp uge i64 %a, %b
195 %tmp1 = sext i1 %tmp0 to i32
196 store i32 %tmp1, i32 addrspace(1)* %out
197 ret void
198 }
199
200 ; GCN-LABEL: {{^}}i64_ult:
201 ; GCN: v_cmp_lt_u64
202 define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
203 entry:
204 %tmp0 = icmp ult i64 %a, %b
205 %tmp1 = sext i1 %tmp0 to i32
206 store i32 %tmp1, i32 addrspace(1)* %out
207 ret void
208 }
209
210 ; GCN-LABEL: {{^}}i64_ule:
211 ; GCN: v_cmp_le_u64
212 define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
213 entry:
214 %tmp0 = icmp ule i64 %a, %b
215 %tmp1 = sext i1 %tmp0 to i32
216 store i32 %tmp1, i32 addrspace(1)* %out
217 ret void
218 }
219
220 ; GCN-LABEL: {{^}}i64_sgt:
221 ; GCN: v_cmp_gt_i64
222 define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
223 entry:
224 %tmp0 = icmp sgt i64 %a, %b
225 %tmp1 = sext i1 %tmp0 to i32
226 store i32 %tmp1, i32 addrspace(1)* %out
227 ret void
228 }
229
230 ; GCN-LABEL: {{^}}i64_sge:
231 ; GCN: v_cmp_ge_i64
232 define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
233 entry:
234 %tmp0 = icmp sge i64 %a, %b
235 %tmp1 = sext i1 %tmp0 to i32
236 store i32 %tmp1, i32 addrspace(1)* %out
237 ret void
238 }
239
240 ; GCN-LABEL: {{^}}i64_slt:
241 ; GCN: v_cmp_lt_i64
242 define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
243 entry:
244 %tmp0 = icmp slt i64 %a, %b
245 %tmp1 = sext i1 %tmp0 to i32
246 store i32 %tmp1, i32 addrspace(1)* %out
247 ret void
248 }
249
250 ; GCN-LABEL: {{^}}i64_sle:
251 ; GCN: v_cmp_le_i64
252 define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) #0 {
253 entry:
254 %tmp0 = icmp sle i64 %a, %b
255 %tmp1 = sext i1 %tmp0 to i32
256 store i32 %tmp1, i32 addrspace(1)* %out
257 ret void
258 }
259
260 attributes #0 = { nounwind }