target/arm: Implement SVE2 crypto destructive binary operations

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210525010358.152808-70-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2021-05-24 18:03:35 -07:00 committed by Peter Maydell
parent b2bcd1be4b
commit 3cc7a88e0d
3 changed files with 50 additions and 0 deletions

View file

@ -8159,3 +8159,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);
}