From nobody Tue Feb 10 06:58:47 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508541772873421.28204561255484; Fri, 20 Oct 2017 16:22:52 -0700 (PDT) Received: from localhost ([::1]:55984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gcp-0007Za-On for importer@patchew.org; Fri, 20 Oct 2017 19:22:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gah-0005mG-TV for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5gag-0007Wc-AZ for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:20:35 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:45628) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5gag-0007WK-2V for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:20:34 -0400 Received: by mail-pf0-x243.google.com with SMTP id d28so13076583pfe.2 for ; Fri, 20 Oct 2017 16:20:34 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-165-104.tukw.qwest.net. [97.113.165.104]) by smtp.gmail.com with ESMTPSA id a17sm3532594pfk.173.2017.10.20.16.20.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 16:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t9ys3/8LijwpbtvxFW1HFB4jXByD4VLp1FvKYybUpBw=; b=QG33l/p6RB+ePkt/Kx45kW+3mgpQu9ACDUB5SZWP3e9ylXYSL4h6Tqnhd7PCKH7u0h uJW++hxW8MN5/c6HcCXA4GpXk+yI6cnZVfIrxMnn1/r/bVUBBYHLHg85RE2/f+6o5lOC IfG/yrrdbpjH9y95lJv3KP4NEqX/C2Sq+5zEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t9ys3/8LijwpbtvxFW1HFB4jXByD4VLp1FvKYybUpBw=; b=AzgIJD3e3goNuf6i5k817u088jhst2QFrUdSRV5tbNHZpWCLyiFNAb6L08ms4KPS1n IAfHrR5lr0hFRGdh4xSGjpFW5Jhwg6xQBO5TgGNY4JVnhKlsDs8h5oski9uO6bXlfGUu bq3ET6MPBLD99vffegNVLj4xjrXJv9OvknIPOv8VyHvKYQH9B/ecxmWtR/jJ5h8kAJJn MUMPYE9zS8PsjXztiVulmVnU8VdDPHt5yWkN34h3+A21o7qUbFS9ikTFRHpjCDhp4eEn G5B7Ave0ji+tkgoXIcbDlkVAe73DsEJ+r79RKd6afW34294qdAmrn3Mb9VNJ4PMZ7CEc mP0g== X-Gm-Message-State: AMCzsaVx5Bje36SQHI6Lm2WXOsepaW6hVicQCcTxERdYDOQtsbzwV1nR SXjB+o8kHEQTsesYut57hj2wZOGCKdA= X-Google-Smtp-Source: ABhQp+Qj3ebBCignXw4zwHhn3YOllJUfJTG8gmW+NEe3N6BJFGGIxWKykg7lZflU4wr7N5GCBrK03g== X-Received: by 10.84.128.229 with SMTP id a92mr5309703pla.278.1508541632767; Fri, 20 Oct 2017 16:20:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 20 Oct 2017 16:19:35 -0700 Message-Id: <20171020232023.15010-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020232023.15010-1-richard.henderson@linaro.org> References: <20171020232023.15010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH v7 04/52] tcg: Propagate TCGOp down to allocators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, cota@braap.org, f4bug@amsat.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 From: Richard Henderson Reviewed-by: Emilio G. Cota Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- tcg/tcg.c | 75 +++++++++++++++++++++++++++++++----------------------------= ---- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 4f56077f64..27c8b14295 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2334,25 +2334,24 @@ static void tcg_reg_alloc_do_movi(TCGContext *s, TC= GTemp *ots, } } =20 -static void tcg_reg_alloc_movi(TCGContext *s, const TCGArg *args, - TCGLifeData arg_life) +static void tcg_reg_alloc_movi(TCGContext *s, const TCGOp *op) { - TCGTemp *ots =3D &s->temps[args[0]]; - tcg_target_ulong val =3D args[1]; + TCGTemp *ots =3D &s->temps[op->args[0]]; + tcg_target_ulong val =3D op->args[1]; =20 - tcg_reg_alloc_do_movi(s, ots, val, arg_life); + tcg_reg_alloc_do_movi(s, ots, val, op->life); } =20 -static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def, - const TCGArg *args, TCGLifeData arg_life) +static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op) { + const TCGLifeData arg_life =3D op->life; TCGRegSet allocated_regs; TCGTemp *ts, *ots; TCGType otype, itype; =20 allocated_regs =3D s->reserved_regs; - ots =3D &s->temps[args[0]]; - ts =3D &s->temps[args[1]]; + ots =3D &s->temps[op->args[0]]; + ts =3D &s->temps[op->args[1]]; =20 /* Note that otype !=3D itype for no-op truncation. */ otype =3D ots->type; @@ -2382,7 +2381,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TC= GOpDef *def, liveness analysis disabled). */ tcg_debug_assert(NEED_SYNC_ARG(0)); if (!ots->mem_allocated) { - temp_allocate_frame(s, args[0]); + temp_allocate_frame(s, op->args[0]); } tcg_out_st(s, otype, ts->reg, ots->mem_base->reg, ots->mem_offset); if (IS_DEAD_ARG(1)) { @@ -2416,10 +2415,10 @@ static void tcg_reg_alloc_mov(TCGContext *s, const = TCGOpDef *def, } } =20 -static void tcg_reg_alloc_op(TCGContext *s,=20 - const TCGOpDef *def, TCGOpcode opc, - const TCGArg *args, TCGLifeData arg_life) +static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) { + const TCGLifeData arg_life =3D op->life; + const TCGOpDef * const def =3D &tcg_op_defs[op->opc]; TCGRegSet i_allocated_regs; TCGRegSet o_allocated_regs; int i, k, nb_iargs, nb_oargs; @@ -2435,16 +2434,16 @@ static void tcg_reg_alloc_op(TCGContext *s, =20 /* copy constants */ memcpy(new_args + nb_oargs + nb_iargs,=20 - args + nb_oargs + nb_iargs,=20 + op->args + nb_oargs + nb_iargs, sizeof(TCGArg) * def->nb_cargs); =20 i_allocated_regs =3D s->reserved_regs; o_allocated_regs =3D s->reserved_regs; =20 /* satisfy input constraints */=20 - for(k =3D 0; k < nb_iargs; k++) { + for (k =3D 0; k < nb_iargs; k++) { i =3D def->sorted_args[nb_oargs + k]; - arg =3D args[i]; + arg =3D op->args[i]; arg_ct =3D &def->args_ct[i]; ts =3D &s->temps[arg]; =20 @@ -2462,7 +2461,7 @@ static void tcg_reg_alloc_op(TCGContext *s, if (ts->fixed_reg) { /* if fixed register, we must allocate a new register if the alias is not the same register */ - if (arg !=3D args[arg_ct->alias_index]) + if (arg !=3D op->args[arg_ct->alias_index]) goto allocate_in_reg; } else { /* if the input is aliased to an output and if it is @@ -2503,7 +2502,7 @@ static void tcg_reg_alloc_op(TCGContext *s, /* mark dead temporaries and free the associated registers */ for (i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { if (IS_DEAD_ARG(i)) { - temp_dead(s, &s->temps[args[i]]); + temp_dead(s, &s->temps[op->args[i]]); } } =20 @@ -2527,7 +2526,7 @@ static void tcg_reg_alloc_op(TCGContext *s, /* satisfy the output constraints */ for(k =3D 0; k < nb_oargs; k++) { i =3D def->sorted_args[k]; - arg =3D args[i]; + arg =3D op->args[i]; arg_ct =3D &def->args_ct[i]; ts =3D &s->temps[arg]; if ((arg_ct->ct & TCG_CT_ALIAS) @@ -2566,11 +2565,11 @@ static void tcg_reg_alloc_op(TCGContext *s, } =20 /* emit instruction */ - tcg_out_op(s, opc, new_args, const_args); + tcg_out_op(s, op->opc, new_args, const_args); =20 /* move the outputs in the correct register if needed */ for(i =3D 0; i < nb_oargs; i++) { - ts =3D &s->temps[args[i]]; + ts =3D &s->temps[op->args[i]]; reg =3D new_args[i]; if (ts->fixed_reg && ts->reg !=3D reg) { tcg_out_mov(s, ts->type, ts->reg, reg); @@ -2589,9 +2588,11 @@ static void tcg_reg_alloc_op(TCGContext *s, #define STACK_DIR(x) (x) #endif =20 -static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, - const TCGArg * const args, TCGLifeData arg_= life) +static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) { + const int nb_oargs =3D op->callo; + const int nb_iargs =3D op->calli; + const TCGLifeData arg_life =3D op->life; int flags, nb_regs, i; TCGReg reg; TCGArg arg; @@ -2602,8 +2603,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_= oargs, int nb_iargs, int allocate_args; TCGRegSet allocated_regs; =20 - func_addr =3D (tcg_insn_unit *)(intptr_t)args[nb_oargs + nb_iargs]; - flags =3D args[nb_oargs + nb_iargs + 1]; + func_addr =3D (tcg_insn_unit *)(intptr_t)op->args[nb_oargs + nb_iargs]; + flags =3D op->args[nb_oargs + nb_iargs + 1]; =20 nb_regs =3D ARRAY_SIZE(tcg_target_call_iarg_regs); if (nb_regs > nb_iargs) { @@ -2622,8 +2623,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_= oargs, int nb_iargs, } =20 stack_offset =3D TCG_TARGET_CALL_STACK_OFFSET; - for(i =3D nb_regs; i < nb_iargs; i++) { - arg =3D args[nb_oargs + i]; + for (i =3D nb_regs; i < nb_iargs; i++) { + arg =3D op->args[nb_oargs + i]; #ifdef TCG_TARGET_STACK_GROWSUP stack_offset -=3D sizeof(tcg_target_long); #endif @@ -2640,8 +2641,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_= oargs, int nb_iargs, =20 /* assign input registers */ allocated_regs =3D s->reserved_regs; - for(i =3D 0; i < nb_regs; i++) { - arg =3D args[nb_oargs + i]; + for (i =3D 0; i < nb_regs; i++) { + arg =3D op->args[nb_oargs + i]; if (arg !=3D TCG_CALL_DUMMY_ARG) { ts =3D &s->temps[arg]; reg =3D tcg_target_call_iarg_regs[i]; @@ -2663,9 +2664,9 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_= oargs, int nb_iargs, } =20 /* mark dead temporaries and free the associated registers */ - for(i =3D nb_oargs; i < nb_iargs + nb_oargs; i++) { + for (i =3D nb_oargs; i < nb_iargs + nb_oargs; i++) { if (IS_DEAD_ARG(i)) { - temp_dead(s, &s->temps[args[i]]); + temp_dead(s, &s->temps[op->args[i]]); } } =20 @@ -2690,7 +2691,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_= oargs, int nb_iargs, =20 /* assign output registers and emit moves if needed */ for(i =3D 0; i < nb_oargs; i++) { - arg =3D args[i]; + arg =3D op->args[i]; ts =3D &s->temps[arg]; reg =3D tcg_target_call_oarg_regs[i]; tcg_debug_assert(s->reg_to_temp[reg] =3D=3D NULL); @@ -2838,8 +2839,6 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) for (oi =3D s->gen_op_buf[0].next; oi !=3D 0; oi =3D oi_next) { TCGOp * const op =3D &s->gen_op_buf[oi]; TCGOpcode opc =3D op->opc; - const TCGOpDef *def =3D &tcg_op_defs[opc]; - TCGLifeData arg_life =3D op->life; =20 oi_next =3D op->next; #ifdef CONFIG_PROFILER @@ -2849,11 +2848,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *t= b) switch (opc) { case INDEX_op_mov_i32: case INDEX_op_mov_i64: - tcg_reg_alloc_mov(s, def, op->args, arg_life); + tcg_reg_alloc_mov(s, op); break; case INDEX_op_movi_i32: case INDEX_op_movi_i64: - tcg_reg_alloc_movi(s, op->args, arg_life); + tcg_reg_alloc_movi(s, op); break; case INDEX_op_insn_start: if (num_insns >=3D 0) { @@ -2878,7 +2877,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) tcg_out_label(s, arg_label(op->args[0]), s->code_ptr); break; case INDEX_op_call: - tcg_reg_alloc_call(s, op->callo, op->calli, op->args, arg_life= ); + tcg_reg_alloc_call(s, op); break; default: /* Sanity check that we've not introduced any unhandled opcode= s. */ @@ -2886,7 +2885,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) /* Note: in order to speed up the code, it would be much faster to have specialized register allocator functions for some common argument patterns */ - tcg_reg_alloc_op(s, def, opc, op->args, arg_life); + tcg_reg_alloc_op(s, op); break; } #ifdef CONFIG_DEBUG_TCG --=20 2.13.6