@@ -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>
@@ -4899,10 +4904,14 @@ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4899
4904
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
4900
4905
}
4901
4906
4902
- multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4907
+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm, SDPatternOperator op > {
4903
4908
def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4904
4909
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4905
4910
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4911
+
4912
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv8i16, op, nxv8i1, nxv8i8, !cast<Instruction>(NAME # _H)>;
4913
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i8, !cast<Instruction>(NAME # _S)>;
4914
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i8, !cast<Instruction>(NAME # _D)>;
4906
4915
}
4907
4916
4908
4917
multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
@@ -4922,9 +4931,12 @@ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
4922
4931
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
4923
4932
}
4924
4933
4925
- multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4934
+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm, SDPatternOperator op > {
4926
4935
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4927
4936
def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4937
+
4938
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv4i32, op, nxv4i1, nxv4i16, !cast<Instruction>(NAME # _S)>;
4939
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i16, !cast<Instruction>(NAME # _D)>;
4928
4940
}
4929
4941
4930
4942
multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
@@ -4939,6 +4951,12 @@ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
4939
4951
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
4940
4952
}
4941
4953
4954
+ multiclass sve_int_un_pred_arit_d_z<bits<3> opc, string asm, SDPatternOperator op> {
4955
+ def _D : sve_int_un_pred_arit_z<0b11, {opc, 0b0}, asm, ZPR64>;
4956
+
4957
+ def : SVE_InReg_Extend_PassthruUndefZero<nxv2i64, op, nxv2i1, nxv2i32, !cast<Instruction>(NAME # _D)>;
4958
+ }
4959
+
4942
4960
multiclass sve_int_un_pred_arit_bitwise<bits<3> opc, string asm,
4943
4961
SDPatternOperator op> {
4944
4962
def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
0 commit comments