1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV32I
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s -check-prefix=RV64I
7 define i1 @and_icmp_eq(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
8 ; RV32I-LABEL: and_icmp_eq:
10 ; RV32I-NEXT: xor a0, a0, a1
11 ; RV32I-NEXT: xor a2, a2, a3
12 ; RV32I-NEXT: or a0, a0, a2
13 ; RV32I-NEXT: seqz a0, a0
16 ; RV64I-LABEL: and_icmp_eq:
18 ; RV64I-NEXT: xor a0, a0, a1
19 ; RV64I-NEXT: xor a2, a2, a3
20 ; RV64I-NEXT: or a0, a0, a2
21 ; RV64I-NEXT: seqz a0, a0
23 %cmp1 = icmp eq i32 %a, %b
24 %cmp2 = icmp eq i32 %c, %d
25 %and = and i1 %cmp1, %cmp2
29 define i1 @or_icmp_ne(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
30 ; RV32I-LABEL: or_icmp_ne:
32 ; RV32I-NEXT: xor a0, a0, a1
33 ; RV32I-NEXT: xor a2, a2, a3
34 ; RV32I-NEXT: or a0, a0, a2
35 ; RV32I-NEXT: snez a0, a0
38 ; RV64I-LABEL: or_icmp_ne:
40 ; RV64I-NEXT: xor a0, a0, a1
41 ; RV64I-NEXT: xor a2, a2, a3
42 ; RV64I-NEXT: or a0, a0, a2
43 ; RV64I-NEXT: snez a0, a0
45 %cmp1 = icmp ne i32 %a, %b
46 %cmp2 = icmp ne i32 %c, %d
47 %or = or i1 %cmp1, %cmp2
51 define i1 @or_icmps_const_1bit_diff(i64 %x) nounwind {
52 ; RV32I-LABEL: or_icmps_const_1bit_diff:
54 ; RV32I-NEXT: addi a2, a0, -13
55 ; RV32I-NEXT: sltu a0, a2, a0
56 ; RV32I-NEXT: add a0, a1, a0
57 ; RV32I-NEXT: addi a0, a0, -1
58 ; RV32I-NEXT: andi a2, a2, -5
59 ; RV32I-NEXT: or a0, a2, a0
60 ; RV32I-NEXT: seqz a0, a0
63 ; RV64I-LABEL: or_icmps_const_1bit_diff:
65 ; RV64I-NEXT: addi a0, a0, -13
66 ; RV64I-NEXT: andi a0, a0, -5
67 ; RV64I-NEXT: seqz a0, a0
69 %a = icmp eq i64 %x, 17
70 %b = icmp eq i64 %x, 13
75 define i1 @and_icmps_const_1bit_diff(i32 %x) nounwind {
76 ; RV32I-LABEL: and_icmps_const_1bit_diff:
78 ; RV32I-NEXT: addi a0, a0, -44
79 ; RV32I-NEXT: andi a0, a0, -17
80 ; RV32I-NEXT: snez a0, a0
83 ; RV64I-LABEL: and_icmps_const_1bit_diff:
85 ; RV64I-NEXT: addiw a0, a0, -44
86 ; RV64I-NEXT: andi a0, a0, -17
87 ; RV64I-NEXT: snez a0, a0
89 %a = icmp ne i32 %x, 44
90 %b = icmp ne i32 %x, 60
95 define i1 @and_icmps_const_not1bit_diff(i32 %x) nounwind {
96 ; RV32I-LABEL: and_icmps_const_not1bit_diff:
98 ; RV32I-NEXT: addi a1, a0, -44
99 ; RV32I-NEXT: snez a1, a1
100 ; RV32I-NEXT: addi a0, a0, -92
101 ; RV32I-NEXT: snez a0, a0
102 ; RV32I-NEXT: and a0, a1, a0
105 ; RV64I-LABEL: and_icmps_const_not1bit_diff:
107 ; RV64I-NEXT: sext.w a0, a0
108 ; RV64I-NEXT: addi a1, a0, -44
109 ; RV64I-NEXT: snez a1, a1
110 ; RV64I-NEXT: addi a0, a0, -92
111 ; RV64I-NEXT: snez a0, a0
112 ; RV64I-NEXT: and a0, a1, a0
114 %a = icmp ne i32 %x, 44
115 %b = icmp ne i32 %x, 92
120 define i1 @and_icmp_sge(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
121 ; RV32I-LABEL: and_icmp_sge:
123 ; RV32I-NEXT: slt a0, a0, a1
124 ; RV32I-NEXT: slt a1, a2, a3
125 ; RV32I-NEXT: or a0, a0, a1
126 ; RV32I-NEXT: xori a0, a0, 1
129 ; RV64I-LABEL: and_icmp_sge:
131 ; RV64I-NEXT: slt a0, a0, a1
132 ; RV64I-NEXT: slt a1, a2, a3
133 ; RV64I-NEXT: or a0, a0, a1
134 ; RV64I-NEXT: xori a0, a0, 1
136 %cmp1 = icmp sge i32 %a, %b
137 %cmp2 = icmp sge i32 %c, %d
138 %and = and i1 %cmp1, %cmp2
142 define i1 @and_icmp_sle(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
143 ; RV32I-LABEL: and_icmp_sle:
145 ; RV32I-NEXT: slt a0, a1, a0
146 ; RV32I-NEXT: slt a1, a3, a2
147 ; RV32I-NEXT: or a0, a0, a1
148 ; RV32I-NEXT: xori a0, a0, 1
151 ; RV64I-LABEL: and_icmp_sle:
153 ; RV64I-NEXT: slt a0, a1, a0
154 ; RV64I-NEXT: slt a1, a3, a2
155 ; RV64I-NEXT: or a0, a0, a1
156 ; RV64I-NEXT: xori a0, a0, 1
158 %cmp1 = icmp sle i32 %a, %b
159 %cmp2 = icmp sle i32 %c, %d
160 %and = and i1 %cmp1, %cmp2
164 define i1 @and_icmp_uge(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
165 ; RV32I-LABEL: and_icmp_uge:
167 ; RV32I-NEXT: sltu a0, a0, a1
168 ; RV32I-NEXT: sltu a1, a2, a3
169 ; RV32I-NEXT: or a0, a0, a1
170 ; RV32I-NEXT: xori a0, a0, 1
173 ; RV64I-LABEL: and_icmp_uge:
175 ; RV64I-NEXT: sltu a0, a0, a1
176 ; RV64I-NEXT: sltu a1, a2, a3
177 ; RV64I-NEXT: or a0, a0, a1
178 ; RV64I-NEXT: xori a0, a0, 1
180 %cmp1 = icmp uge i32 %a, %b
181 %cmp2 = icmp uge i32 %c, %d
182 %and = and i1 %cmp1, %cmp2
186 define i1 @and_icmp_ule(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
187 ; RV32I-LABEL: and_icmp_ule:
189 ; RV32I-NEXT: sltu a0, a1, a0
190 ; RV32I-NEXT: sltu a1, a3, a2
191 ; RV32I-NEXT: or a0, a0, a1
192 ; RV32I-NEXT: xori a0, a0, 1
195 ; RV64I-LABEL: and_icmp_ule:
197 ; RV64I-NEXT: sltu a0, a1, a0
198 ; RV64I-NEXT: sltu a1, a3, a2
199 ; RV64I-NEXT: or a0, a0, a1
200 ; RV64I-NEXT: xori a0, a0, 1
202 %cmp1 = icmp ule i32 %a, %b
203 %cmp2 = icmp ule i32 %c, %d
204 %and = and i1 %cmp1, %cmp2
208 define i1 @or_icmp_sge(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
209 ; RV32I-LABEL: or_icmp_sge:
211 ; RV32I-NEXT: slt a0, a0, a1
212 ; RV32I-NEXT: slt a1, a2, a3
213 ; RV32I-NEXT: and a0, a0, a1
214 ; RV32I-NEXT: xori a0, a0, 1
217 ; RV64I-LABEL: or_icmp_sge:
219 ; RV64I-NEXT: slt a0, a0, a1
220 ; RV64I-NEXT: slt a1, a2, a3
221 ; RV64I-NEXT: and a0, a0, a1
222 ; RV64I-NEXT: xori a0, a0, 1
224 %cmp1 = icmp sge i32 %a, %b
225 %cmp2 = icmp sge i32 %c, %d
226 %and = or i1 %cmp1, %cmp2
230 define i1 @or_icmp_sle(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
231 ; RV32I-LABEL: or_icmp_sle:
233 ; RV32I-NEXT: slt a0, a1, a0
234 ; RV32I-NEXT: slt a1, a3, a2
235 ; RV32I-NEXT: and a0, a0, a1
236 ; RV32I-NEXT: xori a0, a0, 1
239 ; RV64I-LABEL: or_icmp_sle:
241 ; RV64I-NEXT: slt a0, a1, a0
242 ; RV64I-NEXT: slt a1, a3, a2
243 ; RV64I-NEXT: and a0, a0, a1
244 ; RV64I-NEXT: xori a0, a0, 1
246 %cmp1 = icmp sle i32 %a, %b
247 %cmp2 = icmp sle i32 %c, %d
248 %and = or i1 %cmp1, %cmp2
252 define i1 @or_icmp_uge(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
253 ; RV32I-LABEL: or_icmp_uge:
255 ; RV32I-NEXT: sltu a0, a0, a1
256 ; RV32I-NEXT: sltu a1, a2, a3
257 ; RV32I-NEXT: and a0, a0, a1
258 ; RV32I-NEXT: xori a0, a0, 1
261 ; RV64I-LABEL: or_icmp_uge:
263 ; RV64I-NEXT: sltu a0, a0, a1
264 ; RV64I-NEXT: sltu a1, a2, a3
265 ; RV64I-NEXT: and a0, a0, a1
266 ; RV64I-NEXT: xori a0, a0, 1
268 %cmp1 = icmp uge i32 %a, %b
269 %cmp2 = icmp uge i32 %c, %d
270 %and = or i1 %cmp1, %cmp2
274 define i1 @or_icmp_ule(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
275 ; RV32I-LABEL: or_icmp_ule:
277 ; RV32I-NEXT: sltu a0, a1, a0
278 ; RV32I-NEXT: sltu a1, a3, a2
279 ; RV32I-NEXT: and a0, a0, a1
280 ; RV32I-NEXT: xori a0, a0, 1
283 ; RV64I-LABEL: or_icmp_ule:
285 ; RV64I-NEXT: sltu a0, a1, a0
286 ; RV64I-NEXT: sltu a1, a3, a2
287 ; RV64I-NEXT: and a0, a0, a1
288 ; RV64I-NEXT: xori a0, a0, 1
290 %cmp1 = icmp ule i32 %a, %b
291 %cmp2 = icmp ule i32 %c, %d
292 %and = or i1 %cmp1, %cmp2
296 declare void @bar(...)
298 define void @and_sge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
299 ; RV32I-LABEL: and_sge_eq:
301 ; RV32I-NEXT: slt a0, a0, a1
302 ; RV32I-NEXT: xor a2, a2, a3
303 ; RV32I-NEXT: snez a1, a2
304 ; RV32I-NEXT: or a0, a1, a0
305 ; RV32I-NEXT: bnez a0, .LBB13_2
306 ; RV32I-NEXT: # %bb.1:
308 ; RV32I-NEXT: .LBB13_2:
309 ; RV32I-NEXT: tail bar@plt
311 ; RV64I-LABEL: and_sge_eq:
313 ; RV64I-NEXT: slt a0, a0, a1
314 ; RV64I-NEXT: xor a2, a2, a3
315 ; RV64I-NEXT: snez a1, a2
316 ; RV64I-NEXT: or a0, a1, a0
317 ; RV64I-NEXT: bnez a0, .LBB13_2
318 ; RV64I-NEXT: # %bb.1:
320 ; RV64I-NEXT: .LBB13_2:
321 ; RV64I-NEXT: tail bar@plt
322 %5 = icmp sge i32 %0, %1
323 %6 = icmp eq i32 %2, %3
325 br i1 %7, label %9, label %8
328 tail call void @bar()
335 define void @and_sle_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
336 ; RV32I-LABEL: and_sle_eq:
338 ; RV32I-NEXT: slt a0, a1, a0
339 ; RV32I-NEXT: xor a2, a2, a3
340 ; RV32I-NEXT: snez a1, a2
341 ; RV32I-NEXT: or a0, a1, a0
342 ; RV32I-NEXT: bnez a0, .LBB14_2
343 ; RV32I-NEXT: # %bb.1:
345 ; RV32I-NEXT: .LBB14_2:
346 ; RV32I-NEXT: tail bar@plt
348 ; RV64I-LABEL: and_sle_eq:
350 ; RV64I-NEXT: slt a0, a1, a0
351 ; RV64I-NEXT: xor a2, a2, a3
352 ; RV64I-NEXT: snez a1, a2
353 ; RV64I-NEXT: or a0, a1, a0
354 ; RV64I-NEXT: bnez a0, .LBB14_2
355 ; RV64I-NEXT: # %bb.1:
357 ; RV64I-NEXT: .LBB14_2:
358 ; RV64I-NEXT: tail bar@plt
359 %5 = icmp sle i32 %0, %1
360 %6 = icmp eq i32 %2, %3
362 br i1 %7, label %9, label %8
365 tail call void @bar()
372 define void @and_uge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
373 ; RV32I-LABEL: and_uge_eq:
375 ; RV32I-NEXT: sltu a0, a0, a1
376 ; RV32I-NEXT: xor a2, a2, a3
377 ; RV32I-NEXT: snez a1, a2
378 ; RV32I-NEXT: or a0, a1, a0
379 ; RV32I-NEXT: bnez a0, .LBB15_2
380 ; RV32I-NEXT: # %bb.1:
382 ; RV32I-NEXT: .LBB15_2:
383 ; RV32I-NEXT: tail bar@plt
385 ; RV64I-LABEL: and_uge_eq:
387 ; RV64I-NEXT: sltu a0, a0, a1
388 ; RV64I-NEXT: xor a2, a2, a3
389 ; RV64I-NEXT: snez a1, a2
390 ; RV64I-NEXT: or a0, a1, a0
391 ; RV64I-NEXT: bnez a0, .LBB15_2
392 ; RV64I-NEXT: # %bb.1:
394 ; RV64I-NEXT: .LBB15_2:
395 ; RV64I-NEXT: tail bar@plt
396 %5 = icmp uge i32 %0, %1
397 %6 = icmp eq i32 %2, %3
399 br i1 %7, label %9, label %8
402 tail call void @bar()
409 define void @and_ule_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
410 ; RV32I-LABEL: and_ule_eq:
412 ; RV32I-NEXT: sltu a0, a1, a0
413 ; RV32I-NEXT: xor a2, a2, a3
414 ; RV32I-NEXT: snez a1, a2
415 ; RV32I-NEXT: or a0, a1, a0
416 ; RV32I-NEXT: bnez a0, .LBB16_2
417 ; RV32I-NEXT: # %bb.1:
419 ; RV32I-NEXT: .LBB16_2:
420 ; RV32I-NEXT: tail bar@plt
422 ; RV64I-LABEL: and_ule_eq:
424 ; RV64I-NEXT: sltu a0, a1, a0
425 ; RV64I-NEXT: xor a2, a2, a3
426 ; RV64I-NEXT: snez a1, a2
427 ; RV64I-NEXT: or a0, a1, a0
428 ; RV64I-NEXT: bnez a0, .LBB16_2
429 ; RV64I-NEXT: # %bb.1:
431 ; RV64I-NEXT: .LBB16_2:
432 ; RV64I-NEXT: tail bar@plt
433 %5 = icmp ule i32 %0, %1
434 %6 = icmp eq i32 %2, %3
436 br i1 %7, label %9, label %8
439 tail call void @bar()
446 define void @and_sge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
447 ; RV32I-LABEL: and_sge_ne:
449 ; RV32I-NEXT: slt a0, a0, a1
450 ; RV32I-NEXT: xor a2, a2, a3
451 ; RV32I-NEXT: seqz a1, a2
452 ; RV32I-NEXT: or a0, a1, a0
453 ; RV32I-NEXT: bnez a0, .LBB17_2
454 ; RV32I-NEXT: # %bb.1:
456 ; RV32I-NEXT: .LBB17_2:
457 ; RV32I-NEXT: tail bar@plt
459 ; RV64I-LABEL: and_sge_ne:
461 ; RV64I-NEXT: slt a0, a0, a1
462 ; RV64I-NEXT: xor a2, a2, a3
463 ; RV64I-NEXT: seqz a1, a2
464 ; RV64I-NEXT: or a0, a1, a0
465 ; RV64I-NEXT: bnez a0, .LBB17_2
466 ; RV64I-NEXT: # %bb.1:
468 ; RV64I-NEXT: .LBB17_2:
469 ; RV64I-NEXT: tail bar@plt
470 %5 = icmp sge i32 %0, %1
471 %6 = icmp ne i32 %2, %3
473 br i1 %7, label %9, label %8
476 tail call void @bar()
483 define void @and_sle_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
484 ; RV32I-LABEL: and_sle_ne:
486 ; RV32I-NEXT: slt a0, a1, a0
487 ; RV32I-NEXT: xor a2, a2, a3
488 ; RV32I-NEXT: seqz a1, a2
489 ; RV32I-NEXT: or a0, a1, a0
490 ; RV32I-NEXT: bnez a0, .LBB18_2
491 ; RV32I-NEXT: # %bb.1:
493 ; RV32I-NEXT: .LBB18_2:
494 ; RV32I-NEXT: tail bar@plt
496 ; RV64I-LABEL: and_sle_ne:
498 ; RV64I-NEXT: slt a0, a1, a0
499 ; RV64I-NEXT: xor a2, a2, a3
500 ; RV64I-NEXT: seqz a1, a2
501 ; RV64I-NEXT: or a0, a1, a0
502 ; RV64I-NEXT: bnez a0, .LBB18_2
503 ; RV64I-NEXT: # %bb.1:
505 ; RV64I-NEXT: .LBB18_2:
506 ; RV64I-NEXT: tail bar@plt
507 %5 = icmp sle i32 %0, %1
508 %6 = icmp ne i32 %2, %3
510 br i1 %7, label %9, label %8
513 tail call void @bar()
520 define void @and_uge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
521 ; RV32I-LABEL: and_uge_ne:
523 ; RV32I-NEXT: sltu a0, a0, a1
524 ; RV32I-NEXT: xor a2, a2, a3
525 ; RV32I-NEXT: seqz a1, a2
526 ; RV32I-NEXT: or a0, a1, a0
527 ; RV32I-NEXT: bnez a0, .LBB19_2
528 ; RV32I-NEXT: # %bb.1:
530 ; RV32I-NEXT: .LBB19_2:
531 ; RV32I-NEXT: tail bar@plt
533 ; RV64I-LABEL: and_uge_ne:
535 ; RV64I-NEXT: sltu a0, a0, a1
536 ; RV64I-NEXT: xor a2, a2, a3
537 ; RV64I-NEXT: seqz a1, a2
538 ; RV64I-NEXT: or a0, a1, a0
539 ; RV64I-NEXT: bnez a0, .LBB19_2
540 ; RV64I-NEXT: # %bb.1:
542 ; RV64I-NEXT: .LBB19_2:
543 ; RV64I-NEXT: tail bar@plt
544 %5 = icmp uge i32 %0, %1
545 %6 = icmp ne i32 %2, %3
547 br i1 %7, label %9, label %8
550 tail call void @bar()
557 define void @and_ule_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
558 ; RV32I-LABEL: and_ule_ne:
560 ; RV32I-NEXT: sltu a0, a1, a0
561 ; RV32I-NEXT: xor a2, a2, a3
562 ; RV32I-NEXT: seqz a1, a2
563 ; RV32I-NEXT: or a0, a1, a0
564 ; RV32I-NEXT: bnez a0, .LBB20_2
565 ; RV32I-NEXT: # %bb.1:
567 ; RV32I-NEXT: .LBB20_2:
568 ; RV32I-NEXT: tail bar@plt
570 ; RV64I-LABEL: and_ule_ne:
572 ; RV64I-NEXT: sltu a0, a1, a0
573 ; RV64I-NEXT: xor a2, a2, a3
574 ; RV64I-NEXT: seqz a1, a2
575 ; RV64I-NEXT: or a0, a1, a0
576 ; RV64I-NEXT: bnez a0, .LBB20_2
577 ; RV64I-NEXT: # %bb.1:
579 ; RV64I-NEXT: .LBB20_2:
580 ; RV64I-NEXT: tail bar@plt
581 %5 = icmp ule i32 %0, %1
582 %6 = icmp ne i32 %2, %3
584 br i1 %7, label %9, label %8
587 tail call void @bar()
594 define void @or_sge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
595 ; RV32I-LABEL: or_sge_eq:
597 ; RV32I-NEXT: slt a0, a0, a1
598 ; RV32I-NEXT: xor a2, a2, a3
599 ; RV32I-NEXT: snez a1, a2
600 ; RV32I-NEXT: and a0, a1, a0
601 ; RV32I-NEXT: bnez a0, .LBB21_2
602 ; RV32I-NEXT: # %bb.1:
604 ; RV32I-NEXT: .LBB21_2:
605 ; RV32I-NEXT: tail bar@plt
607 ; RV64I-LABEL: or_sge_eq:
609 ; RV64I-NEXT: slt a0, a0, a1
610 ; RV64I-NEXT: xor a2, a2, a3
611 ; RV64I-NEXT: snez a1, a2
612 ; RV64I-NEXT: and a0, a1, a0
613 ; RV64I-NEXT: bnez a0, .LBB21_2
614 ; RV64I-NEXT: # %bb.1:
616 ; RV64I-NEXT: .LBB21_2:
617 ; RV64I-NEXT: tail bar@plt
618 %5 = icmp sge i32 %0, %1
619 %6 = icmp eq i32 %2, %3
621 br i1 %7, label %9, label %8
624 tail call void @bar()
631 define void @or_sle_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
632 ; RV32I-LABEL: or_sle_eq:
634 ; RV32I-NEXT: slt a0, a1, a0
635 ; RV32I-NEXT: xor a2, a2, a3
636 ; RV32I-NEXT: snez a1, a2
637 ; RV32I-NEXT: and a0, a1, a0
638 ; RV32I-NEXT: bnez a0, .LBB22_2
639 ; RV32I-NEXT: # %bb.1:
641 ; RV32I-NEXT: .LBB22_2:
642 ; RV32I-NEXT: tail bar@plt
644 ; RV64I-LABEL: or_sle_eq:
646 ; RV64I-NEXT: slt a0, a1, a0
647 ; RV64I-NEXT: xor a2, a2, a3
648 ; RV64I-NEXT: snez a1, a2
649 ; RV64I-NEXT: and a0, a1, a0
650 ; RV64I-NEXT: bnez a0, .LBB22_2
651 ; RV64I-NEXT: # %bb.1:
653 ; RV64I-NEXT: .LBB22_2:
654 ; RV64I-NEXT: tail bar@plt
655 %5 = icmp sle i32 %0, %1
656 %6 = icmp eq i32 %2, %3
658 br i1 %7, label %9, label %8
661 tail call void @bar()
668 define void @or_uge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
669 ; RV32I-LABEL: or_uge_eq:
671 ; RV32I-NEXT: sltu a0, a0, a1
672 ; RV32I-NEXT: xor a2, a2, a3
673 ; RV32I-NEXT: snez a1, a2
674 ; RV32I-NEXT: and a0, a1, a0
675 ; RV32I-NEXT: bnez a0, .LBB23_2
676 ; RV32I-NEXT: # %bb.1:
678 ; RV32I-NEXT: .LBB23_2:
679 ; RV32I-NEXT: tail bar@plt
681 ; RV64I-LABEL: or_uge_eq:
683 ; RV64I-NEXT: sltu a0, a0, a1
684 ; RV64I-NEXT: xor a2, a2, a3
685 ; RV64I-NEXT: snez a1, a2
686 ; RV64I-NEXT: and a0, a1, a0
687 ; RV64I-NEXT: bnez a0, .LBB23_2
688 ; RV64I-NEXT: # %bb.1:
690 ; RV64I-NEXT: .LBB23_2:
691 ; RV64I-NEXT: tail bar@plt
692 %5 = icmp uge i32 %0, %1
693 %6 = icmp eq i32 %2, %3
695 br i1 %7, label %9, label %8
698 tail call void @bar()
705 define void @or_ule_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
706 ; RV32I-LABEL: or_ule_eq:
708 ; RV32I-NEXT: sltu a0, a1, a0
709 ; RV32I-NEXT: xor a2, a2, a3
710 ; RV32I-NEXT: snez a1, a2
711 ; RV32I-NEXT: and a0, a1, a0
712 ; RV32I-NEXT: bnez a0, .LBB24_2
713 ; RV32I-NEXT: # %bb.1:
715 ; RV32I-NEXT: .LBB24_2:
716 ; RV32I-NEXT: tail bar@plt
718 ; RV64I-LABEL: or_ule_eq:
720 ; RV64I-NEXT: sltu a0, a1, a0
721 ; RV64I-NEXT: xor a2, a2, a3
722 ; RV64I-NEXT: snez a1, a2
723 ; RV64I-NEXT: and a0, a1, a0
724 ; RV64I-NEXT: bnez a0, .LBB24_2
725 ; RV64I-NEXT: # %bb.1:
727 ; RV64I-NEXT: .LBB24_2:
728 ; RV64I-NEXT: tail bar@plt
729 %5 = icmp ule i32 %0, %1
730 %6 = icmp eq i32 %2, %3
732 br i1 %7, label %9, label %8
735 tail call void @bar()
742 define void @or_sge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
743 ; RV32I-LABEL: or_sge_ne:
745 ; RV32I-NEXT: slt a0, a0, a1
746 ; RV32I-NEXT: xor a2, a2, a3
747 ; RV32I-NEXT: seqz a1, a2
748 ; RV32I-NEXT: and a0, a1, a0
749 ; RV32I-NEXT: bnez a0, .LBB25_2
750 ; RV32I-NEXT: # %bb.1:
752 ; RV32I-NEXT: .LBB25_2:
753 ; RV32I-NEXT: tail bar@plt
755 ; RV64I-LABEL: or_sge_ne:
757 ; RV64I-NEXT: slt a0, a0, a1
758 ; RV64I-NEXT: xor a2, a2, a3
759 ; RV64I-NEXT: seqz a1, a2
760 ; RV64I-NEXT: and a0, a1, a0
761 ; RV64I-NEXT: bnez a0, .LBB25_2
762 ; RV64I-NEXT: # %bb.1:
764 ; RV64I-NEXT: .LBB25_2:
765 ; RV64I-NEXT: tail bar@plt
766 %5 = icmp sge i32 %0, %1
767 %6 = icmp ne i32 %2, %3
769 br i1 %7, label %9, label %8
772 tail call void @bar()
779 define void @or_sle_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
780 ; RV32I-LABEL: or_sle_ne:
782 ; RV32I-NEXT: slt a0, a1, a0
783 ; RV32I-NEXT: xor a2, a2, a3
784 ; RV32I-NEXT: seqz a1, a2
785 ; RV32I-NEXT: and a0, a1, a0
786 ; RV32I-NEXT: bnez a0, .LBB26_2
787 ; RV32I-NEXT: # %bb.1:
789 ; RV32I-NEXT: .LBB26_2:
790 ; RV32I-NEXT: tail bar@plt
792 ; RV64I-LABEL: or_sle_ne:
794 ; RV64I-NEXT: slt a0, a1, a0
795 ; RV64I-NEXT: xor a2, a2, a3
796 ; RV64I-NEXT: seqz a1, a2
797 ; RV64I-NEXT: and a0, a1, a0
798 ; RV64I-NEXT: bnez a0, .LBB26_2
799 ; RV64I-NEXT: # %bb.1:
801 ; RV64I-NEXT: .LBB26_2:
802 ; RV64I-NEXT: tail bar@plt
803 %5 = icmp sle i32 %0, %1
804 %6 = icmp ne i32 %2, %3
806 br i1 %7, label %9, label %8
809 tail call void @bar()
816 define void @or_uge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
817 ; RV32I-LABEL: or_uge_ne:
819 ; RV32I-NEXT: sltu a0, a0, a1
820 ; RV32I-NEXT: xor a2, a2, a3
821 ; RV32I-NEXT: seqz a1, a2
822 ; RV32I-NEXT: and a0, a1, a0
823 ; RV32I-NEXT: bnez a0, .LBB27_2
824 ; RV32I-NEXT: # %bb.1:
826 ; RV32I-NEXT: .LBB27_2:
827 ; RV32I-NEXT: tail bar@plt
829 ; RV64I-LABEL: or_uge_ne:
831 ; RV64I-NEXT: sltu a0, a0, a1
832 ; RV64I-NEXT: xor a2, a2, a3
833 ; RV64I-NEXT: seqz a1, a2
834 ; RV64I-NEXT: and a0, a1, a0
835 ; RV64I-NEXT: bnez a0, .LBB27_2
836 ; RV64I-NEXT: # %bb.1:
838 ; RV64I-NEXT: .LBB27_2:
839 ; RV64I-NEXT: tail bar@plt
840 %5 = icmp uge i32 %0, %1
841 %6 = icmp ne i32 %2, %3
843 br i1 %7, label %9, label %8
846 tail call void @bar()
853 define void @or_ule_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
854 ; RV32I-LABEL: or_ule_ne:
856 ; RV32I-NEXT: sltu a0, a1, a0
857 ; RV32I-NEXT: xor a2, a2, a3
858 ; RV32I-NEXT: seqz a1, a2
859 ; RV32I-NEXT: and a0, a1, a0
860 ; RV32I-NEXT: bnez a0, .LBB28_2
861 ; RV32I-NEXT: # %bb.1:
863 ; RV32I-NEXT: .LBB28_2:
864 ; RV32I-NEXT: tail bar@plt
866 ; RV64I-LABEL: or_ule_ne:
868 ; RV64I-NEXT: sltu a0, a1, a0
869 ; RV64I-NEXT: xor a2, a2, a3
870 ; RV64I-NEXT: seqz a1, a2
871 ; RV64I-NEXT: and a0, a1, a0
872 ; RV64I-NEXT: bnez a0, .LBB28_2
873 ; RV64I-NEXT: # %bb.1:
875 ; RV64I-NEXT: .LBB28_2:
876 ; RV64I-NEXT: tail bar@plt
877 %5 = icmp ule i32 %0, %1
878 %6 = icmp ne i32 %2, %3
880 br i1 %7, label %9, label %8
883 tail call void @bar()
890 define void @and_eq_sge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
891 ; RV32I-LABEL: and_eq_sge:
893 ; RV32I-NEXT: xor a0, a0, a1
894 ; RV32I-NEXT: snez a0, a0
895 ; RV32I-NEXT: slt a1, a2, a3
896 ; RV32I-NEXT: or a0, a0, a1
897 ; RV32I-NEXT: bnez a0, .LBB29_2
898 ; RV32I-NEXT: # %bb.1:
900 ; RV32I-NEXT: .LBB29_2:
901 ; RV32I-NEXT: tail bar@plt
903 ; RV64I-LABEL: and_eq_sge:
905 ; RV64I-NEXT: xor a0, a0, a1
906 ; RV64I-NEXT: snez a0, a0
907 ; RV64I-NEXT: slt a1, a2, a3
908 ; RV64I-NEXT: or a0, a0, a1
909 ; RV64I-NEXT: bnez a0, .LBB29_2
910 ; RV64I-NEXT: # %bb.1:
912 ; RV64I-NEXT: .LBB29_2:
913 ; RV64I-NEXT: tail bar@plt
914 %5 = icmp eq i32 %0, %1
915 %6 = icmp sge i32 %2, %3
917 br i1 %7, label %9, label %8
920 tail call void @bar()
927 define void @and_eq_sle(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
928 ; RV32I-LABEL: and_eq_sle:
930 ; RV32I-NEXT: xor a0, a0, a1
931 ; RV32I-NEXT: snez a0, a0
932 ; RV32I-NEXT: slt a1, a3, a2
933 ; RV32I-NEXT: or a0, a0, a1
934 ; RV32I-NEXT: bnez a0, .LBB30_2
935 ; RV32I-NEXT: # %bb.1:
937 ; RV32I-NEXT: .LBB30_2:
938 ; RV32I-NEXT: tail bar@plt
940 ; RV64I-LABEL: and_eq_sle:
942 ; RV64I-NEXT: xor a0, a0, a1
943 ; RV64I-NEXT: snez a0, a0
944 ; RV64I-NEXT: slt a1, a3, a2
945 ; RV64I-NEXT: or a0, a0, a1
946 ; RV64I-NEXT: bnez a0, .LBB30_2
947 ; RV64I-NEXT: # %bb.1:
949 ; RV64I-NEXT: .LBB30_2:
950 ; RV64I-NEXT: tail bar@plt
951 %5 = icmp eq i32 %0, %1
952 %6 = icmp sle i32 %2, %3
954 br i1 %7, label %9, label %8
957 tail call void @bar()
964 define void @and_eq_uge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
965 ; RV32I-LABEL: and_eq_uge:
967 ; RV32I-NEXT: xor a0, a0, a1
968 ; RV32I-NEXT: snez a0, a0
969 ; RV32I-NEXT: sltu a1, a2, a3
970 ; RV32I-NEXT: or a0, a0, a1
971 ; RV32I-NEXT: bnez a0, .LBB31_2
972 ; RV32I-NEXT: # %bb.1:
974 ; RV32I-NEXT: .LBB31_2:
975 ; RV32I-NEXT: tail bar@plt
977 ; RV64I-LABEL: and_eq_uge:
979 ; RV64I-NEXT: xor a0, a0, a1
980 ; RV64I-NEXT: snez a0, a0
981 ; RV64I-NEXT: sltu a1, a2, a3
982 ; RV64I-NEXT: or a0, a0, a1
983 ; RV64I-NEXT: bnez a0, .LBB31_2
984 ; RV64I-NEXT: # %bb.1:
986 ; RV64I-NEXT: .LBB31_2:
987 ; RV64I-NEXT: tail bar@plt
988 %5 = icmp eq i32 %0, %1
989 %6 = icmp uge i32 %2, %3
991 br i1 %7, label %9, label %8
994 tail call void @bar()
1001 define void @and_eq_ule(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1002 ; RV32I-LABEL: and_eq_ule:
1004 ; RV32I-NEXT: xor a0, a0, a1
1005 ; RV32I-NEXT: snez a0, a0
1006 ; RV32I-NEXT: sltu a1, a3, a2
1007 ; RV32I-NEXT: or a0, a0, a1
1008 ; RV32I-NEXT: bnez a0, .LBB32_2
1009 ; RV32I-NEXT: # %bb.1:
1011 ; RV32I-NEXT: .LBB32_2:
1012 ; RV32I-NEXT: tail bar@plt
1014 ; RV64I-LABEL: and_eq_ule:
1016 ; RV64I-NEXT: xor a0, a0, a1
1017 ; RV64I-NEXT: snez a0, a0
1018 ; RV64I-NEXT: sltu a1, a3, a2
1019 ; RV64I-NEXT: or a0, a0, a1
1020 ; RV64I-NEXT: bnez a0, .LBB32_2
1021 ; RV64I-NEXT: # %bb.1:
1023 ; RV64I-NEXT: .LBB32_2:
1024 ; RV64I-NEXT: tail bar@plt
1025 %5 = icmp eq i32 %0, %1
1026 %6 = icmp ule i32 %2, %3
1028 br i1 %7, label %9, label %8
1031 tail call void @bar()
1038 define void @and_ne_sge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1039 ; RV32I-LABEL: and_ne_sge:
1041 ; RV32I-NEXT: xor a0, a0, a1
1042 ; RV32I-NEXT: seqz a0, a0
1043 ; RV32I-NEXT: slt a1, a2, a3
1044 ; RV32I-NEXT: or a0, a0, a1
1045 ; RV32I-NEXT: bnez a0, .LBB33_2
1046 ; RV32I-NEXT: # %bb.1:
1048 ; RV32I-NEXT: .LBB33_2:
1049 ; RV32I-NEXT: tail bar@plt
1051 ; RV64I-LABEL: and_ne_sge:
1053 ; RV64I-NEXT: xor a0, a0, a1
1054 ; RV64I-NEXT: seqz a0, a0
1055 ; RV64I-NEXT: slt a1, a2, a3
1056 ; RV64I-NEXT: or a0, a0, a1
1057 ; RV64I-NEXT: bnez a0, .LBB33_2
1058 ; RV64I-NEXT: # %bb.1:
1060 ; RV64I-NEXT: .LBB33_2:
1061 ; RV64I-NEXT: tail bar@plt
1062 %5 = icmp ne i32 %0, %1
1063 %6 = icmp sge i32 %2, %3
1065 br i1 %7, label %9, label %8
1068 tail call void @bar()
1075 define void @and_ne_sle(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1076 ; RV32I-LABEL: and_ne_sle:
1078 ; RV32I-NEXT: xor a0, a0, a1
1079 ; RV32I-NEXT: seqz a0, a0
1080 ; RV32I-NEXT: slt a1, a3, a2
1081 ; RV32I-NEXT: or a0, a0, a1
1082 ; RV32I-NEXT: bnez a0, .LBB34_2
1083 ; RV32I-NEXT: # %bb.1:
1085 ; RV32I-NEXT: .LBB34_2:
1086 ; RV32I-NEXT: tail bar@plt
1088 ; RV64I-LABEL: and_ne_sle:
1090 ; RV64I-NEXT: xor a0, a0, a1
1091 ; RV64I-NEXT: seqz a0, a0
1092 ; RV64I-NEXT: slt a1, a3, a2
1093 ; RV64I-NEXT: or a0, a0, a1
1094 ; RV64I-NEXT: bnez a0, .LBB34_2
1095 ; RV64I-NEXT: # %bb.1:
1097 ; RV64I-NEXT: .LBB34_2:
1098 ; RV64I-NEXT: tail bar@plt
1099 %5 = icmp ne i32 %0, %1
1100 %6 = icmp sle i32 %2, %3
1102 br i1 %7, label %9, label %8
1105 tail call void @bar()
1112 define void @and_ne_uge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1113 ; RV32I-LABEL: and_ne_uge:
1115 ; RV32I-NEXT: xor a0, a0, a1
1116 ; RV32I-NEXT: seqz a0, a0
1117 ; RV32I-NEXT: sltu a1, a2, a3
1118 ; RV32I-NEXT: or a0, a0, a1
1119 ; RV32I-NEXT: bnez a0, .LBB35_2
1120 ; RV32I-NEXT: # %bb.1:
1122 ; RV32I-NEXT: .LBB35_2:
1123 ; RV32I-NEXT: tail bar@plt
1125 ; RV64I-LABEL: and_ne_uge:
1127 ; RV64I-NEXT: xor a0, a0, a1
1128 ; RV64I-NEXT: seqz a0, a0
1129 ; RV64I-NEXT: sltu a1, a2, a3
1130 ; RV64I-NEXT: or a0, a0, a1
1131 ; RV64I-NEXT: bnez a0, .LBB35_2
1132 ; RV64I-NEXT: # %bb.1:
1134 ; RV64I-NEXT: .LBB35_2:
1135 ; RV64I-NEXT: tail bar@plt
1136 %5 = icmp ne i32 %0, %1
1137 %6 = icmp uge i32 %2, %3
1139 br i1 %7, label %9, label %8
1142 tail call void @bar()
1149 define void @and_ne_ule(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1150 ; RV32I-LABEL: and_ne_ule:
1152 ; RV32I-NEXT: xor a0, a0, a1
1153 ; RV32I-NEXT: seqz a0, a0
1154 ; RV32I-NEXT: sltu a1, a3, a2
1155 ; RV32I-NEXT: or a0, a0, a1
1156 ; RV32I-NEXT: bnez a0, .LBB36_2
1157 ; RV32I-NEXT: # %bb.1:
1159 ; RV32I-NEXT: .LBB36_2:
1160 ; RV32I-NEXT: tail bar@plt
1162 ; RV64I-LABEL: and_ne_ule:
1164 ; RV64I-NEXT: xor a0, a0, a1
1165 ; RV64I-NEXT: seqz a0, a0
1166 ; RV64I-NEXT: sltu a1, a3, a2
1167 ; RV64I-NEXT: or a0, a0, a1
1168 ; RV64I-NEXT: bnez a0, .LBB36_2
1169 ; RV64I-NEXT: # %bb.1:
1171 ; RV64I-NEXT: .LBB36_2:
1172 ; RV64I-NEXT: tail bar@plt
1173 %5 = icmp ne i32 %0, %1
1174 %6 = icmp ule i32 %2, %3
1176 br i1 %7, label %9, label %8
1179 tail call void @bar()
1186 define void @and_sge_gt0(i32 signext %0, i32 signext %1, i32 signext %2) {
1187 ; RV32I-LABEL: and_sge_gt0:
1189 ; RV32I-NEXT: slt a0, a0, a1
1190 ; RV32I-NEXT: slti a1, a2, 1
1191 ; RV32I-NEXT: or a0, a1, a0
1192 ; RV32I-NEXT: bnez a0, .LBB37_2
1193 ; RV32I-NEXT: # %bb.1:
1195 ; RV32I-NEXT: .LBB37_2:
1196 ; RV32I-NEXT: tail bar@plt
1198 ; RV64I-LABEL: and_sge_gt0:
1200 ; RV64I-NEXT: slt a0, a0, a1
1201 ; RV64I-NEXT: slti a1, a2, 1
1202 ; RV64I-NEXT: or a0, a1, a0
1203 ; RV64I-NEXT: bnez a0, .LBB37_2
1204 ; RV64I-NEXT: # %bb.1:
1206 ; RV64I-NEXT: .LBB37_2:
1207 ; RV64I-NEXT: tail bar@plt
1208 %4 = icmp sge i32 %0, %1
1209 %5 = icmp sgt i32 %2, 0
1211 br i1 %6, label %8, label %7
1214 tail call void @bar()
1221 define void @and_sle_lt1(i32 signext %0, i32 signext %1, i32 signext %2) {
1222 ; RV32I-LABEL: and_sle_lt1:
1224 ; RV32I-NEXT: slt a0, a1, a0
1225 ; RV32I-NEXT: sgtz a1, a2
1226 ; RV32I-NEXT: or a0, a1, a0
1227 ; RV32I-NEXT: bnez a0, .LBB38_2
1228 ; RV32I-NEXT: # %bb.1:
1230 ; RV32I-NEXT: .LBB38_2:
1231 ; RV32I-NEXT: tail bar@plt
1233 ; RV64I-LABEL: and_sle_lt1:
1235 ; RV64I-NEXT: slt a0, a1, a0
1236 ; RV64I-NEXT: sgtz a1, a2
1237 ; RV64I-NEXT: or a0, a1, a0
1238 ; RV64I-NEXT: bnez a0, .LBB38_2
1239 ; RV64I-NEXT: # %bb.1:
1241 ; RV64I-NEXT: .LBB38_2:
1242 ; RV64I-NEXT: tail bar@plt
1243 %4 = icmp sle i32 %0, %1
1244 %5 = icmp slt i32 %2, 1
1246 br i1 %6, label %8, label %7
1249 tail call void @bar()
1256 define void @or_uge_gt0(i32 signext %0, i32 signext %1, i32 signext %2) {
1257 ; RV32I-LABEL: or_uge_gt0:
1259 ; RV32I-NEXT: sltu a0, a0, a1
1260 ; RV32I-NEXT: slti a1, a2, 1
1261 ; RV32I-NEXT: and a0, a1, a0
1262 ; RV32I-NEXT: bnez a0, .LBB39_2
1263 ; RV32I-NEXT: # %bb.1:
1265 ; RV32I-NEXT: .LBB39_2:
1266 ; RV32I-NEXT: tail bar@plt
1268 ; RV64I-LABEL: or_uge_gt0:
1270 ; RV64I-NEXT: sltu a0, a0, a1
1271 ; RV64I-NEXT: slti a1, a2, 1
1272 ; RV64I-NEXT: and a0, a1, a0
1273 ; RV64I-NEXT: bnez a0, .LBB39_2
1274 ; RV64I-NEXT: # %bb.1:
1276 ; RV64I-NEXT: .LBB39_2:
1277 ; RV64I-NEXT: tail bar@plt
1278 %4 = icmp uge i32 %0, %1
1279 %5 = icmp sgt i32 %2, 0
1281 br i1 %6, label %8, label %7
1284 tail call void @bar()
1291 define void @or_ule_lt1(i32 signext %0, i32 signext %1, i32 signext %2) {
1292 ; RV32I-LABEL: or_ule_lt1:
1294 ; RV32I-NEXT: sltu a0, a1, a0
1295 ; RV32I-NEXT: sgtz a1, a2
1296 ; RV32I-NEXT: and a0, a1, a0
1297 ; RV32I-NEXT: bnez a0, .LBB40_2
1298 ; RV32I-NEXT: # %bb.1:
1300 ; RV32I-NEXT: .LBB40_2:
1301 ; RV32I-NEXT: tail bar@plt
1303 ; RV64I-LABEL: or_ule_lt1:
1305 ; RV64I-NEXT: sltu a0, a1, a0
1306 ; RV64I-NEXT: sgtz a1, a2
1307 ; RV64I-NEXT: and a0, a1, a0
1308 ; RV64I-NEXT: bnez a0, .LBB40_2
1309 ; RV64I-NEXT: # %bb.1:
1311 ; RV64I-NEXT: .LBB40_2:
1312 ; RV64I-NEXT: tail bar@plt
1313 %4 = icmp ule i32 %0, %1
1314 %5 = icmp slt i32 %2, 1
1316 br i1 %6, label %8, label %7
1319 tail call void @bar()