On Sat, 17 Jul 2021 at 20:24, Richard Henderson
<[email protected]> 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 <[email protected]>
> ---

> @@ -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 <[email protected]>

thanks
-- PMM

Reply via email to