[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/28] target/i386: Improve bswap translation
From: |
Richard Henderson |
Subject: |
[PATCH 23/28] target/i386: Improve bswap translation |
Date: |
Mon, 14 Jun 2021 01:37:55 -0700 |
Use a break instead of an ifdefed else.
There's no need to move the values through s->T0.
Remove TCG_BSWAP_IZ and the preceding zero-extension.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/translate.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index e8a9dcd21a..b21873ed23 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -7195,17 +7195,11 @@ static target_ulong disas_insn(DisasContext *s,
CPUState *cpu)
reg = (b & 7) | REX_B(s);
#ifdef TARGET_X86_64
if (dflag == MO_64) {
- gen_op_mov_v_reg(s, MO_64, s->T0, reg);
- tcg_gen_bswap64_i64(s->T0, s->T0);
- gen_op_mov_reg_v(s, MO_64, reg, s->T0);
- } else
-#endif
- {
- gen_op_mov_v_reg(s, MO_32, s->T0, reg);
- tcg_gen_ext32u_tl(s->T0, s->T0);
- tcg_gen_bswap32_tl(s->T0, s->T0, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
- gen_op_mov_reg_v(s, MO_32, reg, s->T0);
+ tcg_gen_bswap64_i64(cpu_regs[reg], cpu_regs[reg]);
+ break;
}
+#endif
+ tcg_gen_bswap32_tl(cpu_regs[reg], cpu_regs[reg], TCG_BSWAP_OZ);
break;
case 0xd6: /* salc */
if (CODE64(s))
--
2.25.1
- [PATCH 19/28] tcg: Make use of bswap flags in tcg_gen_qemu_st_*, (continued)
- [PATCH 19/28] tcg: Make use of bswap flags in tcg_gen_qemu_st_*, Richard Henderson, 2021/06/14
- [PATCH 25/28] target/mips: Fix gen_mxu_s32ldd_s32lddr, Richard Henderson, 2021/06/14
- [PATCH 27/28] tcg/aarch64: Unset TCG_TARGET_HAS_MEMORY_BSWAP, Richard Henderson, 2021/06/14
- [PATCH 12/28] tcg/s390: Support bswap flags, Richard Henderson, 2021/06/14
- [PATCH 21/28] target/arm: Improve vector REV, Richard Henderson, 2021/06/14
- [PATCH 23/28] target/i386: Improve bswap translation,
Richard Henderson <=
- [PATCH 24/28] target/sh4: Improve swap.b translation, Richard Henderson, 2021/06/14
- [PATCH 22/28] target/arm: Improve REVSH, Richard Henderson, 2021/06/14
- [PATCH 28/28] tcg/riscv: Remove MO_BSWAP handling, Richard Henderson, 2021/06/14
- [PATCH 26/28] tcg/arm: Unset TCG_TARGET_HAS_MEMORY_BSWAP, Richard Henderson, 2021/06/14