qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [PATCH v2 22/68] target/arm: Convert USAD8, USADA8, SBFX,


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v2 22/68] target/arm: Convert USAD8, USADA8, SBFX, UBFX, BFC, BFI, UDF
Date: Fri, 23 Aug 2019 16:39:41 +0100

On Mon, 19 Aug 2019 at 22:38, Richard Henderson
<address@hidden> wrote:
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  target/arm/translate.c | 200 +++++++++++++++++++++--------------------
>  target/arm/a32.decode  |  20 +++++
>  target/arm/t32.decode  |  19 ++++
>  3 files changed, 143 insertions(+), 96 deletions(-)


> +static bool op_bfx(DisasContext *s, arg_UBFX *a, bool u)
> +{
> +    TCGv_i32 tmp;
> +    int width = a->widthm1 + 1;
> +    int shift = a->lsb;
> +
> +    if (!ENABLE_ARCH_6T2) {
> +        return false;
> +    }
> +
> +    tmp = load_reg(s, a->rn);
> +    if (shift + width > 32) {
> +        return false;

This UNDEF check should go before we
generate any code with the load_reg().

> +    } else if (width < 32) {
> +        if (u) {
> +            tcg_gen_extract_i32(tmp, tmp, shift, width);
> +        } else {
> +            tcg_gen_sextract_i32(tmp, tmp, shift, width);
> +        }
> +    }
> +    store_reg(s, a->rd, tmp);
> +    return true;
> +}

Otherwise
Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

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