From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMljy-0002xj-20 for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMljc-0005V1-Hl for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:21 -0400 Received: from mail-yh0-x22e.google.com ([2607:f8b0:4002:c01::22e]:46030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMljc-0005Uv-CV for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:00 -0400 Received: by mail-yh0-f46.google.com with SMTP id c41so4371708yho.19 for ; Thu, 19 Sep 2013 14:26:00 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 19 Sep 2013 14:25:02 -0700 Message-Id: <1379625908-27964-11-git-send-email-rth@twiddle.net> In-Reply-To: <1379625908-27964-1-git-send-email-rth@twiddle.net> References: <1379625908-27964-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [RFC 10/16] tcg: Change temp_save argument to TCGTemp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, aurelien@aurel32.net Signed-off-by: Richard Henderson --- tcg/tcg.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0ca8dbe..579541c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1690,10 +1690,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. */ @@ -1711,8 +1710,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); } } @@ -1739,13 +1738,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. -- 1.8.1.4