@@ -662,6 +662,17 @@ multiclass SVE_InReg_Extend_PassthruUndef<ValueType vt, SDPatternOperator op, Va
662
662
(inst $PassThru, $Pg, $Src)>;
663
663
}
664
664
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
+
665
676
class SVE_Shift_DupImm_Pred_Pat<ValueType vt, SDPatternOperator op,
666
677
ValueType pt, ValueType it,
667
678
ComplexPattern cast, Instruction inst>
@@ -4930,10 +4941,14 @@ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4930
4941
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
4931
4942
}
4932
4943
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 > {
4934
4945
def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4935
4946
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4936
4947
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)>;
4937
4952
}
4938
4953
4939
4954
multiclass 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,
4953
4968
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
4954
4969
}
4955
4970
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 > {
4957
4972
def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4958
4973
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)>;
4959
4977
}
4960
4978
4961
4979
multiclass 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,
4970
4988
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
4971
4989
}
4972
4990
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
+
4973
4997
multiclass sve_int_un_pred_arit_bitwise<bits<3> opc, string asm,
4974
4998
SDPatternOperator op> {
4975
4999
def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
0 commit comments