From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMljw-0002uh-Hy for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMlja-0005UU-NQ for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:20 -0400 Received: from mail-yh0-x231.google.com ([2607:f8b0:4002:c01::231]:45968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMlja-0005UL-Iw for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:25:58 -0400 Received: by mail-yh0-f49.google.com with SMTP id i57so4355427yha.22 for ; Thu, 19 Sep 2013 14:25:58 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 19 Sep 2013 14:25:01 -0700 Message-Id: <1379625908-27964-10-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 09/16] tcg: Change temp_sync 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, 8 insertions(+), 8 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ee11c94..0ca8dbe 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1664,10 +1664,8 @@ static inline void temp_dead(TCGContext *s, TCGTemp *ts) /* sync 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_sync(TCGContext *s, int temp, TCGRegSet allocated_regs) +static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs) { - TCGTemp *ts = &s->temps[temp]; - if (!ts->fixed_reg) { switch(ts->val_type) { case TEMP_VAL_CONST: @@ -1701,7 +1699,7 @@ static inline void temp_save(TCGContext *s, int temp, TCGRegSet allocated_regs) in memory. Keep an assert for safety. */ assert(ts->val_type == TEMP_VAL_MEM || ts->fixed_reg); #else - temp_sync(s, temp, allocated_regs); + temp_sync(s, ts, allocated_regs); temp_dead(s, ts); #endif } @@ -1726,11 +1724,13 @@ static void sync_globals(TCGContext *s, TCGRegSet allocated_regs) int i; for (i = 0; i < s->nb_globals; i++) { + TCGTemp *ts = &s->temps[i]; #ifdef USE_LIVENESS_ANALYSIS - assert(s->temps[i].val_type != TEMP_VAL_REG || s->temps[i].fixed_reg || - s->temps[i].mem_coherent); + assert(ts->val_type != TEMP_VAL_REG + || ts->fixed_reg + || ts->mem_coherent); #else - temp_sync(s, i, allocated_regs); + temp_sync(s, ts, allocated_regs); #endif } } @@ -1785,7 +1785,7 @@ static void tcg_reg_alloc_movi(TCGContext *s, const TCGArg *args, ots->val = val; } if (NEED_SYNC_ARG(0)) { - temp_sync(s, args[0], s->reserved_regs); + temp_sync(s, ots, s->reserved_regs); } if (IS_DEAD_ARG(0)) { temp_dead(s, ots); -- 1.8.1.4