From patchwork Mon Jun 5 16:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9766919 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 EA4426034B for ; Mon, 5 Jun 2017 16:59:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D3427F10 for ; Mon, 5 Jun 2017 16:59:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9C5627E5A; Mon, 5 Jun 2017 16:59:13 +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 BA72727E5A for ; Mon, 5 Jun 2017 16:59:12 +0000 (UTC) Received: from localhost ([::1]:34378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvLT-0000Wl-On for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Jun 2017 12:59:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvFI-0004J0-K9 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvFH-0003gj-3q for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:48 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:34325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHvFG-0003gD-Oc for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:46 -0400 Received: by mail-qt0-x241.google.com with SMTP id o21so13465259qtb.1 for ; Mon, 05 Jun 2017 09:52: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=0zYjzo/efhOpgeBsqHWXDc30ZQYqtGwqLZDUBnSKFlA=; b=rdEanlKIwjyZxaFUJcfiQC5z9Ud6jacA8+TFuYj1Y9YauTYudZGvXm9/KLCAkF+l5o 54vw1euGbQ4j/S43YqVbHwFtRT8SIEZmRL3STW5cpJedNzOQVOZrVPdCAfVV3O4kK0cu GucwcwtVChXlzcJDi2tSXJvlmwRkY2AV1Y6HOM9BkSBLv+/dUrz/w/RlYlHzx2u88xPU YXFC3XgbpA0keq/C5hNKa+SK2+UMa61GnvBi95v2lZ+TGbRGxV0SiL4HRgrUoKGfGN82 w7egDpVF63HmLKRjY5liTHy8QAKNg4GixbiCNTSQfl08wfFZyi/1TZrjdMuDQrB/Qd7n i9Eg== 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=0zYjzo/efhOpgeBsqHWXDc30ZQYqtGwqLZDUBnSKFlA=; b=OzxYcEnwovAJ4QdmwUW7tfUx0w6rtZ96X0yaIwYLvz3yQijA6TLQknGN6XAnnIQQ+G 6630Sq2JWYr8KxurTXLqtj9lgN+4zEL+pSI7qBkFp/ndsr51YGexMRKtkCOC0nd06oj7 XK1tPkbAH+StVL6IAC2olUADcWbpzs+AeXtXTs4fVIxMSP/dBACL00FXMVfrddza11bz YAuYZHDl1SjkfDgYuZBNnLv/s0xrVGpeIMvBefNJ+kqqOq1Fz4cP8/VqfF5ZJyizehOh s0nUw1+btp1yMMs7gV58MU32GdTd9PukLjisHpcnHYNOpDM9VKPM7hDq5l2DAth71Hqg HpdQ== X-Gm-Message-State: AKS2vOw3ony3HvLOjxoBtBMCmE+xs/N4jqxi9Il9mjBSgn/hA6qEDGDY 8mZdeSJc1BVr+T8LCIc= X-Received: by 10.55.9.203 with SMTP id 194mr25470131qkj.20.1496681565988; Mon, 05 Jun 2017 09:52:45 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id c6sm1637044qtb.56.2017.06.05.09.52.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 09:52:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 09:52:13 -0700 Message-Id: <20170605165233.4135-7-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170605165233.4135-1-rth@twiddle.net> References: <20170605165233.4135-1-rth@twiddle.net> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PULL 06/26] 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@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Emilio G. Cota" 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. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <1493263764-18657-7-git-send-email-cota@braap.org> Signed-off-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 ae6646c..d72953f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -4157,8 +4157,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); } }