From nobody Wed Nov 5 18:27:48 2025 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.zoho.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 1496681831578364.14629537877033; Mon, 5 Jun 2017 09:57:11 -0700 (PDT) Received: from localhost ([::1]:34375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvJV-0007n8-7d for importer@patchew.org; Mon, 05 Jun 2017 12:57:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvFR-0004Wd-WA for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvFQ-0003p3-BP for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:58 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:36150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHvFQ-0003oi-36 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:56 -0400 Received: by mail-qt0-x241.google.com with SMTP id s33so9907274qtg.3 for ; Mon, 05 Jun 2017 09:52:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 09:52:54 -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=6LXVq7J8cZOHsct777LaGbs+txdbgPbYt4cDLfnQZJ4=; b=jpywcDnRf5aZIxxGGYfcn4gr67/yoz9b5//IGFj+twTK3DkQkAN6dCgXoFbzh+4gD3 gOQZPU+7k/oGTlt4L1EL3dOAdB8B93Pl23GvDhQ0jzdesSQXIU0KynpnWlC4XYKTB32k mFld1vvwx/OCsn0WJfLwaI4eyL07jFuSjBde2cYKda5Qw0M3EekHmzF13yFozhtceM8u 2jVK99O23qPXGFBXFNgLa/ERrfoS4O45PmOjOWT55DJJeGXlv4xqUrMOz/P65GtLJsB1 zeU3SEFKYQ+itkO3BRtBn92kVjNwBvjHLVyvUcNqJrO2iU6IMSRtrX5ToU/B+mzt4OOR EREg== 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=6LXVq7J8cZOHsct777LaGbs+txdbgPbYt4cDLfnQZJ4=; b=of4XvJ2N0Zm67MFPXc+nn8Ifk1PD1gM/QSHn/tgTyf7N1CoC0beOEpKl0WtNskKY5A INEVg7LdlYePoXvcLyW2qIYM6IU+MS5xIxSeyUWxwR0Xz9RARYFzJMOfnW65xFMQpn0v B8uaWPxF4B1lfbY40AipoU2toRN2/L3PMvv9XoQ8uZ+WvbVQ2/CBQkBH1znREGvQ9PX/ +8FLcuTNDXb/4TC359MnvSuMCfrY/we5i1V5RkcFeuxicVY82tPz2n8Ae/aXWeHMd5xl GAVuh/BO4x61LDsLDTXczDyV/XyoskQFVeVOZTxm9+JLGmL3oRhShTtNxez4sjvwoYNu /8Qg== X-Gm-Message-State: AKS2vOyeO8F660q97FDcwa262JA325rH2UYpr7gO0Q6gaNdxrAfTp1W0 pW+KtQBs8lQiL+7cwTk= X-Received: by 10.200.36.194 with SMTP id t2mr6078431qtt.147.1496681575235; Mon, 05 Jun 2017 09:52:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 09:52:20 -0700 Message-Id: <20170605165233.4135-14-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> 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 13/26] tcg/aarch64: Implement goto_ptr 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 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Measurements: SPECint06 (test set), x86_64-linux-user. Host: APM 64= -bit ARMv8 (Atlas/A57) @ 2.4 GHz 1.45x +-+-----------------------------------------------------------------= --------------------------------------------+-+ | ***** = | | +++ * * = +goto-ptr | 1.4x +-+...*****............................*...*........................= ............................................+-+ | *+++* * * = +++ | 1.35x +-+...*...*............................*...*........................= ...*****....................................+-+ | * * * * = *+++* | | * * * * = * * | 1.3x +-+...*...*............................*...*........................= ...*...*....................................+-+ | * * * * = * * | | * * * * = * * ***** | 1.25x +-+...*...*...........*****............*...*........................= ...*...*............*****...*...*...........+-+ | * * * * * * = * * *+++* * * | 1.2x +-+...*...*...........*...*............*...*........................= ...*...*............*...*...*...*...........+-+ | * * * * * * = * * * * * * | | * * * * * * = * * * * * * ***** | 1.15x +-+...*...*...........*...*............*...*........................= ...*...*............*...*...*...*...*...*...+-+ | * * * * * * = * * +++ * * * * * * | | * * * * * * = * * ***** * * * * * * | 1.1x +-+...*...*...........*...*....*****...*...*...*****................= ...*...*...*...*....*...*...*...*...*...*...+-+ | * * * * * * * * * * = * * * * * * * * * * | 1.05x +-+...*...*...........*...*....*...*...*...*...*...*................= ...*...*...*...*....*...*...*...*...*...*...+-+ | * * ***** * * * * * * * * = * * * * * * * * * * | | * * * * * * * * * * * * ***** *****= * * * * * * * * * * | 1x +-+---*****---*****---*****----*****---*****---*****---*****---*****= ---*****---*****----*****---*****---*****---+-+ astar bzip2 gcc gobmk h264ref hmmlibquantum mcf om= netpperlbench sjenxalancbmk hmean png: http://imgur.com/en9HE8L Tested-by: Emilio G. Cota Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 +- tcg/aarch64/tcg-target.inc.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index b82eac4..55a46ac 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -77,7 +77,7 @@ typedef enum { #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_extrl_i64_i32 0 #define TCG_TARGET_HAS_extrh_i64_i32 0 -#define TCG_TARGET_HAS_goto_ptr 0 +#define TCG_TARGET_HAS_goto_ptr 1 =20 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 290de6d..5f18545 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -1357,8 +1357,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, =20 switch (opc) { case INDEX_op_exit_tb: - tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_X0, a0); - tcg_out_goto(s, tb_ret_addr); + /* Reuse the zeroing that exists for goto_ptr. */ + if (a0 =3D=3D 0) { + tcg_out_goto(s, s->code_gen_epilogue); + } else { + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_X0, a0); + tcg_out_goto(s, tb_ret_addr); + } break; =20 case INDEX_op_goto_tb: @@ -1374,6 +1379,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, s->tb_jmp_reset_offset[a0] =3D tcg_current_code_size(s); break; =20 + case INDEX_op_goto_ptr: + tcg_out_insn(s, 3207, BR, a0); + break; + case INDEX_op_br: tcg_out_goto_label(s, arg_label(a0)); break; @@ -1735,6 +1744,7 @@ static const TCGTargetOpDef aarch64_op_defs[] =3D { { INDEX_op_exit_tb, { } }, { INDEX_op_goto_tb, { } }, { INDEX_op_br, { } }, + { INDEX_op_goto_ptr, { "r" } }, =20 { INDEX_op_ld8u_i32, { "r", "r" } }, { INDEX_op_ld8s_i32, { "r", "r" } }, @@ -1942,6 +1952,14 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]); tcg_out_insn(s, 3207, BR, tcg_target_call_iarg_regs[1]); =20 + /* + * Return path for goto_ptr. Set return value to 0, a-la exit_tb, + * and fall through to the rest of the epilogue. + */ + s->code_gen_epilogue =3D s->code_ptr; + tcg_out_movi(s, TCG_TYPE_REG, TCG_REG_X0, 0); + + /* TB epilogue */ tb_ret_addr =3D s->code_ptr; =20 /* Remove TCG locals stack space. */ --=20 2.9.4