提交 54604f74 编写于 作者: A aurel32

Some cleanups after dyngen removal

1. hostregs_helper.h: fix comment
2. translate-all.c: rename dyngen_code(_search_pc) to
   tcg_gen_code(_search_pc)
3. tcg.c:
  - rename dyngen_table_op_count to tcg_table_op_count
  - no need to generate a log of dyngen ops generated
  - rename dyngen_code(_search_pc) to tcg_gen_code(_search_pc)
4. tcg.h: rename dyngen_code(_search_pc) to
   tcg_gen_code(_search_pc)
Signed-off-by: NLaurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5936 c046a42c-6fe2-441c-8c8c-71466251a162
上级 5c16736a
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* The GCC global register vairable extension is used to reserve some /* The GCC global register variable extension is used to reserve some
host registers for use by dyngen. However only the core parts of the host registers for use by generated code. However only the core parts of
translation engine are compiled with these settings. We must manually the translation engine are compiled with these settings. We must manually
save/restore these registers when called from regular code. save/restore these registers when called from regular code.
It is not sufficient to save/restore T0 et. al. as these may be declared It is not sufficient to save/restore T0 et. al. as these may be declared
with a datatype smaller than the actual register. */ with a datatype smaller than the actual register. */
......
...@@ -1890,20 +1890,15 @@ static int tcg_reg_alloc_call(TCGContext *s, const TCGOpDef *def, ...@@ -1890,20 +1890,15 @@ static int tcg_reg_alloc_call(TCGContext *s, const TCGOpDef *def,
#ifdef CONFIG_PROFILER #ifdef CONFIG_PROFILER
static int64_t dyngen_table_op_count[NB_OPS]; static int64_t tcg_table_op_count[NB_OPS];
void dump_op_count(void) void dump_op_count(void)
{ {
int i; int i;
FILE *f; FILE *f;
f = fopen("/tmp/op1.log", "w"); f = fopen("/tmp/op.log", "w");
for(i = 0; i < INDEX_op_end; i++) {
fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, dyngen_table_op_count[i]);
}
fclose(f);
f = fopen("/tmp/op2.log", "w");
for(i = INDEX_op_end; i < NB_OPS; i++) { for(i = INDEX_op_end; i < NB_OPS; i++) {
fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, dyngen_table_op_count[i]); fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
} }
fclose(f); fclose(f);
} }
...@@ -1953,7 +1948,7 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, ...@@ -1953,7 +1948,7 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
for(;;) { for(;;) {
opc = gen_opc_buf[op_index]; opc = gen_opc_buf[op_index];
#ifdef CONFIG_PROFILER #ifdef CONFIG_PROFILER
dyngen_table_op_count[opc]++; tcg_table_op_count[opc]++;
#endif #endif
def = &tcg_op_defs[opc]; def = &tcg_op_defs[opc];
#if 0 #if 0
...@@ -2030,7 +2025,7 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, ...@@ -2030,7 +2025,7 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
return -1; return -1;
} }
int dyngen_code(TCGContext *s, uint8_t *gen_code_buf) int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf)
{ {
#ifdef CONFIG_PROFILER #ifdef CONFIG_PROFILER
{ {
...@@ -2058,7 +2053,7 @@ int dyngen_code(TCGContext *s, uint8_t *gen_code_buf) ...@@ -2058,7 +2053,7 @@ int dyngen_code(TCGContext *s, uint8_t *gen_code_buf)
offset bytes from the start of the TB. The contents of gen_code_buf must offset bytes from the start of the TB. The contents of gen_code_buf must
not be changed, though writing the same values is ok. not be changed, though writing the same values is ok.
Return -1 if not found. */ Return -1 if not found. */
int dyngen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset) int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset)
{ {
return tcg_gen_code_common(s, gen_code_buf, offset); return tcg_gen_code_common(s, gen_code_buf, offset);
} }
......
...@@ -314,8 +314,8 @@ static inline void *tcg_malloc(int size) ...@@ -314,8 +314,8 @@ static inline void *tcg_malloc(int size)
void tcg_context_init(TCGContext *s); void tcg_context_init(TCGContext *s);
void tcg_func_start(TCGContext *s); void tcg_func_start(TCGContext *s);
int dyngen_code(TCGContext *s, uint8_t *gen_code_buf); int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf);
int dyngen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset); int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset);
void tcg_set_frame(TCGContext *s, int reg, void tcg_set_frame(TCGContext *s, int reg,
tcg_target_long start, tcg_target_long size); tcg_target_long start, tcg_target_long size);
......
...@@ -118,7 +118,7 @@ int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr) ...@@ -118,7 +118,7 @@ int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr)
s->interm_time += profile_getclock() - ti; s->interm_time += profile_getclock() - ti;
s->code_time -= profile_getclock(); s->code_time -= profile_getclock();
#endif #endif
gen_code_size = dyngen_code(s, gen_code_buf); gen_code_size = tcg_gen_code(s, gen_code_buf);
*gen_code_size_ptr = gen_code_size; *gen_code_size_ptr = gen_code_size;
#ifdef CONFIG_PROFILER #ifdef CONFIG_PROFILER
s->code_time += profile_getclock(); s->code_time += profile_getclock();
...@@ -177,7 +177,7 @@ int cpu_restore_state(TranslationBlock *tb, ...@@ -177,7 +177,7 @@ int cpu_restore_state(TranslationBlock *tb,
s->tb_jmp_offset = NULL; s->tb_jmp_offset = NULL;
s->tb_next = tb->tb_next; s->tb_next = tb->tb_next;
#endif #endif
j = dyngen_code_search_pc(s, (uint8_t *)tc_ptr, searched_pc - tc_ptr); j = tcg_gen_code_search_pc(s, (uint8_t *)tc_ptr, searched_pc - tc_ptr);
if (j < 0) if (j < 0)
return -1; return -1;
/* now find start of instruction before */ /* now find start of instruction before */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册