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: blt a0, a1, .LBB13_3
302 ; RV32I-NEXT: # %bb.1:
303 ; RV32I-NEXT: bne a2, a3, .LBB13_3
304 ; RV32I-NEXT: # %bb.2:
306 ; RV32I-NEXT: .LBB13_3:
307 ; RV32I-NEXT: tail bar
309 ; RV64I-LABEL: and_sge_eq:
311 ; RV64I-NEXT: blt a0, a1, .LBB13_3
312 ; RV64I-NEXT: # %bb.1:
313 ; RV64I-NEXT: bne a2, a3, .LBB13_3
314 ; RV64I-NEXT: # %bb.2:
316 ; RV64I-NEXT: .LBB13_3:
317 ; RV64I-NEXT: tail bar
318 %5 = icmp sge i32 %0, %1
319 %6 = icmp eq i32 %2, %3
321 br i1 %7, label %9, label %8
324 tail call void @bar()
331 define void @and_sle_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
332 ; RV32I-LABEL: and_sle_eq:
334 ; RV32I-NEXT: blt a1, a0, .LBB14_3
335 ; RV32I-NEXT: # %bb.1:
336 ; RV32I-NEXT: bne a2, a3, .LBB14_3
337 ; RV32I-NEXT: # %bb.2:
339 ; RV32I-NEXT: .LBB14_3:
340 ; RV32I-NEXT: tail bar
342 ; RV64I-LABEL: and_sle_eq:
344 ; RV64I-NEXT: blt a1, a0, .LBB14_3
345 ; RV64I-NEXT: # %bb.1:
346 ; RV64I-NEXT: bne a2, a3, .LBB14_3
347 ; RV64I-NEXT: # %bb.2:
349 ; RV64I-NEXT: .LBB14_3:
350 ; RV64I-NEXT: tail bar
351 %5 = icmp sle i32 %0, %1
352 %6 = icmp eq i32 %2, %3
354 br i1 %7, label %9, label %8
357 tail call void @bar()
364 define void @and_uge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
365 ; RV32I-LABEL: and_uge_eq:
367 ; RV32I-NEXT: bltu a0, a1, .LBB15_3
368 ; RV32I-NEXT: # %bb.1:
369 ; RV32I-NEXT: bne a2, a3, .LBB15_3
370 ; RV32I-NEXT: # %bb.2:
372 ; RV32I-NEXT: .LBB15_3:
373 ; RV32I-NEXT: tail bar
375 ; RV64I-LABEL: and_uge_eq:
377 ; RV64I-NEXT: bltu a0, a1, .LBB15_3
378 ; RV64I-NEXT: # %bb.1:
379 ; RV64I-NEXT: bne a2, a3, .LBB15_3
380 ; RV64I-NEXT: # %bb.2:
382 ; RV64I-NEXT: .LBB15_3:
383 ; RV64I-NEXT: tail bar
384 %5 = icmp uge i32 %0, %1
385 %6 = icmp eq i32 %2, %3
387 br i1 %7, label %9, label %8
390 tail call void @bar()
397 define void @and_ule_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
398 ; RV32I-LABEL: and_ule_eq:
400 ; RV32I-NEXT: bltu a1, a0, .LBB16_3
401 ; RV32I-NEXT: # %bb.1:
402 ; RV32I-NEXT: bne a2, a3, .LBB16_3
403 ; RV32I-NEXT: # %bb.2:
405 ; RV32I-NEXT: .LBB16_3:
406 ; RV32I-NEXT: tail bar
408 ; RV64I-LABEL: and_ule_eq:
410 ; RV64I-NEXT: bltu a1, a0, .LBB16_3
411 ; RV64I-NEXT: # %bb.1:
412 ; RV64I-NEXT: bne a2, a3, .LBB16_3
413 ; RV64I-NEXT: # %bb.2:
415 ; RV64I-NEXT: .LBB16_3:
416 ; RV64I-NEXT: tail bar
417 %5 = icmp ule i32 %0, %1
418 %6 = icmp eq i32 %2, %3
420 br i1 %7, label %9, label %8
423 tail call void @bar()
430 define void @and_sge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
431 ; RV32I-LABEL: and_sge_ne:
433 ; RV32I-NEXT: blt a0, a1, .LBB17_3
434 ; RV32I-NEXT: # %bb.1:
435 ; RV32I-NEXT: beq a2, a3, .LBB17_3
436 ; RV32I-NEXT: # %bb.2:
438 ; RV32I-NEXT: .LBB17_3:
439 ; RV32I-NEXT: tail bar
441 ; RV64I-LABEL: and_sge_ne:
443 ; RV64I-NEXT: blt a0, a1, .LBB17_3
444 ; RV64I-NEXT: # %bb.1:
445 ; RV64I-NEXT: beq a2, a3, .LBB17_3
446 ; RV64I-NEXT: # %bb.2:
448 ; RV64I-NEXT: .LBB17_3:
449 ; RV64I-NEXT: tail bar
450 %5 = icmp sge i32 %0, %1
451 %6 = icmp ne i32 %2, %3
453 br i1 %7, label %9, label %8
456 tail call void @bar()
463 define void @and_sle_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
464 ; RV32I-LABEL: and_sle_ne:
466 ; RV32I-NEXT: blt a1, a0, .LBB18_3
467 ; RV32I-NEXT: # %bb.1:
468 ; RV32I-NEXT: beq a2, a3, .LBB18_3
469 ; RV32I-NEXT: # %bb.2:
471 ; RV32I-NEXT: .LBB18_3:
472 ; RV32I-NEXT: tail bar
474 ; RV64I-LABEL: and_sle_ne:
476 ; RV64I-NEXT: blt a1, a0, .LBB18_3
477 ; RV64I-NEXT: # %bb.1:
478 ; RV64I-NEXT: beq a2, a3, .LBB18_3
479 ; RV64I-NEXT: # %bb.2:
481 ; RV64I-NEXT: .LBB18_3:
482 ; RV64I-NEXT: tail bar
483 %5 = icmp sle i32 %0, %1
484 %6 = icmp ne i32 %2, %3
486 br i1 %7, label %9, label %8
489 tail call void @bar()
496 define void @and_uge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
497 ; RV32I-LABEL: and_uge_ne:
499 ; RV32I-NEXT: bltu a0, a1, .LBB19_3
500 ; RV32I-NEXT: # %bb.1:
501 ; RV32I-NEXT: beq a2, a3, .LBB19_3
502 ; RV32I-NEXT: # %bb.2:
504 ; RV32I-NEXT: .LBB19_3:
505 ; RV32I-NEXT: tail bar
507 ; RV64I-LABEL: and_uge_ne:
509 ; RV64I-NEXT: bltu a0, a1, .LBB19_3
510 ; RV64I-NEXT: # %bb.1:
511 ; RV64I-NEXT: beq a2, a3, .LBB19_3
512 ; RV64I-NEXT: # %bb.2:
514 ; RV64I-NEXT: .LBB19_3:
515 ; RV64I-NEXT: tail bar
516 %5 = icmp uge i32 %0, %1
517 %6 = icmp ne i32 %2, %3
519 br i1 %7, label %9, label %8
522 tail call void @bar()
529 define void @and_ule_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
530 ; RV32I-LABEL: and_ule_ne:
532 ; RV32I-NEXT: bltu a1, a0, .LBB20_3
533 ; RV32I-NEXT: # %bb.1:
534 ; RV32I-NEXT: beq a2, a3, .LBB20_3
535 ; RV32I-NEXT: # %bb.2:
537 ; RV32I-NEXT: .LBB20_3:
538 ; RV32I-NEXT: tail bar
540 ; RV64I-LABEL: and_ule_ne:
542 ; RV64I-NEXT: bltu a1, a0, .LBB20_3
543 ; RV64I-NEXT: # %bb.1:
544 ; RV64I-NEXT: beq a2, a3, .LBB20_3
545 ; RV64I-NEXT: # %bb.2:
547 ; RV64I-NEXT: .LBB20_3:
548 ; RV64I-NEXT: tail bar
549 %5 = icmp ule i32 %0, %1
550 %6 = icmp ne i32 %2, %3
552 br i1 %7, label %9, label %8
555 tail call void @bar()
562 define void @or_sge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
563 ; RV32I-LABEL: or_sge_eq:
565 ; RV32I-NEXT: bge a0, a1, .LBB21_3
566 ; RV32I-NEXT: # %bb.1:
567 ; RV32I-NEXT: beq a2, a3, .LBB21_3
568 ; RV32I-NEXT: # %bb.2:
569 ; RV32I-NEXT: tail bar
570 ; RV32I-NEXT: .LBB21_3:
573 ; RV64I-LABEL: or_sge_eq:
575 ; RV64I-NEXT: bge a0, a1, .LBB21_3
576 ; RV64I-NEXT: # %bb.1:
577 ; RV64I-NEXT: beq a2, a3, .LBB21_3
578 ; RV64I-NEXT: # %bb.2:
579 ; RV64I-NEXT: tail bar
580 ; RV64I-NEXT: .LBB21_3:
582 %5 = icmp sge i32 %0, %1
583 %6 = icmp eq i32 %2, %3
585 br i1 %7, label %9, label %8
588 tail call void @bar()
595 define void @or_sle_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
596 ; RV32I-LABEL: or_sle_eq:
598 ; RV32I-NEXT: bge a1, a0, .LBB22_3
599 ; RV32I-NEXT: # %bb.1:
600 ; RV32I-NEXT: beq a2, a3, .LBB22_3
601 ; RV32I-NEXT: # %bb.2:
602 ; RV32I-NEXT: tail bar
603 ; RV32I-NEXT: .LBB22_3:
606 ; RV64I-LABEL: or_sle_eq:
608 ; RV64I-NEXT: bge a1, a0, .LBB22_3
609 ; RV64I-NEXT: # %bb.1:
610 ; RV64I-NEXT: beq a2, a3, .LBB22_3
611 ; RV64I-NEXT: # %bb.2:
612 ; RV64I-NEXT: tail bar
613 ; RV64I-NEXT: .LBB22_3:
615 %5 = icmp sle i32 %0, %1
616 %6 = icmp eq i32 %2, %3
618 br i1 %7, label %9, label %8
621 tail call void @bar()
628 define void @or_uge_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
629 ; RV32I-LABEL: or_uge_eq:
631 ; RV32I-NEXT: bgeu a0, a1, .LBB23_3
632 ; RV32I-NEXT: # %bb.1:
633 ; RV32I-NEXT: beq a2, a3, .LBB23_3
634 ; RV32I-NEXT: # %bb.2:
635 ; RV32I-NEXT: tail bar
636 ; RV32I-NEXT: .LBB23_3:
639 ; RV64I-LABEL: or_uge_eq:
641 ; RV64I-NEXT: bgeu a0, a1, .LBB23_3
642 ; RV64I-NEXT: # %bb.1:
643 ; RV64I-NEXT: beq a2, a3, .LBB23_3
644 ; RV64I-NEXT: # %bb.2:
645 ; RV64I-NEXT: tail bar
646 ; RV64I-NEXT: .LBB23_3:
648 %5 = icmp uge i32 %0, %1
649 %6 = icmp eq i32 %2, %3
651 br i1 %7, label %9, label %8
654 tail call void @bar()
661 define void @or_ule_eq(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
662 ; RV32I-LABEL: or_ule_eq:
664 ; RV32I-NEXT: bgeu a1, a0, .LBB24_3
665 ; RV32I-NEXT: # %bb.1:
666 ; RV32I-NEXT: beq a2, a3, .LBB24_3
667 ; RV32I-NEXT: # %bb.2:
668 ; RV32I-NEXT: tail bar
669 ; RV32I-NEXT: .LBB24_3:
672 ; RV64I-LABEL: or_ule_eq:
674 ; RV64I-NEXT: bgeu a1, a0, .LBB24_3
675 ; RV64I-NEXT: # %bb.1:
676 ; RV64I-NEXT: beq a2, a3, .LBB24_3
677 ; RV64I-NEXT: # %bb.2:
678 ; RV64I-NEXT: tail bar
679 ; RV64I-NEXT: .LBB24_3:
681 %5 = icmp ule i32 %0, %1
682 %6 = icmp eq i32 %2, %3
684 br i1 %7, label %9, label %8
687 tail call void @bar()
694 define void @or_sge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
695 ; RV32I-LABEL: or_sge_ne:
697 ; RV32I-NEXT: bge a0, a1, .LBB25_3
698 ; RV32I-NEXT: # %bb.1:
699 ; RV32I-NEXT: bne a2, a3, .LBB25_3
700 ; RV32I-NEXT: # %bb.2:
701 ; RV32I-NEXT: tail bar
702 ; RV32I-NEXT: .LBB25_3:
705 ; RV64I-LABEL: or_sge_ne:
707 ; RV64I-NEXT: bge a0, a1, .LBB25_3
708 ; RV64I-NEXT: # %bb.1:
709 ; RV64I-NEXT: bne a2, a3, .LBB25_3
710 ; RV64I-NEXT: # %bb.2:
711 ; RV64I-NEXT: tail bar
712 ; RV64I-NEXT: .LBB25_3:
714 %5 = icmp sge i32 %0, %1
715 %6 = icmp ne i32 %2, %3
717 br i1 %7, label %9, label %8
720 tail call void @bar()
727 define void @or_sle_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
728 ; RV32I-LABEL: or_sle_ne:
730 ; RV32I-NEXT: bge a1, a0, .LBB26_3
731 ; RV32I-NEXT: # %bb.1:
732 ; RV32I-NEXT: bne a2, a3, .LBB26_3
733 ; RV32I-NEXT: # %bb.2:
734 ; RV32I-NEXT: tail bar
735 ; RV32I-NEXT: .LBB26_3:
738 ; RV64I-LABEL: or_sle_ne:
740 ; RV64I-NEXT: bge a1, a0, .LBB26_3
741 ; RV64I-NEXT: # %bb.1:
742 ; RV64I-NEXT: bne a2, a3, .LBB26_3
743 ; RV64I-NEXT: # %bb.2:
744 ; RV64I-NEXT: tail bar
745 ; RV64I-NEXT: .LBB26_3:
747 %5 = icmp sle i32 %0, %1
748 %6 = icmp ne i32 %2, %3
750 br i1 %7, label %9, label %8
753 tail call void @bar()
760 define void @or_uge_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
761 ; RV32I-LABEL: or_uge_ne:
763 ; RV32I-NEXT: bgeu a0, a1, .LBB27_3
764 ; RV32I-NEXT: # %bb.1:
765 ; RV32I-NEXT: bne a2, a3, .LBB27_3
766 ; RV32I-NEXT: # %bb.2:
767 ; RV32I-NEXT: tail bar
768 ; RV32I-NEXT: .LBB27_3:
771 ; RV64I-LABEL: or_uge_ne:
773 ; RV64I-NEXT: bgeu a0, a1, .LBB27_3
774 ; RV64I-NEXT: # %bb.1:
775 ; RV64I-NEXT: bne a2, a3, .LBB27_3
776 ; RV64I-NEXT: # %bb.2:
777 ; RV64I-NEXT: tail bar
778 ; RV64I-NEXT: .LBB27_3:
780 %5 = icmp uge i32 %0, %1
781 %6 = icmp ne i32 %2, %3
783 br i1 %7, label %9, label %8
786 tail call void @bar()
793 define void @or_ule_ne(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
794 ; RV32I-LABEL: or_ule_ne:
796 ; RV32I-NEXT: bgeu a1, a0, .LBB28_3
797 ; RV32I-NEXT: # %bb.1:
798 ; RV32I-NEXT: bne a2, a3, .LBB28_3
799 ; RV32I-NEXT: # %bb.2:
800 ; RV32I-NEXT: tail bar
801 ; RV32I-NEXT: .LBB28_3:
804 ; RV64I-LABEL: or_ule_ne:
806 ; RV64I-NEXT: bgeu a1, a0, .LBB28_3
807 ; RV64I-NEXT: # %bb.1:
808 ; RV64I-NEXT: bne a2, a3, .LBB28_3
809 ; RV64I-NEXT: # %bb.2:
810 ; RV64I-NEXT: tail bar
811 ; RV64I-NEXT: .LBB28_3:
813 %5 = icmp ule i32 %0, %1
814 %6 = icmp ne i32 %2, %3
816 br i1 %7, label %9, label %8
819 tail call void @bar()
826 define void @and_eq_sge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
827 ; RV32I-LABEL: and_eq_sge:
829 ; RV32I-NEXT: bne a0, a1, .LBB29_3
830 ; RV32I-NEXT: # %bb.1:
831 ; RV32I-NEXT: blt a2, a3, .LBB29_3
832 ; RV32I-NEXT: # %bb.2:
834 ; RV32I-NEXT: .LBB29_3:
835 ; RV32I-NEXT: tail bar
837 ; RV64I-LABEL: and_eq_sge:
839 ; RV64I-NEXT: bne a0, a1, .LBB29_3
840 ; RV64I-NEXT: # %bb.1:
841 ; RV64I-NEXT: blt a2, a3, .LBB29_3
842 ; RV64I-NEXT: # %bb.2:
844 ; RV64I-NEXT: .LBB29_3:
845 ; RV64I-NEXT: tail bar
846 %5 = icmp eq i32 %0, %1
847 %6 = icmp sge i32 %2, %3
849 br i1 %7, label %9, label %8
852 tail call void @bar()
859 define void @and_eq_sle(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
860 ; RV32I-LABEL: and_eq_sle:
862 ; RV32I-NEXT: bne a0, a1, .LBB30_3
863 ; RV32I-NEXT: # %bb.1:
864 ; RV32I-NEXT: blt a3, a2, .LBB30_3
865 ; RV32I-NEXT: # %bb.2:
867 ; RV32I-NEXT: .LBB30_3:
868 ; RV32I-NEXT: tail bar
870 ; RV64I-LABEL: and_eq_sle:
872 ; RV64I-NEXT: bne a0, a1, .LBB30_3
873 ; RV64I-NEXT: # %bb.1:
874 ; RV64I-NEXT: blt a3, a2, .LBB30_3
875 ; RV64I-NEXT: # %bb.2:
877 ; RV64I-NEXT: .LBB30_3:
878 ; RV64I-NEXT: tail bar
879 %5 = icmp eq i32 %0, %1
880 %6 = icmp sle i32 %2, %3
882 br i1 %7, label %9, label %8
885 tail call void @bar()
892 define void @and_eq_uge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
893 ; RV32I-LABEL: and_eq_uge:
895 ; RV32I-NEXT: bne a0, a1, .LBB31_3
896 ; RV32I-NEXT: # %bb.1:
897 ; RV32I-NEXT: bltu a2, a3, .LBB31_3
898 ; RV32I-NEXT: # %bb.2:
900 ; RV32I-NEXT: .LBB31_3:
901 ; RV32I-NEXT: tail bar
903 ; RV64I-LABEL: and_eq_uge:
905 ; RV64I-NEXT: bne a0, a1, .LBB31_3
906 ; RV64I-NEXT: # %bb.1:
907 ; RV64I-NEXT: bltu a2, a3, .LBB31_3
908 ; RV64I-NEXT: # %bb.2:
910 ; RV64I-NEXT: .LBB31_3:
911 ; RV64I-NEXT: tail bar
912 %5 = icmp eq i32 %0, %1
913 %6 = icmp uge i32 %2, %3
915 br i1 %7, label %9, label %8
918 tail call void @bar()
925 define void @and_eq_ule(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
926 ; RV32I-LABEL: and_eq_ule:
928 ; RV32I-NEXT: bne a0, a1, .LBB32_3
929 ; RV32I-NEXT: # %bb.1:
930 ; RV32I-NEXT: bltu a3, a2, .LBB32_3
931 ; RV32I-NEXT: # %bb.2:
933 ; RV32I-NEXT: .LBB32_3:
934 ; RV32I-NEXT: tail bar
936 ; RV64I-LABEL: and_eq_ule:
938 ; RV64I-NEXT: bne a0, a1, .LBB32_3
939 ; RV64I-NEXT: # %bb.1:
940 ; RV64I-NEXT: bltu a3, a2, .LBB32_3
941 ; RV64I-NEXT: # %bb.2:
943 ; RV64I-NEXT: .LBB32_3:
944 ; RV64I-NEXT: tail bar
945 %5 = icmp eq i32 %0, %1
946 %6 = icmp ule i32 %2, %3
948 br i1 %7, label %9, label %8
951 tail call void @bar()
958 define void @and_ne_sge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
959 ; RV32I-LABEL: and_ne_sge:
961 ; RV32I-NEXT: beq a0, a1, .LBB33_3
962 ; RV32I-NEXT: # %bb.1:
963 ; RV32I-NEXT: blt a2, a3, .LBB33_3
964 ; RV32I-NEXT: # %bb.2:
966 ; RV32I-NEXT: .LBB33_3:
967 ; RV32I-NEXT: tail bar
969 ; RV64I-LABEL: and_ne_sge:
971 ; RV64I-NEXT: beq a0, a1, .LBB33_3
972 ; RV64I-NEXT: # %bb.1:
973 ; RV64I-NEXT: blt a2, a3, .LBB33_3
974 ; RV64I-NEXT: # %bb.2:
976 ; RV64I-NEXT: .LBB33_3:
977 ; RV64I-NEXT: tail bar
978 %5 = icmp ne i32 %0, %1
979 %6 = icmp sge i32 %2, %3
981 br i1 %7, label %9, label %8
984 tail call void @bar()
991 define void @and_ne_sle(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
992 ; RV32I-LABEL: and_ne_sle:
994 ; RV32I-NEXT: beq a0, a1, .LBB34_3
995 ; RV32I-NEXT: # %bb.1:
996 ; RV32I-NEXT: blt a3, a2, .LBB34_3
997 ; RV32I-NEXT: # %bb.2:
999 ; RV32I-NEXT: .LBB34_3:
1000 ; RV32I-NEXT: tail bar
1002 ; RV64I-LABEL: and_ne_sle:
1004 ; RV64I-NEXT: beq a0, a1, .LBB34_3
1005 ; RV64I-NEXT: # %bb.1:
1006 ; RV64I-NEXT: blt a3, a2, .LBB34_3
1007 ; RV64I-NEXT: # %bb.2:
1009 ; RV64I-NEXT: .LBB34_3:
1010 ; RV64I-NEXT: tail bar
1011 %5 = icmp ne i32 %0, %1
1012 %6 = icmp sle i32 %2, %3
1014 br i1 %7, label %9, label %8
1017 tail call void @bar()
1024 define void @and_ne_uge(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1025 ; RV32I-LABEL: and_ne_uge:
1027 ; RV32I-NEXT: beq a0, a1, .LBB35_3
1028 ; RV32I-NEXT: # %bb.1:
1029 ; RV32I-NEXT: bltu a2, a3, .LBB35_3
1030 ; RV32I-NEXT: # %bb.2:
1032 ; RV32I-NEXT: .LBB35_3:
1033 ; RV32I-NEXT: tail bar
1035 ; RV64I-LABEL: and_ne_uge:
1037 ; RV64I-NEXT: beq a0, a1, .LBB35_3
1038 ; RV64I-NEXT: # %bb.1:
1039 ; RV64I-NEXT: bltu a2, a3, .LBB35_3
1040 ; RV64I-NEXT: # %bb.2:
1042 ; RV64I-NEXT: .LBB35_3:
1043 ; RV64I-NEXT: tail bar
1044 %5 = icmp ne i32 %0, %1
1045 %6 = icmp uge i32 %2, %3
1047 br i1 %7, label %9, label %8
1050 tail call void @bar()
1057 define void @and_ne_ule(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1058 ; RV32I-LABEL: and_ne_ule:
1060 ; RV32I-NEXT: beq a0, a1, .LBB36_3
1061 ; RV32I-NEXT: # %bb.1:
1062 ; RV32I-NEXT: bltu a3, a2, .LBB36_3
1063 ; RV32I-NEXT: # %bb.2:
1065 ; RV32I-NEXT: .LBB36_3:
1066 ; RV32I-NEXT: tail bar
1068 ; RV64I-LABEL: and_ne_ule:
1070 ; RV64I-NEXT: beq a0, a1, .LBB36_3
1071 ; RV64I-NEXT: # %bb.1:
1072 ; RV64I-NEXT: bltu a3, a2, .LBB36_3
1073 ; RV64I-NEXT: # %bb.2:
1075 ; RV64I-NEXT: .LBB36_3:
1076 ; RV64I-NEXT: tail bar
1077 %5 = icmp ne i32 %0, %1
1078 %6 = icmp ule i32 %2, %3
1080 br i1 %7, label %9, label %8
1083 tail call void @bar()
1090 define void @and_sge_gt0(i32 signext %0, i32 signext %1, i32 signext %2) {
1091 ; RV32I-LABEL: and_sge_gt0:
1093 ; RV32I-NEXT: blt a0, a1, .LBB37_3
1094 ; RV32I-NEXT: # %bb.1:
1095 ; RV32I-NEXT: blez a2, .LBB37_3
1096 ; RV32I-NEXT: # %bb.2:
1098 ; RV32I-NEXT: .LBB37_3:
1099 ; RV32I-NEXT: tail bar
1101 ; RV64I-LABEL: and_sge_gt0:
1103 ; RV64I-NEXT: blt a0, a1, .LBB37_3
1104 ; RV64I-NEXT: # %bb.1:
1105 ; RV64I-NEXT: blez a2, .LBB37_3
1106 ; RV64I-NEXT: # %bb.2:
1108 ; RV64I-NEXT: .LBB37_3:
1109 ; RV64I-NEXT: tail bar
1110 %4 = icmp sge i32 %0, %1
1111 %5 = icmp sgt i32 %2, 0
1113 br i1 %6, label %8, label %7
1116 tail call void @bar()
1123 define void @and_sle_lt1(i32 signext %0, i32 signext %1, i32 signext %2) {
1124 ; RV32I-LABEL: and_sle_lt1:
1126 ; RV32I-NEXT: blt a1, a0, .LBB38_3
1127 ; RV32I-NEXT: # %bb.1:
1128 ; RV32I-NEXT: bgtz a2, .LBB38_3
1129 ; RV32I-NEXT: # %bb.2:
1131 ; RV32I-NEXT: .LBB38_3:
1132 ; RV32I-NEXT: tail bar
1134 ; RV64I-LABEL: and_sle_lt1:
1136 ; RV64I-NEXT: blt a1, a0, .LBB38_3
1137 ; RV64I-NEXT: # %bb.1:
1138 ; RV64I-NEXT: bgtz a2, .LBB38_3
1139 ; RV64I-NEXT: # %bb.2:
1141 ; RV64I-NEXT: .LBB38_3:
1142 ; RV64I-NEXT: tail bar
1143 %4 = icmp sle i32 %0, %1
1144 %5 = icmp slt i32 %2, 1
1146 br i1 %6, label %8, label %7
1149 tail call void @bar()
1156 define void @or_uge_gt0(i32 signext %0, i32 signext %1, i32 signext %2) {
1157 ; RV32I-LABEL: or_uge_gt0:
1159 ; RV32I-NEXT: bgeu a0, a1, .LBB39_3
1160 ; RV32I-NEXT: # %bb.1:
1161 ; RV32I-NEXT: bgtz a2, .LBB39_3
1162 ; RV32I-NEXT: # %bb.2:
1163 ; RV32I-NEXT: tail bar
1164 ; RV32I-NEXT: .LBB39_3:
1167 ; RV64I-LABEL: or_uge_gt0:
1169 ; RV64I-NEXT: bgeu a0, a1, .LBB39_3
1170 ; RV64I-NEXT: # %bb.1:
1171 ; RV64I-NEXT: bgtz a2, .LBB39_3
1172 ; RV64I-NEXT: # %bb.2:
1173 ; RV64I-NEXT: tail bar
1174 ; RV64I-NEXT: .LBB39_3:
1176 %4 = icmp uge i32 %0, %1
1177 %5 = icmp sgt i32 %2, 0
1179 br i1 %6, label %8, label %7
1182 tail call void @bar()
1189 define void @or_ule_lt1(i32 signext %0, i32 signext %1, i32 signext %2) {
1190 ; RV32I-LABEL: or_ule_lt1:
1192 ; RV32I-NEXT: bgeu a1, a0, .LBB40_3
1193 ; RV32I-NEXT: # %bb.1:
1194 ; RV32I-NEXT: blez a2, .LBB40_3
1195 ; RV32I-NEXT: # %bb.2:
1196 ; RV32I-NEXT: tail bar
1197 ; RV32I-NEXT: .LBB40_3:
1200 ; RV64I-LABEL: or_ule_lt1:
1202 ; RV64I-NEXT: bgeu a1, a0, .LBB40_3
1203 ; RV64I-NEXT: # %bb.1:
1204 ; RV64I-NEXT: blez a2, .LBB40_3
1205 ; RV64I-NEXT: # %bb.2:
1206 ; RV64I-NEXT: tail bar
1207 ; RV64I-NEXT: .LBB40_3:
1209 %4 = icmp ule i32 %0, %1
1210 %5 = icmp slt i32 %2, 1
1212 br i1 %6, label %8, label %7
1215 tail call void @bar()