[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 47/57] tcg/mips: Use atom_and_align_for_opc
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 47/57] tcg/mips: Use atom_and_align_for_opc |
Date: |
Fri, 5 May 2023 14:17:44 +0100 |
On Wed, 3 May 2023 at 08:41, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> tcg/mips/tcg-target.c.inc | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc
> index cd0254a0d7..43a8ffac17 100644
> --- a/tcg/mips/tcg-target.c.inc
> +++ b/tcg/mips/tcg-target.c.inc
> @@ -1139,6 +1139,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s,
> TCGLabelQemuLdst *l)
> typedef struct {
> TCGReg base;
> MemOp align;
> + MemOp atom;
> } HostAddress;
>
> bool tcg_target_has_memory_bswap(MemOp memop)
> @@ -1158,11 +1159,16 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext
> *s, HostAddress *h,
> {
> TCGLabelQemuLdst *ldst = NULL;
> MemOp opc = get_memop(oi);
> - unsigned a_bits = get_alignment_bits(opc);
> + MemOp a_bits, atom_u;
> unsigned s_bits = opc & MO_SIZE;
> - unsigned a_mask = (1 << a_bits) - 1;
> + unsigned a_mask;
> TCGReg base;
>
> + a_bits = atom_and_align_for_opc(s, &h->atom, &atom_u, opc,
> + MO_ATOM_IFALIGN, false);
> + h->align = a_bits;
> + a_mask = (1 << a_bits) - 1;
> +
> #ifdef CONFIG_SOFTMMU
> unsigned s_mask = (1 << s_bits) - 1;
> int mem_index = get_mmuidx(oi);
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
(For a set of functions so new they're not even in master yet
these do seem to have a surprisingly large variance in how
they're setting up these HostAddress structs...)
thanks
-- PMM
- Re: [PATCH v4 34/57] tcg/sparc64: Use standard slow path for softmmu, (continued)
- [PATCH v4 38/57] tcg/riscv: Support softmmu unaligned accesses, Richard Henderson, 2023/05/03
- [PATCH v4 39/57] tcg: Introduce tcg_target_has_memory_bswap, Richard Henderson, 2023/05/03
- [PATCH v4 43/57] tcg/i386: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 40/57] tcg: Add INDEX_op_qemu_{ld,st}_i128, Richard Henderson, 2023/05/03
- [PATCH v4 47/57] tcg/mips: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- Re: [PATCH v4 47/57] tcg/mips: Use atom_and_align_for_opc,
Peter Maydell <=
- [PATCH v4 44/57] tcg/aarch64: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 48/57] tcg/ppc: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 46/57] tcg/loongarch64: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 41/57] tcg: Support TCG_TYPE_I128 in tcg_out_{ld, st}_helper_{args, ret}, Richard Henderson, 2023/05/03
- [PATCH v4 50/57] tcg/s390x: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03