summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCullen Rhodes <cullen.rhodes@arm.com>2019-05-28 09:13:17 +0000
committerCullen Rhodes <cullen.rhodes@arm.com>2019-05-28 09:13:17 +0000
commit8e91dd7934659df87e67e2ac5c78d583fce15fe0 (patch)
tree812a14a2f09d3b57667399d5af818be51ad09a64 /llvm/lib
parentc4ed601bd9f5c7d6138330317bfc0ce519198085 (diff)
downloadbcm5719-llvm-8e91dd7934659df87e67e2ac5c78d583fce15fe0.tar.gz
bcm5719-llvm-8e91dd7934659df87e67e2ac5c78d583fce15fe0.zip
[AArch64][SVE2] Asm: support SVE2 Crypto Extensions Group
Summary: Patch adds support for the following instructions: SVE2 crypto constructive binary operations: * SM4EKEY, RAX1 SVE2 crypto destructive binary operations: * AESE, AESD, SM4E SVE2 crypto unary operations: * AESMC, AESIMC AESE, AESD, AESMC and AESIMC are enabled with +sve2-aes. SM4E and SM4EKEY are enabled with +sve2-sm4. RAX1 is enabled with +sve2-sha3. The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: SjoerdMeijer Differential Revision: https://reviews.llvm.org/D62307 llvm-svn: 361797
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td20
-rw-r--r--llvm/lib/Target/AArch64/SVEInstrFormats.td51
2 files changed, 71 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
index 05470f5e364..1635a602539 100644
--- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
@@ -1298,6 +1298,14 @@ let Predicates = [HasSVE2] in {
}
let Predicates = [HasSVE2AES] in {
+ // SVE2 crypto destructive binary operations
+ def AESE_ZZZ_B : sve2_crypto_des_bin_op<0b00, "aese", ZPR8>;
+ def AESD_ZZZ_B : sve2_crypto_des_bin_op<0b01, "aesd", ZPR8>;
+
+ // SVE2 crypto unary operations
+ def AESMC_ZZ_B : sve2_crypto_unary_op<0b0, "aesmc">;
+ def AESIMC_ZZ_B : sve2_crypto_unary_op<0b1, "aesimc">;
+
// PMULLB and PMULLT instructions which operate with 64-bit source and
// 128-bit destination elements are enabled with crypto extensions, similar
// to NEON PMULL2 instruction.
@@ -1307,6 +1315,18 @@ let Predicates = [HasSVE2AES] in {
ZPR128, ZPR64, ZPR64>;
}
+let Predicates = [HasSVE2SM4] in {
+ // SVE2 crypto constructive binary operations
+ def SM4EKEY_ZZZ_S : sve2_crypto_cons_bin_op<0b0, "sm4ekey", ZPR32>;
+ // SVE2 crypto destructive binary operations
+ def SM4E_ZZZ_S : sve2_crypto_des_bin_op<0b10, "sm4e", ZPR32>;
+}
+
+let Predicates = [HasSVE2SHA3] in {
+ // SVE2 crypto constructive binary operations
+ def RAX1_ZZZ_D : sve2_crypto_cons_bin_op<0b1, "rax1", ZPR64>;
+}
+
let Predicates = [HasSVE2BitPerm] in {
// SVE2 bitwise permute
defm BEXT_ZZZ : sve2_misc_bitwise<0b1100, "bext">;
diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td
index 4d9c5a8262a..25a25e7d38c 100644
--- a/llvm/lib/Target/AArch64/SVEInstrFormats.td
+++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td
@@ -5286,3 +5286,54 @@ multiclass sve2_hist_gen_vector<string asm> {
def _S : sve2_hist_gen_vector<0b0, asm, ZPR32>;
def _D : sve2_hist_gen_vector<0b1, asm, ZPR64>;
}
+
+//===----------------------------------------------------------------------===//
+// SVE2 Crypto Extensions Group
+//===----------------------------------------------------------------------===//
+
+class sve2_crypto_cons_bin_op<bit opc, string asm, ZPRRegOp zprty>
+: I<(outs zprty:$Zd), (ins zprty:$Zn, zprty:$Zm),
+ asm, "\t$Zd, $Zn, $Zm",
+ "",
+ []>, Sched<[]> {
+ bits<5> Zd;
+ bits<5> Zn;
+ bits<5> Zm;
+ let Inst{31-21} = 0b01000101001;
+ let Inst{20-16} = Zm;
+ let Inst{15-11} = 0b11110;
+ let Inst{10} = opc;
+ let Inst{9-5} = Zn;
+ let Inst{4-0} = Zd;
+}
+
+class sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty>
+: I<(outs zprty:$Zdn), (ins zprty:$_Zdn, zprty:$Zm),
+ asm, "\t$Zdn, $_Zdn, $Zm",
+ "",
+ []>, Sched<[]> {
+ bits<5> Zdn;
+ bits<5> Zm;
+ let Inst{31-17} = 0b010001010010001;
+ let Inst{16} = opc{1};
+ let Inst{15-11} = 0b11100;
+ let Inst{10} = opc{0};
+ let Inst{9-5} = Zm;
+ let Inst{4-0} = Zdn;
+
+ let Constraints = "$Zdn = $_Zdn";
+}
+
+class sve2_crypto_unary_op<bit opc, string asm>
+: I<(outs ZPR8:$Zdn), (ins ZPR8:$_Zdn),
+ asm, "\t$Zdn, $_Zdn",
+ "",
+ []>, Sched<[]> {
+ bits<5> Zdn;
+ let Inst{31-11} = 0b010001010010000011100;
+ let Inst{10} = opc;
+ let Inst{9-5} = 0b00000;
+ let Inst{4-0} = Zdn;
+
+ let Constraints = "$Zdn = $_Zdn";
+}
OpenPOWER on IntegriCloud