[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/23] target-sparc: Cleanup "global" temporary allo
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 21/23] target-sparc: Cleanup "global" temporary allocation |
Date: |
Fri, 5 Oct 2012 16:55:08 -0700 |
There are 6 temporaries that disas_sparc_insn relies on having been
allocated. Now that they are no longer referenced across branches,
they need not be allocated as local temps.
Move the allocation/free of these temporaries to make it clear that
they are local to the translation of a single insn.
Signed-off-by: Richard Henderson <address@hidden>
---
target-sparc/translate.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index d594284..48c245e 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -5177,16 +5177,6 @@ static inline void
gen_intermediate_code_internal(TranslationBlock * tb,
dc->singlestep = (env->singlestep_enabled || singlestep);
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
- cpu_tmp0 = tcg_temp_new();
- cpu_tmp32 = tcg_temp_new_i32();
- cpu_tmp64 = tcg_temp_new_i64();
-
- cpu_dst = tcg_temp_local_new();
-
- // loads and stores
- cpu_val = tcg_temp_local_new();
- cpu_addr = tcg_temp_local_new();
-
num_insns = 0;
max_insns = tb->cflags & CF_COUNT_MASK;
if (max_insns == 0)
@@ -5222,9 +5212,24 @@ static inline void
gen_intermediate_code_internal(TranslationBlock * tb,
gen_io_start();
last_pc = dc->pc;
insn = cpu_ldl_code(env, dc->pc);
+
+ cpu_tmp0 = tcg_temp_new();
+ cpu_tmp32 = tcg_temp_new_i32();
+ cpu_tmp64 = tcg_temp_new_i64();
+ cpu_dst = tcg_temp_new();
+ cpu_val = tcg_temp_new();
+ cpu_addr = tcg_temp_new();
+
disas_sparc_insn(dc, insn);
num_insns++;
+ tcg_temp_free(cpu_addr);
+ tcg_temp_free(cpu_val);
+ tcg_temp_free(cpu_dst);
+ tcg_temp_free_i64(cpu_tmp64);
+ tcg_temp_free_i32(cpu_tmp32);
+ tcg_temp_free(cpu_tmp0);
+
if (dc->is_br)
break;
/* if the next PC is different, we abort now */
@@ -5244,23 +5249,18 @@ static inline void
gen_intermediate_code_internal(TranslationBlock * tb,
num_insns < max_insns);
exit_gen_loop:
- tcg_temp_free(cpu_addr);
- tcg_temp_free(cpu_val);
- tcg_temp_free(cpu_dst);
- tcg_temp_free_i64(cpu_tmp64);
- tcg_temp_free_i32(cpu_tmp32);
- tcg_temp_free(cpu_tmp0);
-
- if (tb->cflags & CF_LAST_IO)
+ if (tb->cflags & CF_LAST_IO) {
gen_io_end();
+ }
if (!dc->is_br) {
if (dc->pc != DYNAMIC_PC &&
(dc->npc != DYNAMIC_PC && dc->npc != JUMP_PC)) {
/* static PC and NPC: we can use direct chaining */
gen_goto_tb(dc, 0, dc->pc, dc->npc);
} else {
- if (dc->pc != DYNAMIC_PC)
+ if (dc->pc != DYNAMIC_PC) {
tcg_gen_movi_tl(cpu_pc, dc->pc);
+ }
save_npc(dc);
tcg_gen_exit_tb(0);
}
--
1.7.11.4
- [Qemu-devel] [PATCH 09/23] target-sparc: Tidy gen_generic_branch interface, (continued)
- [Qemu-devel] [PATCH 09/23] target-sparc: Tidy gen_generic_branch interface, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 17/23] target-sparc: Tidy Tcc, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 12/23] target-sparc: Use DisasCompare and movcond in FMOVR, FMOVCC, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 11/23] target-sparc: Use DisasCompare in Tcc, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 13/23] target-sparc: Use DisasCompare and movcond in MOVCC, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 18/23] target-sparc: Move taddcctv and tsubcctv out of line, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 04/23] target-sparc: Tidy flush_cond interface, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 16/23] target-sparc: Move sdivx and udivx out of line, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 14/23] target-sparc: Use DisasCompare and movcond in MOVR, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 15/23] target-sparc: Use movcond in gen_generic_branch, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 21/23] target-sparc: Cleanup "global" temporary allocation,
Richard Henderson <=
- [Qemu-devel] [PATCH 23/23] target-sparc: Optimize conditionals using SUBCC, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 22/23] target-sparc: Fall through from not-taken trap, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 19/23] target-sparc: Use movcond in mulscc, Richard Henderson, 2012/10/05
- [Qemu-devel] [PATCH 20/23] target-sparc: Use movcond for FMOV*R, Richard Henderson, 2012/10/05
- Re: [Qemu-devel] [PATCH 00/23] target-sparc comparison improvements, Blue Swirl, 2012/10/07