Skip to contentSkip to conversation

Delegate setup of TCG temporaries to targets

PATCH In review Blue Swirl 1 participant 1 message Jun 19, 2011

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

PATCH 1/18 Delegate setup of TCG temporaries to targets

Delegate TCG temp_buf setup to targets, so that they can use a stack frame later instead.

---
 tcg/arm/tcg-target.c   |    2 ++
 tcg/hppa/tcg-target.c  |    2 ++
 tcg/i386/tcg-target.c  |    2 ++
 tcg/ia64/tcg-target.c  |    2 ++
 tcg/mips/tcg-target.c  |    2 ++
 tcg/ppc/tcg-target.c   |    2 ++
 tcg/ppc64/tcg-target.c |    2 ++
 tcg/s390/tcg-target.c  |    2 ++
 tcg/sparc/tcg-target.c |    2 ++
 translate-all.c        |    2 --
 10 files changed, 18 insertions(+), 2 deletions(-)
tcg/arm/tcg-target.c +2 -0
index 457ad7e..93eb0f1 100644
@@ -1804,6 +1804,8 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_PC);
 
     tcg_add_target_add_op_defs(arm_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
 
 static inline void tcg_out_ld(TCGContext *s, TCGType type, int arg,
tcg/hppa/tcg-target.c +2 -0
index 7248520..79bca63 100644
@@ -1682,4 +1682,6 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R31); /* ble link reg */
 
     tcg_add_target_add_op_defs(hppa_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/i386/tcg-target.c +2 -0
index 72b3a48..3ff9105 100644
@@ -1981,4 +1981,6 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_ESP);
 
     tcg_add_target_add_op_defs(x86_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/ia64/tcg-target.c +2 -0
index 246b2c0..6386a5b 100644
@@ -2388,4 +2388,6 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_R6);
 
     tcg_add_target_add_op_defs(ia64_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/mips/tcg-target.c +2 -0
index cb2ab8b..12ff9d5 100644
@@ -1528,4 +1528,6 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP);   /* stack pointer */
 
     tcg_add_target_add_op_defs(mips_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/ppc/tcg-target.c +2 -0
index 266e699..dde4e18 100644
@@ -1919,4 +1919,6 @@ static void tcg_target_init(TCGContext *s)
 #endif
 
     tcg_add_target_add_op_defs(ppc_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/ppc64/tcg-target.c +2 -0
index 2e3cd2b..3218438 100644
@@ -1696,4 +1696,6 @@ static void tcg_target_init (TCGContext *s)
     tcg_regset_set_reg (s->reserved_regs, TCG_REG_R13);
 
     tcg_add_target_add_op_defs (ppc_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
tcg/s390/tcg-target.c +2 -0
index 8d8498c..2fc5646 100644
@@ -2291,6 +2291,8 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
 
     tcg_add_target_add_op_defs(s390_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
 
 static void tcg_target_qemu_prologue(TCGContext *s)
tcg/sparc/tcg-target.c +2 -0
index ecf7ace..86f8c1e 100644
@@ -1566,4 +1566,6 @@ static void tcg_target_init(TCGContext *s)
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_O6);
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_O7);
     tcg_add_target_add_op_defs(sparc_op_defs);
+    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
translate-all.c +0 -2
index 24878aa..041c108 100644
@@ -43,8 +43,6 @@ uint8_t gen_opc_instr_start[OPC_BUF_SIZE];
 void cpu_gen_init(void)
 {
     tcg_context_init(&tcg_ctx);
-    tcg_set_frame(&tcg_ctx, TCG_AREG0, offsetof(CPUState, temp_buf),
-                  CPU_TEMP_BUF_NLONGS * sizeof(long));
 }
 
 /* return non zero if the very first instruction is invalid so that
Signature · 1 line
1.6.2.4