mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/arm: Handle SME in sve_access_check
The pseudocode for CheckSVEEnabled gains a check for Streaming SVE mode, and for SME present but SVE absent. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708151540.18136-17-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3d74825f4d
commit
285b1d5fce
1 changed files with 16 additions and 6 deletions
|
@ -1183,21 +1183,31 @@ static bool fp_access_check(DisasContext *s)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that SVE access is enabled. If it is, return true.
|
/*
|
||||||
|
* Check that SVE access is enabled. If it is, return true.
|
||||||
* If not, emit code to generate an appropriate exception and return false.
|
* If not, emit code to generate an appropriate exception and return false.
|
||||||
|
* This function corresponds to CheckSVEEnabled().
|
||||||
*/
|
*/
|
||||||
bool sve_access_check(DisasContext *s)
|
bool sve_access_check(DisasContext *s)
|
||||||
{
|
{
|
||||||
if (s->sve_excp_el) {
|
if (s->pstate_sm || !dc_isar_feature(aa64_sve, s)) {
|
||||||
assert(!s->sve_access_checked);
|
assert(dc_isar_feature(aa64_sme, s));
|
||||||
s->sve_access_checked = true;
|
if (!sme_sm_enabled_check(s)) {
|
||||||
|
goto fail_exit;
|
||||||
|
}
|
||||||
|
} else if (s->sve_excp_el) {
|
||||||
gen_exception_insn_el(s, s->pc_curr, EXCP_UDEF,
|
gen_exception_insn_el(s, s->pc_curr, EXCP_UDEF,
|
||||||
syn_sve_access_trap(), s->sve_excp_el);
|
syn_sve_access_trap(), s->sve_excp_el);
|
||||||
return false;
|
goto fail_exit;
|
||||||
}
|
}
|
||||||
s->sve_access_checked = true;
|
s->sve_access_checked = true;
|
||||||
return fp_access_check(s);
|
return fp_access_check(s);
|
||||||
|
|
||||||
|
fail_exit:
|
||||||
|
/* Assert that we only raise one exception per instruction. */
|
||||||
|
assert(!s->sve_access_checked);
|
||||||
|
s->sve_access_checked = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue