From patchwork Wed Jun 7 22:52:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9772973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DAA760350 for ; Wed, 7 Jun 2017 22:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 340D2283BD for ; Wed, 7 Jun 2017 22:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 277802848F; Wed, 7 Jun 2017 22:53:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF445283BD for ; Wed, 7 Jun 2017 22:53:33 +0000 (UTC) Received: from localhost ([::1]:46396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIjpU-0002hE-Uj for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Jun 2017 18:53:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIjoI-0002gZ-7h for qemu-devel@nongnu.org; Wed, 07 Jun 2017 18:52:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIjoF-0000he-L2 for qemu-devel@nongnu.org; Wed, 07 Jun 2017 18:52:18 -0400 Received: from mail-yw0-x241.google.com ([2607:f8b0:4002:c05::241]:35105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIjoF-0000hV-H6 for qemu-devel@nongnu.org; Wed, 07 Jun 2017 18:52:15 -0400 Received: by mail-yw0-x241.google.com with SMTP id p144so1302950ywp.2 for ; Wed, 07 Jun 2017 15:52:15 -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; bh=d6CGtYaLd/L8c64a05LM4cfgtG+qRpj6ITitRBtJ8Ow=; b=jimcETDLwZpjQsGNRdp5oi/EBeUvnXgWbPKGuVh9YAotTuT8HNGS5pWOUY18eGncIT ANaZBTqEpQd1SQy4e3On8Lr88IxK4M17HeMFuATKLn2/9PaBsEC3Y++GYAOPmF/ZWnK0 oO15sel5FwFfAt9dGzSyxBhZykbZtEdC3iS0BUAlF8au3XET1ABdYiyPqIiATo/PFTM9 Nj5WK9/dfiDKO6d9FEE3yL5KrRir/GDVqXgJiLBQ09AAmRNFp9bxayRg1DogJelo7Vrn iEq0S3vgn5abXTTPBGsltCM5xQKtID48EuVFbDtP7EmqLlk2tk52377By3L5U+gEw/WU oiKg== 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=d6CGtYaLd/L8c64a05LM4cfgtG+qRpj6ITitRBtJ8Ow=; b=sxuozOGADPeKj35XNzpJMi4mM7ODwmGrtPyza4+GOTQB3PYnRLBZ94FS4CI5yir9pL qH8P1d90TTtY9FGR8SemW/4mKXy4lqTv5QlotHVA6lFuf4NSdhDNjdEVJsHO8HUIg2lb SO5KbahBkOsUMRkImUZFvk8GfUwVWJuU3i1KTkmYJrrduWFXtTxZqkJJs2vKJYjhc11q 737riidBXDZcC5Ux9TEcREi17Q0Rc8Svwj4270otrU0YYU0o7xMs++hktXGLqMV1HsE5 u9kWydfJcBDPXOO0ubqFXhqx7D18Y+YK8y0v08dcDHbg1k3+rnWJxXkUNwdRS1P+o2Bv kOsQ== X-Gm-Message-State: AODbwcCx+Z2RrxfgFPkJ8rNgdWTFGHkW/NlnKQXxjCUSbQ0w1NvOaK3W FwaQSTqOvffhbQ== X-Received: by 10.129.113.6 with SMTP id m6mr8350193ywc.19.1496875934382; Wed, 07 Jun 2017 15:52:14 -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 u187sm1269123ywd.22.2017.06.07.15.52.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 15:52:13 -0700 (PDT) From: Pranith Kumar To: alex.bennee@linaro.org Date: Wed, 7 Jun 2017 18:52:10 -0400 Message-Id: <20170607225212.23714-2-bobby.prani@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170607225212.23714-1-bobby.prani@gmail.com> References: <20170607225212.23714-1-bobby.prani@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::241 Subject: [Qemu-devel] [RFC PATCH 1/3] tcg/aarch64: Introduce and use jump 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pranith Kumar --- tcg/aarch64/tcg-target.inc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 1fa3bccc89..ab0a8caa03 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -819,6 +819,12 @@ 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_register(TCGContext *s, intptr_t target) +{ + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP, 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 from @@ -1364,10 +1370,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(s, s->code_gen_epilogue); + tcg_out_goto_register(s, (intptr_t)(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_register(s, (intptr_t)(tb_ret_addr)); } break;