@@ -662,6 +662,17 @@ multiclass SVE_InReg_Extend_PassthruUndef<ValueType vt, SDPatternOperator op, Va
662662 (inst $PassThru, $Pg, $Src)>;
663663}
664664
665+ multiclass SVE_InReg_Extend_PassthruUndefZero<ValueType vt, SDPatternOperator op, ValueType pt,
666+ ValueType inreg_vt, Instruction inst> {
667+ let AddedComplexity = 1 in {
668+ def : Pat<(vt (op pt:$Pg, vt:$Src, inreg_vt, (vt (SVEDup0Undef)))),
669+ (inst $Pg, $Src)>;
670+
671+ def : Pat<(vt (op (pt (SVEAllActive:$Pg)), vt:$Src, inreg_vt, (vt (SVEAny)))),
672+ (inst $Pg, $Src)>;
673+ }
674+ }
675+
665676class SVE_Shift_DupImm_Pred_Pat<ValueType vt, SDPatternOperator op,
666677 ValueType pt, ValueType it,
667678 ComplexPattern cast, Instruction inst>
@@ -4930,10 +4941,14 @@ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
49304941 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
49314942}
49324943
4933- multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4944+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm, SDPatternOperator op > {
49344945 def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
49354946 def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
49364947 def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4948+
4949+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv8i16, op, nxv8i1, nxv8i8, !cast<Instruction>(NAME # _H)>;
4950+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i8, !cast<Instruction>(NAME # _S)>;
4951+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i8, !cast<Instruction>(NAME # _D)>;
49374952}
49384953
49394954multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
@@ -4953,9 +4968,12 @@ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
49534968 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
49544969}
49554970
4956- multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4971+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm, SDPatternOperator op > {
49574972 def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
49584973 def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4974+
4975+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i16, !cast<Instruction>(NAME # _S)>;
4976+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i16, !cast<Instruction>(NAME # _D)>;
49594977}
49604978
49614979multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
@@ -4970,6 +4988,12 @@ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
49704988 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
49714989}
49724990
4991+ multiclass sve_int_un_pred_arit_d_z<bits<3> opc, string asm, SDPatternOperator op> {
4992+ def _D : sve_int_un_pred_arit_z<0b11, {opc, 0b0}, asm, ZPR64>;
4993+
4994+ defm : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i32, !cast<Instruction>(NAME # _D)>;
4995+ }
4996+
49734997multiclass sve_int_un_pred_arit_bitwise<bits<3> opc, string asm,
49744998 SDPatternOperator op> {
49754999 def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
0 commit comments