[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 01/54] include/exec/memop: Add MO_ATOM_*
From: |
Peter Maydell |
Subject: |
Re: [PATCH v5 01/54] include/exec/memop: Add MO_ATOM_* |
Date: |
Mon, 15 May 2023 17:32:40 +0100 |
On Mon, 15 May 2023 at 15:34, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This field may be used to describe the precise atomicity requirements
> of the guest, which may then be used to constrain the methods by which
> it may be emulated by the host.
> @@ -2330,17 +2339,23 @@ static void tcg_dump_ops(TCGContext *s, FILE *f, bool
> have_prefs)
> case INDEX_op_qemu_ld_i64:
> case INDEX_op_qemu_st_i64:
> {
> + const char *s_al, *s_op, *s_at = NULL;
Do we need this NULL initializer? We seem to immediately assign
to s_at below, same as we do for s_al and s_op.
> MemOpIdx oi = op->args[k++];
> MemOp op = get_memop(oi);
> unsigned ix = get_mmuidx(oi);
>
> - if (op & ~(MO_AMASK | MO_BSWAP | MO_SSIZE)) {
> - col += ne_fprintf(f, ",$0x%x,%u", op, ix);
> + s_al = alignment_name[(op & MO_AMASK) >> MO_ASHIFT];
> + s_op = ldst_name[op & (MO_BSWAP | MO_SSIZE)];
> + s_at = atom_name[(op & MO_ATOM_MASK) >> MO_ATOM_SHIFT];
> + op &= ~(MO_AMASK | MO_BSWAP | MO_SSIZE | MO_ATOM_MASK);
> +
> + /* If all fields are accounted for, print symbolically.
> */
> + if (!op && s_al && s_op && s_at) {
> + col += ne_fprintf(f, ",%s%s%s,%u",
> + s_at, s_al, s_op, ix);
> } else {
> - const char *s_al, *s_op;
> - s_al = alignment_name[(op & MO_AMASK) >> MO_ASHIFT];
> - s_op = ldst_name[op & (MO_BSWAP | MO_SSIZE)];
> - col += ne_fprintf(f, ",%s%s,%u", s_al, s_op, ix);
> + op = get_memop(oi);
> + col += ne_fprintf(f, ",$0x%x,%u", op, ix);
> }
> i = 1;
> }
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v5 00/54] tcg: Improve atomicity support, Richard Henderson, 2023/05/15
- [PATCH v5 01/54] include/exec/memop: Add MO_ATOM_*, Richard Henderson, 2023/05/15
- Re: [PATCH v5 01/54] include/exec/memop: Add MO_ATOM_*,
Peter Maydell <=
- [PATCH v5 04/54] tcg: Unify helper_{be,le}_{ld,st}*, Richard Henderson, 2023/05/15
- [PATCH v5 02/54] accel/tcg: Honor atomicity of loads, Richard Henderson, 2023/05/15
- [PATCH v5 06/54] tcg/tci: Use helper_{ld,st}*_mmu for user-only, Richard Henderson, 2023/05/15
- [PATCH v5 05/54] accel/tcg: Implement helper_{ld, st}*_mmu for user-only, Richard Henderson, 2023/05/15
- [PATCH v5 08/54] meson: Detect atomic128 support with optimization, Richard Henderson, 2023/05/15
- [PATCH v5 03/54] accel/tcg: Honor atomicity of stores, Richard Henderson, 2023/05/15