target/mips: Use tcg_gen_lea() for [D]LSA and MXU S32LD*V opcodes
PATCH 1/1 target/mips: Use tcg_gen_lea() for [D]LSA and MXU S32LD*V opcodes
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
---
Based-on: <[email protected]>
--- target/mips/tcg/mxu_translate.c | 3 +-- target/mips/tcg/translate_addr_const.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-)
target/mips/tcg/mxu_translate.c +1 -2
@@ -1601,8 +1601,7 @@ static void gen_mxu_s32ldxvx(DisasContext *ctx, bool reversed,gen_load_gpr (t0, Rb);gen_load_gpr (t1, Rc); -tcg_gen_shli_i32 (t1, t1, strd2); -tcg_gen_add_i32 (t0, t0, t1); +tcg_gen_lea_i32 (t0, t0, t1, strd2,0 ); tcg_gen_qemu_ld_i32(t1, t0, ctx->mem_idx, MO_SL | mo_endian_rev(ctx, reversed) |
target/mips/tcg/translate_addr_const.c +2 -4
@@ -26,8 +26,7 @@ bool gen_lsa(DisasContext *ctx, int rd, int rt, int rs, int sa) t1 =tcg_temp_new ();gen_load_gpr (t0, rs);gen_load_gpr (t1, rt); -tcg_gen_shli_tl (t0, t0, sa); -tcg_gen_add_tl (cpu_gpr[rd], t0, t1); +tcg_gen_lea_tl (cpu_gpr[rd], t1, t0, sa,0 );tcg_gen_ext32s_tl (cpu_gpr[rd], cpu_gpr[rd]);return true; }
@@ -47,7 +46,6 @@ bool gen_dlsa(DisasContext *ctx, int rd, int rt, int rs, int sa) t1 =tcg_temp_new ();gen_load_gpr (t0, rs);gen_load_gpr (t1, rt); -tcg_gen_shli_tl (t0, t0, sa); -tcg_gen_add_tl (cpu_gpr[rd], t0, t1); +tcg_gen_lea_tl (cpu_gpr[rd], t1, t0, sa,0 );return true; }
Signature · 1 line
2.53.0
Quoted 7 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé<[email protected]>---
Based-on:<[email protected]>--- target/mips/tcg/mxu_translate.c | 3 +-- target/mips/tcg/translate_addr_const.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
Thanks, I've queued this with the rest of the lea patch set.
r~