qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 05/10] accel/tcg: Standardize atomic helpers on softmmu ap


From: Peter Maydell
Subject: Re: [PATCH v3 05/10] accel/tcg: Standardize atomic helpers on softmmu api
Date: Mon, 19 Jul 2021 13:19:07 +0100

On Sat, 17 Jul 2021 at 20:24, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Reduce the amount of code duplication by always passing
> the TCGMemOpIdx argument to helper_atomic_*.  This is not
> currently used for user-only, but it's easy to ignore.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

> @@ -3144,14 +3137,8 @@ void tcg_gen_atomic_cmpxchg_i32(TCGv_i32 retv, TCGv 
> addr, TCGv_i32 cmpv,
>          gen = table_cmpxchg[memop & (MO_SIZE | MO_BSWAP)];
>          tcg_debug_assert(gen != NULL);
>
> -#ifdef CONFIG_SOFTMMU
> -        {
> -            TCGMemOpIdx oi = make_memop_idx(memop & ~MO_SIGN, idx);
> -            gen(retv, cpu_env, addr, cmpv, newv, tcg_constant_i32(oi));
> -        }
> -#else
> -        gen(retv, cpu_env, addr, cmpv, newv);
> -#endif
> +        TCGMemOpIdx oi = make_memop_idx(memop & ~MO_SIGN, idx);
> +        gen(retv, cpu_env, addr, cmpv, newv, tcg_constant_i32(oi));

In all of these, our coding style says 'oi' should be declared at the top
of the function, not in the middle like this.

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

thanks
-- PMM



reply via email to

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