@@ -3895,7 +3895,7 @@ multiclass sve2_int_sadd_long_accum_pairwise<bit U, string asm, SDPatternOperato
38953895 def : SVE_3_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, nxv4i32, !cast<Instruction>(NAME # _D)>;
38963896}
38973897
3898- class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
3898+ class sve2_int_un_pred_arit<bits<2> sz, bits<2> opc,
38993899 string asm, ZPRRegOp zprty>
39003900: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
39013901 asm, "\t$Zd, $Pg/m, $Zn",
@@ -3907,23 +3907,44 @@ class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
39073907 let Inst{31-24} = 0b01000100;
39083908 let Inst{23-22} = sz;
39093909 let Inst{21-20} = 0b00;
3910- let Inst{19} = Q ;
3911- let Inst{18} = 0b0 ;
3912- let Inst{17- 16} = opc;
3910+ let Inst{19} = opc{1} ;
3911+ let Inst{18-17} = 0b00 ;
3912+ let Inst{16} = opc{0} ;
39133913 let Inst{15-13} = 0b101;
39143914 let Inst{12-10} = Pg;
39153915 let Inst{9-5} = Zn;
39163916 let Inst{4-0} = Zd;
3917-
39183917 let Constraints = "$Zd = $_Zd";
39193918 let DestructiveInstType = DestructiveUnaryPassthru;
39203919 let ElementSize = zprty.ElementSize;
39213920 let hasSideEffects = 0;
39223921}
39233922
3924- multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
3923+ class sve2_int_un_pred_arit_z<bits<2> sz, bits<2> opc,
3924+ string asm, ZPRRegOp zprty>
3925+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
3926+ asm, "\t$Zd, $Pg/z, $Zn",
3927+ "",
3928+ []>, Sched<[]> {
3929+ bits<3> Pg;
3930+ bits<5> Zd;
3931+ bits<5> Zn;
3932+ let Inst{31-24} = 0b01000100;
3933+ let Inst{23-22} = sz;
3934+ let Inst{21-20} = 0b00;
3935+ let Inst{19} = opc{1};
3936+ let Inst{18-17} = 0b01;
3937+ let Inst{16} = opc{0};
3938+ let Inst{15-13} = 0b101;
3939+ let Inst{12-10} = Pg;
3940+ let Inst{9-5} = Zn;
3941+ let Inst{4-0} = Zd;
3942+ let hasSideEffects = 0;
3943+ }
3944+
3945+ multiclass sve2_int_un_pred_arit_s<bits<2> opc, string asm,
39253946 SDPatternOperator op> {
3926- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3947+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
39273948 SVEPseudo2Instr<NAME # _S, 1>;
39283949
39293950 def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Instruction>(NAME # _S)>;
@@ -3933,14 +3954,14 @@ multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
39333954 defm : SVE_3_Op_Undef_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Pseudo>(NAME # _S_UNDEF)>;
39343955}
39353956
3936- multiclass sve2_int_un_pred_arit<bits<3 > opc, string asm, SDPatternOperator op> {
3937- def _B : sve2_int_un_pred_arit<0b00, opc{2}, opc{1-0} , asm, ZPR8>,
3957+ multiclass sve2_int_un_pred_arit<bits<2 > opc, string asm, SDPatternOperator op> {
3958+ def _B : sve2_int_un_pred_arit<0b00, opc, asm, ZPR8>,
39383959 SVEPseudo2Instr<NAME # _B, 1>;
3939- def _H : sve2_int_un_pred_arit<0b01, opc{2}, opc{1-0} , asm, ZPR16>,
3960+ def _H : sve2_int_un_pred_arit<0b01, opc, asm, ZPR16>,
39403961 SVEPseudo2Instr<NAME # _H, 1>;
3941- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3962+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
39423963 SVEPseudo2Instr<NAME # _S, 1>;
3943- def _D : sve2_int_un_pred_arit<0b11, opc{2}, opc{1-0} , asm, ZPR64>,
3964+ def _D : sve2_int_un_pred_arit<0b11, opc, asm, ZPR64>,
39443965 SVEPseudo2Instr<NAME # _D, 1>;
39453966
39463967 def : SVE_3_Op_Pat<nxv16i8, op, nxv16i8, nxv16i1, nxv16i8, !cast<Instruction>(NAME # _B)>;
@@ -3959,6 +3980,13 @@ multiclass sve2_int_un_pred_arit<bits<3> opc, string asm, SDPatternOperator op>
39593980 defm : SVE_3_Op_Undef_Pat<nxv2i64, op, nxv2i64, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
39603981}
39613982
3983+ multiclass sve2_int_un_pred_arit_z<bits<2> opc, string asm> {
3984+ def _B : sve2_int_un_pred_arit_z<0b00, opc, asm, ZPR8>;
3985+ def _H : sve2_int_un_pred_arit_z<0b01, opc, asm, ZPR16>;
3986+ def _S : sve2_int_un_pred_arit_z<0b10, opc, asm, ZPR32>;
3987+ def _D : sve2_int_un_pred_arit_z<0b11, opc, asm, ZPR64>;
3988+ }
3989+
39623990//===----------------------------------------------------------------------===//
39633991// SVE2 Widening Integer Arithmetic Group
39643992//===----------------------------------------------------------------------===//
0 commit comments