Received: from eggs.gnu.org ([2001:4830:134:3::10]:41202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMlk2-00035D-GY for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMljh-0005Y5-BY for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:26 -0400 Received: from mail-yh0-x230.google.com ([2607:f8b0:4002:c01::230]:48289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMljh-0005Xy-6F for qemu-devel@nongnu.org; Thu, 19 Sep 2013 17:26:05 -0400 Received: by mail-yh0-f48.google.com with SMTP id f10so4388508yha.7 for ; Thu, 19 Sep 2013 14:26:04 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 19 Sep 2013 14:25:05 -0700 Message-Id: <1379625908-27964-14-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 13/16] tcg: Use temp_idx 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index a69186a..3591491 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -808,7 +808,7 @@ static void tcg_reg_alloc_start(TCGContext *s) static char *tcg_get_arg_str_ptr(TCGContext *s, char *buf, int buf_size, TCGTemp *ts) { - int idx = ts - s->temps; + int idx = temp_idx(s, ts); if (idx < s->nb_globals) { pstrcpy(buf, buf_size, ts->name); @@ -1593,7 +1593,7 @@ static inline void tcg_reg_sync(TCGContext *s, TCGReg reg) assert(ts->val_type == TEMP_VAL_REG); if (!ts->mem_coherent && !ts->fixed_reg) { if (!ts->mem_allocated) { - temp_allocate_frame(s, ts - s->temps); + temp_allocate_frame(s, temp_idx(s, ts)); } tcg_out_st(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset); } @@ -1673,7 +1673,7 @@ static void temp_load(TCGContext *s, TCGTemp *ts, TCGRegSet desired_regs, /* mark a temporary as dead. */ static inline void temp_dead(TCGContext *s, TCGTemp *ts) { - int idx = ts - s->temps; + int idx = temp_idx(s, ts); if (ts->fixed_reg) { return; } -- 1.8.1.4