From patchwork Thu Apr 27 11:59:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9702805 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 1729A602CC for ; Thu, 27 Apr 2017 12:06:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED7B62839C for ; Thu, 27 Apr 2017 12:06:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0E9F28449; Thu, 27 Apr 2017 12:06:50 +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 D98C328399 for ; Thu, 27 Apr 2017 12:06:49 +0000 (UTC) Received: from localhost ([::1]:60237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3iC8-00005c-Uh for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Apr 2017 08:06:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3i60-00040i-N8 for qemu-devel@nongnu.org; Thu, 27 Apr 2017 08:00:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3i5w-0001Tq-RQ for qemu-devel@nongnu.org; Thu, 27 Apr 2017 08:00:28 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3i5w-0001So-LC for qemu-devel@nongnu.org; Thu, 27 Apr 2017 08:00:24 -0400 Received: by mail-wr0-x244.google.com with SMTP id w50so3540192wrc.0 for ; Thu, 27 Apr 2017 05:00:24 -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; bh=1C+xRNFJ5k8/d5H+Q6H1rGJmoNfLpuUP7DVW6ufqoLM=; b=CcJdKwoMWLrCdOk9jsyIQ/Xu3fv+t5TgfUZ9ndVr/1CpaHIUg2dl4NcWFjPVB3ezMy XcEgLzSDocHvxaTiuThsNVxmUiUZ1RyOX5w9cKU1LGur+AKzM5EWXoemfjkDoOmKq4js nqmW2vEBMxfe3+uyHNn/BxxKY0NF9ke9tHgnu3jptFy9rJL6v0fF2HuFCB85SuHHoTG7 RtQDJArOYTL1auVzwglzx13xb7ID/ZQh/bGZgIWi7hrRircYWr+QlcJjLiC0My1SIEib uALtUsIs5tKyXl1LSH24dxdg8I7jIVUYouhhEQXs5p7vZEIjlvkeOUO4UrCygzI1cVoi 1Ffg== 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; bh=1C+xRNFJ5k8/d5H+Q6H1rGJmoNfLpuUP7DVW6ufqoLM=; b=n8cov3kHqhT9mF0YXsIMAVBAxYl/GOpmMW96hcKB99Ro7u8QXVwpl8G9WDduETYn6c SdPddHdTjBBQU3kqeXfgi6dpn+YSzsbgwdT/m06wloETbeUx1Ya9iac2KR88S4lUGpnG sxae9XTNnKlsT2FFtH4b8hBHFc0t+dHthDcSHZeKVVvJ6iCngUbw2J8k7qiDJVYdebft Qg4rwibU2aCWBoZ728FE1wRQR9QgMfdkwqR4BXACb+eYHJHBiQu9GTJkuj1q3n/EEmeK KDXzKKm6lDPyUhOEtE2AUoYVmh5fdaYTnBjgR/0BMnY/X4YfCmDJePp7VxaVfM++lhCd O8jQ== X-Gm-Message-State: AN3rC/4HYQX2K0Qveaj4nvjWJHqTCopVsXwVFYSB2FGGfvaRsUYV+wpn Aefk9qcdzSuCJg== X-Received: by 10.223.138.137 with SMTP id y9mr3473905wry.26.1493294423606; Thu, 27 Apr 2017 05:00:23 -0700 (PDT) Received: from bigtime.twiddle.net.com (251.red-80-29-7.adsl.static.ccgg.telefonica.net. [80.29.7.251]) by smtp.gmail.com with ESMTPSA id i199sm3056470wmf.33.2017.04.27.05.00.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 05:00:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 27 Apr 2017 13:59:55 +0200 Message-Id: <20170427120006.20564-9-rth@twiddle.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170427120006.20564-1-rth@twiddle.net> References: <20170427120006.20564-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH v5 08/19] 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: cota@braap.org 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: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <1493263764-18657-7-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- 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 0b5a0bc..facb52f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -4153,8 +4153,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); } }