@@ -3900,7 +3900,7 @@ multiclass sve2_int_sadd_long_accum_pairwise<bit U, string asm, SDPatternOperato
3900
3900
def : SVE_3_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, nxv4i32, !cast<Instruction>(NAME # _D)>;
3901
3901
}
3902
3902
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,
3904
3904
string asm, ZPRRegOp zprty>
3905
3905
: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
3906
3906
asm, "\t$Zd, $Pg/m, $Zn",
@@ -3912,9 +3912,9 @@ class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
3912
3912
let Inst{31-24} = 0b01000100;
3913
3913
let Inst{23-22} = sz;
3914
3914
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} ;
3918
3918
let Inst{15-13} = 0b101;
3919
3919
let Inst{12-10} = Pg;
3920
3920
let Inst{9-5} = Zn;
@@ -3926,9 +3926,32 @@ class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
3926
3926
let hasSideEffects = 0;
3927
3927
}
3928
3928
3929
- multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
3929
+ class sve2_int_un_pred_arit_z<bits<2> sz, bits<2> opc,
3930
+ string asm, ZPRRegOp zprty>
3931
+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
3932
+ asm, "\t$Zd, $Pg/z, $Zn",
3933
+ "",
3934
+ []>, Sched<[]> {
3935
+ bits<3> Pg;
3936
+ bits<5> Zd;
3937
+ bits<5> Zn;
3938
+ let Inst{31-24} = 0b01000100;
3939
+ let Inst{23-22} = sz;
3940
+ let Inst{21-20} = 0b00;
3941
+ let Inst{19} = opc{1};
3942
+ let Inst{18-17} = 0b01;
3943
+ let Inst{16} = opc{0};
3944
+ let Inst{15-13} = 0b101;
3945
+ let Inst{12-10} = Pg;
3946
+ let Inst{9-5} = Zn;
3947
+ let Inst{4-0} = Zd;
3948
+
3949
+ let hasSideEffects = 0;
3950
+ }
3951
+
3952
+ multiclass sve2_int_un_pred_arit_s<bits<2> opc, string asm,
3930
3953
SDPatternOperator op> {
3931
- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3954
+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
3932
3955
SVEPseudo2Instr<NAME # _S, 1>;
3933
3956
3934
3957
def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Instruction>(NAME # _S)>;
@@ -3938,14 +3961,14 @@ multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm,
3938
3961
defm : SVE_3_Op_Undef_Pat<nxv4i32, op, nxv4i32, nxv4i1, nxv4i32, !cast<Pseudo>(NAME # _S_UNDEF)>;
3939
3962
}
3940
3963
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>,
3964
+ multiclass sve2_int_un_pred_arit<bits<2 > opc, string asm, SDPatternOperator op> {
3965
+ def _B : sve2_int_un_pred_arit<0b00, opc, asm, ZPR8>,
3943
3966
SVEPseudo2Instr<NAME # _B, 1>;
3944
- def _H : sve2_int_un_pred_arit<0b01, opc{2}, opc{1-0} , asm, ZPR16>,
3967
+ def _H : sve2_int_un_pred_arit<0b01, opc, asm, ZPR16>,
3945
3968
SVEPseudo2Instr<NAME # _H, 1>;
3946
- def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0} , asm, ZPR32>,
3969
+ def _S : sve2_int_un_pred_arit<0b10, opc, asm, ZPR32>,
3947
3970
SVEPseudo2Instr<NAME # _S, 1>;
3948
- def _D : sve2_int_un_pred_arit<0b11, opc{2}, opc{1-0} , asm, ZPR64>,
3971
+ def _D : sve2_int_un_pred_arit<0b11, opc, asm, ZPR64>,
3949
3972
SVEPseudo2Instr<NAME # _D, 1>;
3950
3973
3951
3974
def : SVE_3_Op_Pat<nxv16i8, op, nxv16i8, nxv16i1, nxv16i8, !cast<Instruction>(NAME # _B)>;
@@ -3964,6 +3987,13 @@ multiclass sve2_int_un_pred_arit<bits<3> opc, string asm, SDPatternOperator op>
3964
3987
defm : SVE_3_Op_Undef_Pat<nxv2i64, op, nxv2i64, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
3965
3988
}
3966
3989
3990
+ multiclass sve2_int_un_pred_arit_z<bits<2> opc, string asm> {
3991
+ def _B : sve2_int_un_pred_arit_z<0b00, opc, asm, ZPR8>;
3992
+ def _H : sve2_int_un_pred_arit_z<0b01, opc, asm, ZPR16>;
3993
+ def _S : sve2_int_un_pred_arit_z<0b10, opc, asm, ZPR32>;
3994
+ def _D : sve2_int_un_pred_arit_z<0b11, opc, asm, ZPR64>;
3995
+ }
3996
+
3967
3997
//===----------------------------------------------------------------------===//
3968
3998
// SVE2 Widening Integer Arithmetic Group
3969
3999
//===----------------------------------------------------------------------===//
@@ -4593,8 +4623,30 @@ class sve_int_un_pred_arit<bits<2> sz8_64, bits<4> opc,
4593
4623
let hasSideEffects = 0;
4594
4624
}
4595
4625
4596
- multiclass sve_int_un_pred_arit_0<bits<3> opc, string asm,
4597
- SDPatternOperator op> {
4626
+ class sve_int_un_pred_arit_z<bits<2> sz8_64, bits<4> opc,
4627
+ string asm, ZPRRegOp zprty>
4628
+ : I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
4629
+ asm, "\t$Zd, $Pg/z, $Zn",
4630
+ "",
4631
+ []>, Sched<[]> {
4632
+ bits<3> Pg;
4633
+ bits<5> Zd;
4634
+ bits<5> Zn;
4635
+ let Inst{31-24} = 0b00000100;
4636
+ let Inst{23-22} = sz8_64;
4637
+ let Inst{21-20} = 0b00;
4638
+ let Inst{19} = opc{0};
4639
+ let Inst{18-16} = opc{3-1};
4640
+ let Inst{15-13} = 0b101;
4641
+ let Inst{12-10} = Pg;
4642
+ let Inst{9-5} = Zn;
4643
+ let Inst{4-0} = Zd;
4644
+
4645
+ let hasSideEffects = 0;
4646
+ }
4647
+
4648
+ multiclass sve_int_un_pred_arit<bits<3> opc, string asm,
4649
+ SDPatternOperator op> {
4598
4650
def _B : sve_int_un_pred_arit<0b00, { opc, 0b0 }, asm, ZPR8>,
4599
4651
SVEPseudo2Instr<NAME # _B, 1>;
4600
4652
def _H : sve_int_un_pred_arit<0b01, { opc, 0b0 }, asm, ZPR16>,
@@ -4620,8 +4672,15 @@ multiclass sve_int_un_pred_arit_0<bits<3> opc, string asm,
4620
4672
defm : SVE_1_Op_PassthruUndef_Pat<nxv2i64, op, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
4621
4673
}
4622
4674
4623
- multiclass sve_int_un_pred_arit_0_h<bits<3> opc, string asm,
4624
- SDPatternOperator op> {
4675
+ multiclass sve_int_un_pred_arit_z<bits<3> opc, string asm> {
4676
+ def _B : sve_int_un_pred_arit_z<0b00, { opc, 0b0 }, asm, ZPR8>;
4677
+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4678
+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4679
+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4680
+ }
4681
+
4682
+ multiclass sve_int_un_pred_arit_h<bits<3> opc, string asm,
4683
+ SDPatternOperator op> {
4625
4684
def _H : sve_int_un_pred_arit<0b01, { opc, 0b0 }, asm, ZPR16>,
4626
4685
SVEPseudo2Instr<NAME # _H, 1>;
4627
4686
def _S : sve_int_un_pred_arit<0b10, { opc, 0b0 }, asm, ZPR32>,
@@ -4642,8 +4701,14 @@ multiclass sve_int_un_pred_arit_0_h<bits<3> opc, string asm,
4642
4701
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i8, !cast<Pseudo>(NAME # _D_UNDEF)>;
4643
4702
}
4644
4703
4645
- multiclass sve_int_un_pred_arit_0_w<bits<3> opc, string asm,
4646
- SDPatternOperator op> {
4704
+ multiclass sve_int_un_pred_arit_h_z<bits<3> opc, string asm> {
4705
+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b0 }, asm, ZPR16>;
4706
+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4707
+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4708
+ }
4709
+
4710
+ multiclass sve_int_un_pred_arit_w<bits<3> opc, string asm,
4711
+ SDPatternOperator op> {
4647
4712
def _S : sve_int_un_pred_arit<0b10, { opc, 0b0 }, asm, ZPR32>,
4648
4713
SVEPseudo2Instr<NAME # _S, 1>;
4649
4714
def _D : sve_int_un_pred_arit<0b11, { opc, 0b0 }, asm, ZPR64>,
@@ -4659,8 +4724,13 @@ multiclass sve_int_un_pred_arit_0_w<bits<3> opc, string asm,
4659
4724
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i16, !cast<Pseudo>(NAME # _D_UNDEF)>;
4660
4725
}
4661
4726
4662
- multiclass sve_int_un_pred_arit_0_d<bits<3> opc, string asm,
4663
- SDPatternOperator op> {
4727
+ multiclass sve_int_un_pred_arit_w_z<bits<3> opc, string asm> {
4728
+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b0 }, asm, ZPR32>;
4729
+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b0 }, asm, ZPR64>;
4730
+ }
4731
+
4732
+ multiclass sve_int_un_pred_arit_d<bits<3> opc, string asm,
4733
+ SDPatternOperator op> {
4664
4734
def _D : sve_int_un_pred_arit<0b11, { opc, 0b0 }, asm, ZPR64>,
4665
4735
SVEPseudo2Instr<NAME # _D, 1>;
4666
4736
@@ -4671,8 +4741,8 @@ multiclass sve_int_un_pred_arit_0_d<bits<3> opc, string asm,
4671
4741
defm : SVE_InReg_Extend_PassthruUndef<nxv2i64, op, nxv2i1, nxv2i32, !cast<Pseudo>(NAME # _D_UNDEF)>;
4672
4742
}
4673
4743
4674
- multiclass sve_int_un_pred_arit_1 <bits<3> opc, string asm,
4675
- SDPatternOperator op> {
4744
+ multiclass sve_int_un_pred_arit_bitwise <bits<3> opc, string asm,
4745
+ SDPatternOperator op> {
4676
4746
def _B : sve_int_un_pred_arit<0b00, { opc, 0b1 }, asm, ZPR8>,
4677
4747
SVEPseudo2Instr<NAME # _B, 1>;
4678
4748
def _H : sve_int_un_pred_arit<0b01, { opc, 0b1 }, asm, ZPR16>,
@@ -4698,7 +4768,15 @@ multiclass sve_int_un_pred_arit_1<bits<3> opc, string asm,
4698
4768
defm : SVE_1_Op_PassthruUndef_Pat<nxv2i64, op, nxv2i1, nxv2i64, !cast<Pseudo>(NAME # _D_UNDEF)>;
4699
4769
}
4700
4770
4701
- multiclass sve_int_un_pred_arit_1_fp<bits<3> opc, string asm, SDPatternOperator op> {
4771
+ multiclass sve_int_un_pred_arit_bitwise_z<bits<3> opc, string asm> {
4772
+ def _B : sve_int_un_pred_arit_z<0b00, { opc, 0b1 }, asm, ZPR8>;
4773
+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b1 }, asm, ZPR16>;
4774
+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b1 }, asm, ZPR32>;
4775
+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b1 }, asm, ZPR64>;
4776
+ }
4777
+
4778
+ multiclass sve_int_un_pred_arit_bitwise_fp<bits<3> opc, string asm,
4779
+ SDPatternOperator op> {
4702
4780
def _H : sve_int_un_pred_arit<0b01, { opc, 0b1 }, asm, ZPR16>,
4703
4781
SVEPseudo2Instr<NAME # _H, 1>;
4704
4782
def _S : sve_int_un_pred_arit<0b10, { opc, 0b1 }, asm, ZPR32>,
@@ -4725,6 +4803,12 @@ multiclass sve_int_un_pred_arit_1_fp<bits<3> opc, string asm, SDPatternOperator
4725
4803
defm : SVE_1_Op_PassthruUndef_Pat<nxv2f64, op, nxv2i1, nxv2f64, !cast<Pseudo>(NAME # _D_UNDEF)>;
4726
4804
}
4727
4805
4806
+ multiclass sve_int_un_pred_arit_bitwise_fp_z<bits<3> opc, string asm> {
4807
+ def _H : sve_int_un_pred_arit_z<0b01, { opc, 0b1 }, asm, ZPR16>;
4808
+ def _S : sve_int_un_pred_arit_z<0b10, { opc, 0b1 }, asm, ZPR32>;
4809
+ def _D : sve_int_un_pred_arit_z<0b11, { opc, 0b1 }, asm, ZPR64>;
4810
+ }
4811
+
4728
4812
//===----------------------------------------------------------------------===//
4729
4813
// SVE Integer Wide Immediate - Unpredicated Group
4730
4814
//===----------------------------------------------------------------------===//
0 commit comments