diff mbox

[v2,9/9] target-sh4: simplify tas instruction

Message ID 1387713039-9584-10-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno Dec. 22, 2013, 11:50 a.m. UTC
Now that setcondi is used instead of branches, temp_local are not needed
anymore.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-sh4/translate.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Richard Henderson Dec. 24, 2013, 2:49 p.m. UTC | #1
On 12/22/2013 03:50 AM, Aurelien Jarno wrote:
> Now that setcondi is used instead of branches, temp_local are not needed
> anymore.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target-sh4/translate.c |   10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 9a878d0..e73932c 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -1673,16 +1673,12 @@  static void _decode_opc(DisasContext * ctx)
 	return;
     case 0x401b:		/* tas.b @Rn */
 	{
-	    TCGv addr, val;
-	    addr = tcg_temp_local_new();
-	    tcg_gen_mov_i32(addr, REG(B11_8));
-	    val = tcg_temp_local_new();
-            tcg_gen_qemu_ld_i32(val, addr, ctx->memidx, MO_UB);
+	    TCGv val = tcg_temp_new();
+            tcg_gen_qemu_ld_i32(val, REG(B11_8), ctx->memidx, MO_UB);
             tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_sr_t, val, 0);
 	    tcg_gen_ori_i32(val, val, 0x80);
-            tcg_gen_qemu_st_i32(val, addr, ctx->memidx, MO_UB);
+            tcg_gen_qemu_st_i32(val, REG(B11_8), ctx->memidx, MO_UB);
 	    tcg_temp_free(val);
-	    tcg_temp_free(addr);
 	}
 	return;
     case 0xf00d: /* fsts FPUL,FRn - FPSCR: Nothing */