target/arm: Convert Cryptographic 2-register SHA512 to decodetree
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20240524232121.284515-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
7010e36676
commit
54b8230107
@ -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
|
||||
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user