qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 01/13] target/arm: Move constant expanders to translate.h


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 01/13] target/arm: Move constant expanders to translate.h
Date: Tue, 13 Apr 2021 18:59:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 4/13/21 6:07 PM, Peter Maydell wrote:
> Some of the constant expanders defined in translate.c are generically
> useful and will be used by the separate C files for VFP and Neon once
> they are created; move the expander definitions to translate.h.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/translate.h | 24 ++++++++++++++++++++++++
>  target/arm/translate.c | 24 ------------------------
>  2 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/target/arm/translate.h b/target/arm/translate.h
> index 423b0e08df0..4c0b6e8fc42 100644
> --- a/target/arm/translate.h
> +++ b/target/arm/translate.h
> @@ -116,6 +116,30 @@ extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF;
>  extern TCGv_i64 cpu_exclusive_addr;
>  extern TCGv_i64 cpu_exclusive_val;
>  
> +/*
> + * Constant expanders for the decoders.
> + */
> +
> +static inline int negate(DisasContext *s, int x)
> +{
> +    return -x;
> +}
> +
> +static inline int plus_2(DisasContext *s, int x)
> +{
> +    return x + 2;
> +}
> +
> +static inline int times_2(DisasContext *s, int x)
> +{
> +    return x * 2;
> +}
> +
> +static inline int times_4(DisasContext *s, int x)
> +{
> +    return x * 4;
> +}

Being static inlined, I wonder if these shouldn't belong
to "exec/translator.h" or another generic helper header
(because I ended using similar helpers in MIPS).

Can be done later tho, so:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



reply via email to

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