From patchwork Wed Nov 28 05:38:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 152183 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp688044ljp; Tue, 27 Nov 2018 21:41:56 -0800 (PST) X-Google-Smtp-Source: AJdET5e9dr73l8ksdCHOdZpOKiNp1rNIavKwthV9GkQq7lS2c4VHe7ke6W/EH/jg2fdfakMOTgDs X-Received: by 2002:a81:6f03:: with SMTP id k3mr35900899ywc.424.1543383716454; Tue, 27 Nov 2018 21:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543383716; cv=none; d=google.com; s=arc-20160816; b=b5hxpFNGy1Cra3AoSYijSEs9SD9OK9kZ0GATzcE2w2OXjSjpudbYoVsiEH1hhhkErD DzbYFoWd9VEqZ922oNaHakZ9YwF/olQTHpWG2bHWA+NkMFrhivt6+PKf+lSTOWVnyoYe t9x030btknauI0mmrMTDR0GEFXjXl12fOXr+psIb2qfQNNleRkg7KtkrRdz4qWVkfY3R 6rCkZcx05JrBbIlT2HSqGqBmMTZ1vFtXZvZlAXM6wBHt6hyCLFSFffNkildDKRYGGSkN lO45oe9OXGvZNgkrdQZMEfJjcAwdLYqLYfggTXWoc8SRRWM11nus3XyI7I5KwcKrE3/u ed1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=N+S/Ex+S3f3RfZoA0pODXX8UV9gW9SVi2akCyHlxE00=; b=hGmNHILARUy6ghmB6Sie6KAeXybDjEzR5eC/s/dwcq0+Ek1vvPNNLopBq+KbNayB5Y XAbVlojqHd8e/YoaQL5bpUlCcMa65yNmBHMv2Gcql7L4iWJDG68bdrY51sFPKLIiB8Gt wfgZSSoaQOU2LFXOhMSqVGr0pcZZ9RbTlFMwMug7khEcgGnkrhraDKEUZYCPEA+su0kp nsjwRCQ5wEetzA+H+SBgr6GIMBWUpUv9hiBz7EgFLKWxZ5PRQLZEL647X/RMpJ3Oou29 P32yPMD7AbCCXme9Sz/DIUh5FYZSkK5OmC6hGmryXWcn/LdWIWvehcgd7/YEK6I/1HdZ vKUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="C/v89Rhl"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m185si4208523ywf.256.2018.11.27.21.41.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Nov 2018 21:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="C/v89Rhl"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsbj-0006aq-Pq for patch@linaro.org; Wed, 28 Nov 2018 00:41:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsYe-0003lt-ID for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRsYd-0004Jw-AN for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:44 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:35043) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRsYb-0004J8-Gt for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:42 -0500 Received: by mail-pl1-x644.google.com with SMTP id p8so6529534plo.2 for ; 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=N+S/Ex+S3f3RfZoA0pODXX8UV9gW9SVi2akCyHlxE00=; b=C/v89RhlVCK2qUByCs0lcC3AharYt17GjavhG/5o4jQz2Cxrx7UGPJkrRprNG8l3NB zNY1bFmND9pMU779gQOXMGZw+z4ciUbIwaRpXqPHdO9b0OMuOL/Vwv1FCZOXm95tNiKw UKGSSmjd0dtn0ugTqDy1Kg3KJ3gPvioAW1HKY= 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=N+S/Ex+S3f3RfZoA0pODXX8UV9gW9SVi2akCyHlxE00=; b=K6EsMJNSbsQdxYVfPE4oWujBafmZEhb1iATCQIfPVrYwmuRcIIeGAe4rpfeLV3X+ru X8rwCFH5w/dr3Co/NJUGP3VpdSkd2IhrffAAKpzTltKrrAzPGIINOw4ppb51y1HQirW2 tM3rnJtarUkHyRLIQioFziXLku7GYbtdtFOHsTkOgnwFLbnACaVGbl6TdjrS4E1c/4h1 T+5WFDIff/SK5YImbXugesJDqjqWAWFy7FJPtRZbSWby/yhQio/1PMYJxlYrvK1OpyAq j/LkFV3vb7rwMAVr/pw1X0gvzsRjgMShGE4Pymce+jFHQ2WjrUXtV1lRxKT002c6i9OT qrag== X-Gm-Message-State: AA+aEWZN6d190bCnAO67P56+JDlTNVTxCmtv5wrnqcv+95uG5oprwiPK +f2doE/bP1KGecuuLZJKY9uWXlYSmac= X-Received: by 2002:a17:902:9a4c:: with SMTP id x12mr1731911plv.94.1543383520195; Tue, 27 Nov 2018 21:38:40 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 21:38:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 21:38:25 -0800 Message-Id: <20181128053834.10861-4-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::644 Subject: [Qemu-devel] [PATCH 03/12] tcg: Add preferred_reg argument to temp_sync 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Pass this through to tcg_reg_alloc. Signed-off-by: Richard Henderson --- tcg/tcg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.17.2 diff --git a/tcg/tcg.c b/tcg/tcg.c index 7f29a2045a..509e5974bd 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2887,8 +2887,8 @@ static inline void temp_dead(TCGContext *s, TCGTemp *ts) registers needs to be allocated to store a constant. If 'free_or_dead' is non-zero, subsequently release the temporary; if it is positive, the temp is dead; if it is negative, the temp is free. */ -static void temp_sync(TCGContext *s, TCGTemp *ts, - TCGRegSet allocated_regs, int free_or_dead) +static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs, + TCGRegSet preferred_regs, int free_or_dead) { if (ts->fixed_reg) { return; @@ -2908,7 +2908,7 @@ static void temp_sync(TCGContext *s, TCGTemp *ts, break; } temp_load(s, ts, tcg_target_available_regs[ts->type], - allocated_regs, 0); + allocated_regs, preferred_regs); /* fallthrough */ case TEMP_VAL_REG: @@ -2935,7 +2935,7 @@ static void tcg_reg_free(TCGContext *s, TCGReg reg, TCGRegSet allocated_regs) { TCGTemp *ts = s->reg_to_temp[reg]; if (ts != NULL) { - temp_sync(s, ts, allocated_regs, -1); + temp_sync(s, ts, allocated_regs, 0, -1); } } @@ -3115,7 +3115,7 @@ static void tcg_reg_alloc_do_movi(TCGContext *s, TCGTemp *ots, ots->val = val; ots->mem_coherent = 0; if (NEED_SYNC_ARG(0)) { - temp_sync(s, ots, s->reserved_regs, IS_DEAD_ARG(0)); + temp_sync(s, ots, s->reserved_regs, 0, IS_DEAD_ARG(0)); } else if (IS_DEAD_ARG(0)) { temp_dead(s, ots); } @@ -3198,7 +3198,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op) ots->mem_coherent = 0; s->reg_to_temp[ots->reg] = ots; if (NEED_SYNC_ARG(0)) { - temp_sync(s, ots, allocated_regs, 0); + temp_sync(s, ots, allocated_regs, 0, 0); } } } @@ -3368,7 +3368,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) tcg_out_mov(s, ts->type, ts->reg, reg); } if (NEED_SYNC_ARG(i)) { - temp_sync(s, ts, o_allocated_regs, IS_DEAD_ARG(i)); + temp_sync(s, ts, o_allocated_regs, 0, IS_DEAD_ARG(i)); } else if (IS_DEAD_ARG(i)) { temp_dead(s, ts); } @@ -3502,7 +3502,7 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) ts->mem_coherent = 0; s->reg_to_temp[reg] = ts; if (NEED_SYNC_ARG(i)) { - temp_sync(s, ts, allocated_regs, IS_DEAD_ARG(i)); + temp_sync(s, ts, allocated_regs, 0, IS_DEAD_ARG(i)); } else if (IS_DEAD_ARG(i)) { temp_dead(s, ts); }