From patchwork Mon Nov 12 21:44:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 150883 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3650706ljp; Mon, 12 Nov 2018 13:55:59 -0800 (PST) X-Google-Smtp-Source: AJdET5eYjjH63FefREql02EU+a9TEJQort9x2dNoQ+HhzCcleSJ0spHxQ3COo6oOagEVSvUalDzL X-Received: by 2002:ac8:f6f:: with SMTP id l44mr2687675qtk.158.1542059759185; Mon, 12 Nov 2018 13:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542059759; cv=none; d=google.com; s=arc-20160816; b=tlKpWT+Q3ihgmGgs8BJu3gaWpv2GxKsHfs8dxbrCmW3GiXQYZf1msjgo7gqvsWNio3 b+EavvcCIbDbiyXJkNvIzvRcrzl+sLOJvugfkMfVp/phRV0MupHNdINj/0yyZc32MG6t x4NmkB2tEuz+u4jr+LfvNADYVUd0Yubo7RmVxT1mdoToI+5WBBfMELiAibqda9/6ne1o wWW8X+oOEN7yyNpuLEiM/8W0ABu7s9zoO0TV7lpdJF1cwQB3Uiuqa2INXI1FwfomQilZ hI8Ck1AXZf00JicW7/xL7tVikK89Cl998pF6vpjvSOgFRW308fVH0Eq6arCq7l04QHeC J2JA== 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=cF/WsFdDAm7U5UqklJmZSwbqOFpj42nXKi+HNMQOl1Crqw6A/XvDPX3HDR4Ag5K+2p t2YF3msVJ1KvlrzoKXp58eYzFE2U8LDOJmAcnQmeNJ3NLIDWdtCZtCu9O1yo3TTx3HF3 jfMQ9pnmYMxrkgFAzoBPv9XJmHt661KS3m4G1H3a5gr/r7ld1vFpIGOekbynb9moJU1C 0k7Yz+1S5eipqKJIXaX9CIJjr+1X24omXlM626Ki/Rojg6i7RpJIhowC6HpZcvliW+KV HsIuztQjSs9NMcWz5yaOi2Jv5eoILAShmrl2Al3Mgckkfe5USGVmIuv9UWbnxUGeqUV8 V+EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jKzSa1sw; 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 t11si617443qtn.365.2018.11.12.13.55.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Nov 2018 13:55:59 -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=jKzSa1sw; 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]:50850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMKBa-0003G4-9h for patch@linaro.org; Mon, 12 Nov 2018 16:55:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMK3G-0003dp-8A for qemu-devel@nongnu.org; Mon, 12 Nov 2018 16:47:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMK3D-00050O-UD for qemu-devel@nongnu.org; Mon, 12 Nov 2018 16:47:21 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMK3D-0004zj-5P for qemu-devel@nongnu.org; Mon, 12 Nov 2018 16:47:19 -0500 Received: by mail-wr1-x443.google.com with SMTP id v18-v6so11019146wrt.8 for ; Mon, 12 Nov 2018 13:47:18 -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=jKzSa1swtOLRLYglXfKFRywfdgn+LYhR6/pSrv7buXBPDSOZ1iek5jS0LFKlYN/Wct zrWAjzB4AQCU3zW0TvQzG2ct1jND2Y111j0GCic3MAMC67aHbsEqC3IxXe5Nsh9m5O5O 3Y7MRhXFRTpZ0ifoK8jwUv/7b5lqCgKPelFVg= 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=Y2GkxlJ3JavvFAgmRy/8Luw2jUFluJHQkKhCrTWcHMBGYThgKVtsBj+3uCrmBX5Ybt L+Tb+Dc8t9wNsBYQW1oD9tIsY83G6SvApEA84tzwpaHSzvirYtu0xyQl0Kx16FPFhMbH M7R730KjQB+vtZFAP0MGpzDE79mfluXNUsLeSn6KuIWGaqJ5zi0ApvgyJ0Ab+Ndx/3g5 eSQndt35OVMGEYnJwVpe3HQVvhIyhjlLhaTf7wJZ990i9/Kx1S+CFN/Y3APgFsRxb+Fo apr/ibx+O3G5t7x61J7MzHqqFWs1NZwumdmlJ7BNPHWl/Mkt5xFnHuZgoa+6Z6//qP2t 4kwg== X-Gm-Message-State: AGRZ1gJPlwmminHzQr9B7ZFrCCJ7U88GaOGylh2gjs+UGoTz1//ZtA7c lo38/k9Nhv7kQV88impT4HR3Yo0+hgPggA== X-Received: by 2002:adf:a109:: with SMTP id o9-v6mr2490565wro.169.1542059237533; Mon, 12 Nov 2018 13:47:17 -0800 (PST) Received: from cloudburst.twiddle.net (178.red-213-99-154.dynamicip.rima-tde.net. [213.99.154.178]) by smtp.gmail.com with ESMTPSA id y123-v6sm3946907wme.38.2018.11.12.13.47.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 13:47:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 12 Nov 2018 22:44:56 +0100 Message-Id: <20181112214503.22941-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181112214503.22941-1-richard.henderson@linaro.org> References: <20181112214503.22941-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::443 Subject: [Qemu-devel] [PATCH for-4.0 10/17] 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: cota@braap.org 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;