@@ -651,6 +651,11 @@ multiclass SVE_InReg_Extend_PassthruUndef<ValueType vt, SDPatternOperator op, Va
651
651
(inst $PassThru, $Pg, $Src)>;
652
652
}
653
653
654
+ class SVE_InReg_Extend_PassthruUndefZero<ValueType vt, SDPatternOperator op, ValueType pt,
655
+ ValueType inreg_vt, Instruction inst>
656
+ : Pat<(vt (op pt:$Pg, vt:$Src, inreg_vt, (vt (SVEDup0Undef)))),
657
+ (inst $Pg, $Src)>;
658
+
654
659
class SVE_Shift_DupImm_Pred_Pat<ValueType vt, SDPatternOperator op,
655
660
ValueType pt, ValueType it,
656
661
ComplexPattern cast, Instruction inst>
@@ -4926,10 +4931,14 @@ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4926
4931
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
4927
4932
}
4928
4933
4929
- multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4934
+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm, SDPatternOperator op > {
4930
4935
def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4931
4936
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4932
4937
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4938
+
4939
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv8i16, op, nxv8i1, nxv8i8, !cast<Instruction>(NAME # _H)>;
4940
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i8, !cast<Instruction>(NAME # _S)>;
4941
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i8, !cast<Instruction>(NAME # _D)>;
4933
4942
}
4934
4943
4935
4944
multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
@@ -4949,9 +4958,12 @@ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
4949
4958
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
4950
4959
}
4951
4960
4952
- multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4961
+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm, SDPatternOperator op > {
4953
4962
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4954
4963
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4964
+
4965
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i16, !cast<Instruction>(NAME # _S)>;
4966
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i16, !cast<Instruction>(NAME # _D)>;
4955
4967
}
4956
4968
4957
4969
multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
@@ -4966,6 +4978,12 @@ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
4966
4978
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
4967
4979
}
4968
4980
4981
+ multiclass sve_int_un_pred_arit_d_z<bits<3> opc, string asm, SDPatternOperator op> {
4982
+ def _D : sve_int_un_pred_arit_z<0b11, {opc, 0b0}, asm, ZPR64>;
4983
+
4984
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i32, !cast<Instruction>(NAME # _D)>;
4985
+ }
4986
+
4969
4987
multiclass sve_int_un_pred_arit_bitwise<bits<3> opc, string asm,
4970
4988
SDPatternOperator op> {
4971
4989
def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
0 commit comments