[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 9/9] target/arm: Implement SVE2 crypto constructive binary ope
From: |
Richard Henderson |
Subject: |
[PATCH v3 9/9] target/arm: Implement SVE2 crypto constructive binary operations |
Date: |
Wed, 29 Apr 2020 19:03:03 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/cpu.h | 5 +++++
target/arm/sve.decode | 4 ++++
target/arm/translate-sve.c | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 4f09dd42ba..0a7c68843b 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3870,6 +3870,11 @@ static inline bool isar_feature_aa64_sve2_bitperm(const
ARMISARegisters *id)
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, BITPERM) != 0;
}
+static inline bool isar_feature_aa64_sve2_sha3(const ARMISARegisters *id)
+{
+ return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SHA3) != 0;
+}
+
static inline bool isar_feature_aa64_sve2_sm4(const ARMISARegisters *id)
{
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SM4) != 0;
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index 149de7949b..3cf824bac5 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -1564,3 +1564,7 @@ AESMC 01000101 00 10000011100 decrypt:1 00000
rd:5
AESE 01000101 00 10001 0 11100 0 ..... ..... @rdn_rm_e0
AESD 01000101 00 10001 0 11100 1 ..... ..... @rdn_rm_e0
SM4E 01000101 00 10001 1 11100 0 ..... ..... @rdn_rm_e0
+
+# SVE2 crypto constructive binary operations
+SM4EKEY 01000101 00 1 ..... 11110 0 ..... ..... @rd_rn_rm_e0
+RAX1 01000101 00 1 ..... 11110 1 ..... ..... @rd_rn_rm_e0
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 91e71882d6..a8e57ea5f4 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -8233,3 +8233,23 @@ static bool trans_SM4E(DisasContext *s, arg_rrr_esz *a)
{
return do_sm4(s, a, gen_helper_crypto_sm4e);
}
+
+static bool trans_SM4EKEY(DisasContext *s, arg_rrr_esz *a)
+{
+ return do_sm4(s, a, gen_helper_crypto_sm4ekey);
+}
+
+static bool trans_RAX1(DisasContext *s, arg_rrr_esz *a)
+{
+ if (!dc_isar_feature(aa64_sve2_sha3, s)) {
+ return false;
+ }
+ if (sve_access_check(s)) {
+ unsigned vsz = vec_full_reg_size(s);
+ tcg_gen_gvec_3(vec_full_reg_offset(s, a->rd),
+ vec_full_reg_offset(s, a->rn),
+ vec_full_reg_offset(s, a->rm),
+ vsz, vsz, &rax1_op);
+ }
+ return true;
+}
--
2.20.1
- [PATCH v3 0/9] target/arm: Implement SVE2 Crypto Extensions, Richard Henderson, 2020/04/29
- [PATCH v3 1/9] target/arm: Convert aes and sm4 to gvec helpers, Richard Henderson, 2020/04/29
- [PATCH v3 2/9] target/arm: Convert rax1 to gvec helpers, Richard Henderson, 2020/04/29
- [PATCH v3 4/9] target/arm: Convert sha1 and sha256 to gvec helpers, Richard Henderson, 2020/04/29
- [PATCH v3 3/9] target/arm: Convert sha512 and sm3 to gvec helpers, Richard Henderson, 2020/04/29
- [PATCH v3 6/9] target/arm: Split helper_crypto_sm3tt, Richard Henderson, 2020/04/29
- [PATCH v3 8/9] target/arm: Implement SVE2 crypto destructive binary operations, Richard Henderson, 2020/04/29
- [PATCH v3 5/9] target/arm: Split helper_crypto_sha1_3reg, Richard Henderson, 2020/04/29
- [PATCH v3 9/9] target/arm: Implement SVE2 crypto constructive binary operations,
Richard Henderson <=
- [PATCH v3 7/9] target/arm: Implement SVE2 crypto unary operations, Richard Henderson, 2020/04/29