From nobody Sun Feb 8 12:58:20 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.zohomail.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 1499672465692511.7269382346519; Mon, 10 Jul 2017 00:41:05 -0700 (PDT) Received: from localhost ([::1]:39051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUTJY-0002k0-0a for importer@patchew.org; Mon, 10 Jul 2017 03:41:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUTFV-0007y6-Jx for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:36:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUTFQ-0007fe-Ln for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:36:53 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUTFQ-0007fX-FZ for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:36:48 -0400 Received: by mail-pg0-f68.google.com with SMTP id u36so11708966pgn.3 for ; Mon, 10 Jul 2017 00:36:48 -0700 (PDT) Received: from bigtime.twiddle.net (rrcs-173-197-98-123.west.biz.rr.com. [173.197.98.123]) by smtp.gmail.com with ESMTPSA id o8sm21619584pgn.52.2017.07.10.00.35.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 00:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IP/qPMw1NkXnK0I1vRv+HZLa1kKYGF/ss6svw8YL8+E=; b=ZBff5duxr1Er7BJo+9kdPTogZAdSl8zPNiXNPjg2lkRUJHMNZHGYx7SRYTCG4u4Qw1 WjZb/kssa2mEp+FAFIs5bgz+w9QNMvKyZg7J00nfnD5kBQGtNnjKkpN5gyOVy/L4KjYs RLnnX9/BZO1wX68qPRBknNb89g4PDPH+PnBq4xr+AJbjpOqX0Hq7J6nkOnVw2pH0xXfK qD+/HDqlsVn79OPX84LkFGLSoX+IQEggbfXj7uRSL2mdhiBwK4c+i6kjB3jK9vFeIn5W KCTCYtA4hxs4fa6exH1GEIe8WUNcQHxsHiXBYhtwuEhyFmysV/XHSrA6E4np42a91D+1 J7nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IP/qPMw1NkXnK0I1vRv+HZLa1kKYGF/ss6svw8YL8+E=; b=dzfpb3fiEDVbEoszo90wSYepMZGqVy9FL1Sjj74pjt26v/meoTE9CAdtE8bSN78aPC mSQB5srMgHXNQ6DcE9BdxC/0XzYf5NEWyeA4awWttgOcdYhwK5YhCcP8cDdMEesQoTyo mBfTIqNeFPNGGB/QqSo3VCthK057PKE3BhO6zYfxhFLC5ltjyCxLqPO3sKrcw0msl/HT LvUIsl+zd5exaGoWQwHUT1BM9MJF7PdDJvref7yPk7v+sI75iff5qggP2BOQCuHi3Lu2 cuWviu6tfT5dmN+l24ur/EIDVVGgiFqUasuwacqZZzZcN0BUOQCzz6idgYcodSdgtTyw QfpQ== X-Gm-Message-State: AIVw1118+1dun/0wFIWM/ZcOCTUD38l2tfgZpj4MUlmS/VxiFFp6p2zS FFsitJzBmy29xeo+37Y= X-Received: by 10.84.232.198 with SMTP id x6mr16492460plm.139.1499672147402; Mon, 10 Jul 2017 00:35:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Jul 2017 21:34:57 -1000 Message-Id: <20170710073501.5207-2-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170710073501.5207-1-rth@twiddle.net> References: <20170710073501.5207-1-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.68 Subject: [Qemu-devel] [PULL 1/5] 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: peter.maydell@linaro.org, Pranith Kumar , =?UTF-8?q?Alex=20Benn=C3=A9e?= 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 From: Pranith Kumar 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 Message-Id: <20170630143614.31059-1-bobby.prani@gmail.com> Signed-off-by: Richard Henderson --- 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 1fa3bcc..8fce11a 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.9.4