[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 62/82] target/arm: Implement SVE2 crypto destructive binary op
From: |
Richard Henderson |
Subject: |
[PATCH v6 62/82] target/arm: Implement SVE2 crypto destructive binary operations |
Date: |
Fri, 30 Apr 2021 13:25:50 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.h | 5 +++++
target/arm/sve.decode | 7 +++++++
target/arm/translate-sve.c | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 0a41142d35..384c92eebb 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -4246,6 +4246,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_sm4(const ARMISARegisters *id)
+{
+ return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SM4) != 0;
+}
+
static inline bool isar_feature_aa64_sve_i8mm(const ARMISARegisters *id)
{
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, I8MM) != 0;
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index 6ab13b2f78..fb4d32691e 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -118,6 +118,8 @@
@pd_pn_pm ........ esz:2 .. rm:4 ....... rn:4 . rd:4 &rrr_esz
@rdn_rm ........ esz:2 ...... ...... rm:5 rd:5 \
&rrr_esz rn=%reg_movprfx
+@rdn_rm_e0 ........ .. ...... ...... rm:5 rd:5 \
+ &rrr_esz rn=%reg_movprfx esz=0
@rdn_sh_i8u ........ esz:2 ...... ...... ..... rd:5 \
&rri_esz rn=%reg_movprfx imm=%sh8_i8u
@rdn_i8u ........ esz:2 ...... ... imm:8 rd:5 \
@@ -1515,3 +1517,8 @@ STNT1_zprz 1110010 .. 10 ..... 001 ... ..... ..... \
# SVE2 crypto unary operations
# AESMC and AESIMC
AESMC 01000101 00 10000011100 decrypt:1 00000 rd:5
+
+# SVE2 crypto destructive binary operations
+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
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 5219b93abd..fd4ec4a66b 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -8083,3 +8083,41 @@ static bool trans_AESMC(DisasContext *s, arg_AESMC *a)
}
return true;
}
+
+static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt)
+{
+ if (!dc_isar_feature(aa64_sve2_aes, s)) {
+ return false;
+ }
+ if (sve_access_check(s)) {
+ gen_gvec_ool_zzz(s, gen_helper_crypto_aese,
+ a->rd, a->rn, a->rm, decrypt);
+ }
+ return true;
+}
+
+static bool trans_AESE(DisasContext *s, arg_rrr_esz *a)
+{
+ return do_aese(s, a, false);
+}
+
+static bool trans_AESD(DisasContext *s, arg_rrr_esz *a)
+{
+ return do_aese(s, a, true);
+}
+
+static bool do_sm4(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn)
+{
+ if (!dc_isar_feature(aa64_sve2_sm4, s)) {
+ return false;
+ }
+ if (sve_access_check(s)) {
+ gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0);
+ }
+ return true;
+}
+
+static bool trans_SM4E(DisasContext *s, arg_rrr_esz *a)
+{
+ return do_sm4(s, a, gen_helper_crypto_sm4e);
+}
--
2.25.1
- [PATCH v6 77/82] target/arm: Fix decode for VDOT (indexed), (continued)
- [PATCH v6 77/82] target/arm: Fix decode for VDOT (indexed), Richard Henderson, 2021/04/30
- [PATCH v6 64/82] target/arm: Implement SVE2 TBL, TBX, Richard Henderson, 2021/04/30
- [PATCH v6 74/82] target/arm: Implement aarch64 SUDOT, USDOT, Richard Henderson, 2021/04/30
- [PATCH v6 76/82] target/arm: Remove unused fpst from VDOT_scalar, Richard Henderson, 2021/04/30
- [PATCH v6 70/82] target/arm: Implement SVE2 LD1RO, Richard Henderson, 2021/04/30
- [PATCH v6 68/82] target/arm: Implement SVE2 FLOGB, Richard Henderson, 2021/04/30
- [PATCH v6 72/82] target/arm: Implement SVE2 bitwise shift immediate, Richard Henderson, 2021/04/30
- [PATCH v6 73/82] target/arm: Implement SVE2 fp multiply-add long, Richard Henderson, 2021/04/30
- [PATCH v6 78/82] target/arm: Split decode of VSDOT and VUDOT, Richard Henderson, 2021/04/30
- [PATCH v6 75/82] target/arm: Split out do_neon_ddda_fpst, Richard Henderson, 2021/04/30
- [PATCH v6 62/82] target/arm: Implement SVE2 crypto destructive binary operations,
Richard Henderson <=
- [PATCH v6 66/82] target/arm: Implement SVE2 FCVTLT, Richard Henderson, 2021/04/30
- [PATCH v6 69/82] target/arm: Share table of sve load functions, Richard Henderson, 2021/04/30
- [PATCH v6 61/82] target/arm: Implement SVE2 crypto unary operations, Richard Henderson, 2021/04/30
- [PATCH v6 63/82] target/arm: Implement SVE2 crypto constructive binary operations, Richard Henderson, 2021/04/30
- [PATCH v6 67/82] target/arm: Implement SVE2 FCVTXNT, FCVTX, Richard Henderson, 2021/04/30
- [PATCH v6 79/82] target/arm: Implement aarch32 VSUDOT, VUSDOT, Richard Henderson, 2021/04/30
- [PATCH v6 80/82] target/arm: Implement integer matrix multiply accumulate, Richard Henderson, 2021/04/30
- [PATCH v6 82/82] target/arm: Enable SVE2 and related extensions, Richard Henderson, 2021/04/30
- [PATCH v6 81/82] linux-user/aarch64: Enable hwcap bits for sve2 and related extensions, Richard Henderson, 2021/04/30