[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
- [PATCH v3 03/10] qemu/atomic: Add aligned_{int64,uint64}_t types, (continued)
- [PATCH v3 03/10] qemu/atomic: Add aligned_{int64,uint64}_t types, Richard Henderson, 2021/07/17
- [PATCH v3 04/10] tcg: Rename helper_atomic_*_mmu and provide for user-only, Richard Henderson, 2021/07/17
- [PATCH v3 02/10] qemu/atomic: Remove pre-C11 atomic fallbacks, Richard Henderson, 2021/07/17
- [PATCH v3 06/10] accel/tcg: Fold EXTRA_ARGS into atomic_template.h, Richard Henderson, 2021/07/17
- [PATCH v3 07/10] accel/tcg: Remove ATOMIC_MMU_DECLS, Richard Henderson, 2021/07/17
- [PATCH v3 05/10] accel/tcg: Standardize atomic helpers on softmmu api, Richard Henderson, 2021/07/17
- Re: [PATCH v3 05/10] accel/tcg: Standardize atomic helpers on softmmu api,
Peter Maydell <=
- [PATCH v3 10/10] accel/tcg: Push trace info building into atomic_common.c.inc, Richard Henderson, 2021/07/17
- [PATCH v3 09/10] trace: Fold mem-internal.h into mem.h, Richard Henderson, 2021/07/17
- [PATCH v3 08/10] accel/tcg: Expand ATOMIC_MMU_LOOKUP_*, Richard Henderson, 2021/07/17
- Re: [PATCH v3 00/10] Atomic cleanup + clang-12 build fix, Cole Robinson, 2021/07/18