From nobody Fri Dec 19 19:55:17 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543383849414601.0139919537669; Tue, 27 Nov 2018 21:44:09 -0800 (PST) Received: from localhost ([::1]:46049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsdl-0000XD-88 for importer@patchew.org; Wed, 28 Nov 2018 00:44:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsYi-0003tD-GC for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRsYg-0004Ln-Jb for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:48 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:34139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRsYe-0004Js-Hy for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:46 -0500 Received: by mail-pf1-x444.google.com with SMTP id h3so9623490pfg.1 for ; Tue, 27 Nov 2018 21:38:43 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-170-180.tukw.qwest.net. [97.113.170.180]) by smtp.gmail.com with ESMTPSA id 19sm8569336pfs.108.2018.11.27.21.38.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 21:38:41 -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=E+Xgls1DHstwRUyEFIzImDIJL7cTIdasMbg1UXdI6nY=; b=S8NhrgpbgbTZLi1NSf22G8yR3HzGanLaTfaXJLjQ1BycrkyCtc3EkPhSc42oontRs8 2sSwunqNO2FmAGAx6mnONNNIRtGu+HDlQnca07WgYm2X0aCbskFFCFzAz95OzId0KFA9 /M7H4CZ0WWVX9c6cOt8a3s/1EPAD8kd3Uwaow= 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=E+Xgls1DHstwRUyEFIzImDIJL7cTIdasMbg1UXdI6nY=; b=pwYo9+PLZYvCm5f43rHY77lx81O34G8sUKsSdI0dMFvVq3ropj6B0tA/8NKI/5bPiB O9uuz+XQ5uXuhzBOSibqbIV/tbCHkZDt42qNly/j9YDTIXM+/d3bZUD4rMtSsZQ63iSX bJV8hQi6DDcNQMYnlL2QOxUQxSyhJrsvEggs1LRWRc4DrzuaRv7z7ImaB5U+9XIC4mOQ cHmXtXDAHjcWQL0my+aQmttQ4j4rlcJZxXZXo/FQkG1rVFcMi04bnFR7bpLApWjSZ5Ad NQWDyMrV/vlb3AGeJyUONBhnB7ivsUxRvI9GI6lGdyURyan/5KtLwBnk6UaO9+RqZAi1 F6fA== X-Gm-Message-State: AA+aEWYyFhy/FaRwIgp9YyqzllUJV3NBNY/AZKg3MOWoCCgn9k4CMY/2 GNbsUr4C8rKP/ZEK2HziRFp4U7RfZ/0= X-Google-Smtp-Source: AFSGD/XVAXkApWwCwtz4lvIBRFAfGaNZ80rgxt3+l6sGT5wNMl/xs4EAjdkSvtcB9K3rJZOJTdaJEw== X-Received: by 2002:a62:5fc4:: with SMTP id t187mr5083653pfb.66.1543383522513; Tue, 27 Nov 2018 21:38:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 21:38:27 -0800 Message-Id: <20181128053834.10861-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181128053834.10861-1-richard.henderson@linaro.org> References: <20181128053834.10861-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::444 Subject: [Qemu-devel] [PATCH 05/12] 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: cota@braap.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. 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 c6caeeb42b..b2e274b7af 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -621,6 +621,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 c83ca238aa..f86415ce29 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2613,6 +2613,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 @@ -3127,17 +3129,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 @@ -3151,7 +3154,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 @@ -3160,7 +3163,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); @@ -3190,7 +3194,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); @@ -3324,7 +3328,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; @@ -3333,7 +3337,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