[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/67] target/arm: Convert Cryptographic 2-register SHA512 to
From: |
Richard Henderson |
Subject: |
[PATCH v2 13/67] target/arm: Convert Cryptographic 2-register SHA512 to decodetree |
Date: |
Fri, 24 May 2024 16:20:27 -0700 |
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/a64.decode | 5 ++++
target/arm/tcg/translate-a64.c | 50 ++--------------------------------
2 files changed, 8 insertions(+), 47 deletions(-)
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index c342c27608..5a46205751 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -631,3 +631,8 @@ RAX1 1100 1110 011 ..... 100011 ..... .....
@rrr_q1e3
SM3PARTW1 1100 1110 011 ..... 110000 ..... ..... @rrr_q1e0
SM3PARTW2 1100 1110 011 ..... 110001 ..... ..... @rrr_q1e0
SM4EKEY 1100 1110 011 ..... 110010 ..... ..... @rrr_q1e0
+
+### Cryptographic two-register SHA512
+
+SHA512SU0 1100 1110 110 00000 100000 ..... ..... @rr_q1e0
+SM4E 1100 1110 110 00000 100001 ..... ..... @r2r_q1e0
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 77b24cd52e..eed0abe912 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -4629,6 +4629,9 @@ TRANS_FEAT(SM3PARTW1, aa64_sm3, do_gvec_op3_ool, a, 0,
gen_helper_crypto_sm3part
TRANS_FEAT(SM3PARTW2, aa64_sm3, do_gvec_op3_ool, a, 0,
gen_helper_crypto_sm3partw2)
TRANS_FEAT(SM4EKEY, aa64_sm4, do_gvec_op3_ool, a, 0, gen_helper_crypto_sm4ekey)
+TRANS_FEAT(SHA512SU0, aa64_sha512, do_gvec_op2_ool, a, 0,
gen_helper_crypto_sha512su0)
+TRANS_FEAT(SM4E, aa64_sm4, do_gvec_op3_ool, a, 0, gen_helper_crypto_sm4e)
+
/* Shift a TCGv src by TCGv shift_amount, put result in dst.
* Note that it is the caller's responsibility to ensure that the
@@ -13530,52 +13533,6 @@ static void disas_simd_indexed(DisasContext *s,
uint32_t insn)
}
}
-/* Crypto two-reg SHA512
- * 31 12 11 10 9 5 4 0
- * +-----------------------------------------+--------+------+------+
- * | 1 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 1 0 0 0 | opcode | Rn | Rd |
- * +-----------------------------------------+--------+------+------+
- */
-static void disas_crypto_two_reg_sha512(DisasContext *s, uint32_t insn)
-{
- int opcode = extract32(insn, 10, 2);
- int rn = extract32(insn, 5, 5);
- int rd = extract32(insn, 0, 5);
- bool feature;
-
- switch (opcode) {
- case 0: /* SHA512SU0 */
- feature = dc_isar_feature(aa64_sha512, s);
- break;
- case 1: /* SM4E */
- feature = dc_isar_feature(aa64_sm4, s);
- break;
- default:
- unallocated_encoding(s);
- return;
- }
-
- if (!feature) {
- unallocated_encoding(s);
- return;
- }
-
- if (!fp_access_check(s)) {
- return;
- }
-
- switch (opcode) {
- case 0: /* SHA512SU0 */
- gen_gvec_op2_ool(s, true, rd, rn, 0, gen_helper_crypto_sha512su0);
- break;
- case 1: /* SM4E */
- gen_gvec_op3_ool(s, true, rd, rd, rn, 0, gen_helper_crypto_sm4e);
- break;
- default:
- g_assert_not_reached();
- }
-}
-
/* Crypto four-register
* 31 23 22 21 20 16 15 14 10 9 5 4 0
* +-------------------+-----+------+---+------+------+------+
@@ -13750,7 +13707,6 @@ static const AArch64DecodeTable data_proc_simd[] = {
{ 0x5e000400, 0xdfe08400, disas_simd_scalar_copy },
{ 0x5f000000, 0xdf000400, disas_simd_indexed }, /* scalar indexed */
{ 0x5f000400, 0xdf800400, disas_simd_scalar_shift_imm },
- { 0xcec08000, 0xfffff000, disas_crypto_two_reg_sha512 },
{ 0xce000000, 0xff808000, disas_crypto_four_reg },
{ 0xce800000, 0xffe00000, disas_crypto_xar },
{ 0xce408000, 0xffe0c000, disas_crypto_three_reg_imm2 },
--
2.34.1
- [PATCH v2 02/67] target/arm: Use PLD, PLDW, PLI not NOP for t32, (continued)
- [PATCH v2 02/67] target/arm: Use PLD, PLDW, PLI not NOP for t32, Richard Henderson, 2024/05/24
- [PATCH v2 03/67] target/arm: Reject incorrect operands to PLD, PLDW, PLI, Richard Henderson, 2024/05/24
- [PATCH v2 04/67] target/arm: Zero-extend writeback for fp16 FCVTZS (scalar, integer), Richard Henderson, 2024/05/24
- [PATCH v2 05/67] target/arm: Fix decode of FMOV (hp) vs MOVI, Richard Henderson, 2024/05/24
- [PATCH v2 06/67] target/arm: Verify sz=0 for Advanced SIMD scalar pairwise (fp16), Richard Henderson, 2024/05/24
- [PATCH v2 09/67] target/arm: Convert Cryptographic AES to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 08/67] target/arm: Split out gengvec64.c, Richard Henderson, 2024/05/24
- [PATCH v2 10/67] target/arm: Convert Cryptographic 3-register SHA to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 07/67] target/arm: Split out gengvec.c, Richard Henderson, 2024/05/24
- [PATCH v2 11/67] target/arm: Convert Cryptographic 2-register SHA to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 13/67] target/arm: Convert Cryptographic 2-register SHA512 to decodetree,
Richard Henderson <=
- [PATCH v2 12/67] target/arm: Convert Cryptographic 3-register SHA512 to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 15/67] target/arm: Convert Cryptographic 3-register, imm2 to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 16/67] target/arm: Convert XAR to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 14/67] target/arm: Convert Cryptographic 4-register to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 17/67] target/arm: Convert Advanced SIMD copy to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 21/67] target/arm: Introduce vfp_load_reg16, Richard Henderson, 2024/05/24
- [PATCH v2 23/67] target/arm: Convert FNMUL to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 24/67] target/arm: Convert FMLA, FMLS to decodetree, Richard Henderson, 2024/05/24
- [PATCH v2 20/67] target/arm: Convert FMAX, FMIN, FMAXNM, FMINNM to decodetree, Richard Henderson, 2024/05/24