[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 60/63] target/mips: Fix gen_mxu_s32ldd_s32lddr
From: |
Richard Henderson |
Subject: |
[PULL 60/63] target/mips: Fix gen_mxu_s32ldd_s32lddr |
Date: |
Tue, 29 Jun 2021 11:54:52 -0700 |
There were two bugs here: (1) the required endianness was
not present in the MemOp, and (2) we were not providing a
zero-extended input to the bswap as semantics required.
The best fix is to fold the bswap into the memory operation,
producing the desired result directly.
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/mips/tcg/mxu_translate.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c
index 3f35e46399..f52244e1b2 100644
--- a/target/mips/tcg/mxu_translate.c
+++ b/target/mips/tcg/mxu_translate.c
@@ -857,12 +857,8 @@ static void gen_mxu_s32ldd_s32lddr(DisasContext *ctx)
tcg_gen_ori_tl(t1, t1, 0xFFFFF000);
}
tcg_gen_add_tl(t1, t0, t1);
- tcg_gen_qemu_ld_tl(t1, t1, ctx->mem_idx, MO_SL);
+ tcg_gen_qemu_ld_tl(t1, t1, ctx->mem_idx, MO_TESL ^ (sel * MO_BSWAP));
- if (sel == 1) {
- /* S32LDDR */
- tcg_gen_bswap32_tl(t1, t1, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
- }
gen_store_mxu_gpr(t1, XRa);
tcg_temp_free(t0);
--
2.25.1
- [PULL 52/63] tcg: Add flags argument to tcg_gen_bswap16_*, tcg_gen_bswap32_i64, (continued)
- [PULL 52/63] tcg: Add flags argument to tcg_gen_bswap16_*, tcg_gen_bswap32_i64, Richard Henderson, 2021/06/29
- [PULL 51/63] tcg: Handle new bswap flags during optimize, Richard Henderson, 2021/06/29
- [PULL 54/63] tcg: Make use of bswap flags in tcg_gen_qemu_st_*, Richard Henderson, 2021/06/29
- [PULL 50/63] tcg/tci: Support bswap flags, Richard Henderson, 2021/06/29
- [PULL 53/63] tcg: Make use of bswap flags in tcg_gen_qemu_ld_*, Richard Henderson, 2021/06/29
- [PULL 57/63] target/arm: Improve REVSH, Richard Henderson, 2021/06/29
- [PULL 59/63] target/sh4: Improve swap.b translation, Richard Henderson, 2021/06/29
- [PULL 56/63] target/arm: Improve vector REV, Richard Henderson, 2021/06/29
- [PULL 58/63] target/i386: Improve bswap translation, Richard Henderson, 2021/06/29
- [PULL 62/63] tcg/aarch64: Unset TCG_TARGET_HAS_MEMORY_BSWAP, Richard Henderson, 2021/06/29
- [PULL 60/63] target/mips: Fix gen_mxu_s32ldd_s32lddr,
Richard Henderson <=
- [PULL 55/63] target/arm: Improve REV32, Richard Henderson, 2021/06/29
- [PULL 63/63] tcg/riscv: Remove MO_BSWAP handling, Richard Henderson, 2021/06/29
- [PULL 61/63] tcg/arm: Unset TCG_TARGET_HAS_MEMORY_BSWAP, Richard Henderson, 2021/06/29