@@ -526,6 +526,24 @@ define zeroext i32 @zext_divuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwin
526
526
ret i32 %1
527
527
}
528
528
529
+ define zeroext i8 @zext_divuw_zext_zext_i8 (i8 zeroext %a , i8 zeroext %b ) nounwind {
530
+ ; RV64IM-LABEL: zext_divuw_zext_zext_i8:
531
+ ; RV64IM: # %bb.0:
532
+ ; RV64IM-NEXT: divu a0, a0, a1
533
+ ; RV64IM-NEXT: ret
534
+ %1 = udiv i8 %a , %b
535
+ ret i8 %1
536
+ }
537
+
538
+ define zeroext i16 @zext_divuw_zext_zext_i16 (i16 zeroext %a , i16 zeroext %b ) nounwind {
539
+ ; RV64IM-LABEL: zext_divuw_zext_zext_i16:
540
+ ; RV64IM: # %bb.0:
541
+ ; RV64IM-NEXT: divu a0, a0, a1
542
+ ; RV64IM-NEXT: ret
543
+ %1 = udiv i16 %a , %b
544
+ ret i16 %1
545
+ }
546
+
529
547
define i32 @aext_divw_aext_aext (i32 %a , i32 %b ) nounwind {
530
548
; RV64IM-LABEL: aext_divw_aext_aext:
531
549
; RV64IM: # %bb.0:
@@ -787,6 +805,28 @@ define zeroext i32 @zext_divw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind
787
805
ret i32 %1
788
806
}
789
807
808
+ define signext i8 @sext_divw_sext_sext_i8 (i8 signext %a , i8 signext %b ) nounwind {
809
+ ; RV64IM-LABEL: sext_divw_sext_sext_i8:
810
+ ; RV64IM: # %bb.0:
811
+ ; RV64IM-NEXT: div a0, a0, a1
812
+ ; RV64IM-NEXT: slli a0, a0, 56
813
+ ; RV64IM-NEXT: srai a0, a0, 56
814
+ ; RV64IM-NEXT: ret
815
+ %1 = sdiv i8 %a , %b
816
+ ret i8 %1
817
+ }
818
+
819
+ define signext i16 @sext_divw_sext_sext_i16 (i16 signext %a , i16 signext %b ) nounwind {
820
+ ; RV64IM-LABEL: sext_divw_sext_sext_i16:
821
+ ; RV64IM: # %bb.0:
822
+ ; RV64IM-NEXT: div a0, a0, a1
823
+ ; RV64IM-NEXT: slli a0, a0, 48
824
+ ; RV64IM-NEXT: srai a0, a0, 48
825
+ ; RV64IM-NEXT: ret
826
+ %1 = sdiv i16 %a , %b
827
+ ret i16 %1
828
+ }
829
+
790
830
define i32 @aext_remw_aext_aext (i32 %a , i32 %b ) nounwind {
791
831
; RV64IM-LABEL: aext_remw_aext_aext:
792
832
; RV64IM: # %bb.0:
@@ -1048,6 +1088,28 @@ define zeroext i32 @zext_remw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwind
1048
1088
ret i32 %1
1049
1089
}
1050
1090
1091
+ define signext i8 @sext_remw_sext_sext_i8 (i8 signext %a , i8 signext %b ) nounwind {
1092
+ ; RV64IM-LABEL: sext_remw_sext_sext_i8:
1093
+ ; RV64IM: # %bb.0:
1094
+ ; RV64IM-NEXT: rem a0, a0, a1
1095
+ ; RV64IM-NEXT: slli a0, a0, 56
1096
+ ; RV64IM-NEXT: srai a0, a0, 56
1097
+ ; RV64IM-NEXT: ret
1098
+ %1 = srem i8 %a , %b
1099
+ ret i8 %1
1100
+ }
1101
+
1102
+ define signext i16 @sext_remw_sext_sext_i16 (i16 signext %a , i16 signext %b ) nounwind {
1103
+ ; RV64IM-LABEL: sext_remw_sext_sext_i16:
1104
+ ; RV64IM: # %bb.0:
1105
+ ; RV64IM-NEXT: rem a0, a0, a1
1106
+ ; RV64IM-NEXT: slli a0, a0, 48
1107
+ ; RV64IM-NEXT: srai a0, a0, 48
1108
+ ; RV64IM-NEXT: ret
1109
+ %1 = srem i16 %a , %b
1110
+ ret i16 %1
1111
+ }
1112
+
1051
1113
define i32 @aext_remuw_aext_aext (i32 %a , i32 %b ) nounwind {
1052
1114
; RV64IM-LABEL: aext_remuw_aext_aext:
1053
1115
; RV64IM: # %bb.0:
@@ -1306,3 +1368,21 @@ define zeroext i32 @zext_remuw_zext_zext(i32 zeroext %a, i32 zeroext %b) nounwin
1306
1368
%1 = urem i32 %a , %b
1307
1369
ret i32 %1
1308
1370
}
1371
+
1372
+ define zeroext i8 @zext_remuw_zext_zext_i8 (i8 zeroext %a , i8 zeroext %b ) nounwind {
1373
+ ; RV64IM-LABEL: zext_remuw_zext_zext_i8:
1374
+ ; RV64IM: # %bb.0:
1375
+ ; RV64IM-NEXT: remu a0, a0, a1
1376
+ ; RV64IM-NEXT: ret
1377
+ %1 = urem i8 %a , %b
1378
+ ret i8 %1
1379
+ }
1380
+
1381
+ define zeroext i16 @zext_remuw_zext_zext_i16 (i16 zeroext %a , i16 zeroext %b ) nounwind {
1382
+ ; RV64IM-LABEL: zext_remuw_zext_zext_i16:
1383
+ ; RV64IM: # %bb.0:
1384
+ ; RV64IM-NEXT: remu a0, a0, a1
1385
+ ; RV64IM-NEXT: ret
1386
+ %1 = urem i16 %a , %b
1387
+ ret i16 %1
1388
+ }
0 commit comments