@@ -4685,8 +4685,30 @@ class sve_int_un_pred_arit<bits<2> sz8_64, bits<4> opc,
46854685 let hasSideEffects = 0;
46864686}
46874687
4688- multiclass sve_int_un_pred_arit_0<bits<3> opc, string asm,
4689- SDPatternOperator op> {
4688+ class sve_int_un_pred_arit_z<bits<2> sz8_64, bits<4> opc,
4689+ string asm, ZPRRegOp zprty>
4690+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
4691+ asm, "\t$Zd, $Pg/z, $Zn",
4692+ "",
4693+ []>, Sched<[]> {
4694+ bits<3> Pg;
4695+ bits<5> Zd;
4696+ bits<5> Zn;
4697+ let Inst{31-24} = 0b00000100;
4698+ let Inst{23-22} = sz8_64;
4699+ let Inst{21-20} = 0b00;
4700+ let Inst{19} = opc{0};
4701+ let Inst{18-16} = opc{3-1};
4702+ let Inst{15-13} = 0b101;
4703+ let Inst{12-10} = Pg;
4704+ let Inst{9-5} = Zn;
4705+ let Inst{4-0} = Zd;
4706+
4707+ let hasSideEffects = 0;
4708+ }
4709+
4710+ multiclass sve_int_un_pred_arit<bits<3> opc, string asm,
4711+ SDPatternOperator op> {
46904712 def _B : sve_int_un_pred_arit<0b00, { opc, 0b0 }, asm, ZPR8>,
46914713 SVEPseudo2Instr<NAME # _B, 1>;
46924714 def _H : sve_int_un_pred_arit<0b01, { opc, 0b0 }, asm, ZPR16>,
@@ -4712,8 +4734,15 @@ multiclass sve_int_un_pred_arit_0<bits<3> opc, string asm,
47124734 defm : SVE_1_Op_PassthruUndef_Pat<nxv2i64, op, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
47134735}
47144736
4715- multiclass sve_int_un_pred_arit_0_h<bits<3> opc, string asm,
4716- SDPatternOperator op> {
4737+ multiclass sve_int_un_pred_arit_z<bits<3> opc, string asm> {
4738+ def _B : sve_int_un_pred_arit_z<0b00, { opc, 0b0 }, asm, ZPR8>;
4739+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4740+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4741+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4742+ }
4743+
4744+ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4745+ SDPatternOperator op> {
47174746 def _H : sve_int_un_pred_arit<0b01, { opc, 0b0 }, asm, ZPR16>,
47184747 SVEPseudo2Instr<NAME # _H, 1>;
47194748 def _S : sve_int_un_pred_arit<0b10, { opc, 0b0 }, asm, ZPR32>,
@@ -4734,8 +4763,14 @@ multiclass sve_int_un_pred_arit_0_h<bits<3> opc, string asm,
47344763 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
47354764}
47364765
4737- multiclass sve_int_un_pred_arit_0_w<bits<3> opc, string asm,
4738- SDPatternOperator op> {
4766+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4767+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4768+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4769+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4770+ }
4771+
4772+ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
4773+ SDPatternOperator op> {
47394774 def _S : sve_int_un_pred_arit<0b10, { opc, 0b0 }, asm, ZPR32>,
47404775 SVEPseudo2Instr<NAME # _S, 1>;
47414776 def _D : sve_int_un_pred_arit<0b11, { opc, 0b0 }, asm, ZPR64>,
@@ -4751,8 +4786,13 @@ multiclass sve_int_un_pred_arit_0_w<bits<3> opc, string asm,
47514786 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
47524787}
47534788
4754- multiclass sve_int_un_pred_arit_0_d<bits<3> opc, string asm,
4755- SDPatternOperator op> {
4789+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4790+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4791+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4792+ }
4793+
4794+ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
4795+ SDPatternOperator op> {
47564796 def _D : sve_int_un_pred_arit<0b11, { opc, 0b0 }, asm, ZPR64>,
47574797 SVEPseudo2Instr<NAME # _D, 1>;
47584798
@@ -4763,8 +4803,8 @@ multiclass sve_int_un_pred_arit_0_d<bits<3> opc, string asm,
47634803 defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
47644804}
47654805
4766- multiclass sve_int_un_pred_arit_1 <bits<3> opc, string asm,
4767- SDPatternOperator op> {
4806+ multiclass sve_int_un_pred_arit_bitwise <bits<3> opc, string asm,
4807+ SDPatternOperator op> {
47684808 def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
47694809 SVEPseudo2Instr<NAME # _B, 1>;
47704810 def _H : sve_int_un_pred_arit<0b01, { opc, 0b1 }, asm, ZPR16>,
@@ -4790,7 +4830,15 @@ multiclass sve_int_un_pred_arit_1<bits<3> opc, string asm,
47904830 defm : SVE_1_Op_PassthruUndef_Pat<nxv2i64, op, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
47914831}
47924832
4793- multiclass sve_int_un_pred_arit_1_fp<bits<3> opc, string asm, SDPatternOperator op> {
4833+ multiclass sve_int_un_pred_arit_bitwise_z<bits<3> opc, string asm> {
4834+ def _B : sve_int_un_pred_arit_z<0b00, { opc, 0b1 }, asm, ZPR8>;
4835+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b1 }, asm, ZPR16>;
4836+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b1 }, asm, ZPR32>;
4837+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b1 }, asm, ZPR64>;
4838+ }
4839+
4840+ multiclass sve_int_un_pred_arit_bitwise_fp<bits<3> opc, string asm,
4841+ SDPatternOperator op> {
47944842 def _H : sve_int_un_pred_arit<0b01, { opc, 0b1 }, asm, ZPR16>,
47954843 SVEPseudo2Instr<NAME # _H, 1>;
47964844 def _S : sve_int_un_pred_arit<0b10, { opc, 0b1 }, asm, ZPR32>,
@@ -4817,6 +4865,12 @@ multiclass sve_int_un_pred_arit_1_fp<bits<3> opc, string asm, SDPatternOperator
48174865 defm : SVE_1_Op_PassthruUndef_Pat<nxv2f64, op, nxv2i1, nxv2f64, !cast<Pseudo>(NAME # _D_UNDEF)>;
48184866}
48194867
4868+ multiclass sve_int_un_pred_arit_bitwise_fp_z<bits<3> opc, string asm> {
4869+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b1 }, asm, ZPR16>;
4870+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b1 }, asm, ZPR32>;
4871+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b1 }, asm, ZPR64>;
4872+ }
4873+
48204874//===----------------------------------------------------------------------===//
48214875// SVE Integer Wide Immediate - Unpredicated Group
48224876//===----------------------------------------------------------------------===//
0 commit comments