[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 41/48] tcg: Canonicalize alignment flags in MemOp
From: |
Richard Henderson |
Subject: |
[PATCH v4 41/48] tcg: Canonicalize alignment flags in MemOp |
Date: |
Tue, 12 Oct 2021 19:46:00 -0700 |
Having observed e.g. al8+leq in dumps, canonicalize to al+leq.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg-op.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index b1cfd36f29..61b492d89f 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -2765,7 +2765,12 @@ void tcg_gen_lookup_and_goto_ptr(void)
static inline MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st)
{
/* Trigger the asserts within as early as possible. */
- (void)get_alignment_bits(op);
+ unsigned a_bits = get_alignment_bits(op);
+
+ /* Prefer MO_ALIGN+MO_XX over MO_ALIGN_XX+MO_XX */
+ if (a_bits == (op & MO_SIZE)) {
+ op = (op & ~MO_AMASK) | MO_ALIGN;
+ }
switch (op & MO_SIZE) {
case MO_8:
--
2.25.1
- [PATCH v4 35/48] target/alpha: Reorg fp memory operations, (continued)
- [PATCH v4 35/48] target/alpha: Reorg fp memory operations, Richard Henderson, 2021/10/12
- [PATCH v4 36/48] target/alpha: Reorg integer memory operations, Richard Henderson, 2021/10/12
- [PATCH v4 25/48] target/mips: Use 8-byte memory ops for msa load/store, Richard Henderson, 2021/10/12
- [PATCH v4 30/48] tcg: Add helper_unaligned_{ld, st} for user-only sigbus, Richard Henderson, 2021/10/12
- [PATCH v4 39/48] target/sh4: Implement prctl_unalign_sigbus, Richard Henderson, 2021/10/12
- [PATCH v4 27/48] target/sparc: Use cpu_*_mmu instead of helper_*_mmu, Richard Henderson, 2021/10/12
- [PATCH v4 32/48] linux-user: Disable more prctl subcodes, Richard Henderson, 2021/10/12
- [PATCH v4 33/48] Revert "cpu: Move cpu_common_props to hw/core/cpu.c", Richard Henderson, 2021/10/12
- [PATCH v4 38/48] target/hppa: Implement prctl_unalign_sigbus, Richard Henderson, 2021/10/12
- [PATCH v4 40/48] linux-user/signal: Handle BUS_ADRALN in host_signal_handler, Richard Henderson, 2021/10/12
- [PATCH v4 41/48] tcg: Canonicalize alignment flags in MemOp,
Richard Henderson <=
- [PATCH v4 43/48] tcg/aarch64: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 42/48] tcg/i386: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 44/48] tcg/ppc: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 45/48] tcg/s390: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 46/48] tcg/tci: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 47/48] tcg/riscv: Support raising sigbus for user-only, Richard Henderson, 2021/10/12
- [PATCH v4 48/48] tests/tcg/multiarch: Add sigbus.c, Richard Henderson, 2021/10/12