qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-5.2] target/arm: Fix neon VTBL/VTBX for len > 1


From: Peter Maydell
Subject: Re: [PATCH for-5.2] target/arm: Fix neon VTBL/VTBX for len > 1
Date: Mon, 9 Nov 2020 11:59:24 +0000

On Thu, 5 Nov 2020 at 17:11, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The helper function did not get updated when we reorganized
> the vector register file for SVE.  Since then, the neon dregs
> are non-sequential and cannot be simply indexed.
>
> At the same time, make the helper function operate on 64-bit
> quantities so that we do not have to call it twice.
>
> Fixes: c39c2b9043e
> Reported-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> -    val = 0;
> -    for (shift = 0; shift < 32; shift += 8) {
> -        uint32_t index = (ireg >> shift) & 0xff;
> +    for (shift = 0; shift < 64; shift += 8) {
> +        index = (ireg >> shift) & 0xff;
>          if (index < maxindex) {
> -            uint32_t tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff;
> -            val |= tmp << shift;
> +            reg = base_reg + (index >> 3);
> +            tmp = env->vfp.zregs[reg >> 1].d[reg & 1];

This can be written
  tmp = *aa32_vfp_dreg(env, reg);
rather than open-coding the conversion from a dreg number into
the appropriate access into the zregs representation.

Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

so I'll just make that change and apply it to target-arm.next.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]