* [Qemu-devel] [PATCH 02/18] Get rid of temporary variable cache.
@ 2009-07-19 15:19 Filip Navara
0 siblings, 0 replies; only message in thread
From: Filip Navara @ 2009-07-19 15:19 UTC (permalink / raw)
To: qemu-devel
The temporary variable cache in no longer need since tcg_temp_free was introduced.
Signed-off-by: Filip Navara <filip.navara@gmail.com>
---
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 a0c0436..e0c0b9d 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -110,44 +110,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)
@@ -8760,7 +8736,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.2.1299.gee46c
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-19 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 15:19 [Qemu-devel] [PATCH 02/18] Get rid of temporary variable cache Filip Navara
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.