From patchwork Tue Dec 25 20:55:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154492 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5219032ljp; Tue, 25 Dec 2018 13:13:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN5iFLlcYYGGMPO2V+qDKQ8PaXwIhVK8iuwUcHaVfAOpXFRTmqNL/OA365Aoek0QXmOvrS5W X-Received: by 2002:ae9:ed89:: with SMTP id c131mr15729975qkg.222.1545772385992; Tue, 25 Dec 2018 13:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545772385; cv=none; d=google.com; s=arc-20160816; b=RvomXS2KD641SyvYACnWzcGn/4YqZjO0TurzEm8I7/cH/arQbA8nN80rn1BRNb4BS8 drTaXME8X8//ctvHEsQwvH2aGRtb29nzyPRCWtj9jOCJwN2bQtKG9fyoiWjsqeueArbR 3pRVqU0b89WDxD13qvgZlNwU4wjctg+BT0Ycqe0dcHu1x3wktDelazoO/zqF1GvAEWfZ Vt/cp188R0L+GzCzGLj8cYYc6vUyYrG1p+3Tkbs5rV06k+49UyhcZlvy0sWvl4OlBYsp 6FLSBv/y2inocC7+scIn7/BqNCMSk/7Aq86eFrYuL/n5lW9AHsbCLohkxsk25yTBrdVE 4G6w== 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=Q2OD/0jwdXN0qVQ970iuhIvtXWNMm2381UTggUlPz1c=; b=Hwt5w5hhz8Y93oeOCZGm7sXI3ibh6aZUdHhcMDvSP12gpmRvtxKkNH2zYqsjcXIs6a R6y/GhWMJh/NYCa65MqE+c52VCdJkjT5eYY6/Y0Q1IHNANRLn6GPSZ0APsHvvTiEJisM AGvvOHEa1LL21ObiM0UjVUXxr0A/SwEKwR+0WqzgKqMaM752+E0kTE/xdkeVNwIN4qya J/vmYiYFxkSoAUdeWldrhhQk0dkYohaG/XNfGTSGaI1hD0evJoSKnpKUjRG2B+9zVFg1 iULY19O2DtFd0WiJ4Qu4RQhwBJpTzpPTGJz4rM6nPcdO7DzIj4Ruq560CukMjIwOfch+ Hf5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NitUfoW3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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. [208.118.235.17]) by mx.google.com with ESMTPS id k4si1742752qtm.244.2018.12.25.13.13.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Dec 2018 13:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NitUfoW3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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 ([127.0.0.1]:43162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu0f-0008RP-CM for patch@linaro.org; Tue, 25 Dec 2018 16:13:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbtnW-0007ed-0v for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtnV-0001P9-6i for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:29 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:42169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbtnV-0001OX-13 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:29 -0500 Received: by mail-pf1-x434.google.com with SMTP id 64so7071864pfr.9 for ; Tue, 25 Dec 2018 12:59:28 -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=Q2OD/0jwdXN0qVQ970iuhIvtXWNMm2381UTggUlPz1c=; b=NitUfoW3/NDV6bwkLcIY1rlR85NFCkD5pHm3UezfG+uinWWfgT99i8wgx6FcQYN4Vp EzDEpf11OdTSipFC9JG2PLq4B9Zx7LEPhyGUzLdDRjJBfB1CawVgz/rEZutmnKS2Nv4d NdWvjsJXss1wiWmgbPbURfR5rUU+7K75A4ve0= 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=Q2OD/0jwdXN0qVQ970iuhIvtXWNMm2381UTggUlPz1c=; b=McZ3jwk2pqfXwyuvXWx2IDXZ7fnp984VcFmgMG1oio9jo2L3YHp9AcLNzL2jM+QS/E /JeTWZ+VrO6E92a3X2W0fvL6WAwMyLrhb6yMhsTx6kt0I4mkkFLF6I/aW8nGRTBXOk18 PGqhap3q53fMDl8EZkszIKoilMcYDCrdmLLE9JPG9YT6GsOHl/sLRksA/ro2DW6MpQ8U VEf9dQ1/0JJ1S6mfKi707/tU8QO5z7KL0mQGd3ACCqq0/cAo1bDmi6ArGLNW5DiZl85N 686MgcWr/bTvZ+6E2YaaP/QBf4r4rjIoBMnzMPZYQ0qY5Mto6CTj7Ag0F/iBzd7RVycj T/nA== X-Gm-Message-State: AJcUukdEmjAqhTt57UUa77C2+JNv6NHBJeogSH/3mwEmPVqB9zbmzZ41 xBvraIOiX9daucSlTMeTs2FuCbHvdts= X-Received: by 2002:a63:b543:: with SMTP id u3mr16524609pgo.420.1545771567788; Tue, 25 Dec 2018 12:59:27 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:59:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:19 +1100 Message-Id: <20181225205529.10874-33-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::434 Subject: [Qemu-devel] [PULL 32/42] 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Pass this through to tcg_reg_alloc. Reviewed-by: Emilio G. Cota 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 351d302a68..fe060c481a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2865,8 +2865,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; @@ -2886,7 +2886,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: @@ -2913,7 +2913,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); } } @@ -3093,7 +3093,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); } @@ -3176,7 +3176,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); } } } @@ -3346,7 +3346,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); } @@ -3480,7 +3480,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); }