[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-1.8 18/61] target-i386: Use MO_BE for movbe
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH for-1.8 18/61] target-i386: Use MO_BE for movbe |
Date: |
Thu, 7 Nov 2013 11:04:41 +1000 |
Fold the bswap into the memory operation.
Signed-off-by: Richard Henderson <address@hidden>
---
target-i386/translate.c | 40 +++++-----------------------------------
1 file changed, 5 insertions(+), 35 deletions(-)
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 714fb38..c433cc3 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -3869,44 +3869,14 @@ static void gen_sse(CPUX86State *env, DisasContext *s,
int b,
ot = MO_64;
}
- /* Load the data incoming to the bswap. Note that the TCG
- implementation of bswap requires the input be zero
- extended. In the case of the loads, we simply know that
- gen_op_ld_v via gen_ldst_modrm does that already. */
- if ((b & 1) == 0) {
- gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0);
- } else {
- switch (ot) {
- case MO_16:
- tcg_gen_ext16u_tl(cpu_T[0], cpu_regs[reg]);
- break;
- default:
- tcg_gen_ext32u_tl(cpu_T[0], cpu_regs[reg]);
- break;
- case MO_64:
- tcg_gen_mov_tl(cpu_T[0], cpu_regs[reg]);
- break;
- }
- }
-
- switch (ot) {
- case MO_16:
- tcg_gen_bswap16_tl(cpu_T[0], cpu_T[0]);
- break;
- default:
- tcg_gen_bswap32_tl(cpu_T[0], cpu_T[0]);
- break;
-#ifdef TARGET_X86_64
- case MO_64:
- tcg_gen_bswap64_tl(cpu_T[0], cpu_T[0]);
- break;
-#endif
- }
-
+ gen_lea_modrm(env, s, modrm);
if ((b & 1) == 0) {
+ tcg_gen_qemu_ld_tl(cpu_T[0], cpu_A0,
+ s->mem_index, ot | MO_BE);
gen_op_mov_reg_T0(ot, reg);
} else {
- gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1);
+ tcg_gen_qemu_st_tl(cpu_regs[reg], cpu_A0,
+ s->mem_index, ot | MO_BE);
}
break;
--
1.8.3.1
- [Qemu-devel] [PATCH for-1.8 08/61] target-i386: Remove gen_op_ldu_T0_A0, (continued)
- [Qemu-devel] [PATCH for-1.8 08/61] target-i386: Remove gen_op_ldu_T0_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 09/61] target-i386: Remove gen_op_ld_T1_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 10/61] target-i386: Remove gen_op_lds_T0_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 11/61] target-i386: Introduce gen_op_st_rm_T0_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 12/61] target-i386: Remove gen_op_st_T0_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 13/61] target-i386: Remove gen_op_st_T1_A0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 14/61] target-i386: Fix typo in gen_push_T1, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 15/61] target-i386: Tidy mov[sz][bw], Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 16/61] target-i386: Tidy movsl, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 17/61] target-i386: Remove unused arguments to gen_lea_modrm, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 18/61] target-i386: Use MO_BE for movbe,
Richard Henderson <=
- [Qemu-devel] [PATCH for-1.8 19/61] target-i386: Tidy gen_op_mov_TN_reg+tcg_gen_trunc_tl_i32, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 20/61] target-i386: Tidy load + truncate, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 21/61] target-i386: Tidy extend + store, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 22/61] target-i386: Tidy extend + move, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 23/61] target-i386: Remove gen_op_movl_T0_0, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 24/61] target-i386: Remove gen_op_movl_T0_im*, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 27/61] target-i386: Remove gen_movtl_T*_im, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 28/61] target-i386: Remove gen_op_andl_T0_ffff, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 29/61] target-i386: Remove gen_op_andl_T0_im, Richard Henderson, 2013/11/06
- [Qemu-devel] [PATCH for-1.8 30/61] target-i386: Remove gen_op_movl_T0_T1, Richard Henderson, 2013/11/06