summaryrefslogtreecommitdiffstats
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-09-18 15:35:32 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:34:37 -0600
commitb21b8b92a558ebe3f10d7d4ca6f62b3ff98ca40e (patch)
tree2f226c2f5b733cd6c7641bb8f1ee6e5e4f157a6b /tcg/tcg.c
parentf194e93afb83b6051219307d49a6ef03b5a8d4cf (diff)
downloadhqemu-b21b8b92a558ebe3f10d7d4ca6f62b3ff98ca40e.zip
hqemu-b21b8b92a558ebe3f10d7d4ca6f62b3ff98ca40e.tar.gz
tcg: Change temp_save argument to TCGTemp
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 24712cb..fa9a82c 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1948,10 +1948,9 @@ static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs)
/* save a temporary to memory. 'allocated_regs' is used in case a
temporary registers needs to be allocated to store a constant. */
-static inline void temp_save(TCGContext *s, int temp, TCGRegSet allocated_regs)
+static inline void temp_save(TCGContext *s, TCGTemp *ts,
+ TCGRegSet allocated_regs)
{
- TCGTemp *ts = &s->temps[temp];
-
#ifdef USE_LIVENESS_ANALYSIS
/* The liveness analysis already ensures that globals are back
in memory. Keep an assert for safety. */
@@ -1969,8 +1968,8 @@ static void save_globals(TCGContext *s, TCGRegSet allocated_regs)
{
int i;
- for(i = 0; i < s->nb_globals; i++) {
- temp_save(s, i, allocated_regs);
+ for (i = 0; i < s->nb_globals; i++) {
+ temp_save(s, &s->temps[i], allocated_regs);
}
}
@@ -1997,13 +1996,12 @@ static void sync_globals(TCGContext *s, TCGRegSet allocated_regs)
all globals are stored at their canonical location. */
static void tcg_reg_alloc_bb_end(TCGContext *s, TCGRegSet allocated_regs)
{
- TCGTemp *ts;
int i;
- for(i = s->nb_globals; i < s->nb_temps; i++) {
- ts = &s->temps[i];
+ for (i = s->nb_globals; i < s->nb_temps; i++) {
+ TCGTemp *ts = &s->temps[i];
if (ts->temp_local) {
- temp_save(s, i, allocated_regs);
+ temp_save(s, ts, allocated_regs);
} else {
#ifdef USE_LIVENESS_ANALYSIS
/* The liveness analysis already ensures that temps are dead.
OpenPOWER on IntegriCloud