Commit 54604f74ae618aca3715cf0d8cb2ede923c0d6c0

Authored by aurel32
1 parent 5c16736a

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: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5936 c046a42c-6fe2-441c-8c8c-71466251a162
hostregs_helper.h
@@ -18,9 +18,9 @@ @@ -18,9 +18,9 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21 -/* The GCC global register vairable extension is used to reserve some  
22 - host registers for use by dyngen. However only the core parts of the  
23 - translation engine are compiled with these settings. We must manually 21 +/* The GCC global register variable extension is used to reserve some
  22 + host registers for use by generated code. However only the core parts of
  23 + the translation engine are compiled with these settings. We must manually
24 save/restore these registers when called from regular code. 24 save/restore these registers when called from regular code.
25 It is not sufficient to save/restore T0 et. al. as these may be declared 25 It is not sufficient to save/restore T0 et. al. as these may be declared
26 with a datatype smaller than the actual register. */ 26 with a datatype smaller than the actual register. */
tcg/tcg.c
@@ -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,
1890 1890
1891 #ifdef CONFIG_PROFILER 1891 #ifdef CONFIG_PROFILER
1892 1892
1893 -static int64_t dyngen_table_op_count[NB_OPS]; 1893 +static int64_t tcg_table_op_count[NB_OPS];
1894 1894
1895 void dump_op_count(void) 1895 void dump_op_count(void)
1896 { 1896 {
1897 int i; 1897 int i;
1898 FILE *f; 1898 FILE *f;
1899 - f = fopen("/tmp/op1.log", "w");  
1900 - for(i = 0; i < INDEX_op_end; i++) {  
1901 - fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, dyngen_table_op_count[i]);  
1902 - }  
1903 - fclose(f);  
1904 - f = fopen("/tmp/op2.log", "w"); 1899 + f = fopen("/tmp/op.log", "w");
1905 for(i = INDEX_op_end; i < NB_OPS; i++) { 1900 for(i = INDEX_op_end; i < NB_OPS; i++) {
1906 - fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, dyngen_table_op_count[i]); 1901 + fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
1907 } 1902 }
1908 fclose(f); 1903 fclose(f);
1909 } 1904 }
@@ -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,
1953 for(;;) { 1948 for(;;) {
1954 opc = gen_opc_buf[op_index]; 1949 opc = gen_opc_buf[op_index];
1955 #ifdef CONFIG_PROFILER 1950 #ifdef CONFIG_PROFILER
1956 - dyngen_table_op_count[opc]++; 1951 + tcg_table_op_count[opc]++;
1957 #endif 1952 #endif
1958 def = &tcg_op_defs[opc]; 1953 def = &tcg_op_defs[opc];
1959 #if 0 1954 #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,
2030 return -1; 2025 return -1;
2031 } 2026 }
2032 2027
2033 -int dyngen_code(TCGContext *s, uint8_t *gen_code_buf) 2028 +int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf)
2034 { 2029 {
2035 #ifdef CONFIG_PROFILER 2030 #ifdef CONFIG_PROFILER
2036 { 2031 {
@@ -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)
2058 offset bytes from the start of the TB. The contents of gen_code_buf must 2053 offset bytes from the start of the TB. The contents of gen_code_buf must
2059 not be changed, though writing the same values is ok. 2054 not be changed, though writing the same values is ok.
2060 Return -1 if not found. */ 2055 Return -1 if not found. */
2061 -int dyngen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset) 2056 +int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset)
2062 { 2057 {
2063 return tcg_gen_code_common(s, gen_code_buf, offset); 2058 return tcg_gen_code_common(s, gen_code_buf, offset);
2064 } 2059 }
tcg/tcg.h
@@ -314,8 +314,8 @@ static inline void *tcg_malloc(int size) @@ -314,8 +314,8 @@ static inline void *tcg_malloc(int size)
314 void tcg_context_init(TCGContext *s); 314 void tcg_context_init(TCGContext *s);
315 void tcg_func_start(TCGContext *s); 315 void tcg_func_start(TCGContext *s);
316 316
317 -int dyngen_code(TCGContext *s, uint8_t *gen_code_buf);  
318 -int dyngen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset); 317 +int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf);
  318 +int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset);
319 319
320 void tcg_set_frame(TCGContext *s, int reg, 320 void tcg_set_frame(TCGContext *s, int reg,
321 tcg_target_long start, tcg_target_long size); 321 tcg_target_long start, tcg_target_long size);
translate-all.c
@@ -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)
118 s->interm_time += profile_getclock() - ti; 118 s->interm_time += profile_getclock() - ti;
119 s->code_time -= profile_getclock(); 119 s->code_time -= profile_getclock();
120 #endif 120 #endif
121 - gen_code_size = dyngen_code(s, gen_code_buf); 121 + gen_code_size = tcg_gen_code(s, gen_code_buf);
122 *gen_code_size_ptr = gen_code_size; 122 *gen_code_size_ptr = gen_code_size;
123 #ifdef CONFIG_PROFILER 123 #ifdef CONFIG_PROFILER
124 s->code_time += profile_getclock(); 124 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,
177 s->tb_jmp_offset = NULL; 177 s->tb_jmp_offset = NULL;
178 s->tb_next = tb->tb_next; 178 s->tb_next = tb->tb_next;
179 #endif 179 #endif
180 - j = dyngen_code_search_pc(s, (uint8_t *)tc_ptr, searched_pc - tc_ptr); 180 + j = tcg_gen_code_search_pc(s, (uint8_t *)tc_ptr, searched_pc - tc_ptr);
181 if (j < 0) 181 if (j < 0)
182 return -1; 182 return -1;
183 /* now find start of instruction before */ 183 /* now find start of instruction before */