From patchwork Fri Nov 23 14:45:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 151898 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2229451ljp; Fri, 23 Nov 2018 07:04:42 -0800 (PST) X-Google-Smtp-Source: AJdET5cQIPEzkZcs6kMjzloH3ujT3XuVZ3+tZPrf735FbMpnOJV65cq1g/JsXpWrUtgLtdzrrrWF X-Received: by 2002:a81:a986:: with SMTP id g128-v6mr16639435ywh.269.1542985482224; Fri, 23 Nov 2018 07:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542985482; cv=none; d=google.com; s=arc-20160816; b=oAtU2EUOVwxX5qYAk6oNmc+eOrKLYFC0jrfReJsziFDAD1mVeE9DvpZ8Oy5ph8aPu4 8ZgWM98uEmCtU8mXc+vLidhcKxi6XDmbhQFPWxTFpBxUKzS7Z5ifHTRylAOVNvgRCfCX DooNlPmBHcIebo+lwKID8Xt9GbDUWbHuvBHAvdKp1nEvr0m8JLuckxbh3Zdo1B20GDVy 3ak0q4WVzbWNypJu4BRpZ2ZCOQ9CjDYVrybKF5BwpHfecCTGRy9XfhraZbPsI14jNFSE lx+btqiKDuHlNcnGQV3fH7tu36iJH7CO7907QJx2RpwntrwQPRKWkGEKxKgWxIkXhJ+A p29Q== 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=bfXp2m+eG0fPw8rnLzBA4705O4L8LprWDujoyvgpuQg=; b=r9Fm0roIH7mtb1Uv34QF1U8QoA3tTTFG4/bCBtq2mRtoKhJj1i3/ofe2ji9e/R0bYO pkIRt1TfTRwJQpc3XydB9LbNYk2oR/8bqwkJ+fwXp4Hx4b4ICGbFODM39RB2AlMBDlHN TKa670/8ZvicR4Q6f5YwuGW/Z7RuQ9D2s9gknGHzM45oRnPByY3MY+1lcOAiVcV7oEI3 uDCSa+E2Su0y4Psfol6Jvg0l/UQtjmCN8zgs6FsU4F+B232x+Py2Y9keK9oBCczzv5/q XQwtBc5hvqd22oUoScQoNfZA8CYn84c2FYrd/vMTfzvaewUQCiwM/A7cqsb8R+D9UPet zyTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U7k3uJk6; 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 f18-v6si22478425ybn.255.2018.11.23.07.04.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 23 Nov 2018 07:04:42 -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=U7k3uJk6; 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]:52856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQD0b-0000mt-Iz for patch@linaro.org; Fri, 23 Nov 2018 10:04:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQCik-00081X-Vm for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQCij-0003Ga-RE for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:14 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQCij-0003FK-IT for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:13 -0500 Received: by mail-wm1-x343.google.com with SMTP id u13-v6so12248483wmc.4 for ; Fri, 23 Nov 2018 06:46:13 -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=bfXp2m+eG0fPw8rnLzBA4705O4L8LprWDujoyvgpuQg=; b=U7k3uJk6yF8aTFNtqpq2sGt1Gfmct4617lnV/6ozerK48fvJPlSoDQ4pc5nnIk7PaW 06lyt6nlYMGgUEZQPIh9dgPfmRgiUda6M/qHecfWDyzI3PEzskBh8VIX9Snbk3FT13pw nH2Z8qJblUD6/DqTcI6gBWihVY7Coy+Rcx8f0= 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=bfXp2m+eG0fPw8rnLzBA4705O4L8LprWDujoyvgpuQg=; b=lqyYP3ttlWXEfELdoQeL/Sc6Ud68xBrdH2i5xRopNwCHsu6521njsoq93py0vtLpj+ LLoN2kcsPLURcuncy7c4uf2Ro9k6frOOkIIjyEVrLXLWqxVR+f7zGPjmnWVKogsV4XRv PvPFu1rsDdoLNJGqCgNNQk1ayqPB6ChHUQPElWYkGgesf898a4TCLwLx+r9YoVKxg4D/ sbQQQvzO90DjmJUwOAaCH+xxbRTgvYYOB07f7PE+spQi0YUUhumrOP598yCC0fIuBhnT PB0xEaMydmeL5wobWxHic51/QXyRzLmcPPfHcomIFiSlXvesuqiU5+27pNS70LwjQBcj nLbA== X-Gm-Message-State: AA+aEWZC6H2EaqkEAtV7w5l2d+0UbCnN5dx8qpUoG45Kv7XYB1ZufGxi kciD/lx8fE+OE38e2KuyFsyMIKSykH2e7A== X-Received: by 2002:a1c:6408:: with SMTP id y8mr14108517wmb.0.1542984372267; Fri, 23 Nov 2018 06:46:12 -0800 (PST) Received: from cloudburst.twiddle.net ([195.77.246.50]) by smtp.gmail.com with ESMTPSA id p74sm10339630wmd.29.2018.11.23.06.46.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 06:46:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 15:45:33 +0100 Message-Id: <20181123144558.5048-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181123144558.5048-1-richard.henderson@linaro.org> References: <20181123144558.5048-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH for-4.0 v2 12/37] tcg/aarch64: Parameterize the temp for tcg_out_goto_long 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: Alistair.Francis@wdc.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We cannot use TCG_REG_LR (aka TCG_REG_TMP) for tail calls. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.17.2 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index c0ba9a6d50..ea5fe33fca 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -1134,14 +1134,15 @@ static inline void tcg_out_goto(TCGContext *s, tcg_insn_unit *target) tcg_out_insn(s, 3206, B, offset); } -static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target) +static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target, + TCGReg scratch) { ptrdiff_t offset = target - s->code_ptr; if (offset == sextract64(offset, 0, 26)) { tcg_out_insn(s, 3206, BL, offset); } else { - tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP, (intptr_t)target); - tcg_out_insn(s, 3207, BR, TCG_REG_TMP); + tcg_out_movi(s, TCG_TYPE_I64, scratch, (intptr_t)target); + tcg_out_insn(s, 3207, BR, scratch); } } @@ -1716,10 +1717,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_exit_tb: /* Reuse the zeroing that exists for goto_ptr. */ if (a0 == 0) { - tcg_out_goto_long(s, s->code_gen_epilogue); + tcg_out_goto_long(s, s->code_gen_epilogue, TCG_REG_TMP); } else { tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_X0, a0); - tcg_out_goto_long(s, tb_ret_addr); + tcg_out_goto_long(s, tb_ret_addr, TCG_REG_TMP); } break;