Received: from eggs.gnu.org ([2001:4830:134:3::10]:52721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c76Fe-0000m6-Ld for qemu-devel@nongnu.org; Wed, 16 Nov 2016 14:52:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c76Fd-00077Q-Fb for qemu-devel@nongnu.org; Wed, 16 Nov 2016 14:52:10 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33926) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c76Fd-000776-8r for qemu-devel@nongnu.org; Wed, 16 Nov 2016 14:52:09 -0500 Received: by mail-wm0-x243.google.com with SMTP id g23so14617205wme.1 for ; Wed, 16 Nov 2016 11:52:09 -0800 (PST) Sender: Richard Henderson From: Richard Henderson Date: Wed, 16 Nov 2016 20:51:42 +0100 Message-Id: <1479325910-9060-7-git-send-email-rth@twiddle.net> In-Reply-To: <1479325910-9060-1-git-send-email-rth@twiddle.net> References: <1479325910-9060-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [RFC 06/14] tcg: More use of arg_temp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net, peter.maydell@linaro.org Signed-off-by: Richard Henderson --- tcg/tcg.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 840c8b5..4bcdb1e 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -523,7 +523,7 @@ TCGTemp *tcg_global_mem_new_internal(TCGType type, TCGv_ptr base, intptr_t offset, const char *name) { TCGContext *s = &tcg_ctx; - TCGTemp *base_ts = &s->temps[GET_TCGV_PTR(base)]; + TCGTemp *base_ts = &base->impl; TCGTemp *ts = tcg_global_alloc(s); int indirect_reg = 0, bigendian = 0; #ifdef HOST_WORDS_BIGENDIAN @@ -2107,7 +2107,7 @@ static void tcg_reg_alloc_do_movi(TCGContext *s, TCGTemp *ots, static void tcg_reg_alloc_movi(TCGContext *s, const TCGArg *args, TCGLifeData arg_life) { - TCGTemp *ots = &s->temps[args[0]]; + TCGTemp *ots = arg_temp(args[0]); tcg_target_ulong val = args[1]; tcg_reg_alloc_do_movi(s, ots, val, arg_life); @@ -2121,8 +2121,8 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def, TCGType otype, itype; tcg_regset_set(allocated_regs, s->reserved_regs); - ots = &s->temps[args[0]]; - ts = &s->temps[args[1]]; + ots = arg_temp(args[0]); + ts = arg_temp(args[1]); /* Note that otype != itype for no-op truncation. */ otype = ots->type; @@ -2213,7 +2213,7 @@ static void tcg_reg_alloc_op(TCGContext *s, i = def->sorted_args[nb_oargs + k]; arg = args[i]; arg_ct = &def->args_ct[i]; - ts = &s->temps[arg]; + ts = arg_temp(arg); if (ts->val_type == TEMP_VAL_CONST && tcg_target_const_match(ts->val, ts->type, arg_ct)) { @@ -2270,7 +2270,7 @@ static void tcg_reg_alloc_op(TCGContext *s, /* mark dead temporaries and free the associated registers */ for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { if (IS_DEAD_ARG(i)) { - temp_dead(s, &s->temps[args[i]]); + temp_dead(s, arg_temp(args[i])); } } @@ -2297,7 +2297,7 @@ static void tcg_reg_alloc_op(TCGContext *s, i = def->sorted_args[k]; arg = args[i]; arg_ct = &def->args_ct[i]; - ts = &s->temps[arg]; + ts = arg_temp(arg); if (arg_ct->ct & TCG_CT_ALIAS) { reg = new_args[arg_ct->alias_index]; } else { @@ -2333,7 +2333,7 @@ static void tcg_reg_alloc_op(TCGContext *s, /* move the outputs in the correct register if needed */ for(i = 0; i < nb_oargs; i++) { - ts = &s->temps[args[i]]; + ts = arg_temp(args[i]); reg = new_args[i]; if (ts->fixed_reg && ts->reg != reg) { tcg_out_mov(s, ts->type, ts->reg, reg); @@ -2391,7 +2391,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, stack_offset -= sizeof(tcg_target_long); #endif if (arg != TCG_CALL_DUMMY_ARG) { - ts = &s->temps[arg]; + ts = arg_temp(arg); temp_load(s, ts, tcg_target_available_regs[ts->type], s->reserved_regs); tcg_out_st(s, ts->type, ts->reg, TCG_REG_CALL_STACK, stack_offset); @@ -2406,7 +2406,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, for(i = 0; i < nb_regs; i++) { arg = args[nb_oargs + i]; if (arg != TCG_CALL_DUMMY_ARG) { - ts = &s->temps[arg]; + ts = arg_temp(arg); reg = tcg_target_call_iarg_regs[i]; tcg_reg_free(s, reg, allocated_regs); @@ -2429,7 +2429,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, /* mark dead temporaries and free the associated registers */ for(i = nb_oargs; i < nb_iargs + nb_oargs; i++) { if (IS_DEAD_ARG(i)) { - temp_dead(s, &s->temps[args[i]]); + temp_dead(s, arg_temp(args[i])); } } @@ -2455,7 +2455,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, /* assign output registers and emit moves if needed */ for(i = 0; i < nb_oargs; i++) { arg = args[i]; - ts = &s->temps[arg]; + ts = arg_temp(arg); reg = tcg_target_call_oarg_regs[i]; tcg_debug_assert(s->reg_to_temp[reg] == NULL); @@ -2627,7 +2627,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) } break; case INDEX_op_discard: - temp_dead(s, &s->temps[args[0]]); + temp_dead(s, arg_temp(args[0])); break; case INDEX_op_set_label: tcg_reg_alloc_bb_end(s, s->reserved_regs); -- 2.7.4