@@ -3900,7 +3900,7 @@ multiclass sve2_int_sadd_long_accum_pairwise<bit U, string asm, SDPatternOperato
39003900 def : SVE_3_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, nxv4i32, !cast<Instruction>(NAME # _D)>;
39013901}
39023902
3903- class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
3903+ class sve2_int_un_pred_arit<bits<2> sz, bits<2> opc,
39043904 string asm, ZPRRegOp zprty>
39053905: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
39063906 asm, "\t$Zd, $Pg/m, $Zn",
@@ -3912,23 +3912,44 @@ class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
39123912 let Inst{31-24} = 0b01000100;
39133913 let Inst{23-22} = sz;
39143914 let Inst{21-20} = 0b00;
3915- let Inst{19} = Q ;
3916- let Inst{18} = 0b0 ;
3917- let Inst{17- 16} = opc;
3915+ let Inst{19} = opc{1} ;
3916+ let Inst{18-17} = 0b00 ;
3917+ let Inst{16} = opc{0} ;
39183918 let Inst{15-13} = 0b101;
39193919 let Inst{12-10} = Pg;
39203920 let Inst{9-5} = Zn;
39213921 let Inst{4-0} = Zd;
3922-
39233922 let Constraints = "$Zd = $_Zd";
39243923 let DestructiveInstType = DestructiveUnaryPassthru;
39253924 let ElementSize = zprty.ElementSize;
39263925 let hasSideEffects = 0;
39273926}
39283927
3929- multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
3928+ class sve2_int_un_pred_arit_z<bits<2> sz, bits<2> opc,
3929+ string asm, ZPRRegOp zprty>
3930+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
3931+ asm, "\t$Zd, $Pg/z, $Zn",
3932+ "",
3933+ []>, Sched<[]> {
3934+ bits<3> Pg;
3935+ bits<5> Zd;
3936+ bits<5> Zn;
3937+ let Inst{31-24} = 0b01000100;
3938+ let Inst{23-22} = sz;
3939+ let Inst{21-20} = 0b00;
3940+ let Inst{19} = opc{1};
3941+ let Inst{18-17} = 0b01;
3942+ let Inst{16} = opc{0};
3943+ let Inst{15-13} = 0b101;
3944+ let Inst{12-10} = Pg;
3945+ let Inst{9-5} = Zn;
3946+ let Inst{4-0} = Zd;
3947+ let hasSideEffects = 0;
3948+ }
3949+
3950+ multiclass sve2_int_un_pred_arit_s<bits<2> opc, string asm,
39303951 SDPatternOperator op> {
3931- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3952+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
39323953 SVEPseudo2Instr<NAME # _S, 1>;
39333954
39343955 def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Instruction>(NAME # _S)>;
@@ -3938,14 +3959,14 @@ multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
39383959 defm : SVE_3_Op_Undef_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Pseudo>(NAME # _S_UNDEF)>;
39393960}
39403961
3941- multiclass sve2_int_un_pred_arit<bits<3 > opc, string asm, SDPatternOperator op> {
3942- def _B : sve2_int_un_pred_arit<0b00, opc{2}, opc{1-0} , asm, ZPR8>,
3962+ multiclass sve2_int_un_pred_arit<bits<2 > opc, string asm, SDPatternOperator op> {
3963+ def _B : sve2_int_un_pred_arit<0b00, opc, asm, ZPR8>,
39433964 SVEPseudo2Instr<NAME # _B, 1>;
3944- def _H : sve2_int_un_pred_arit<0b01, opc{2}, opc{1-0} , asm, ZPR16>,
3965+ def _H : sve2_int_un_pred_arit<0b01, opc, asm, ZPR16>,
39453966 SVEPseudo2Instr<NAME # _H, 1>;
3946- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3967+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
39473968 SVEPseudo2Instr<NAME # _S, 1>;
3948- def _D : sve2_int_un_pred_arit<0b11, opc{2}, opc{1-0} , asm, ZPR64>,
3969+ def _D : sve2_int_un_pred_arit<0b11, opc, asm, ZPR64>,
39493970 SVEPseudo2Instr<NAME # _D, 1>;
39503971
39513972 def : SVE_3_Op_Pat<nxv16i8, op, nxv16i8, nxv16i1, nxv16i8, !cast<Instruction>(NAME # _B)>;
@@ -3964,6 +3985,13 @@ multiclass sve2_int_un_pred_arit<bits<3> opc, string asm, SDPatternOperator op>
39643985 defm : SVE_3_Op_Undef_Pat<nxv2i64, op, nxv2i64, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
39653986}
39663987
3988+ multiclass sve2_int_un_pred_arit_z<bits<2> opc, string asm> {
3989+ def _B : sve2_int_un_pred_arit_z<0b00, opc, asm, ZPR8>;
3990+ def _H : sve2_int_un_pred_arit_z<0b01, opc, asm, ZPR16>;
3991+ def _S : sve2_int_un_pred_arit_z<0b10, opc, asm, ZPR32>;
3992+ def _D : sve2_int_un_pred_arit_z<0b11, opc, asm, ZPR64>;
3993+ }
3994+
39673995//===----------------------------------------------------------------------===//
39683996// SVE2 Widening Integer Arithmetic Group
39693997//===----------------------------------------------------------------------===//
0 commit comments