1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV64IM
5 ; The patterns for the 'W' suffixed RV64M instructions have the potential of
6 ; missing cases. This file checks all the variants of
7 ; sign-extended/zero-extended/any-extended inputs and outputs.
9 define i32 @aext_mulw_aext_aext(i32 %a, i32 %b) nounwind {
10 ; RV64IM-LABEL: aext_mulw_aext_aext:
12 ; RV64IM-NEXT: mulw a0, a0, a1
18 define i32 @aext_mulw_aext_sext(i32 %a, i32 signext %b) nounwind {
19 ; RV64IM-LABEL: aext_mulw_aext_sext:
21 ; RV64IM-NEXT: mulw a0, a0, a1
27 define i32 @aext_mulw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
28 ; RV64IM-LABEL: aext_mulw_aext_zext:
30 ; RV64IM-NEXT: mulw a0, a0, a1
36 define i32 @aext_mulw_sext_aext(i32 signext %a, i32 %b) nounwind {
37 ; RV64IM-LABEL: aext_mulw_sext_aext:
39 ; RV64IM-NEXT: mulw a0, a0, a1
45 define i32 @aext_mulw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
46 ; RV64IM-LABEL: aext_mulw_sext_sext:
48 ; RV64IM-NEXT: mulw a0, a0, a1
54 define i32 @aext_mulw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
55 ; RV64IM-LABEL: aext_mulw_sext_zext:
57 ; RV64IM-NEXT: mulw a0, a0, a1
63 define i32 @aext_mulw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
64 ; RV64IM-LABEL: aext_mulw_zext_aext:
66 ; RV64IM-NEXT: mulw a0, a0, a1
72 define i32 @aext_mulw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
73 ; RV64IM-LABEL: aext_mulw_zext_sext:
75 ; RV64IM-NEXT: mulw a0, a0, a1
81 define i32 @aext_mulw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
82 ; RV64IM-LABEL: aext_mulw_zext_zext:
84 ; RV64IM-NEXT: mulw a0, a0, a1
90 define signext i32 @sext_mulw_aext_aext(i32 %a, i32 %b) nounwind {
91 ; RV64IM-LABEL: sext_mulw_aext_aext:
93 ; RV64IM-NEXT: mulw a0, a0, a1
99 define signext i32 @sext_mulw_aext_sext(i32 %a, i32 signext %b) nounwind {
100 ; RV64IM-LABEL: sext_mulw_aext_sext:
102 ; RV64IM-NEXT: mulw a0, a0, a1
108 define signext i32 @sext_mulw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
109 ; RV64IM-LABEL: sext_mulw_aext_zext:
111 ; RV64IM-NEXT: mulw a0, a0, a1
117 define signext i32 @sext_mulw_sext_aext(i32 signext %a, i32 %b) nounwind {
118 ; RV64IM-LABEL: sext_mulw_sext_aext:
120 ; RV64IM-NEXT: mulw a0, a0, a1
126 define signext i32 @sext_mulw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
127 ; RV64IM-LABEL: sext_mulw_sext_sext:
129 ; RV64IM-NEXT: mulw a0, a0, a1
135 define signext i32 @sext_mulw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
136 ; RV64IM-LABEL: sext_mulw_sext_zext:
138 ; RV64IM-NEXT: mulw a0, a0, a1
144 define signext i32 @sext_mulw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
145 ; RV64IM-LABEL: sext_mulw_zext_aext:
147 ; RV64IM-NEXT: mulw a0, a0, a1
153 define signext i32 @sext_mulw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
154 ; RV64IM-LABEL: sext_mulw_zext_sext:
156 ; RV64IM-NEXT: mulw a0, a0, a1
162 define signext i32 @sext_mulw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
163 ; RV64IM-LABEL: sext_mulw_zext_zext:
165 ; RV64IM-NEXT: mulw a0, a0, a1
171 define zeroext i32 @zext_mulw_aext_aext(i32 %a, i32 %b) nounwind {
172 ; RV64IM-LABEL: zext_mulw_aext_aext:
174 ; RV64IM-NEXT: mul a0, a0, a1
175 ; RV64IM-NEXT: slli a0, a0, 32
176 ; RV64IM-NEXT: srli a0, a0, 32
182 define zeroext i32 @zext_mulw_aext_sext(i32 %a, i32 signext %b) nounwind {
183 ; RV64IM-LABEL: zext_mulw_aext_sext:
185 ; RV64IM-NEXT: mul a0, a0, a1
186 ; RV64IM-NEXT: slli a0, a0, 32
187 ; RV64IM-NEXT: srli a0, a0, 32
193 define zeroext i32 @zext_mulw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
194 ; RV64IM-LABEL: zext_mulw_aext_zext:
196 ; RV64IM-NEXT: mul a0, a0, a1
197 ; RV64IM-NEXT: slli a0, a0, 32
198 ; RV64IM-NEXT: srli a0, a0, 32
204 define zeroext i32 @zext_mulw_sext_aext(i32 signext %a, i32 %b) nounwind {
205 ; RV64IM-LABEL: zext_mulw_sext_aext:
207 ; RV64IM-NEXT: mul a0, a0, a1
208 ; RV64IM-NEXT: slli a0, a0, 32
209 ; RV64IM-NEXT: srli a0, a0, 32
215 define zeroext i32 @zext_mulw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
216 ; RV64IM-LABEL: zext_mulw_sext_sext:
218 ; RV64IM-NEXT: mul a0, a0, a1
219 ; RV64IM-NEXT: slli a0, a0, 32
220 ; RV64IM-NEXT: srli a0, a0, 32
226 define zeroext i32 @zext_mulw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
227 ; RV64IM-LABEL: zext_mulw_sext_zext:
229 ; RV64IM-NEXT: mul a0, a0, a1
230 ; RV64IM-NEXT: slli a0, a0, 32
231 ; RV64IM-NEXT: srli a0, a0, 32
237 define zeroext i32 @zext_mulw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
238 ; RV64IM-LABEL: zext_mulw_zext_aext:
240 ; RV64IM-NEXT: mul a0, a0, a1
241 ; RV64IM-NEXT: slli a0, a0, 32
242 ; RV64IM-NEXT: srli a0, a0, 32
248 define zeroext i32 @zext_mulw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
249 ; RV64IM-LABEL: zext_mulw_zext_sext:
251 ; RV64IM-NEXT: mul a0, a0, a1
252 ; RV64IM-NEXT: slli a0, a0, 32
253 ; RV64IM-NEXT: srli a0, a0, 32
259 define zeroext i32 @zext_mulw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
260 ; RV64IM-LABEL: zext_mulw_zext_zext:
262 ; RV64IM-NEXT: mul a0, a0, a1
263 ; RV64IM-NEXT: slli a0, a0, 32
264 ; RV64IM-NEXT: srli a0, a0, 32
270 define i32 @aext_divuw_aext_aext(i32 %a, i32 %b) nounwind {
271 ; RV64IM-LABEL: aext_divuw_aext_aext:
273 ; RV64IM-NEXT: divuw a0, a0, a1
279 define i32 @aext_divuw_aext_sext(i32 %a, i32 signext %b) nounwind {
280 ; RV64IM-LABEL: aext_divuw_aext_sext:
282 ; RV64IM-NEXT: divuw a0, a0, a1
288 define i32 @aext_divuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
289 ; RV64IM-LABEL: aext_divuw_aext_zext:
291 ; RV64IM-NEXT: divuw a0, a0, a1
297 define i32 @aext_divuw_sext_aext(i32 signext %a, i32 %b) nounwind {
298 ; RV64IM-LABEL: aext_divuw_sext_aext:
300 ; RV64IM-NEXT: divuw a0, a0, a1
306 define i32 @aext_divuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
307 ; RV64IM-LABEL: aext_divuw_sext_sext:
309 ; RV64IM-NEXT: divuw a0, a0, a1
315 define i32 @aext_divuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
316 ; RV64IM-LABEL: aext_divuw_sext_zext:
318 ; RV64IM-NEXT: divuw a0, a0, a1
324 define i32 @aext_divuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
325 ; RV64IM-LABEL: aext_divuw_zext_aext:
327 ; RV64IM-NEXT: divuw a0, a0, a1
333 define i32 @aext_divuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
334 ; RV64IM-LABEL: aext_divuw_zext_sext:
336 ; RV64IM-NEXT: divuw a0, a0, a1
342 define i32 @aext_divuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
343 ; RV64IM-LABEL: aext_divuw_zext_zext:
345 ; RV64IM-NEXT: divuw a0, a0, a1
351 define signext i32 @sext_divuw_aext_aext(i32 %a, i32 %b) nounwind {
352 ; RV64IM-LABEL: sext_divuw_aext_aext:
354 ; RV64IM-NEXT: divuw a0, a0, a1
360 define signext i32 @sext_divuw_aext_sext(i32 %a, i32 signext %b) nounwind {
361 ; RV64IM-LABEL: sext_divuw_aext_sext:
363 ; RV64IM-NEXT: divuw a0, a0, a1
369 define signext i32 @sext_divuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
370 ; RV64IM-LABEL: sext_divuw_aext_zext:
372 ; RV64IM-NEXT: divuw a0, a0, a1
378 define signext i32 @sext_divuw_sext_aext(i32 signext %a, i32 %b) nounwind {
379 ; RV64IM-LABEL: sext_divuw_sext_aext:
381 ; RV64IM-NEXT: divuw a0, a0, a1
387 define signext i32 @sext_divuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
388 ; RV64IM-LABEL: sext_divuw_sext_sext:
390 ; RV64IM-NEXT: divuw a0, a0, a1
396 define signext i32 @sext_divuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
397 ; RV64IM-LABEL: sext_divuw_sext_zext:
399 ; RV64IM-NEXT: divuw a0, a0, a1
405 define signext i32 @sext_divuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
406 ; RV64IM-LABEL: sext_divuw_zext_aext:
408 ; RV64IM-NEXT: divuw a0, a0, a1
414 define signext i32 @sext_divuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
415 ; RV64IM-LABEL: sext_divuw_zext_sext:
417 ; RV64IM-NEXT: divuw a0, a0, a1
423 define signext i32 @sext_divuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
424 ; RV64IM-LABEL: sext_divuw_zext_zext:
426 ; RV64IM-NEXT: divuw a0, a0, a1
432 define zeroext i32 @zext_divuw_aext_aext(i32 %a, i32 %b) nounwind {
433 ; RV64IM-LABEL: zext_divuw_aext_aext:
435 ; RV64IM-NEXT: divuw a0, a0, a1
436 ; RV64IM-NEXT: slli a0, a0, 32
437 ; RV64IM-NEXT: srli a0, a0, 32
443 define zeroext i32 @zext_divuw_aext_sext(i32 %a, i32 signext %b) nounwind {
444 ; RV64IM-LABEL: zext_divuw_aext_sext:
446 ; RV64IM-NEXT: divuw a0, a0, a1
447 ; RV64IM-NEXT: slli a0, a0, 32
448 ; RV64IM-NEXT: srli a0, a0, 32
454 define zeroext i32 @zext_divuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
455 ; RV64IM-LABEL: zext_divuw_aext_zext:
457 ; RV64IM-NEXT: divuw a0, a0, a1
458 ; RV64IM-NEXT: slli a0, a0, 32
459 ; RV64IM-NEXT: srli a0, a0, 32
465 define zeroext i32 @zext_divuw_sext_aext(i32 signext %a, i32 %b) nounwind {
466 ; RV64IM-LABEL: zext_divuw_sext_aext:
468 ; RV64IM-NEXT: divuw a0, a0, a1
469 ; RV64IM-NEXT: slli a0, a0, 32
470 ; RV64IM-NEXT: srli a0, a0, 32
476 define zeroext i32 @zext_divuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
477 ; RV64IM-LABEL: zext_divuw_sext_sext:
479 ; RV64IM-NEXT: divuw a0, a0, a1
480 ; RV64IM-NEXT: slli a0, a0, 32
481 ; RV64IM-NEXT: srli a0, a0, 32
487 define zeroext i32 @zext_divuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
488 ; RV64IM-LABEL: zext_divuw_sext_zext:
490 ; RV64IM-NEXT: divuw a0, a0, a1
491 ; RV64IM-NEXT: slli a0, a0, 32
492 ; RV64IM-NEXT: srli a0, a0, 32
498 define zeroext i32 @zext_divuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
499 ; RV64IM-LABEL: zext_divuw_zext_aext:
501 ; RV64IM-NEXT: divuw a0, a0, a1
502 ; RV64IM-NEXT: slli a0, a0, 32
503 ; RV64IM-NEXT: srli a0, a0, 32
509 define zeroext i32 @zext_divuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
510 ; RV64IM-LABEL: zext_divuw_zext_sext:
512 ; RV64IM-NEXT: divuw a0, a0, a1
513 ; RV64IM-NEXT: slli a0, a0, 32
514 ; RV64IM-NEXT: srli a0, a0, 32
520 define zeroext i32 @zext_divuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
521 ; RV64IM-LABEL: zext_divuw_zext_zext:
523 ; RV64IM-NEXT: divu a0, a0, a1
529 define zeroext i8 @zext_divuw_zext_zext_i8(i8 zeroext %a, i8 zeroext %b) nounwind {
530 ; RV64IM-LABEL: zext_divuw_zext_zext_i8:
532 ; RV64IM-NEXT: divuw a0, a0, a1
538 define zeroext i16 @zext_divuw_zext_zext_i16(i16 zeroext %a, i16 zeroext %b) nounwind {
539 ; RV64IM-LABEL: zext_divuw_zext_zext_i16:
541 ; RV64IM-NEXT: divuw a0, a0, a1
547 define i32 @aext_divw_aext_aext(i32 %a, i32 %b) nounwind {
548 ; RV64IM-LABEL: aext_divw_aext_aext:
550 ; RV64IM-NEXT: divw a0, a0, a1
556 define i32 @aext_divw_aext_sext(i32 %a, i32 signext %b) nounwind {
557 ; RV64IM-LABEL: aext_divw_aext_sext:
559 ; RV64IM-NEXT: divw a0, a0, a1
565 define i32 @aext_divw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
566 ; RV64IM-LABEL: aext_divw_aext_zext:
568 ; RV64IM-NEXT: divw a0, a0, a1
574 define i32 @aext_divw_sext_aext(i32 signext %a, i32 %b) nounwind {
575 ; RV64IM-LABEL: aext_divw_sext_aext:
577 ; RV64IM-NEXT: divw a0, a0, a1
583 define i32 @aext_divw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
584 ; RV64IM-LABEL: aext_divw_sext_sext:
586 ; RV64IM-NEXT: divw a0, a0, a1
592 define i32 @aext_divw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
593 ; RV64IM-LABEL: aext_divw_sext_zext:
595 ; RV64IM-NEXT: divw a0, a0, a1
601 define i32 @aext_divw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
602 ; RV64IM-LABEL: aext_divw_zext_aext:
604 ; RV64IM-NEXT: divw a0, a0, a1
610 define i32 @aext_divw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
611 ; RV64IM-LABEL: aext_divw_zext_sext:
613 ; RV64IM-NEXT: divw a0, a0, a1
619 define i32 @aext_divw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
620 ; RV64IM-LABEL: aext_divw_zext_zext:
622 ; RV64IM-NEXT: divw a0, a0, a1
628 define signext i32 @sext_divw_aext_aext(i32 %a, i32 %b) nounwind {
629 ; RV64IM-LABEL: sext_divw_aext_aext:
631 ; RV64IM-NEXT: divw a0, a0, a1
637 define signext i32 @sext_divw_aext_sext(i32 %a, i32 signext %b) nounwind {
638 ; RV64IM-LABEL: sext_divw_aext_sext:
640 ; RV64IM-NEXT: divw a0, a0, a1
646 define signext i32 @sext_divw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
647 ; RV64IM-LABEL: sext_divw_aext_zext:
649 ; RV64IM-NEXT: divw a0, a0, a1
655 define signext i32 @sext_divw_sext_aext(i32 signext %a, i32 %b) nounwind {
656 ; RV64IM-LABEL: sext_divw_sext_aext:
658 ; RV64IM-NEXT: divw a0, a0, a1
664 define signext i32 @sext_divw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
665 ; RV64IM-LABEL: sext_divw_sext_sext:
667 ; RV64IM-NEXT: divw a0, a0, a1
673 define signext i32 @sext_divw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
674 ; RV64IM-LABEL: sext_divw_sext_zext:
676 ; RV64IM-NEXT: divw a0, a0, a1
682 define signext i32 @sext_divw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
683 ; RV64IM-LABEL: sext_divw_zext_aext:
685 ; RV64IM-NEXT: divw a0, a0, a1
691 define signext i32 @sext_divw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
692 ; RV64IM-LABEL: sext_divw_zext_sext:
694 ; RV64IM-NEXT: divw a0, a0, a1
700 define signext i32 @sext_divw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
701 ; RV64IM-LABEL: sext_divw_zext_zext:
703 ; RV64IM-NEXT: divw a0, a0, a1
709 define zeroext i32 @zext_divw_aext_aext(i32 %a, i32 %b) nounwind {
710 ; RV64IM-LABEL: zext_divw_aext_aext:
712 ; RV64IM-NEXT: divw a0, a0, a1
713 ; RV64IM-NEXT: slli a0, a0, 32
714 ; RV64IM-NEXT: srli a0, a0, 32
720 define zeroext i32 @zext_divw_aext_sext(i32 %a, i32 signext %b) nounwind {
721 ; RV64IM-LABEL: zext_divw_aext_sext:
723 ; RV64IM-NEXT: divw a0, a0, a1
724 ; RV64IM-NEXT: slli a0, a0, 32
725 ; RV64IM-NEXT: srli a0, a0, 32
731 define zeroext i32 @zext_divw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
732 ; RV64IM-LABEL: zext_divw_aext_zext:
734 ; RV64IM-NEXT: divw a0, a0, a1
735 ; RV64IM-NEXT: slli a0, a0, 32
736 ; RV64IM-NEXT: srli a0, a0, 32
742 define zeroext i32 @zext_divw_sext_aext(i32 signext %a, i32 %b) nounwind {
743 ; RV64IM-LABEL: zext_divw_sext_aext:
745 ; RV64IM-NEXT: divw a0, a0, a1
746 ; RV64IM-NEXT: slli a0, a0, 32
747 ; RV64IM-NEXT: srli a0, a0, 32
753 define zeroext i32 @zext_divw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
754 ; RV64IM-LABEL: zext_divw_sext_sext:
756 ; RV64IM-NEXT: divw a0, a0, a1
757 ; RV64IM-NEXT: slli a0, a0, 32
758 ; RV64IM-NEXT: srli a0, a0, 32
764 define zeroext i32 @zext_divw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
765 ; RV64IM-LABEL: zext_divw_sext_zext:
767 ; RV64IM-NEXT: divw a0, a0, a1
768 ; RV64IM-NEXT: slli a0, a0, 32
769 ; RV64IM-NEXT: srli a0, a0, 32
775 define zeroext i32 @zext_divw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
776 ; RV64IM-LABEL: zext_divw_zext_aext:
778 ; RV64IM-NEXT: divw a0, a0, a1
779 ; RV64IM-NEXT: slli a0, a0, 32
780 ; RV64IM-NEXT: srli a0, a0, 32
786 define zeroext i32 @zext_divw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
787 ; RV64IM-LABEL: zext_divw_zext_sext:
789 ; RV64IM-NEXT: divw a0, a0, a1
790 ; RV64IM-NEXT: slli a0, a0, 32
791 ; RV64IM-NEXT: srli a0, a0, 32
797 define zeroext i32 @zext_divw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
798 ; RV64IM-LABEL: zext_divw_zext_zext:
800 ; RV64IM-NEXT: divw a0, a0, a1
801 ; RV64IM-NEXT: slli a0, a0, 32
802 ; RV64IM-NEXT: srli a0, a0, 32
808 define signext i8 @sext_divw_sext_sext_i8(i8 signext %a, i8 signext %b) nounwind {
809 ; RV64IM-LABEL: sext_divw_sext_sext_i8:
811 ; RV64IM-NEXT: divw a0, a0, a1
812 ; RV64IM-NEXT: slli a0, a0, 56
813 ; RV64IM-NEXT: srai a0, a0, 56
819 define signext i16 @sext_divw_sext_sext_i16(i16 signext %a, i16 signext %b) nounwind {
820 ; RV64IM-LABEL: sext_divw_sext_sext_i16:
822 ; RV64IM-NEXT: divw a0, a0, a1
823 ; RV64IM-NEXT: slli a0, a0, 48
824 ; RV64IM-NEXT: srai a0, a0, 48
830 define i32 @aext_remw_aext_aext(i32 %a, i32 %b) nounwind {
831 ; RV64IM-LABEL: aext_remw_aext_aext:
833 ; RV64IM-NEXT: remw a0, a0, a1
839 define i32 @aext_remw_aext_sext(i32 %a, i32 signext %b) nounwind {
840 ; RV64IM-LABEL: aext_remw_aext_sext:
842 ; RV64IM-NEXT: remw a0, a0, a1
848 define i32 @aext_remw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
849 ; RV64IM-LABEL: aext_remw_aext_zext:
851 ; RV64IM-NEXT: remw a0, a0, a1
857 define i32 @aext_remw_sext_aext(i32 signext %a, i32 %b) nounwind {
858 ; RV64IM-LABEL: aext_remw_sext_aext:
860 ; RV64IM-NEXT: remw a0, a0, a1
866 define i32 @aext_remw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
867 ; RV64IM-LABEL: aext_remw_sext_sext:
869 ; RV64IM-NEXT: remw a0, a0, a1
875 define i32 @aext_remw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
876 ; RV64IM-LABEL: aext_remw_sext_zext:
878 ; RV64IM-NEXT: remw a0, a0, a1
884 define i32 @aext_remw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
885 ; RV64IM-LABEL: aext_remw_zext_aext:
887 ; RV64IM-NEXT: remw a0, a0, a1
893 define i32 @aext_remw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
894 ; RV64IM-LABEL: aext_remw_zext_sext:
896 ; RV64IM-NEXT: remw a0, a0, a1
902 define i32 @aext_remw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
903 ; RV64IM-LABEL: aext_remw_zext_zext:
905 ; RV64IM-NEXT: remw a0, a0, a1
911 define signext i32 @sext_remw_aext_aext(i32 %a, i32 %b) nounwind {
912 ; RV64IM-LABEL: sext_remw_aext_aext:
914 ; RV64IM-NEXT: remw a0, a0, a1
920 define signext i32 @sext_remw_aext_sext(i32 %a, i32 signext %b) nounwind {
921 ; RV64IM-LABEL: sext_remw_aext_sext:
923 ; RV64IM-NEXT: remw a0, a0, a1
929 define signext i32 @sext_remw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
930 ; RV64IM-LABEL: sext_remw_aext_zext:
932 ; RV64IM-NEXT: remw a0, a0, a1
938 define signext i32 @sext_remw_sext_aext(i32 signext %a, i32 %b) nounwind {
939 ; RV64IM-LABEL: sext_remw_sext_aext:
941 ; RV64IM-NEXT: remw a0, a0, a1
947 define signext i32 @sext_remw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
948 ; RV64IM-LABEL: sext_remw_sext_sext:
950 ; RV64IM-NEXT: remw a0, a0, a1
956 define signext i32 @sext_remw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
957 ; RV64IM-LABEL: sext_remw_sext_zext:
959 ; RV64IM-NEXT: remw a0, a0, a1
965 define signext i32 @sext_remw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
966 ; RV64IM-LABEL: sext_remw_zext_aext:
968 ; RV64IM-NEXT: remw a0, a0, a1
974 define signext i32 @sext_remw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
975 ; RV64IM-LABEL: sext_remw_zext_sext:
977 ; RV64IM-NEXT: remw a0, a0, a1
983 define signext i32 @sext_remw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
984 ; RV64IM-LABEL: sext_remw_zext_zext:
986 ; RV64IM-NEXT: remw a0, a0, a1
992 define zeroext i32 @zext_remw_aext_aext(i32 %a, i32 %b) nounwind {
993 ; RV64IM-LABEL: zext_remw_aext_aext:
995 ; RV64IM-NEXT: remw a0, a0, a1
996 ; RV64IM-NEXT: slli a0, a0, 32
997 ; RV64IM-NEXT: srli a0, a0, 32
1003 define zeroext i32 @zext_remw_aext_sext(i32 %a, i32 signext %b) nounwind {
1004 ; RV64IM-LABEL: zext_remw_aext_sext:
1006 ; RV64IM-NEXT: remw a0, a0, a1
1007 ; RV64IM-NEXT: slli a0, a0, 32
1008 ; RV64IM-NEXT: srli a0, a0, 32
1010 %1 = srem i32 %a, %b
1014 define zeroext i32 @zext_remw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
1015 ; RV64IM-LABEL: zext_remw_aext_zext:
1017 ; RV64IM-NEXT: remw a0, a0, a1
1018 ; RV64IM-NEXT: slli a0, a0, 32
1019 ; RV64IM-NEXT: srli a0, a0, 32
1021 %1 = srem i32 %a, %b
1025 define zeroext i32 @zext_remw_sext_aext(i32 signext %a, i32 %b) nounwind {
1026 ; RV64IM-LABEL: zext_remw_sext_aext:
1028 ; RV64IM-NEXT: remw a0, a0, a1
1029 ; RV64IM-NEXT: slli a0, a0, 32
1030 ; RV64IM-NEXT: srli a0, a0, 32
1032 %1 = srem i32 %a, %b
1036 define zeroext i32 @zext_remw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
1037 ; RV64IM-LABEL: zext_remw_sext_sext:
1039 ; RV64IM-NEXT: remw a0, a0, a1
1040 ; RV64IM-NEXT: slli a0, a0, 32
1041 ; RV64IM-NEXT: srli a0, a0, 32
1043 %1 = srem i32 %a, %b
1047 define zeroext i32 @zext_remw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
1048 ; RV64IM-LABEL: zext_remw_sext_zext:
1050 ; RV64IM-NEXT: remw a0, a0, a1
1051 ; RV64IM-NEXT: slli a0, a0, 32
1052 ; RV64IM-NEXT: srli a0, a0, 32
1054 %1 = srem i32 %a, %b
1058 define zeroext i32 @zext_remw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
1059 ; RV64IM-LABEL: zext_remw_zext_aext:
1061 ; RV64IM-NEXT: remw a0, a0, a1
1062 ; RV64IM-NEXT: slli a0, a0, 32
1063 ; RV64IM-NEXT: srli a0, a0, 32
1065 %1 = srem i32 %a, %b
1069 define zeroext i32 @zext_remw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
1070 ; RV64IM-LABEL: zext_remw_zext_sext:
1072 ; RV64IM-NEXT: remw a0, a0, a1
1073 ; RV64IM-NEXT: slli a0, a0, 32
1074 ; RV64IM-NEXT: srli a0, a0, 32
1076 %1 = srem i32 %a, %b
1080 define zeroext i32 @zext_remw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
1081 ; RV64IM-LABEL: zext_remw_zext_zext:
1083 ; RV64IM-NEXT: remw a0, a0, a1
1084 ; RV64IM-NEXT: slli a0, a0, 32
1085 ; RV64IM-NEXT: srli a0, a0, 32
1087 %1 = srem i32 %a, %b
1091 define signext i8 @sext_remw_sext_sext_i8(i8 signext %a, i8 signext %b) nounwind {
1092 ; RV64IM-LABEL: sext_remw_sext_sext_i8:
1094 ; RV64IM-NEXT: remw a0, a0, a1
1100 define signext i16 @sext_remw_sext_sext_i16(i16 signext %a, i16 signext %b) nounwind {
1101 ; RV64IM-LABEL: sext_remw_sext_sext_i16:
1103 ; RV64IM-NEXT: remw a0, a0, a1
1105 %1 = srem i16 %a, %b
1109 define signext i32 @sext_i32_remw_zext_sext_i16(i16 zeroext %0, i16 signext %1) nounwind {
1110 ; RV64IM-LABEL: sext_i32_remw_zext_sext_i16:
1112 ; RV64IM-NEXT: remw a0, a0, a1
1114 %3 = sext i16 %1 to i32
1115 %4 = zext i16 %0 to i32
1116 %5 = srem i32 %4, %3
1120 define signext i32 @sext_i32_remw_sext_zext_i16(i16 signext %a, i16 zeroext %b) nounwind {
1121 ; RV64IM-LABEL: sext_i32_remw_sext_zext_i16:
1123 ; RV64IM-NEXT: remw a0, a0, a1
1125 %1 = sext i16 %a to i32
1126 %2 = zext i16 %b to i32
1127 %3 = srem i32 %1, %2
1131 define i32 @aext_remuw_aext_aext(i32 %a, i32 %b) nounwind {
1132 ; RV64IM-LABEL: aext_remuw_aext_aext:
1134 ; RV64IM-NEXT: remuw a0, a0, a1
1136 %1 = urem i32 %a, %b
1140 define i32 @aext_remuw_aext_sext(i32 %a, i32 signext %b) nounwind {
1141 ; RV64IM-LABEL: aext_remuw_aext_sext:
1143 ; RV64IM-NEXT: remuw a0, a0, a1
1145 %1 = urem i32 %a, %b
1149 define i32 @aext_remuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
1150 ; RV64IM-LABEL: aext_remuw_aext_zext:
1152 ; RV64IM-NEXT: remuw a0, a0, a1
1154 %1 = urem i32 %a, %b
1158 define i32 @aext_remuw_sext_aext(i32 signext %a, i32 %b) nounwind {
1159 ; RV64IM-LABEL: aext_remuw_sext_aext:
1161 ; RV64IM-NEXT: remuw a0, a0, a1
1163 %1 = urem i32 %a, %b
1167 define i32 @aext_remuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
1168 ; RV64IM-LABEL: aext_remuw_sext_sext:
1170 ; RV64IM-NEXT: remuw a0, a0, a1
1172 %1 = urem i32 %a, %b
1176 define i32 @aext_remuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
1177 ; RV64IM-LABEL: aext_remuw_sext_zext:
1179 ; RV64IM-NEXT: remuw a0, a0, a1
1181 %1 = urem i32 %a, %b
1185 define i32 @aext_remuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
1186 ; RV64IM-LABEL: aext_remuw_zext_aext:
1188 ; RV64IM-NEXT: remuw a0, a0, a1
1190 %1 = urem i32 %a, %b
1194 define i32 @aext_remuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
1195 ; RV64IM-LABEL: aext_remuw_zext_sext:
1197 ; RV64IM-NEXT: remuw a0, a0, a1
1199 %1 = urem i32 %a, %b
1203 define i32 @aext_remuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
1204 ; RV64IM-LABEL: aext_remuw_zext_zext:
1206 ; RV64IM-NEXT: remuw a0, a0, a1
1208 %1 = urem i32 %a, %b
1212 define signext i32 @sext_remuw_aext_aext(i32 %a, i32 %b) nounwind {
1213 ; RV64IM-LABEL: sext_remuw_aext_aext:
1215 ; RV64IM-NEXT: remuw a0, a0, a1
1217 %1 = urem i32 %a, %b
1221 define signext i32 @sext_remuw_aext_sext(i32 %a, i32 signext %b) nounwind {
1222 ; RV64IM-LABEL: sext_remuw_aext_sext:
1224 ; RV64IM-NEXT: remuw a0, a0, a1
1226 %1 = urem i32 %a, %b
1230 define signext i32 @sext_remuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
1231 ; RV64IM-LABEL: sext_remuw_aext_zext:
1233 ; RV64IM-NEXT: remuw a0, a0, a1
1235 %1 = urem i32 %a, %b
1239 define signext i32 @sext_remuw_sext_aext(i32 signext %a, i32 %b) nounwind {
1240 ; RV64IM-LABEL: sext_remuw_sext_aext:
1242 ; RV64IM-NEXT: remuw a0, a0, a1
1244 %1 = urem i32 %a, %b
1248 define signext i32 @sext_remuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
1249 ; RV64IM-LABEL: sext_remuw_sext_sext:
1251 ; RV64IM-NEXT: remuw a0, a0, a1
1253 %1 = urem i32 %a, %b
1257 define signext i32 @sext_remuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
1258 ; RV64IM-LABEL: sext_remuw_sext_zext:
1260 ; RV64IM-NEXT: remuw a0, a0, a1
1262 %1 = urem i32 %a, %b
1266 define signext i32 @sext_remuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
1267 ; RV64IM-LABEL: sext_remuw_zext_aext:
1269 ; RV64IM-NEXT: remuw a0, a0, a1
1271 %1 = urem i32 %a, %b
1275 define signext i32 @sext_remuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
1276 ; RV64IM-LABEL: sext_remuw_zext_sext:
1278 ; RV64IM-NEXT: remuw a0, a0, a1
1280 %1 = urem i32 %a, %b
1284 define signext i32 @sext_remuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
1285 ; RV64IM-LABEL: sext_remuw_zext_zext:
1287 ; RV64IM-NEXT: remuw a0, a0, a1
1289 %1 = urem i32 %a, %b
1293 define zeroext i32 @zext_remuw_aext_aext(i32 %a, i32 %b) nounwind {
1294 ; RV64IM-LABEL: zext_remuw_aext_aext:
1296 ; RV64IM-NEXT: remuw a0, a0, a1
1297 ; RV64IM-NEXT: slli a0, a0, 32
1298 ; RV64IM-NEXT: srli a0, a0, 32
1300 %1 = urem i32 %a, %b
1304 define zeroext i32 @zext_remuw_aext_sext(i32 %a, i32 signext %b) nounwind {
1305 ; RV64IM-LABEL: zext_remuw_aext_sext:
1307 ; RV64IM-NEXT: remuw a0, a0, a1
1308 ; RV64IM-NEXT: slli a0, a0, 32
1309 ; RV64IM-NEXT: srli a0, a0, 32
1311 %1 = urem i32 %a, %b
1315 define zeroext i32 @zext_remuw_aext_zext(i32 %a, i32 zeroext %b) nounwind {
1316 ; RV64IM-LABEL: zext_remuw_aext_zext:
1318 ; RV64IM-NEXT: remuw a0, a0, a1
1319 ; RV64IM-NEXT: slli a0, a0, 32
1320 ; RV64IM-NEXT: srli a0, a0, 32
1322 %1 = urem i32 %a, %b
1326 define zeroext i32 @zext_remuw_sext_aext(i32 signext %a, i32 %b) nounwind {
1327 ; RV64IM-LABEL: zext_remuw_sext_aext:
1329 ; RV64IM-NEXT: remuw a0, a0, a1
1330 ; RV64IM-NEXT: slli a0, a0, 32
1331 ; RV64IM-NEXT: srli a0, a0, 32
1333 %1 = urem i32 %a, %b
1337 define zeroext i32 @zext_remuw_sext_sext(i32 signext %a, i32 signext %b) nounwind {
1338 ; RV64IM-LABEL: zext_remuw_sext_sext:
1340 ; RV64IM-NEXT: remuw a0, a0, a1
1341 ; RV64IM-NEXT: slli a0, a0, 32
1342 ; RV64IM-NEXT: srli a0, a0, 32
1344 %1 = urem i32 %a, %b
1348 define zeroext i32 @zext_remuw_sext_zext(i32 signext %a, i32 zeroext %b) nounwind {
1349 ; RV64IM-LABEL: zext_remuw_sext_zext:
1351 ; RV64IM-NEXT: remuw a0, a0, a1
1352 ; RV64IM-NEXT: slli a0, a0, 32
1353 ; RV64IM-NEXT: srli a0, a0, 32
1355 %1 = urem i32 %a, %b
1359 define zeroext i32 @zext_remuw_zext_aext(i32 zeroext %a, i32 %b) nounwind {
1360 ; RV64IM-LABEL: zext_remuw_zext_aext:
1362 ; RV64IM-NEXT: remuw a0, a0, a1
1363 ; RV64IM-NEXT: slli a0, a0, 32
1364 ; RV64IM-NEXT: srli a0, a0, 32
1366 %1 = urem i32 %a, %b
1370 define zeroext i32 @zext_remuw_zext_sext(i32 zeroext %a, i32 signext %b) nounwind {
1371 ; RV64IM-LABEL: zext_remuw_zext_sext:
1373 ; RV64IM-NEXT: remuw a0, a0, a1
1374 ; RV64IM-NEXT: slli a0, a0, 32
1375 ; RV64IM-NEXT: srli a0, a0, 32
1377 %1 = urem i32 %a, %b
1381 define zeroext i32 @zext_remuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind {
1382 ; RV64IM-LABEL: zext_remuw_zext_zext:
1384 ; RV64IM-NEXT: remu a0, a0, a1
1386 %1 = urem i32 %a, %b
1390 define zeroext i8 @zext_remuw_zext_zext_i8(i8 zeroext %a, i8 zeroext %b) nounwind {
1391 ; RV64IM-LABEL: zext_remuw_zext_zext_i8:
1393 ; RV64IM-NEXT: remuw a0, a0, a1
1399 define zeroext i16 @zext_remuw_zext_zext_i16(i16 zeroext %a, i16 zeroext %b) nounwind {
1400 ; RV64IM-LABEL: zext_remuw_zext_zext_i16:
1402 ; RV64IM-NEXT: remuw a0, a0, a1
1404 %1 = urem i16 %a, %b