From patchwork Wed Apr 26 06:23:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 9700331 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 3CF94603F4 for ; Wed, 26 Apr 2017 06:32:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AE8E284D5 for ; Wed, 26 Apr 2017 06:32:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C4FF284DB; Wed, 26 Apr 2017 06:32:44 +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_SIGNED, 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 8C48A284D5 for ; Wed, 26 Apr 2017 06:32:43 +0000 (UTC) Received: from localhost ([::1]:52920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3GVG-0007Wo-Uh for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Apr 2017 02:32:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3GMU-0000fg-Qt for qemu-devel@nongnu.org; Wed, 26 Apr 2017 02:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3GMT-0000Q6-Kq for qemu-devel@nongnu.org; Wed, 26 Apr 2017 02:23:38 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42011) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3GMN-0000Jy-SG; Wed, 26 Apr 2017 02:23:31 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 75D3B21CD1; Wed, 26 Apr 2017 02:23:31 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 26 Apr 2017 02:23:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=I30 QR1pXFPanFJV5oHtvxtoNKLtMGRWno9wckulFwbE=; b=HZ7poXczArSfMyT2n14 EOo5AtsukAg4pWJwYM8W2L9e0M4rlp+XGrKiS9DQIwSfKT3TB+IFxS8OTZl9ZznX X6RhvuaCno4mvcS0AcS4VojBLHoX1x0DjwIJpPfpIeo1ymtM/BPa5KrUp7D3XQ1A S391mAZBZSgtAcks4QCk5Gok= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=I30QR1pXFPanFJV5oHtvxtoNKLtMGRWno9wckulFw bE=; b=dzgNBBS6331hrUscDfgO54X/o5bMwoMXjAdTGR/vPvztA+yL1soKT1mz7 Apf+8b1Ljrw8EG1S2vwwNJ48ze8W5P4hH0epqNKwYZsqBOfkYV71LCzwMTwR6yRP K14prKd026RKND1tyIEZDmGh38RIdSj+wzEU3mX4rKWqdiHEC9Cq8x0vv0S4aPcS F3vLzled2CbD9ZSgyIBfm+2yiX056+QH5nmu2t0gryffNWfj0jYASW8abjV254tX 46Q/M3/zCvhITdEdeQeu+iOJ/kyJ06BXy6LfiZxT0O1ZMuTIzzRWWwpudxMYW1Mm cYOjHHFkmLHJCfYGK1Aj9k6P6K2xw== X-ME-Sender: X-Sasl-enc: TrZ+tcSl4MWDuGwI3H1dw7aYyJCDSOdJuuB+x2HTqFCJ 1493187811 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 358BB7E320; Wed, 26 Apr 2017 02:23:31 -0400 (EDT) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 02:23:18 -0400 Message-Id: <1493187803-4510-6-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493187803-4510-1-git-send-email-cota@braap.org> References: <1493187803-4510-1-git-send-email-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 Subject: [Qemu-devel] [PATCH v3 05/10] target/arm: optimize cross-page direct jumps in softmmu 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 , Eduardo Habkost , Peter Crosthwaite , Stefan Weil , Alexander Graf , alex.bennee@linaro.org, qemu-arm@nongnu.org, Pranith Kumar , Paolo Bonzini , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of unconditionally exiting to the exec loop, use the lookup_and_goto_ptr helper to jump to the target if it is valid. Perf impact: see next commit's log. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- target/arm/translate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index e32e38c..02cad96 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -4085,8 +4085,12 @@ static inline void gen_goto_tb(DisasContext *s, int n, target_ulong dest) gen_set_pc_im(s, dest); tcg_gen_exit_tb((uintptr_t)s->tb + n); } else { + TCGv addr = tcg_temp_new(); + gen_set_pc_im(s, dest); - tcg_gen_exit_tb(0); + tcg_gen_extu_i32_tl(addr, cpu_R[15]); + tcg_gen_lookup_and_goto_ptr(addr); + tcg_temp_free(addr); } }