@@ -555,3 +555,93 @@ body: |
555
555
PseudoRET implicit $x10, implicit $x11
556
556
557
557
...
558
+ ---
559
+ name : udivrem_i32
560
+ body : |
561
+ bb.1.entry:
562
+ liveins: $x10, $x11
563
+
564
+ ; CHECK-I-LABEL: name: udivrem_i32
565
+ ; CHECK-I: liveins: $x10, $x11
566
+ ; CHECK-I-NEXT: {{ $}}
567
+ ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
568
+ ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
569
+ ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
570
+ ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s32)
571
+ ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s32)
572
+ ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__udivsi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
573
+ ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
574
+ ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
575
+ ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
576
+ ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s32)
577
+ ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s32)
578
+ ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__umodsi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
579
+ ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
580
+ ; CHECK-I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x10
581
+ ; CHECK-I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
582
+ ; CHECK-I-NEXT: $x10 = COPY [[ADD]](s32)
583
+ ; CHECK-I-NEXT: PseudoRET implicit $x10
584
+ ;
585
+ ; CHECK-M-LABEL: name: udivrem_i32
586
+ ; CHECK-M: liveins: $x10, $x11
587
+ ; CHECK-M-NEXT: {{ $}}
588
+ ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
589
+ ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
590
+ ; CHECK-M-NEXT: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[COPY]], [[COPY1]]
591
+ ; CHECK-M-NEXT: [[UREM:%[0-9]+]]:_(s32) = G_UREM [[COPY]], [[COPY1]]
592
+ ; CHECK-M-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[UDIV]], [[UREM]]
593
+ ; CHECK-M-NEXT: $x10 = COPY [[ADD]](s32)
594
+ ; CHECK-M-NEXT: PseudoRET implicit $x10
595
+ %0:_(s32) = COPY $x10
596
+ %1:_(s32) = COPY $x11
597
+ %2:_(s32), %3:_(s32) = G_UDIVREM %0, %1
598
+ %4:_(s32) = G_ADD %2, %3
599
+ $x10 = COPY %4(s32)
600
+ PseudoRET implicit $x10
601
+
602
+ ...
603
+ ---
604
+ name : sdivrem_i32
605
+ body : |
606
+ bb.1.entry:
607
+ liveins: $x10, $x11
608
+
609
+ ; CHECK-I-LABEL: name: sdivrem_i32
610
+ ; CHECK-I: liveins: $x10, $x11
611
+ ; CHECK-I-NEXT: {{ $}}
612
+ ; CHECK-I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
613
+ ; CHECK-I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
614
+ ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
615
+ ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s32)
616
+ ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s32)
617
+ ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__divsi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
618
+ ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
619
+ ; CHECK-I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
620
+ ; CHECK-I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
621
+ ; CHECK-I-NEXT: $x10 = COPY [[COPY]](s32)
622
+ ; CHECK-I-NEXT: $x11 = COPY [[COPY1]](s32)
623
+ ; CHECK-I-NEXT: PseudoCALL target-flags(riscv-call) &__modsi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
624
+ ; CHECK-I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
625
+ ; CHECK-I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x10
626
+ ; CHECK-I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
627
+ ; CHECK-I-NEXT: $x10 = COPY [[ADD]](s32)
628
+ ; CHECK-I-NEXT: PseudoRET implicit $x10
629
+ ;
630
+ ; CHECK-M-LABEL: name: sdivrem_i32
631
+ ; CHECK-M: liveins: $x10, $x11
632
+ ; CHECK-M-NEXT: {{ $}}
633
+ ; CHECK-M-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
634
+ ; CHECK-M-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
635
+ ; CHECK-M-NEXT: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[COPY]], [[COPY1]]
636
+ ; CHECK-M-NEXT: [[SREM:%[0-9]+]]:_(s32) = G_SREM [[COPY]], [[COPY1]]
637
+ ; CHECK-M-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[SDIV]], [[SREM]]
638
+ ; CHECK-M-NEXT: $x10 = COPY [[ADD]](s32)
639
+ ; CHECK-M-NEXT: PseudoRET implicit $x10
640
+ %0:_(s32) = COPY $x10
641
+ %1:_(s32) = COPY $x11
642
+ %2:_(s32), %3:_(s32) = G_SDIVREM %0, %1
643
+ %4:_(s32) = G_ADD %2, %3
644
+ $x10 = COPY %4(s32)
645
+ PseudoRET implicit $x10
646
+
647
+ ...
0 commit comments