From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MR3bX-0003Gg-Vd for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:29:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MR3bT-00038M-6b for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:28:59 -0400 Received: from [199.232.76.173] (port=59933 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MR3bS-00037t-Ut for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:28:55 -0400 Received: from [82.113.48.144] (port=4493 helo=FilipNavara-PC) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MR3bS-0005gT-8P for qemu-devel@nongnu.org; Wed, 15 Jul 2009 08:28:54 -0400 Date: Wed, 15 Jul 09 14:28:52 Central Europe Standard Time From: Filip Navara Sender: Filip Navara MIME-Version: 1.0 Content-Type: text/plain; Message-Id: Subject: [Qemu-devel] [PATCH 2/5] Get rid of temporary variable cache. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The temporary variable cache in no longer need since tcg_temp_free was introduced. Signed-off-by: Filip Navara --- target-arm/translate.c | 31 +++---------------------------- 1 files changed, 3 insertions(+), 28 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 0df9bfa..7c6431d 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -111,44 +111,20 @@ void arm_translate_init(void) #include "helpers.h" } -/* The code generator doesn't like lots of temporaries, so maintain our own - cache for reuse within a function. */ -#define MAX_TEMPS 8 static int num_temps; -static TCGv temps[MAX_TEMPS]; /* Allocate a temporary variable. */ static TCGv_i32 new_tmp(void) { - TCGv tmp; - if (num_temps == MAX_TEMPS) - abort(); - - if (GET_TCGV_I32(temps[num_temps])) - return temps[num_temps++]; - - tmp = tcg_temp_new_i32(); - temps[num_temps++] = tmp; - return tmp; + num_temps++; + return tcg_temp_new_i32(); } /* Release a temporary variable. */ static void dead_tmp(TCGv tmp) { - int i; + tcg_temp_free(tmp); num_temps--; - i = num_temps; - if (TCGV_EQUAL(temps[i], tmp)) - return; - - /* Shuffle this temp to the last slot. */ - while (!TCGV_EQUAL(temps[i], tmp)) - i--; - while (i < num_temps) { - temps[i] = temps[i + 1]; - i++; - } - temps[i] = tmp; } static inline TCGv load_cpu_offset(int offset) @@ -8761,7 +8737,6 @@ static inline void gen_intermediate_code_internal(CPUState *env, /* generate intermediate code */ num_temps = 0; - memset(temps, 0, sizeof(temps)); pc_start = tb->pc; -- 1.6.3.msysgit.0