@@ -648,45 +648,46 @@ multiclass VPatReductionVL<SDNode vop, string instruction_name, bit is_float> {
648
648
}
649
649
}
650
650
651
- multiclass VPatBinarySDNodeExt_V_WV <SDNode op, PatFrags extop, string instruction_name> {
651
+ multiclass VPatBinarySDNodeExt_V_WV_WX <SDNode op, PatFrags extop, string instruction_name> {
652
652
foreach vti = AllWidenableIntVectors in {
653
653
def : Pat<
654
654
(vti.Vti.Vector
655
655
(riscv_trunc_vector_vl
656
656
(op (vti.Wti.Vector vti.Wti.RegClass:$rs2),
657
657
(vti.Wti.Vector (extop (vti.Vti.Vector vti.Vti.RegClass:$rs1)))),
658
- (riscv_vmset_vl X0 ),
659
- X0 )),
658
+ (riscv_vmset_vl VLOpFrag ),
659
+ VLOpFrag )),
660
660
(!cast<Instruction>(instruction_name#"_WV_"#vti.Vti.LMul.MX)
661
661
vti.Wti.RegClass:$rs2, vti.Vti.RegClass:$rs1,
662
662
vti.Vti.AVL, vti.Vti.Log2SEW)>;
663
- }
664
- }
665
-
666
- multiclass VPatBinarySDNodeExt_V_WX<SDNode op, PatFrags extop, string instruction_name> {
667
- foreach vti = AllWidenableIntVectors in {
668
663
def : Pat<
669
664
(vti.Vti.Vector
670
665
(riscv_trunc_vector_vl
671
666
(op (vti.Wti.Vector vti.Wti.RegClass:$rs2),
672
667
(vti.Wti.Vector (extop (vti.Vti.Vector (SplatPat GPR:$rs1))))),
673
- (riscv_vmset_vl X0 ),
674
- X0 )),
668
+ (riscv_vmset_vl VLOpFrag ),
669
+ VLOpFrag )),
675
670
(!cast<Instruction>(instruction_name#"_WX_"#vti.Vti.LMul.MX)
676
671
vti.Wti.RegClass:$rs2, GPR:$rs1,
677
672
vti.Vti.AVL, vti.Vti.Log2SEW)>;
678
673
}
679
674
}
680
675
681
-
682
- multiclass VPatBinarySDNode_V_WV<SDNode op, string instruction_name> {
683
- defm : VPatBinarySDNodeExt_V_WV<op, sext_oneuse, instruction_name>;
684
- defm : VPatBinarySDNodeExt_V_WV<op, zext_oneuse, instruction_name>;
685
- }
686
-
687
- multiclass VPatBinarySDNode_V_WX<SDNode op, string instruction_name> {
688
- defm : VPatBinarySDNodeExt_V_WX<op, sext_oneuse, instruction_name>;
689
- defm : VPatBinarySDNodeExt_V_WX<op, zext_oneuse, instruction_name>;
676
+ multiclass VPatBinarySDNode_V_WV_WX_WI<SDNode op, string instruction_name> {
677
+ defm : VPatBinarySDNodeExt_V_WV_WX<op, sext_oneuse, instruction_name>;
678
+ defm : VPatBinarySDNodeExt_V_WV_WX<op, zext_oneuse, instruction_name>;
679
+ foreach vti = AllWidenableIntVectors in {
680
+ def : Pat<
681
+ (vti.Vti.Vector
682
+ (riscv_trunc_vector_vl
683
+ (op (vti.Wti.Vector vti.Wti.RegClass:$rs2),
684
+ (vti.Wti.Vector (SplatPat_uimm5 uimm5:$rs1))),
685
+ (riscv_vmset_vl VLOpFrag),
686
+ VLOpFrag)),
687
+ (!cast<Instruction>(instruction_name#"_WI_"#vti.Vti.LMul.MX)
688
+ vti.Wti.RegClass:$rs2, uimm5:$rs1,
689
+ vti.Vti.AVL, vti.Vti.Log2SEW)>;
690
+ }
690
691
}
691
692
692
693
multiclass VPatWidenReductionVL<SDNode vop, PatFrags extop, string instruction_name, bit is_float> {
@@ -796,10 +797,8 @@ foreach vti = AllIntegerVectors in {
796
797
}
797
798
798
799
// 12.7. Vector Narrowing Integer Right Shift Instructions
799
- defm : VPatBinarySDNode_V_WV<srl, "PseudoVNSRL">;
800
- defm : VPatBinarySDNode_V_WX<srl, "PseudoVNSRL">;
801
- defm : VPatBinarySDNode_V_WV<sra, "PseudoVNSRA">;
802
- defm : VPatBinarySDNode_V_WX<sra, "PseudoVNSRA">;
800
+ defm : VPatBinarySDNode_V_WV_WX_WI<srl, "PseudoVNSRL">;
801
+ defm : VPatBinarySDNode_V_WV_WX_WI<sra, "PseudoVNSRA">;
803
802
804
803
foreach vtiTowti = AllWidenableIntVectors in {
805
804
defvar vti = vtiTowti.Vti;
0 commit comments