@@ -3964,7 +3964,7 @@ multiclass sve2_int_sadd_long_accum_pairwise<bit U, string asm, SDPatternOperato
39643964 def : SVE_3_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, nxv4i32, !cast<Instruction>(NAME # _D)>;
39653965}
39663966
3967- class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
3967+ class sve2_int_un_pred_arit<bits<2> sz, bits<2> opc,
39683968 string asm, ZPRRegOp zprty>
39693969: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
39703970 asm, "\t$Zd, $Pg/m, $Zn",
@@ -3976,23 +3976,44 @@ class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
39763976 let Inst{31-24} = 0b01000100;
39773977 let Inst{23-22} = sz;
39783978 let Inst{21-20} = 0b00;
3979- let Inst{19} = Q ;
3980- let Inst{18} = 0b0 ;
3981- let Inst{17- 16} = opc;
3979+ let Inst{19} = opc{1} ;
3980+ let Inst{18-17} = 0b00 ;
3981+ let Inst{16} = opc{0} ;
39823982 let Inst{15-13} = 0b101;
39833983 let Inst{12-10} = Pg;
39843984 let Inst{9-5} = Zn;
39853985 let Inst{4-0} = Zd;
3986-
39873986 let Constraints = "$Zd = $_Zd";
39883987 let DestructiveInstType = DestructiveUnaryPassthru;
39893988 let ElementSize = zprty.ElementSize;
39903989 let hasSideEffects = 0;
39913990}
39923991
3993- multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
3992+ class sve2_int_un_pred_arit_z<bits<2> sz, bits<2> opc,
3993+ string asm, ZPRRegOp zprty>
3994+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
3995+ asm, "\t$Zd, $Pg/z, $Zn",
3996+ "",
3997+ []>, Sched<[]> {
3998+ bits<3> Pg;
3999+ bits<5> Zd;
4000+ bits<5> Zn;
4001+ let Inst{31-24} = 0b01000100;
4002+ let Inst{23-22} = sz;
4003+ let Inst{21-20} = 0b00;
4004+ let Inst{19} = opc{1};
4005+ let Inst{18-17} = 0b01;
4006+ let Inst{16} = opc{0};
4007+ let Inst{15-13} = 0b101;
4008+ let Inst{12-10} = Pg;
4009+ let Inst{9-5} = Zn;
4010+ let Inst{4-0} = Zd;
4011+ let hasSideEffects = 0;
4012+ }
4013+
4014+ multiclass sve2_int_un_pred_arit_s<bits<2> opc, string asm,
39944015 SDPatternOperator op> {
3995- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
4016+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
39964017 SVEPseudo2Instr<NAME # _S, 1>;
39974018
39984019 def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Instruction>(NAME # _S)>;
@@ -4002,14 +4023,14 @@ multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
40024023 defm : SVE_3_Op_Undef_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Pseudo>(NAME # _S_UNDEF)>;
40034024}
40044025
4005- multiclass sve2_int_un_pred_arit<bits<3 > opc, string asm, SDPatternOperator op> {
4006- def _B : sve2_int_un_pred_arit<0b00, opc{2}, opc{1-0} , asm, ZPR8>,
4026+ multiclass sve2_int_un_pred_arit<bits<2 > opc, string asm, SDPatternOperator op> {
4027+ def _B : sve2_int_un_pred_arit<0b00, opc, asm, ZPR8>,
40074028 SVEPseudo2Instr<NAME # _B, 1>;
4008- def _H : sve2_int_un_pred_arit<0b01, opc{2}, opc{1-0} , asm, ZPR16>,
4029+ def _H : sve2_int_un_pred_arit<0b01, opc, asm, ZPR16>,
40094030 SVEPseudo2Instr<NAME # _H, 1>;
4010- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
4031+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
40114032 SVEPseudo2Instr<NAME # _S, 1>;
4012- def _D : sve2_int_un_pred_arit<0b11, opc{2}, opc{1-0} , asm, ZPR64>,
4033+ def _D : sve2_int_un_pred_arit<0b11, opc, asm, ZPR64>,
40134034 SVEPseudo2Instr<NAME # _D, 1>;
40144035
40154036 def : SVE_3_Op_Pat<nxv16i8, op, nxv16i8, nxv16i1, nxv16i8, !cast<Instruction>(NAME # _B)>;
@@ -4028,6 +4049,13 @@ multiclass sve2_int_un_pred_arit<bits<3> opc, string asm, SDPatternOperator op>
40284049 defm : SVE_3_Op_Undef_Pat<nxv2i64, op, nxv2i64, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
40294050}
40304051
4052+ multiclass sve2_int_un_pred_arit_z<bits<2> opc, string asm> {
4053+ def _B : sve2_int_un_pred_arit_z<0b00, opc, asm, ZPR8>;
4054+ def _H : sve2_int_un_pred_arit_z<0b01, opc, asm, ZPR16>;
4055+ def _S : sve2_int_un_pred_arit_z<0b10, opc, asm, ZPR32>;
4056+ def _D : sve2_int_un_pred_arit_z<0b11, opc, asm, ZPR64>;
4057+ }
4058+
40314059//===----------------------------------------------------------------------===//
40324060// SVE2 Widening Integer Arithmetic Group
40334061//===----------------------------------------------------------------------===//
0 commit comments