From nobody Sun Feb 8 19:38:07 2026 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498783369771309.3355447415181; Thu, 29 Jun 2017 17:42:49 -0700 (PDT) Received: from localhost ([::1]:41839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQk1I-0002d4-7V for importer@patchew.org; Thu, 29 Jun 2017 20:42:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQjzd-0001fI-PC for qemu-devel@nongnu.org; Thu, 29 Jun 2017 20:41:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQjzb-0006HU-Op for qemu-devel@nongnu.org; Thu, 29 Jun 2017 20:41:05 -0400 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:35314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQjzb-0006HG-KL for qemu-devel@nongnu.org; Thu, 29 Jun 2017 20:41:03 -0400 Received: by mail-yw0-x243.google.com with SMTP id z21so5860675ywz.2 for ; Thu, 29 Jun 2017 17:41:03 -0700 (PDT) Received: from localhost.localdomain (c-73-207-178-95.hsd1.ga.comcast.net. [73.207.178.95]) by smtp.gmail.com with ESMTPSA id s29sm2914542ywa.45.2017.06.29.17.41.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 17:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlYU+r9CZ1WfbLrR+FNjtel3zIeloCgLnxvEOP/FaLk=; b=kiu3CNSSfjy/sMCnmGX6KC0/Pe6y/+TBe/UGky9ls5cWHXPSLTcibcKxDSyGhTXDKN 2u/BYMhpdHxznz70BQ38t8KZnZ2+h79sStRXL0kH4OKv7rxaRzH7Ddyr2uGUffh9fdMj L0EtxEL3mN+ole+RLt59DgMhjTbuPZDJiIn2kOGazfXniwRSUpDJh6d8k6Q1rQPcpVYx /ga+sdLvwMHAWDJdgWzr1WBj0qcG0Pd0ckt0TtC/CiGiwM4t9GmF3TIBRRHDHBK0x1O1 AXcGolaLWCRmIK0C3bq7BtJmMEyj2IVb2++I0M/JH+u2w5YVFxaZJ5J2Gl6dGlaEageX Rk/g== 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:mime-version:content-transfer-encoding; bh=YlYU+r9CZ1WfbLrR+FNjtel3zIeloCgLnxvEOP/FaLk=; b=dFBMkYJNXygy8j2aEcsh7hEZAGe5CZhYpRyhCL2xDZJjsX1SwG87hVY8geX9MkvkTs I5F+yM7ffu0cOuzy1V4w59OxY9J6BAzZX6HvtxTVHtMY74Cljhcn7y9hQpOHXIjZNHQK +EpVZDaLsHH9oBSzE+9nOI1sKDFu2WZXgz7KTeDUZs5WqhOCrjEKww3wJ5o/C06Ch3/Q kGsdBFSP/nq974uftpUcdb4UJ3dl2HXXLehuB3CrsqQxCEySj94VGKTNG5HpaPDq876i EEFNRQ/z/RMiKM+K1W519elfC6fUH+rxcyoXs2wJHr/7k/waeRrpL3h+dDRnIzanDAN7 7VGA== X-Gm-Message-State: AKS2vOzapFr0ZGBwQm2LhNsowthCXnq7y7bwX/JihMvqOYL8K68tITVb Ft+aVR+OlZ3Kqx8uTXI= X-Received: by 10.129.163.136 with SMTP id a130mr2694481ywh.266.1498783263082; Thu, 29 Jun 2017 17:41:03 -0700 (PDT) From: Pranith Kumar To: alex.bennee@linaro.org Date: Thu, 29 Jun 2017 20:40:57 -0400 Message-Id: <20170630004059.25619-2-bobby.prani@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170630004059.25619-1-bobby.prani@gmail.com> References: <20170630004059.25619-1-bobby.prani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::243 Subject: [Qemu-devel] [PATCH v3 1/3] tcg/aarch64: Introduce and use long branch to register 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: qemu-devel@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 We can use a branch to register instruction for exit_tb for offsets greater than 128MB. CC: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Signed-off-by: Pranith Kumar --- tcg/aarch64/tcg-target.inc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 1fa3bccc89..8fce11ace7 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -819,6 +819,17 @@ static inline void tcg_out_goto(TCGContext *s, tcg_ins= n_unit *target) tcg_out_insn(s, 3206, B, offset); } =20 +static inline void tcg_out_goto_long(TCGContext *s, tcg_insn_unit *target) +{ + ptrdiff_t offset =3D target - s->code_ptr; + if (offset =3D=3D 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); + } +} + static inline void tcg_out_goto_noaddr(TCGContext *s) { /* We pay attention here to not modify the branch target by reading fr= om @@ -1364,10 +1375,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 =3D=3D 0) { - tcg_out_goto(s, s->code_gen_epilogue); + tcg_out_goto_long(s, s->code_gen_epilogue); } else { tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_X0, a0); - tcg_out_goto(s, tb_ret_addr); + tcg_out_goto_long(s, tb_ret_addr); } break; =20 --=20 2.13.0