On 01/29/2018 10:01 AM, Peter Maydell wrote: > On 23 January 2018 at 03:53, Richard Henderson > <richard.hender...@linaro.org> wrote: >> Add both SVE exception state and vector length. >> >> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > >> diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c >> index 10eef870fe..4c1eca7062 100644 >> --- a/target/arm/translate-a64.c >> +++ b/target/arm/translate-a64.c >> @@ -11263,6 +11263,8 @@ static int >> aarch64_tr_init_disas_context(DisasContextBase *dcbase, >> dc->user = (dc->current_el == 0); >> #endif >> dc->fp_excp_el = ARM_TBFLAG_FPEXC_EL(dc->base.tb->flags); >> + dc->sve_excp_el = ARM_TBFLAG_SVEEXC_EL(dc->base.tb->flags); >> + dc->sve_len = (ARM_TBFLAG_ZCR_LEN(dc->base.tb->flags) + 1) * 16; > > You've carefully arranged that the sve_excp checks are a superset > of the fp_excp checks, which means that we get the correct > exception prioritization by always doing the sve_excp check first > and then the fp_excp check second, without having to look at > whether fp_excp_el or sve_excp_el is larger to see which should > take precedence. We could > assert(dc->sve_excp_el <= dc->fp_excp_el); > and perhaps have a comment noting why this is useful...
Sort of, I suppose. Modulo the fact that "enabled" is zero, so sve disabled & fp enabled means sve_el > fp_el. But you're right that to some extent I'm doing too much work replicating the fp exception check. r~