[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 45/57] tcg/arm: Use atom_and_align_for_opc
From: |
Richard Henderson |
Subject: |
[PATCH v4 45/57] tcg/arm: Use atom_and_align_for_opc |
Date: |
Wed, 3 May 2023 08:06:44 +0100 |
No change to the ultimate load/store routines yet, so some atomicity
conditions not yet honored, but plumbs the change to alignment through
the relevant functions.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/arm/tcg-target.c.inc | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc
index e5aed03247..edd995e04f 100644
--- a/tcg/arm/tcg-target.c.inc
+++ b/tcg/arm/tcg-target.c.inc
@@ -1323,6 +1323,8 @@ typedef struct {
TCGReg base;
int index;
bool index_scratch;
+ MemOp align;
+ MemOp atom;
} HostAddress;
bool tcg_target_has_memory_bswap(MemOp memop)
@@ -1379,8 +1381,12 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext
*s, HostAddress *h,
{
TCGLabelQemuLdst *ldst = NULL;
MemOp opc = get_memop(oi);
- MemOp a_bits = get_alignment_bits(opc);
- unsigned a_mask = (1 << a_bits) - 1;
+ MemOp a_bits, atom_a, atom_u;
+ unsigned a_mask;
+
+ a_bits = atom_and_align_for_opc(s, &atom_a, &atom_u, opc,
+ MO_ATOM_IFALIGN, false);
+ a_mask = (1 << a_bits) - 1;
#ifdef CONFIG_SOFTMMU
int mem_index = get_mmuidx(oi);
@@ -1498,6 +1504,9 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s,
HostAddress *h,
};
#endif
+ h->align = a_bits;
+ h->atom = atom_a;
+
return ldst;
}
--
2.34.1
- Re: [PATCH v4 44/57] tcg/aarch64: Use atom_and_align_for_opc, (continued)
- [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
- [PATCH v4 45/57] tcg/arm: Use atom_and_align_for_opc,
Richard Henderson <=
- [PATCH v4 42/57] tcg: Introduce atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 52/57] tcg/i386: Honor 64-bit atomicity in 32-bit mode, Richard Henderson, 2023/05/03
- [PATCH v4 51/57] tcg/sparc64: Use atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 53/57] tcg/i386: Support 128-bit load/store with have_atomic16, Richard Henderson, 2023/05/03