Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9QMX-00069t-QC for qemu-devel@nongnu.org; Sun, 07 Dec 2008 15:36:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9QMW-00069h-LQ for qemu-devel@nongnu.org; Sun, 07 Dec 2008 15:36:20 -0500 Received: from [199.232.76.173] (port=58469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9QMW-00069e-E1 for qemu-devel@nongnu.org; Sun, 07 Dec 2008 15:36:20 -0500 Received: from hall.aurel32.net ([88.191.82.174]:35667) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L9QMV-0002TY-SF for qemu-devel@nongnu.org; Sun, 07 Dec 2008 15:36:20 -0500 Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1L9QMU-0003s6-9j for qemu-devel@nongnu.org; Sun, 07 Dec 2008 21:36:18 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1L9QMT-0002T6-Ct for qemu-devel@nongnu.org; Sun, 07 Dec 2008 21:36:17 +0100 Date: Sun, 7 Dec 2008 21:36:17 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Some cleanups after dyngen removal Message-ID: <20081207203617.GB3591@volta.aurel32.net> References: <761ea48b0812070912q5a1961d9t3bbf5905238daee8@mail.gmail.com> <20081207181721.GB19389@hall.aurel32.net> <761ea48b0812071110m6409f99dje1687b37ccf2f012@mail.gmail.com> <761ea48b0812071117j7e180071r847d3935173a8a09@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <761ea48b0812071117j7e180071r847d3935173a8a09@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sun, Dec 07, 2008 at 08:17:46PM +0100, Laurent Desnogues wrote: > On Sun, Dec 7, 2008 at 8:10 PM, Laurent Desnogues > wrote: > > > > Here are some further cleanups. > > > > 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) > > Sorry, the previous patch contained an obvious mistake. > Thanks, applied. > Laurent > > Signed-off-by: Laurent Desnogues > Index: hostregs_helper.h > =================================================================== > --- hostregs_helper.h (revision 5931) > +++ hostregs_helper.h (working copy) > @@ -18,9 +18,9 @@ > * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > */ > > -/* The GCC global register vairable extension is used to reserve some > - host registers for use by dyngen. However only the core parts of the > - translation engine are compiled with these settings. We must manually > +/* The GCC global register variable extension is used to reserve some > + host registers for use by generated code. However only the core parts of > + the translation engine are compiled with these settings. We must manually > save/restore these registers when called from regular code. > It is not sufficient to save/restore T0 et. al. as these may be declared > with a datatype smaller than the actual register. */ > Index: translate-all.c > =================================================================== > --- translate-all.c (revision 5931) > +++ translate-all.c (working copy) > @@ -118,7 +118,7 @@ > s->interm_time += profile_getclock() - ti; > s->code_time -= profile_getclock(); > #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; > #ifdef CONFIG_PROFILER > s->code_time += profile_getclock(); > @@ -177,7 +177,7 @@ > s->tb_jmp_offset = NULL; > s->tb_next = tb->tb_next; > #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) > return -1; > /* now find start of instruction before */ > Index: tcg/tcg.c > =================================================================== > --- tcg/tcg.c (revision 5931) > +++ tcg/tcg.c (working copy) > @@ -1890,20 +1890,15 @@ > > #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) > { > int i; > FILE *f; > - f = fopen("/tmp/op1.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"); > + f = fopen("/tmp/op.log", "w"); > 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); > } > @@ -1953,7 +1948,7 @@ > for(;;) { > opc = gen_opc_buf[op_index]; > #ifdef CONFIG_PROFILER > - dyngen_table_op_count[opc]++; > + tcg_table_op_count[opc]++; > #endif > def = &tcg_op_defs[opc]; > #if 0 > @@ -2030,7 +2025,7 @@ > 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 > { > @@ -2058,7 +2053,7 @@ > 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. > 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); > } > Index: tcg/tcg.h > =================================================================== > --- tcg/tcg.h (revision 5931) > +++ tcg/tcg.h (working copy) > @@ -314,8 +314,8 @@ > void tcg_context_init(TCGContext *s); > void tcg_func_start(TCGContext *s); > > -int dyngen_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(TCGContext *s, uint8_t *gen_code_buf); > +int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset); > > void tcg_set_frame(TCGContext *s, int reg, > tcg_target_long start, tcg_target_long size); -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net