1 ; RUN: llc < %s -mtriple=xtensa -O0 | FileCheck %s
3 define i32 @f_eq(i32 %a, i32 %b) nounwind {
5 ; CHECK: addi a8, a1, -16
6 ; CHECK-NEXT: or a1, a8, a8
7 ; CHECK-NEXT: movi a8, 0
8 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
9 ; CHECK-NEXT: movi a8, 1
10 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
11 ; CHECK-NEXT: beq a2, a3, .LBB0_2
12 ; CHECK-NEXT: # %bb.1:
13 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
14 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
15 ; CHECK-NEXT: .LBB0_2:
16 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
17 ; CHECK-NEXT: addi a8, a1, 16
18 ; CHECK-NEXT: or a1, a8, a8
21 %cond = icmp eq i32 %a, %b
22 %res = zext i1 %cond to i32
26 define i32 @f_slt(i32 %a, i32 %b) nounwind {
28 ; CHECK: addi a8, a1, -16
29 ; CHECK-NEXT: or a1, a8, a8
30 ; CHECK-NEXT: movi a8, 0
31 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
32 ; CHECK-NEXT: movi a8, 1
33 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
34 ; CHECK-NEXT: blt a2, a3, .LBB1_2
35 ; CHECK-NEXT: # %bb.1:
36 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
37 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
38 ; CHECK-NEXT: .LBB1_2:
39 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
40 ; CHECK-NEXT: addi a8, a1, 16
41 ; CHECK-NEXT: or a1, a8, a8
44 %cond = icmp slt i32 %a, %b
45 %res = zext i1 %cond to i32
49 define i32 @f_sle(i32 %a, i32 %b) nounwind {
51 ; CHECK: addi a8, a1, -16
52 ; CHECK-NEXT: or a1, a8, a8
53 ; CHECK-NEXT: movi a8, 0
54 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
55 ; CHECK-NEXT: movi a8, 1
56 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
57 ; CHECK-NEXT: bge a3, a2, .LBB2_2
58 ; CHECK-NEXT: # %bb.1:
59 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
60 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
61 ; CHECK-NEXT: .LBB2_2:
62 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
63 ; CHECK-NEXT: addi a8, a1, 16
64 ; CHECK-NEXT: or a1, a8, a8
67 %cond = icmp sle i32 %a, %b
68 %res = zext i1 %cond to i32
72 define i32 @f_sgt(i32 %a, i32 %b) nounwind {
74 ; CHECK: addi a8, a1, -16
75 ; CHECK-NEXT: or a1, a8, a8
76 ; CHECK-NEXT: movi a8, 0
77 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
78 ; CHECK-NEXT: movi a8, 1
79 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
80 ; CHECK-NEXT: blt a3, a2, .LBB3_2
81 ; CHECK-NEXT: # %bb.1:
82 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
83 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
84 ; CHECK-NEXT: .LBB3_2:
85 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
86 ; CHECK-NEXT: addi a8, a1, 16
87 ; CHECK-NEXT: or a1, a8, a8
90 %cond = icmp sgt i32 %a, %b
91 %res = zext i1 %cond to i32
95 define i32 @f_sge(i32 %a, i32 %b) nounwind {
97 ; CHECK: addi a8, a1, -16
98 ; CHECK-NEXT: or a1, a8, a8
99 ; CHECK-NEXT: movi a8, 0
100 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
101 ; CHECK-NEXT: movi a8, 1
102 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
103 ; CHECK-NEXT: bge a2, a3, .LBB4_2
104 ; CHECK-NEXT: # %bb.1:
105 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
106 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
107 ; CHECK-NEXT: .LBB4_2:
108 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
109 ; CHECK-NEXT: addi a8, a1, 16
110 ; CHECK-NEXT: or a1, a8, a8
113 %cond = icmp sge i32 %a, %b
114 %res = zext i1 %cond to i32
118 define i32 @f_ne(i32 %a, i32 %b) nounwind {
120 ; CHECK: addi a8, a1, -16
121 ; CHECK-NEXT: or a1, a8, a8
122 ; CHECK-NEXT: movi a8, 0
123 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
124 ; CHECK-NEXT: movi a8, 1
125 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
126 ; CHECK-NEXT: bne a2, a3, .LBB5_2
127 ; CHECK-NEXT: # %bb.1:
128 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
129 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
130 ; CHECK-NEXT: .LBB5_2:
131 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
132 ; CHECK-NEXT: addi a8, a1, 16
133 ; CHECK-NEXT: or a1, a8, a8
136 %cond = icmp ne i32 %a, %b
137 %res = zext i1 %cond to i32
141 define i32 @f_ult(i32 %a, i32 %b) nounwind {
142 ; CHECK-LABEL: f_ult:
143 ; CHECK: addi a8, a1, -16
144 ; CHECK-NEXT: or a1, a8, a8
145 ; CHECK-NEXT: movi a8, 0
146 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
147 ; CHECK-NEXT: movi a8, 1
148 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
149 ; CHECK-NEXT: bltu a2, a3, .LBB6_2
150 ; CHECK-NEXT: # %bb.1:
151 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
152 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
153 ; CHECK-NEXT: .LBB6_2:
154 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
155 ; CHECK-NEXT: addi a8, a1, 16
156 ; CHECK-NEXT: or a1, a8, a8
159 %cond = icmp ult i32 %a, %b
160 %res = zext i1 %cond to i32
164 define i32 @f_ule(i32 %a, i32 %b) nounwind {
165 ; CHECK-LABEL: f_ule:
166 ; CHECK: addi a8, a1, -16
167 ; CHECK-NEXT: or a1, a8, a8
168 ; CHECK-NEXT: movi a8, 0
169 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
170 ; CHECK-NEXT: movi a8, 1
171 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
172 ; CHECK-NEXT: bgeu a3, a2, .LBB7_2
173 ; CHECK-NEXT: # %bb.1:
174 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
175 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
176 ; CHECK-NEXT: .LBB7_2:
177 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
178 ; CHECK-NEXT: addi a8, a1, 16
179 ; CHECK-NEXT: or a1, a8, a8
182 %cond = icmp ule i32 %a, %b
183 %res = zext i1 %cond to i32
187 define i32 @f_ugt(i32 %a, i32 %b) nounwind {
188 ; CHECK-LABEL: f_ugt:
189 ; CHECK: addi a8, a1, -16
190 ; CHECK-NEXT: or a1, a8, a8
191 ; CHECK-NEXT: movi a8, 0
192 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
193 ; CHECK-NEXT: movi a8, 1
194 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
195 ; CHECK-NEXT: bltu a3, a2, .LBB8_2
196 ; CHECK-NEXT: # %bb.1:
197 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
198 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
199 ; CHECK-NEXT: .LBB8_2:
200 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
201 ; CHECK-NEXT: addi a8, a1, 16
202 ; CHECK-NEXT: or a1, a8, a8
205 %cond = icmp ugt i32 %a, %b
206 %res = zext i1 %cond to i32
210 define i32 @f_uge(i32 %a, i32 %b) nounwind {
211 ; CHECK-LABEL: f_uge:
212 ; CHECK: addi a8, a1, -16
213 ; CHECK-NEXT: or a1, a8, a8
214 ; CHECK-NEXT: movi a8, 0
215 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
216 ; CHECK-NEXT: movi a8, 1
217 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
218 ; CHECK-NEXT: bgeu a2, a3, .LBB9_2
219 ; CHECK-NEXT: # %bb.1:
220 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
221 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
222 ; CHECK-NEXT: .LBB9_2:
223 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
224 ; CHECK-NEXT: addi a8, a1, 16
225 ; CHECK-NEXT: or a1, a8, a8
228 %cond = icmp uge i32 %a, %b
229 %res = zext i1 %cond to i32
234 ; Tests for i64 operands
236 define i64 @f_eq_i64(i64 %a, i64 %b) nounwind {
237 ; CHECK-LABEL: f_eq_i64:
238 ; CHECK: addi a8, a1, -16
239 ; CHECK-NEXT: or a1, a8, a8
240 ; CHECK-NEXT: # kill: def $a8 killed $a5
241 ; CHECK-NEXT: # kill: def $a8 killed $a4
242 ; CHECK-NEXT: # kill: def $a8 killed $a3
243 ; CHECK-NEXT: # kill: def $a8 killed $a2
244 ; CHECK-NEXT: xor a9, a3, a5
245 ; CHECK-NEXT: xor a8, a2, a4
246 ; CHECK-NEXT: or a8, a8, a9
247 ; CHECK-NEXT: movi a10, 1
248 ; CHECK-NEXT: movi a9, 0
249 ; CHECK-NEXT: s32i a9, a1, 0 # 4-byte Folded Spill
250 ; CHECK-NEXT: s32i a10, a1, 4 # 4-byte Folded Spill
251 ; CHECK-NEXT: beq a8, a9, .LBB10_2
252 ; CHECK-NEXT: # %bb.1:
253 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
254 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
255 ; CHECK-NEXT: .LBB10_2:
256 ; CHECK-NEXT: l32i a3, a1, 0 # 4-byte Folded Reload
257 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
258 ; CHECK-NEXT: addi a8, a1, 16
259 ; CHECK-NEXT: or a1, a8, a8
262 %cond = icmp eq i64 %a, %b
263 %res = zext i1 %cond to i64
267 define i64 @f_slt_i64(i64 %a, i64 %b) nounwind {
268 ; CHECK-LABEL: f_slt_i64:
269 ; CHECK: addi a8, a1, -48
270 ; CHECK-NEXT: or a1, a8, a8
271 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
272 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
273 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
274 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
275 ; CHECK-NEXT: # kill: def $a8 killed $a5
276 ; CHECK-NEXT: # kill: def $a8 killed $a3
277 ; CHECK-NEXT: movi a8, 0
278 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
279 ; CHECK-NEXT: movi a8, 1
280 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
281 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
282 ; CHECK-NEXT: blt a3, a5, .LBB11_2
283 ; CHECK-NEXT: # %bb.1:
284 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
285 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
286 ; CHECK-NEXT: .LBB11_2:
287 ; CHECK-NEXT: l32i a8, a1, 24 # 4-byte Folded Reload
288 ; CHECK-NEXT: l32i a9, a1, 16 # 4-byte Folded Reload
289 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
290 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
291 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
292 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
293 ; CHECK-NEXT: bltu a8, a9, .LBB11_4
294 ; CHECK-NEXT: # %bb.3:
295 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
296 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
297 ; CHECK-NEXT: .LBB11_4:
298 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
299 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
300 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
301 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
302 ; CHECK-NEXT: beq a8, a9, .LBB11_6
303 ; CHECK-NEXT: # %bb.5:
304 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
305 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
306 ; CHECK-NEXT: .LBB11_6:
307 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
308 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
309 ; CHECK-NEXT: addi a8, a1, 48
310 ; CHECK-NEXT: or a1, a8, a8
313 %cond = icmp slt i64 %a, %b
314 %res = zext i1 %cond to i64
318 define i64 @f_sle_i64(i64 %a, i64 %b) nounwind {
319 ; CHECK-LABEL: f_sle_i64:
320 ; CHECK: addi a8, a1, -48
321 ; CHECK-NEXT: or a1, a8, a8
322 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
323 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
324 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
325 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
326 ; CHECK-NEXT: # kill: def $a8 killed $a5
327 ; CHECK-NEXT: # kill: def $a8 killed $a3
328 ; CHECK-NEXT: movi a8, 0
329 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
330 ; CHECK-NEXT: movi a8, 1
331 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
332 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
333 ; CHECK-NEXT: bge a5, a3, .LBB12_2
334 ; CHECK-NEXT: # %bb.1:
335 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
336 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
337 ; CHECK-NEXT: .LBB12_2:
338 ; CHECK-NEXT: l32i a8, a1, 16 # 4-byte Folded Reload
339 ; CHECK-NEXT: l32i a9, a1, 24 # 4-byte Folded Reload
340 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
341 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
342 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
343 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
344 ; CHECK-NEXT: bgeu a8, a9, .LBB12_4
345 ; CHECK-NEXT: # %bb.3:
346 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
347 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
348 ; CHECK-NEXT: .LBB12_4:
349 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
350 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
351 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
352 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
353 ; CHECK-NEXT: beq a8, a9, .LBB12_6
354 ; CHECK-NEXT: # %bb.5:
355 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
356 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
357 ; CHECK-NEXT: .LBB12_6:
358 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
359 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
360 ; CHECK-NEXT: addi a8, a1, 48
361 ; CHECK-NEXT: or a1, a8, a8
364 %cond = icmp sle i64 %a, %b
365 %res = zext i1 %cond to i64
369 define i64 @f_sgt_i64(i64 %a, i64 %b) nounwind {
370 ; CHECK-LABEL: f_sgt_i64:
371 ; CHECK: addi a8, a1, -48
372 ; CHECK-NEXT: or a1, a8, a8
373 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
374 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
375 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
376 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
377 ; CHECK-NEXT: # kill: def $a8 killed $a5
378 ; CHECK-NEXT: # kill: def $a8 killed $a3
379 ; CHECK-NEXT: movi a8, 0
380 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
381 ; CHECK-NEXT: movi a8, 1
382 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
383 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
384 ; CHECK-NEXT: blt a5, a3, .LBB13_2
385 ; CHECK-NEXT: # %bb.1:
386 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
387 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
388 ; CHECK-NEXT: .LBB13_2:
389 ; CHECK-NEXT: l32i a8, a1, 16 # 4-byte Folded Reload
390 ; CHECK-NEXT: l32i a9, a1, 24 # 4-byte Folded Reload
391 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
392 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
393 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
394 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
395 ; CHECK-NEXT: bltu a8, a9, .LBB13_4
396 ; CHECK-NEXT: # %bb.3:
397 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
398 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
399 ; CHECK-NEXT: .LBB13_4:
400 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
401 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
402 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
403 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
404 ; CHECK-NEXT: beq a8, a9, .LBB13_6
405 ; CHECK-NEXT: # %bb.5:
406 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
407 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
408 ; CHECK-NEXT: .LBB13_6:
409 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
410 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
411 ; CHECK-NEXT: addi a8, a1, 48
412 ; CHECK-NEXT: or a1, a8, a8
415 %cond = icmp sgt i64 %a, %b
416 %res = zext i1 %cond to i64
420 define i64 @f_sge_i64(i64 %a, i64 %b) nounwind {
421 ; CHECK-LABEL: f_sge_i64:
422 ; CHECK: addi a8, a1, -48
423 ; CHECK-NEXT: or a1, a8, a8
424 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
425 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
426 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
427 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
428 ; CHECK-NEXT: # kill: def $a8 killed $a5
429 ; CHECK-NEXT: # kill: def $a8 killed $a3
430 ; CHECK-NEXT: movi a8, 0
431 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
432 ; CHECK-NEXT: movi a8, 1
433 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
434 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
435 ; CHECK-NEXT: bge a3, a5, .LBB14_2
436 ; CHECK-NEXT: # %bb.1:
437 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
438 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
439 ; CHECK-NEXT: .LBB14_2:
440 ; CHECK-NEXT: l32i a8, a1, 24 # 4-byte Folded Reload
441 ; CHECK-NEXT: l32i a9, a1, 16 # 4-byte Folded Reload
442 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
443 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
444 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
445 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
446 ; CHECK-NEXT: bgeu a8, a9, .LBB14_4
447 ; CHECK-NEXT: # %bb.3:
448 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
449 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
450 ; CHECK-NEXT: .LBB14_4:
451 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
452 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
453 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
454 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
455 ; CHECK-NEXT: beq a8, a9, .LBB14_6
456 ; CHECK-NEXT: # %bb.5:
457 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
458 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
459 ; CHECK-NEXT: .LBB14_6:
460 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
461 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
462 ; CHECK-NEXT: addi a8, a1, 48
463 ; CHECK-NEXT: or a1, a8, a8
466 %cond = icmp sge i64 %a, %b
467 %res = zext i1 %cond to i64
471 define i64 @f_ne_i64(i64 %a, i64 %b) nounwind {
472 ; CHECK-LABEL: f_ne_i64:
473 ; CHECK: addi a8, a1, -16
474 ; CHECK-NEXT: or a1, a8, a8
475 ; CHECK-NEXT: # kill: def $a8 killed $a5
476 ; CHECK-NEXT: # kill: def $a8 killed $a4
477 ; CHECK-NEXT: # kill: def $a8 killed $a3
478 ; CHECK-NEXT: # kill: def $a8 killed $a2
479 ; CHECK-NEXT: xor a9, a3, a5
480 ; CHECK-NEXT: xor a8, a2, a4
481 ; CHECK-NEXT: or a8, a8, a9
482 ; CHECK-NEXT: movi a10, 1
483 ; CHECK-NEXT: movi a9, 0
484 ; CHECK-NEXT: s32i a9, a1, 0 # 4-byte Folded Spill
485 ; CHECK-NEXT: s32i a10, a1, 4 # 4-byte Folded Spill
486 ; CHECK-NEXT: bne a8, a9, .LBB15_2
487 ; CHECK-NEXT: # %bb.1:
488 ; CHECK-NEXT: l32i a8, a1, 0 # 4-byte Folded Reload
489 ; CHECK-NEXT: s32i a8, a1, 4 # 4-byte Folded Spill
490 ; CHECK-NEXT: .LBB15_2:
491 ; CHECK-NEXT: l32i a3, a1, 0 # 4-byte Folded Reload
492 ; CHECK-NEXT: l32i a2, a1, 4 # 4-byte Folded Reload
493 ; CHECK-NEXT: addi a8, a1, 16
494 ; CHECK-NEXT: or a1, a8, a8
497 %cond = icmp ne i64 %a, %b
498 %res = zext i1 %cond to i64
502 define i64 @f_ult_i64(i64 %a, i64 %b) nounwind {
503 ; CHECK-LABEL: f_ult_i64:
504 ; CHECK: addi a8, a1, -48
505 ; CHECK-NEXT: or a1, a8, a8
506 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
507 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
508 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
509 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
510 ; CHECK-NEXT: # kill: def $a8 killed $a5
511 ; CHECK-NEXT: # kill: def $a8 killed $a3
512 ; CHECK-NEXT: movi a8, 0
513 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
514 ; CHECK-NEXT: movi a8, 1
515 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
516 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
517 ; CHECK-NEXT: bltu a3, a5, .LBB16_2
518 ; CHECK-NEXT: # %bb.1:
519 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
520 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
521 ; CHECK-NEXT: .LBB16_2:
522 ; CHECK-NEXT: l32i a8, a1, 24 # 4-byte Folded Reload
523 ; CHECK-NEXT: l32i a9, a1, 16 # 4-byte Folded Reload
524 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
525 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
526 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
527 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
528 ; CHECK-NEXT: bltu a8, a9, .LBB16_4
529 ; CHECK-NEXT: # %bb.3:
530 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
531 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
532 ; CHECK-NEXT: .LBB16_4:
533 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
534 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
535 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
536 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
537 ; CHECK-NEXT: beq a8, a9, .LBB16_6
538 ; CHECK-NEXT: # %bb.5:
539 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
540 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
541 ; CHECK-NEXT: .LBB16_6:
542 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
543 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
544 ; CHECK-NEXT: addi a8, a1, 48
545 ; CHECK-NEXT: or a1, a8, a8
548 %cond = icmp ult i64 %a, %b
549 %res = zext i1 %cond to i64
553 define i64 @f_ule_i64(i64 %a, i64 %b) nounwind {
554 ; CHECK-LABEL: f_ule_i64:
555 ; CHECK: addi a8, a1, -48
556 ; CHECK-NEXT: or a1, a8, a8
557 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
558 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
559 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
560 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
561 ; CHECK-NEXT: # kill: def $a8 killed $a5
562 ; CHECK-NEXT: # kill: def $a8 killed $a3
563 ; CHECK-NEXT: movi a8, 0
564 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
565 ; CHECK-NEXT: movi a8, 1
566 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
567 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
568 ; CHECK-NEXT: bgeu a5, a3, .LBB17_2
569 ; CHECK-NEXT: # %bb.1:
570 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
571 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
572 ; CHECK-NEXT: .LBB17_2:
573 ; CHECK-NEXT: l32i a8, a1, 16 # 4-byte Folded Reload
574 ; CHECK-NEXT: l32i a9, a1, 24 # 4-byte Folded Reload
575 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
576 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
577 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
578 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
579 ; CHECK-NEXT: bgeu a8, a9, .LBB17_4
580 ; CHECK-NEXT: # %bb.3:
581 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
582 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
583 ; CHECK-NEXT: .LBB17_4:
584 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
585 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
586 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
587 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
588 ; CHECK-NEXT: beq a8, a9, .LBB17_6
589 ; CHECK-NEXT: # %bb.5:
590 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
591 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
592 ; CHECK-NEXT: .LBB17_6:
593 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
594 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
595 ; CHECK-NEXT: addi a8, a1, 48
596 ; CHECK-NEXT: or a1, a8, a8
599 %cond = icmp ule i64 %a, %b
600 %res = zext i1 %cond to i64
604 define i64 @f_ugt_i64(i64 %a, i64 %b) nounwind {
605 ; CHECK-LABEL: f_ugt_i64:
606 ; CHECK: addi a8, a1, -48
607 ; CHECK-NEXT: or a1, a8, a8
608 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
609 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
610 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
611 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
612 ; CHECK-NEXT: # kill: def $a8 killed $a5
613 ; CHECK-NEXT: # kill: def $a8 killed $a3
614 ; CHECK-NEXT: movi a8, 0
615 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
616 ; CHECK-NEXT: movi a8, 1
617 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
618 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
619 ; CHECK-NEXT: bltu a5, a3, .LBB18_2
620 ; CHECK-NEXT: # %bb.1:
621 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
622 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
623 ; CHECK-NEXT: .LBB18_2:
624 ; CHECK-NEXT: l32i a8, a1, 16 # 4-byte Folded Reload
625 ; CHECK-NEXT: l32i a9, a1, 24 # 4-byte Folded Reload
626 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
627 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
628 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
629 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
630 ; CHECK-NEXT: bltu a8, a9, .LBB18_4
631 ; CHECK-NEXT: # %bb.3:
632 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
633 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
634 ; CHECK-NEXT: .LBB18_4:
635 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
636 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
637 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
638 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
639 ; CHECK-NEXT: beq a8, a9, .LBB18_6
640 ; CHECK-NEXT: # %bb.5:
641 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
642 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
643 ; CHECK-NEXT: .LBB18_6:
644 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
645 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
646 ; CHECK-NEXT: addi a8, a1, 48
647 ; CHECK-NEXT: or a1, a8, a8
650 %cond = icmp ugt i64 %a, %b
651 %res = zext i1 %cond to i64
655 define i64 @f_uge_i64(i64 %a, i64 %b) nounwind {
656 ; CHECK-LABEL: f_uge_i64:
657 ; CHECK: addi a8, a1, -48
658 ; CHECK-NEXT: or a1, a8, a8
659 ; CHECK-NEXT: s32i a5, a1, 12 # 4-byte Folded Spill
660 ; CHECK-NEXT: s32i a4, a1, 16 # 4-byte Folded Spill
661 ; CHECK-NEXT: s32i a3, a1, 20 # 4-byte Folded Spill
662 ; CHECK-NEXT: s32i a2, a1, 24 # 4-byte Folded Spill
663 ; CHECK-NEXT: # kill: def $a8 killed $a5
664 ; CHECK-NEXT: # kill: def $a8 killed $a3
665 ; CHECK-NEXT: movi a8, 0
666 ; CHECK-NEXT: s32i a8, a1, 28 # 4-byte Folded Spill
667 ; CHECK-NEXT: movi a8, 1
668 ; CHECK-NEXT: s32i a8, a1, 32 # 4-byte Folded Spill
669 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
670 ; CHECK-NEXT: bgeu a3, a5, .LBB19_2
671 ; CHECK-NEXT: # %bb.1:
672 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
673 ; CHECK-NEXT: s32i a8, a1, 36 # 4-byte Folded Spill
674 ; CHECK-NEXT: .LBB19_2:
675 ; CHECK-NEXT: l32i a8, a1, 24 # 4-byte Folded Reload
676 ; CHECK-NEXT: l32i a9, a1, 16 # 4-byte Folded Reload
677 ; CHECK-NEXT: l32i a10, a1, 32 # 4-byte Folded Reload
678 ; CHECK-NEXT: l32i a11, a1, 36 # 4-byte Folded Reload
679 ; CHECK-NEXT: s32i a11, a1, 4 # 4-byte Folded Spill
680 ; CHECK-NEXT: s32i a10, a1, 8 # 4-byte Folded Spill
681 ; CHECK-NEXT: bgeu a8, a9, .LBB19_4
682 ; CHECK-NEXT: # %bb.3:
683 ; CHECK-NEXT: l32i a8, a1, 28 # 4-byte Folded Reload
684 ; CHECK-NEXT: s32i a8, a1, 8 # 4-byte Folded Spill
685 ; CHECK-NEXT: .LBB19_4:
686 ; CHECK-NEXT: l32i a8, a1, 20 # 4-byte Folded Reload
687 ; CHECK-NEXT: l32i a9, a1, 12 # 4-byte Folded Reload
688 ; CHECK-NEXT: l32i a10, a1, 8 # 4-byte Folded Reload
689 ; CHECK-NEXT: s32i a10, a1, 0 # 4-byte Folded Spill
690 ; CHECK-NEXT: beq a8, a9, .LBB19_6
691 ; CHECK-NEXT: # %bb.5:
692 ; CHECK-NEXT: l32i a8, a1, 4 # 4-byte Folded Reload
693 ; CHECK-NEXT: s32i a8, a1, 0 # 4-byte Folded Spill
694 ; CHECK-NEXT: .LBB19_6:
695 ; CHECK-NEXT: l32i a3, a1, 28 # 4-byte Folded Reload
696 ; CHECK-NEXT: l32i a2, a1, 0 # 4-byte Folded Reload
697 ; CHECK-NEXT: addi a8, a1, 48
698 ; CHECK-NEXT: or a1, a8, a8
701 %cond = icmp uge i64 %a, %b
702 %res = zext i1 %cond to i64