@@ -662,6 +662,11 @@ multiclass SVE_InReg_Extend_PassthruUndef<ValueType vt, SDPatternOperator op, Va
662
662
(inst $PassThru, $Pg, $Src)>;
663
663
}
664
664
665
+ class SVE_InReg_Extend_PassthruUndefZero<ValueType vt, SDPatternOperator op, ValueType pt,
666
+ ValueType inreg_vt, Instruction inst>
667
+ : Pat<(vt (op pt:$Pg, vt:$Src, inreg_vt, (vt (SVEDup0Undef)))),
668
+ (inst $Pg, $Src)>;
669
+
665
670
class SVE_Shift_DupImm_Pred_Pat<ValueType vt, SDPatternOperator op,
666
671
ValueType pt, ValueType it,
667
672
ComplexPattern cast, Instruction inst>
@@ -4947,10 +4952,14 @@ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4947
4952
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
4948
4953
}
4949
4954
4950
- multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4955
+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm, SDPatternOperator op > {
4951
4956
def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4952
4957
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4953
4958
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4959
+
4960
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv8i16, op, nxv8i1, nxv8i8, !cast<Instruction>(NAME # _H)>;
4961
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i8, !cast<Instruction>(NAME # _S)>;
4962
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i8, !cast<Instruction>(NAME # _D)>;
4954
4963
}
4955
4964
4956
4965
multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
@@ -4970,9 +4979,12 @@ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
4970
4979
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
4971
4980
}
4972
4981
4973
- multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4982
+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm, SDPatternOperator op > {
4974
4983
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4975
4984
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4985
+
4986
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i16, !cast<Instruction>(NAME # _S)>;
4987
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i16, !cast<Instruction>(NAME # _D)>;
4976
4988
}
4977
4989
4978
4990
multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
@@ -4987,6 +4999,12 @@ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
4987
4999
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
4988
5000
}
4989
5001
5002
+ multiclass sve_int_un_pred_arit_d_z<bits<3> opc, string asm, SDPatternOperator op> {
5003
+ def _D : sve_int_un_pred_arit_z<0b11, {opc, 0b0}, asm, ZPR64>;
5004
+
5005
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i32, !cast<Instruction>(NAME # _D)>;
5006
+ }
5007
+
4990
5008
multiclass sve_int_un_pred_arit_bitwise<bits<3> opc, string asm,
4991
5009
SDPatternOperator op> {
4992
5010
def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
0 commit comments