From nobody Thu Oct 2 10:20:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545772727277189.29207574462157; Tue, 25 Dec 2018 13:18:47 -0800 (PST) Received: from localhost ([127.0.0.1]:43215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu69-0007jL-RP for importer@patchew.org; Tue, 25 Dec 2018 16:18:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbtnf-0007ow-Gk for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtne-0001Z6-Ls for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:39 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:39599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbtne-0001YN-GJ for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:38 -0500 Received: by mail-pg1-x52b.google.com with SMTP id w6so6820097pgl.6 for ; Tue, 25 Dec 2018 12:59:38 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.59.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:59:36 -0800 (PST) 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; bh=6flMHALx7z54lJddWJJTsfo/FLnHBpGEDcANLWqqSwk=; b=dGL8G17LP63PfM3bHGLEPHYOA6k+8hDNWbPykFdHvba+ShgtdQJ4lwxBzea6tTW9Jw 8CS2hkg7oCc1zdQnGCWSs4GkBtWyAf8wTqoIcYkfZAT7BmmSt2gLWBftHrMez+o8ifY6 EOZyzdkk7Y2dahVUECdNas+eAy3fv/M02FEyQ= 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; bh=6flMHALx7z54lJddWJJTsfo/FLnHBpGEDcANLWqqSwk=; b=TGsB44y2fB/njNFXe/rktmpOldi8zn8bqkyJHQR/VtNbNUFla0mLGGyqnU3n+DQdhc 6a7mHubt8rUdBp9ItOMYQNy6hvpV2lfwVf81Vwu8z+8esVhAm8xhZsg/prFzPgAhomy/ EZsBjfP9wI2vzhPVxNSSWzX7robOSaUSj6H84zhyyGBNmvK4/qGGUESClaJO/vruSzkp Cwj3H4SO/8qqPxYIHWeMtdJ2WEVwIrExsf4PL7QwgDgVnLXJhqgIK5mdrXrhaDAxG7OT Yi9woLIJW0JL30R5DnG26b+h2ucJnMQKKM/XqvznLl7CMZ5MriENYGIPoBvQy9AGD+a4 1HVw== X-Gm-Message-State: AJcUukfpwBEGsWnpNOCz5KEJGq4cZsumswt2q7qzNPjuZ/M6UTexwWBk 81GnHiN5r1eWxMhUCX4yGBUgIyN8csU= X-Google-Smtp-Source: ALg8bN7Cxp3jjuOwSVKsWf1IheFPhT6smSd3tRcM4UXH1jS/TuUkMY+1OgAWIN0J3ZXsO/Rhg2ZvLA== X-Received: by 2002:a63:dd15:: with SMTP id t21mr16084483pgg.347.1545771577295; Tue, 25 Dec 2018 12:59:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:21 +1100 Message-Id: <20181225205529.10874-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52b Subject: [Qemu-devel] [PULL 34/42] tcg: Add output_pref to TCGOp 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Allocate storage for, but do not yet fill in, per-opcode preferences for the output operands. Pass it in to the register allocation routines for output operands. Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg.h | 3 +++ tcg/tcg.c | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index db2d91867f..c6721cc7a7 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -619,6 +619,9 @@ typedef struct TCGOp { =20 /* Arguments for the opcode. */ TCGArg args[MAX_OPC_PARAM]; + + /* Register preferences for the output(s). */ + TCGRegSet output_pref[2]; } TCGOp; =20 #define TCGOP_CALLI(X) (X)->param1 diff --git a/tcg/tcg.c b/tcg/tcg.c index 7844158a8a..32c66dae7d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2591,6 +2591,8 @@ static void liveness_pass_1(TCGContext *s) break; } op->life =3D arg_life; + op->output_pref[0] =3D 0; + op->output_pref[1] =3D 0; } } =20 @@ -3105,17 +3107,18 @@ static void tcg_reg_alloc_movi(TCGContext *s, const= TCGOp *op) TCGTemp *ots =3D arg_temp(op->args[0]); tcg_target_ulong val =3D op->args[1]; =20 - tcg_reg_alloc_do_movi(s, ots, val, op->life, 0); + tcg_reg_alloc_do_movi(s, ots, val, op->life, op->output_pref[0]); } =20 static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op) { const TCGLifeData arg_life =3D op->life; - TCGRegSet allocated_regs; + TCGRegSet allocated_regs, preferred_regs; TCGTemp *ts, *ots; TCGType otype, itype; =20 allocated_regs =3D s->reserved_regs; + preferred_regs =3D op->output_pref[0]; ots =3D arg_temp(op->args[0]); ts =3D arg_temp(op->args[1]); =20 @@ -3129,7 +3132,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TC= GOp *op) if (IS_DEAD_ARG(1)) { temp_dead(s, ts); } - tcg_reg_alloc_do_movi(s, ots, val, arg_life, 0); + tcg_reg_alloc_do_movi(s, ots, val, arg_life, preferred_regs); return; } =20 @@ -3138,7 +3141,8 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TC= GOp *op) the SOURCE value into its own register first, that way we don't have to reload SOURCE the next time it is used. */ if (ts->val_type =3D=3D TEMP_VAL_MEM) { - temp_load(s, ts, tcg_target_available_regs[itype], allocated_regs,= 0); + temp_load(s, ts, tcg_target_available_regs[itype], + allocated_regs, preferred_regs); } =20 tcg_debug_assert(ts->val_type =3D=3D TEMP_VAL_REG); @@ -3168,7 +3172,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TC= GOp *op) input one. */ tcg_regset_set_reg(allocated_regs, ts->reg); ots->reg =3D tcg_reg_alloc(s, tcg_target_available_regs[ot= ype], - allocated_regs, 0, + allocated_regs, preferred_regs, ots->indirect_base); } tcg_out_mov(s, otype, ots->reg, ts->reg); @@ -3302,7 +3306,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCG= Op *op) } else if (arg_ct->ct & TCG_CT_NEWREG) { reg =3D tcg_reg_alloc(s, arg_ct->u.regs, i_allocated_regs | o_allocated_regs, - 0, ts->indirect_base); + op->output_pref[k], ts->indirect_base); } else { /* if fixed register, we try to use it */ reg =3D ts->reg; @@ -3311,7 +3315,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCG= Op *op) goto oarg_end; } reg =3D tcg_reg_alloc(s, arg_ct->u.regs, o_allocated_regs, - 0, ts->indirect_base); + op->output_pref[k], ts->indirect_base); } tcg_regset_set_reg(o_allocated_regs, reg); /* if a fixed register is used, then a move will be done after= wards */ --=20 2.17.2