[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 5/5] target/arm: Add SVE state to TB->FLAGS
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v3 5/5] target/arm: Add SVE state to TB->FLAGS |
Date: |
Mon, 29 Jan 2018 10:16:35 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 01/29/2018 10:01 AM, Peter Maydell wrote:
> On 23 January 2018 at 03:53, Richard Henderson
> <address@hidden> wrote:
>> Add both SVE exception state and vector length.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
>
>> 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~
- [Qemu-devel] [PATCH v3 1/5] target/arm: Expand vector registers for SVE, (continued)