Skip to content

Commit 211cb2e

Browse files
committed
Move pattern to main class.
1 parent 52274fe commit 211cb2e

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4064,8 +4064,10 @@ let Predicates = [HasSVE2_or_SME] in {
40644064

40654065
let Predicates = [HasSVEAES, HasNonStreamingSVE2_or_SSVE_AES] in {
40664066
// SVE2 crypto destructive binary operations
4067-
defm AESE_ZZZ_B : sve2_crypto_des_bin_op<0b00, "aese", ZPR8, int_aarch64_sve_aese, nxv16i8, /*commutable=*/1>;
4068-
defm AESD_ZZZ_B : sve2_crypto_des_bin_op<0b01, "aesd", ZPR8, int_aarch64_sve_aesd, nxv16i8, /*commutable=*/1>;
4067+
let isCommutable = 1 in {
4068+
def AESE_ZZZ_B : sve2_crypto_des_bin_op<0b00, "aese", ZPR8, int_aarch64_sve_aese, nxv16i8>;
4069+
def AESD_ZZZ_B : sve2_crypto_des_bin_op<0b01, "aesd", ZPR8, int_aarch64_sve_aesd, nxv16i8>;
4070+
}
40694071

40704072
// SVE2 crypto unary operations
40714073
defm AESMC_ZZ_B : sve2_crypto_unary_op<0b0, "aesmc", int_aarch64_sve_aesmc>;
@@ -4082,7 +4084,7 @@ let Predicates = [HasSVE2SM4] in {
40824084
// SVE2 crypto constructive binary operations
40834085
defm SM4EKEY_ZZZ_S : sve2_crypto_cons_bin_op<0b0, "sm4ekey", ZPR32, int_aarch64_sve_sm4ekey, nxv4i32>;
40844086
// SVE2 crypto destructive binary operations
4085-
defm SM4E_ZZZ_S : sve2_crypto_des_bin_op<0b10, "sm4e", ZPR32, int_aarch64_sve_sm4e, nxv4i32>;
4087+
def SM4E_ZZZ_S : sve2_crypto_des_bin_op<0b10, "sm4e", ZPR32, int_aarch64_sve_sm4e, nxv4i32>;
40864088
} // End HasSVE2SM4
40874089

40884090
let Predicates = [HasSVE2SHA3] in {

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9235,11 +9235,12 @@ multiclass sve2_crypto_cons_bin_op<bit opc, string asm, ZPRRegOp zprty,
92359235
def : SVE_2_Op_Pat<vt, op, vt, vt, !cast<Instruction>(NAME)>;
92369236
}
92379237

9238-
class sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty>
9238+
class sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty,
9239+
SDPatternOperator op, ValueType vt>
92399240
: I<(outs zprty:$Zdn), (ins zprty:$_Zdn, zprty:$Zm),
92409241
asm, "\t$Zdn, $_Zdn, $Zm",
92419242
"",
9242-
[]>, Sched<[]> {
9243+
[(set (vt zprty:$Zdn), (op (vt zprty:$_Zdn), (vt zprty:$Zm)))]>, Sched<[]> {
92439244
bits<5> Zdn;
92449245
bits<5> Zm;
92459246
let Inst{31-17} = 0b010001010010001;
@@ -9253,14 +9254,6 @@ class sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty>
92539254
let hasSideEffects = 0;
92549255
}
92559256

9256-
multiclass sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty,
9257-
SDPatternOperator op, ValueType vt,
9258-
bit commutable = 0> {
9259-
let isCommutable = commutable in
9260-
def NAME : sve2_crypto_des_bin_op<opc, asm, zprty>;
9261-
def : SVE_2_Op_Pat<vt, op, vt, vt, !cast<Instruction>(NAME)>;
9262-
}
9263-
92649257
class sve2_crypto_unary_op<bit opc, string asm, ZPRRegOp zprty>
92659258
: I<(outs zprty:$Zdn), (ins zprty:$_Zdn),
92669259
asm, "\t$Zdn, $_Zdn",

0 commit comments

Comments
 (0)