Patchwork [for-1.8,26/61] target-i386: Remove gen_op_mov*_A0_im

login
register
mail settings
Submitter Richard Henderson
Date Nov. 7, 2013, 1:04 a.m.
Message ID <1383786324-18415-27-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/289152/
State New
Headers show

Comments

Richard Henderson - Nov. 7, 2013, 1:04 a.m.
Propagate the definitions into all users.  In two cases, this allows
us to share code between the 32-bit and 64-bit immediate moves.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-i386/translate.c | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

Patch

diff --git a/target-i386/translate.c b/target-i386/translate.c
index 88e7d08..bda9ff4 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -252,18 +252,6 @@  static void gen_update_cc_op(DisasContext *s)
     }
 }
 
-static inline void gen_op_movl_A0_im(uint32_t val)
-{
-    tcg_gen_movi_tl(cpu_A0, val);
-}
-
-#ifdef TARGET_X86_64
-static inline void gen_op_movq_A0_im(int64_t val)
-{
-    tcg_gen_movi_tl(cpu_A0, val);
-}
-#endif
-
 static inline void gen_movtl_T0_im(target_ulong val)
 {
     tcg_gen_movi_tl(cpu_T[0], val);
@@ -2003,14 +1991,7 @@  static void gen_lea_modrm(CPUX86State *env, DisasContext *s, int modrm)
                     gen_op_addl_A0_im(disp);
             }
         } else {
-#ifdef TARGET_X86_64
-            if (s->aflag == 2) {
-                gen_op_movq_A0_im(disp);
-            } else
-#endif
-            {
-                gen_op_movl_A0_im(disp);
-            }
+            tcg_gen_movi_tl(cpu_A0, disp);
         }
         /* index == 4 means no index */
         if (havesib && (index != 4)) {
@@ -2045,7 +2026,7 @@  static void gen_lea_modrm(CPUX86State *env, DisasContext *s, int modrm)
             if (rm == 6) {
                 disp = cpu_lduw_code(env, s->pc);
                 s->pc += 2;
-                gen_op_movl_A0_im(disp);
+                tcg_gen_movi_tl(cpu_A0, disp);
                 rm = 0; /* avoid SS override */
                 goto no_rm;
             } else {
@@ -5619,7 +5600,6 @@  static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
             if (s->aflag == 2) {
                 offset_addr = cpu_ldq_code(env, s->pc);
                 s->pc += 8;
-                gen_op_movq_A0_im(offset_addr);
             } else
 #endif
             {
@@ -5628,8 +5608,8 @@  static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
                 } else {
                     offset_addr = insn_get(env, s, MO_16);
                 }
-                gen_op_movl_A0_im(offset_addr);
             }
+            tcg_gen_movi_tl(cpu_A0, offset_addr);
             gen_add_A0_ds_seg(s);
             if ((b & 2) == 0) {
                 gen_op_ld_v(s, ot, cpu_T[0], cpu_A0);