@@ -669,19 +669,19 @@ let Predicates = [HasVendorXCValu, IsRV32] in {
669669// Patterns for load & store operations
670670//===----------------------------------------------------------------------===//
671671class CVLdrrPat<PatFrag LoadOp, RVInst Inst>
672- : Pat<(XLenVT (LoadOp CVrr:$regreg)),
672+ : Pat<(i32 (LoadOp CVrr:$regreg)),
673673 (Inst CVrr:$regreg)>;
674674
675675class CVStriPat<PatFrag StoreOp, RVInst Inst>
676- : Pat<(StoreOp (XLenVT GPR:$rs2), GPR:$rs1, simm12_lo:$imm12),
676+ : Pat<(StoreOp (i32 GPR:$rs2), GPR:$rs1, simm12_lo:$imm12),
677677 (Inst GPR:$rs2, GPR:$rs1, simm12_lo:$imm12)>;
678678
679679class CVStrriPat<PatFrag StoreOp, RVInst Inst>
680- : Pat<(StoreOp (XLenVT GPR:$rs2), GPR:$rs1, GPR:$rs3),
680+ : Pat<(StoreOp (i32 GPR:$rs2), GPR:$rs1, GPR:$rs3),
681681 (Inst GPR:$rs2, GPR:$rs1, GPR:$rs3)>;
682682
683683class CVStrrPat<PatFrag StoreOp, RVInst Inst>
684- : Pat<(StoreOp (XLenVT GPR:$rs2), CVrr:$regreg),
684+ : Pat<(StoreOp (i32 GPR:$rs2), CVrr:$regreg),
685685 (Inst GPR:$rs2, CVrr:$regreg)>;
686686
687687let Predicates = [HasVendorXCVmem, IsRV32], AddedComplexity = 1 in {
@@ -725,17 +725,17 @@ let Predicates = [HasVendorXCVbitmanip, IsRV32] in {
725725 (CV_INSERT GPR:$rd, GPR:$rs1, (CV_HI5 cv_uimm10:$imm),
726726 (CV_LO5 cv_uimm10:$imm))>;
727727
728- def : PatGpr<cttz, CV_FF1>;
729- def : PatGpr<ctlz, CV_FL1>;
728+ def : PatGpr<cttz, CV_FF1, i32 >;
729+ def : PatGpr<ctlz, CV_FL1, i32 >;
730730 def : PatGpr<int_riscv_cv_bitmanip_clb, CV_CLB>;
731- def : PatGpr<ctpop, CV_CNT>;
731+ def : PatGpr<ctpop, CV_CNT, i32 >;
732732
733- def : PatGprGpr<rotr, CV_ROR>;
733+ def : PatGprGpr<rotr, CV_ROR, i32 >;
734734
735735 def : Pat<(int_riscv_cv_bitmanip_bitrev GPR:$rs1, cv_tuimm5:$pts,
736736 cv_tuimm2:$radix),
737737 (CV_BITREV GPR:$rs1, cv_tuimm2:$radix, cv_tuimm5:$pts)>;
738- def : Pat<(bitreverse (XLenVT GPR:$rs)), (CV_BITREV GPR:$rs, 0, 0)>;
738+ def : Pat<(bitreverse (i32 GPR:$rs)), (CV_BITREV GPR:$rs, 0, 0)>;
739739}
740740
741741class PatCoreVAluGpr<string intr, string asm> :
@@ -760,18 +760,18 @@ multiclass PatCoreVAluGprGprImm<Intrinsic intr> {
760760}
761761
762762let Predicates = [HasVendorXCValu, IsRV32], AddedComplexity = 1 in {
763- def : PatGpr<abs, CV_ABS>;
764- def : PatGprGpr<setle, CV_SLE>;
765- def : PatGprGpr<setule, CV_SLEU>;
766- def : PatGprGpr<smin, CV_MIN>;
767- def : PatGprGpr<umin, CV_MINU>;
768- def : PatGprGpr<smax, CV_MAX>;
769- def : PatGprGpr<umax, CV_MAXU>;
770-
771- def : Pat<(sext_inreg (XLenVT GPR:$rs1), i16), (CV_EXTHS GPR:$rs1)>;
772- def : Pat<(sext_inreg (XLenVT GPR:$rs1), i8), (CV_EXTBS GPR:$rs1)>;
773- def : Pat<(and (XLenVT GPR:$rs1), 0xffff), (CV_EXTHZ GPR:$rs1)>;
774- def : Pat<(and (XLenVT GPR:$rs1), 0xff), (CV_EXTBZ GPR:$rs1)>;
763+ def : PatGpr<abs, CV_ABS, i32 >;
764+ def : PatGprGpr<setle, CV_SLE, i32 >;
765+ def : PatGprGpr<setule, CV_SLEU, i32 >;
766+ def : PatGprGpr<smin, CV_MIN, i32 >;
767+ def : PatGprGpr<umin, CV_MINU, i32 >;
768+ def : PatGprGpr<smax, CV_MAX, i32 >;
769+ def : PatGprGpr<umax, CV_MAXU, i32 >;
770+
771+ def : Pat<(sext_inreg (i32 GPR:$rs1), i16), (CV_EXTHS GPR:$rs1)>;
772+ def : Pat<(sext_inreg (i32 GPR:$rs1), i8), (CV_EXTBS GPR:$rs1)>;
773+ def : Pat<(and (i32 GPR:$rs1), 0xffff), (CV_EXTHZ GPR:$rs1)>;
774+ def : Pat<(and (i32 GPR:$rs1), 0xff), (CV_EXTBZ GPR:$rs1)>;
775775
776776 defm CLIP : PatCoreVAluGprImm<int_riscv_cv_alu_clip>;
777777 defm CLIPU : PatCoreVAluGprImm<int_riscv_cv_alu_clipu>;
@@ -790,9 +790,9 @@ let Predicates = [HasVendorXCValu, IsRV32], AddedComplexity = 1 in {
790790//===----------------------------------------------------------------------===//
791791
792792let Predicates = [HasVendorXCVbi, IsRV32], AddedComplexity = 2 in {
793- def : Pat<(riscv_brcc GPR:$rs1, simm5:$imm5, SETEQ, bb:$imm12),
793+ def : Pat<(riscv_brcc (i32 GPR:$rs1) , simm5:$imm5, SETEQ, bb:$imm12),
794794 (CV_BEQIMM GPR:$rs1, simm5:$imm5, bare_simm13_lsb0_bb:$imm12)>;
795- def : Pat<(riscv_brcc GPR:$rs1, simm5:$imm5, SETNE, bb:$imm12),
795+ def : Pat<(riscv_brcc (i32 GPR:$rs1) , simm5:$imm5, SETNE, bb:$imm12),
796796 (CV_BNEIMM GPR:$rs1, simm5:$imm5, bare_simm13_lsb0_bb:$imm12)>;
797797
798798 defm CC_SImm5_CV : SelectCC_GPR_riirr<GPR, simm5>;
0 commit comments