qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v11 07/29] target/i386: [tcg] Refactor init_globals


From: Lluís Vilanova
Subject: [Qemu-devel] [PATCH v11 07/29] target/i386: [tcg] Refactor init_globals
Date: Wed, 28 Jun 2017 15:44:54 +0300
User-agent: StGit/0.17.1-dirty

Incrementally paves the way towards using the generic instruction translation
loop.

Signed-off-by: Lluís Vilanova <address@hidden>
---
 target/i386/translate.c |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/target/i386/translate.c b/target/i386/translate.c
index 04453ce48a..d015ea73fa 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -8435,6 +8435,22 @@ static void 
i386_trblock_init_disas_context(DisasContextBase *dcbase, CPUState *
 #endif
 }
 
+static void i386_trblock_init_globals(DisasContextBase *dcbase, CPUState *cpu)
+{
+    cpu_T0 = tcg_temp_new();
+    cpu_T1 = tcg_temp_new();
+    cpu_A0 = tcg_temp_new();
+
+    cpu_tmp0 = tcg_temp_new();
+    cpu_tmp1_i64 = tcg_temp_new_i64();
+    cpu_tmp2_i32 = tcg_temp_new_i32();
+    cpu_tmp3_i32 = tcg_temp_new_i32();
+    cpu_tmp4 = tcg_temp_new();
+    cpu_ptr0 = tcg_temp_new_ptr();
+    cpu_ptr1 = tcg_temp_new_ptr();
+    cpu_cc_srcT = tcg_temp_local_new();
+}
+
 /* generate intermediate code for basic block 'tb'.  */
 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb)
 {
@@ -8451,18 +8467,7 @@ void gen_intermediate_code(CPUState *cpu, 
TranslationBlock *tb)
     dc->base.pc_next = dc->base.pc_first;
     i386_trblock_init_disas_context(&dc->base, cpu);
 
-    cpu_T0 = tcg_temp_new();
-    cpu_T1 = tcg_temp_new();
-    cpu_A0 = tcg_temp_new();
-
-    cpu_tmp0 = tcg_temp_new();
-    cpu_tmp1_i64 = tcg_temp_new_i64();
-    cpu_tmp2_i32 = tcg_temp_new_i32();
-    cpu_tmp3_i32 = tcg_temp_new_i32();
-    cpu_tmp4 = tcg_temp_new();
-    cpu_ptr0 = tcg_temp_new_ptr();
-    cpu_ptr1 = tcg_temp_new_ptr();
-    cpu_cc_srcT = tcg_temp_local_new();
+    i386_trblock_init_globals(&dc->base, cpu);
 
     num_insns = 0;
     max_insns = tb->cflags & CF_COUNT_MASK;




reply via email to

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