@@ -304,6 +304,12 @@ class SVE_4_Op_Pat<ValueType vtd, SDPatternOperator op, ValueType vt1,
304
304
: Pat<(vtd (op vt1:$Op1, vt2:$Op2, vt3:$Op3, vt4:$Op4)),
305
305
(inst $Op1, $Op2, $Op3, $Op4)>;
306
306
307
+ class SVE_3_Op_Imm_Pat<ValueType vtd, SDPatternOperator op, ValueType vt1,
308
+ ValueType vt2, ValueType vt3, Operand ImmTy,
309
+ Instruction inst>
310
+ : Pat<(vtd (op vt1:$Op1, vt2:$Op2, (vt3 ImmTy:$Op3))),
311
+ (inst $Op1, $Op2, ImmTy:$Op3)>;
312
+
307
313
def SVEDup0Undef : ComplexPattern<i64, 0, "SelectDupZeroOrUndef", []>;
308
314
309
315
//===----------------------------------------------------------------------===//
@@ -888,14 +894,18 @@ class sve_int_perm_insrs<bits<2> sz8_64, string asm, ZPRRegOp zprty,
888
894
889
895
let Constraints = "$Zdn = $_Zdn";
890
896
let DestructiveInstType = Destructive;
891
- let ElementSize = ElementSizeNone;
892
897
}
893
898
894
- multiclass sve_int_perm_insrs<string asm> {
899
+ multiclass sve_int_perm_insrs<string asm, SDPatternOperator op > {
895
900
def _B : sve_int_perm_insrs<0b00, asm, ZPR8, GPR32>;
896
901
def _H : sve_int_perm_insrs<0b01, asm, ZPR16, GPR32>;
897
902
def _S : sve_int_perm_insrs<0b10, asm, ZPR32, GPR32>;
898
903
def _D : sve_int_perm_insrs<0b11, asm, ZPR64, GPR64>;
904
+
905
+ def : SVE_2_Op_Pat<nxv16i8, op, nxv16i8, i32, !cast<Instruction>(NAME # _B)>;
906
+ def : SVE_2_Op_Pat<nxv8i16, op, nxv8i16, i32, !cast<Instruction>(NAME # _H)>;
907
+ def : SVE_2_Op_Pat<nxv4i32, op, nxv4i32, i32, !cast<Instruction>(NAME # _S)>;
908
+ def : SVE_2_Op_Pat<nxv2i64, op, nxv2i64, i64, !cast<Instruction>(NAME # _D)>;
899
909
}
900
910
901
911
class sve_int_perm_insrv<bits<2> sz8_64, string asm, ZPRRegOp zprty,
@@ -914,14 +924,17 @@ class sve_int_perm_insrv<bits<2> sz8_64, string asm, ZPRRegOp zprty,
914
924
915
925
let Constraints = "$Zdn = $_Zdn";
916
926
let DestructiveInstType = Destructive;
917
- let ElementSize = ElementSizeNone;
918
927
}
919
928
920
- multiclass sve_int_perm_insrv<string asm> {
929
+ multiclass sve_int_perm_insrv<string asm, SDPatternOperator op > {
921
930
def _B : sve_int_perm_insrv<0b00, asm, ZPR8, FPR8>;
922
931
def _H : sve_int_perm_insrv<0b01, asm, ZPR16, FPR16>;
923
932
def _S : sve_int_perm_insrv<0b10, asm, ZPR32, FPR32>;
924
933
def _D : sve_int_perm_insrv<0b11, asm, ZPR64, FPR64>;
934
+
935
+ def : SVE_2_Op_Pat<nxv8f16, op, nxv8f16, f16, !cast<Instruction>(NAME # _H)>;
936
+ def : SVE_2_Op_Pat<nxv4f32, op, nxv4f32, f32, !cast<Instruction>(NAME # _S)>;
937
+ def : SVE_2_Op_Pat<nxv2f64, op, nxv2f64, f64, !cast<Instruction>(NAME # _D)>;
925
938
}
926
939
927
940
//===----------------------------------------------------------------------===//
@@ -3929,7 +3942,8 @@ multiclass sve_int_bin_pred_shift_imm_left<bits<4> opc, string asm> {
3929
3942
}
3930
3943
}
3931
3944
3932
- multiclass sve_int_bin_pred_shift_imm_right<bits<4> opc, string asm> {
3945
+ multiclass sve_int_bin_pred_shift_imm_right<bits<4> opc, string asm,
3946
+ SDPatternOperator op = null_frag> {
3933
3947
def _B : sve_int_bin_pred_shift_imm<{0,0,0,1}, opc, asm, ZPR8, vecshiftR8,
3934
3948
ElementSizeB>;
3935
3949
def _H : sve_int_bin_pred_shift_imm<{0,0,1,?}, opc, asm, ZPR16, vecshiftR16,
@@ -3945,6 +3959,11 @@ multiclass sve_int_bin_pred_shift_imm_right<bits<4> opc, string asm> {
3945
3959
let Inst{22} = imm{5};
3946
3960
let Inst{9-8} = imm{4-3};
3947
3961
}
3962
+
3963
+ def : SVE_3_Op_Imm_Pat<nxv16i8, op, nxv16i1, nxv16i8, i32, vecshiftR8, !cast<Instruction>(NAME # _B)>;
3964
+ def : SVE_3_Op_Imm_Pat<nxv8i16, op, nxv8i1, nxv8i16, i32, vecshiftR16, !cast<Instruction>(NAME # _H)>;
3965
+ def : SVE_3_Op_Imm_Pat<nxv4i32, op, nxv4i1, nxv4i32, i32, vecshiftR32, !cast<Instruction>(NAME # _S)>;
3966
+ def : SVE_3_Op_Imm_Pat<nxv2i64, op, nxv2i1, nxv2i64, i32, vecshiftR64, !cast<Instruction>(NAME # _D)>;
3948
3967
}
3949
3968
3950
3969
class sve_int_bin_pred_shift<bits<2> sz8_64, bit wide, bits<3> opc,
@@ -3971,17 +3990,28 @@ class sve_int_bin_pred_shift<bits<2> sz8_64, bit wide, bits<3> opc,
3971
3990
let ElementSize = zprty.ElementSize;
3972
3991
}
3973
3992
3974
- multiclass sve_int_bin_pred_shift<bits<3> opc, string asm> {
3993
+ multiclass sve_int_bin_pred_shift<bits<3> opc, string asm,
3994
+ SDPatternOperator op> {
3975
3995
def _B : sve_int_bin_pred_shift<0b00, 0b0, opc, asm, ZPR8, ZPR8>;
3976
3996
def _H : sve_int_bin_pred_shift<0b01, 0b0, opc, asm, ZPR16, ZPR16>;
3977
3997
def _S : sve_int_bin_pred_shift<0b10, 0b0, opc, asm, ZPR32, ZPR32>;
3978
3998
def _D : sve_int_bin_pred_shift<0b11, 0b0, opc, asm, ZPR64, ZPR64>;
3999
+
4000
+ def : SVE_3_Op_Pat<nxv16i8, op, nxv16i1, nxv16i8, nxv16i8, !cast<Instruction>(NAME # _B)>;
4001
+ def : SVE_3_Op_Pat<nxv8i16, op, nxv8i1, nxv8i16, nxv8i16, !cast<Instruction>(NAME # _H)>;
4002
+ def : SVE_3_Op_Pat<nxv4i32, op, nxv4i1, nxv4i32, nxv4i32, !cast<Instruction>(NAME # _S)>;
4003
+ def : SVE_3_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, nxv2i64, !cast<Instruction>(NAME # _D)>;
3979
4004
}
3980
4005
3981
- multiclass sve_int_bin_pred_shift_wide<bits<3> opc, string asm> {
4006
+ multiclass sve_int_bin_pred_shift_wide<bits<3> opc, string asm,
4007
+ SDPatternOperator op> {
3982
4008
def _B : sve_int_bin_pred_shift<0b00, 0b1, opc, asm, ZPR8, ZPR64>;
3983
4009
def _H : sve_int_bin_pred_shift<0b01, 0b1, opc, asm, ZPR16, ZPR64>;
3984
4010
def _S : sve_int_bin_pred_shift<0b10, 0b1, opc, asm, ZPR32, ZPR64>;
4011
+
4012
+ def : SVE_3_Op_Pat<nxv16i8, op, nxv16i1, nxv16i8, nxv2i64, !cast<Instruction>(NAME # _B)>;
4013
+ def : SVE_3_Op_Pat<nxv8i16, op, nxv8i1, nxv8i16, nxv2i64, !cast<Instruction>(NAME # _H)>;
4014
+ def : SVE_3_Op_Pat<nxv4i32, op, nxv4i1, nxv4i32, nxv2i64, !cast<Instruction>(NAME # _S)>;
3985
4015
}
3986
4016
3987
4017
//===----------------------------------------------------------------------===//
0 commit comments