qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-2.5 11/30] m68k: improve clr/moveq


From: Laurent Vivier
Subject: [Qemu-devel] [PATCH for-2.5 11/30] m68k: improve clr/moveq
Date: Sun, 9 Aug 2015 22:13:30 +0200

Generate the TCG constant and use it twice, instead
of generating the TCG constant twice to use it twice.

Signed-off-by: Laurent Vivier <address@hidden>
---
 target-m68k/translate.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 359c761..8a3d315 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -1431,10 +1431,13 @@ DISAS_INSN(lea)
 DISAS_INSN(clr)
 {
     int opsize;
+    TCGv zero;
+
+    zero = tcg_const_i32(0);
 
     opsize = insn_opsize(insn, 6);
-    DEST_EA(env, insn, opsize, tcg_const_i32(0), NULL);
-    gen_logic_cc(s, tcg_const_i32(0), opsize);
+    DEST_EA(env, insn, opsize, zero, NULL);
+    gen_logic_cc(s, zero, opsize);
 }
 
 static TCGv gen_get_ccr(DisasContext *s)
@@ -1776,11 +1779,11 @@ DISAS_INSN(branch)
 
 DISAS_INSN(moveq)
 {
-    uint32_t val;
+    TCGv val;
 
-    val = (int8_t)insn;
-    tcg_gen_movi_i32(DREG(insn, 9), val);
-    gen_logic_cc(s, tcg_const_i32(val), OS_LONG);
+    val = tcg_const_i32((int8_t)insn);
+    tcg_gen_mov_i32(DREG(insn, 9), val);
+    gen_logic_cc(s, val, OS_LONG);
 }
 
 DISAS_INSN(mvzs)
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]