From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0Kqh-0007eW-46 for qemu-devel@nongnu.org; Sun, 25 May 2008 14:21:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0Kqf-0007bi-DM for qemu-devel@nongnu.org; Sun, 25 May 2008 14:21:37 -0400 Received: from [199.232.76.173] (port=53364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0Kqf-0007bZ-AC for qemu-devel@nongnu.org; Sun, 25 May 2008 14:21:37 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54846 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K0Kqf-0003bY-By for qemu-devel@nongnu.org; Sun, 25 May 2008 14:21:37 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K0Kqc-0000Gg-EF for qemu-devel@nongnu.org; Sun, 25 May 2008 18:21:35 +0000 Received: from bellard by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K0Kqb-0000Ga-Ed for qemu-devel@nongnu.org; Sun, 25 May 2008 18:21:33 +0000 MIME-Version: 1.0 Errors-To: bellard Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Fabrice Bellard Message-Id: Date: Sun, 25 May 2008 18:21:33 +0000 Subject: [Qemu-devel] [4580] suppressed unused macro handling 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 Revision: 4580 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4580 Author: bellard Date: 2008-05-25 18:21:31 +0000 (Sun, 25 May 2008) Log Message: ----------- suppressed unused macro handling Modified Paths: -------------- trunk/tcg/tcg-op.h trunk/tcg/tcg-opc.h trunk/tcg/tcg.c trunk/tcg/tcg.h Modified: trunk/tcg/tcg-op.h =================================================================== --- trunk/tcg/tcg-op.h 2008-05-25 18:01:40 UTC (rev 4579) +++ trunk/tcg/tcg-op.h 2008-05-25 18:21:31 UTC (rev 4580) @@ -1396,12 +1396,6 @@ #endif /***************************************/ -static inline void tcg_gen_macro_2(TCGv ret0, TCGv ret1, int macro_id) -{ - tcg_gen_op3i(INDEX_op_macro_2, ret0, ret1, macro_id); -} - -/***************************************/ /* QEMU specific operations. Their type depend on the QEMU CPU type. */ #ifndef TARGET_LONG_BITS Modified: trunk/tcg/tcg-opc.h =================================================================== --- trunk/tcg/tcg-opc.h 2008-05-25 18:01:40 UTC (rev 4579) +++ trunk/tcg/tcg-opc.h 2008-05-25 18:21:31 UTC (rev 4580) @@ -36,11 +36,6 @@ DEF2(nop2, 0, 0, 2, 0) DEF2(nop3, 0, 0, 3, 0) DEF2(nopn, 0, 0, 1, 0) /* variable number of parameters */ -/* macro handling */ -DEF2(macro_2, 2, 0, 1, 0) -DEF2(macro_start, 0, 0, 2, 0) -DEF2(macro_end, 0, 0, 2, 0) -DEF2(macro_goto, 0, 0, 3, 0) DEF2(discard, 1, 0, 0, 0) Modified: trunk/tcg/tcg.c =================================================================== --- trunk/tcg/tcg.c 2008-05-25 18:01:40 UTC (rev 4579) +++ trunk/tcg/tcg.c 2008-05-25 18:21:31 UTC (rev 4580) @@ -259,11 +259,6 @@ s->frame_reg = reg; } -void tcg_set_macro_func(TCGContext *s, TCGMacroFunc *func) -{ - s->macro_func = func; -} - void tcg_func_start(TCGContext *s) { int i; @@ -1120,76 +1115,6 @@ /* mark the temporary as dead */ dead_temps[args[0]] = 1; break; - case INDEX_op_macro_2: - { - int dead_args[2], macro_id; - int saved_op_index, saved_arg_index; - int macro_op_index, macro_arg_index; - int macro_end_op_index, macro_end_arg_index; - int last_nb_temps; - - nb_args = 3; - args -= nb_args; - dead_args[0] = dead_temps[args[0]]; - dead_args[1] = dead_temps[args[1]]; - macro_id = args[2]; - - /* call the macro function which generate code - depending on the live outputs */ - saved_op_index = op_index; - saved_arg_index = args - gen_opparam_buf; - - /* add a macro start instruction */ - *gen_opc_ptr++ = INDEX_op_macro_start; - *gen_opparam_ptr++ = saved_op_index; - *gen_opparam_ptr++ = saved_arg_index; - - macro_op_index = gen_opc_ptr - gen_opc_buf; - macro_arg_index = gen_opparam_ptr - gen_opparam_buf; - - last_nb_temps = s->nb_temps; - - s->macro_func(s, macro_id, dead_args); - - /* realloc temp info (XXX: make it faster) */ - if (s->nb_temps > last_nb_temps) { - uint8_t *new_dead_temps; - - new_dead_temps = tcg_malloc(s->nb_temps); - memcpy(new_dead_temps, dead_temps, last_nb_temps); - memset(new_dead_temps + last_nb_temps, 1, - s->nb_temps - last_nb_temps); - dead_temps = new_dead_temps; - } - - macro_end_op_index = gen_opc_ptr - gen_opc_buf; - macro_end_arg_index = gen_opparam_ptr - gen_opparam_buf; - - /* end of macro: add a goto to the next instruction */ - *gen_opc_ptr++ = INDEX_op_macro_end; - *gen_opparam_ptr++ = op_index + 1; - *gen_opparam_ptr++ = saved_arg_index + nb_args; - - /* modify the macro operation to be a macro_goto */ - gen_opc_buf[op_index] = INDEX_op_macro_goto; - args[0] = macro_op_index; - args[1] = macro_arg_index; - args[2] = 0; /* dummy third arg to match the - macro parameters */ - - /* set the next instruction to the end of the macro */ - op_index = macro_end_op_index; - args = macro_end_arg_index + gen_opparam_buf; - } - break; - case INDEX_op_macro_start: - args -= 2; - op_index = args[0]; - args = gen_opparam_buf + args[1]; - break; - case INDEX_op_macro_goto: - case INDEX_op_macro_end: - tcg_abort(); /* should never happen in liveness analysis */ case INDEX_op_end: break; /* XXX: optimize by hardcoding common cases (e.g. triadic ops) */ @@ -1916,7 +1841,7 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, long search_pc) { - int opc, op_index, macro_op_index; + int opc, op_index; const TCGOpDef *def; unsigned int dead_iargs; const TCGArg *args; @@ -1950,7 +1875,6 @@ s->code_buf = gen_code_buf; s->code_ptr = gen_code_buf; - macro_op_index = -1; args = gen_opparam_buf; op_index = 0; @@ -2002,19 +1926,6 @@ } } break; - case INDEX_op_macro_goto: - macro_op_index = op_index; /* only used for exceptions */ - op_index = args[0] - 1; - args = gen_opparam_buf + args[1]; - goto next; - case INDEX_op_macro_end: - macro_op_index = -1; /* only used for exceptions */ - op_index = args[0] - 1; - args = gen_opparam_buf + args[1]; - goto next; - case INDEX_op_macro_start: - /* must never happen here */ - tcg_abort(); case INDEX_op_set_label: tcg_reg_alloc_bb_end(s, s->reserved_regs); tcg_out_label(s, args[0], (long)s->code_ptr); @@ -2052,10 +1963,7 @@ args += def->nb_args; next: ; if (search_pc >= 0 && search_pc < s->code_ptr - gen_code_buf) { - if (macro_op_index >= 0) - return macro_op_index; - else - return op_index; + return op_index; } op_index++; #ifndef NDEBUG Modified: trunk/tcg/tcg.h =================================================================== --- trunk/tcg/tcg.h 2008-05-25 18:01:40 UTC (rev 4579) +++ trunk/tcg/tcg.h 2008-05-25 18:21:31 UTC (rev 4580) @@ -205,8 +205,6 @@ typedef struct TCGContext TCGContext; -typedef void TCGMacroFunc(TCGContext *s, int macro_id, const int *dead_args); - struct TCGContext { uint8_t *pool_cur, *pool_end; TCGPool *pool_first, *pool_current; @@ -240,7 +238,6 @@ uint8_t *code_ptr; TCGTemp static_temps[TCG_MAX_TEMPS]; - TCGMacroFunc *macro_func; TCGHelperInfo *helpers; int nb_helpers; int allocated_helpers; @@ -301,7 +298,6 @@ void tcg_set_frame(TCGContext *s, int reg, tcg_target_long start, tcg_target_long size); -void tcg_set_macro_func(TCGContext *s, TCGMacroFunc *func); TCGv tcg_global_reg_new(TCGType type, int reg, const char *name); TCGv tcg_global_reg2_new_hack(TCGType type, int reg1, int reg2, const char *name);