From nobody Fri Oct 24 22:18:44 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.zohomail.com; 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 151873746178351.11821454789492; Thu, 15 Feb 2018 15:31:01 -0800 (PST) Received: from localhost ([::1]:43324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emSzV-0000nR-0x for importer@patchew.org; Thu, 15 Feb 2018 18:31:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emSn3-0003bT-5N for qemu-devel@nongnu.org; Thu, 15 Feb 2018 18:18:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emSmz-0000kj-Gz for qemu-devel@nongnu.org; Thu, 15 Feb 2018 18:18:09 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58953) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emSmz-0000kW-CX for qemu-devel@nongnu.org; Thu, 15 Feb 2018 18:18:05 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 12FFF20DE3; Thu, 15 Feb 2018 18:18:05 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 15 Feb 2018 18:18:05 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id B1AFE7E34D; Thu, 15 Feb 2018 18:18:04 -0500 (EST) 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; s=mesmtp; bh=eypZB0NtPgV4Ov XLpoSPOpcUED/mjKX08TRawmsXkdk=; b=KGPrCeymy3dCeh0nxgMZnrIer8WVA8 xJeQJH42764n63LSDaTIH3VkHfpAqrPCOjGSR4BUSSOs0RC+5qPErF0iatCC9+az S84ZBKItKw7SX/w3gWGWGex6AIt38BsxtupJ4No27w2FBJq19M8x9Mg1rE7khIdw uFSOP+0pNIxZg= 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; s= fm2; bh=eypZB0NtPgV4OvXLpoSPOpcUED/mjKX08TRawmsXkdk=; b=EnONq7UH iEWHoFfiXLV4sJEbrLhxVAzdg6BFlMT/b4yuQmGI0BluKFqm0yuFBTFMH11CH7Kf wbg3HS1ql2n5Dm9e9gIFxfNhLI8MRXUfTMzg6807uhPFxhksNfWy/2UJPcUtjtsS xdUP6Bp1cKWvBGII6aBlMVgffCPg+/7ThwHQCUWaxgPwo12Ku6bFsw8DU1YeUNJH qAAt9rO4xWki6NG/0JcvLPdJRe5PSyVPeqhClxumwujVwsyevauw+YSqv/GngRo/ uguWDleofer2b6Q145i3fS0wpgNPr83HxTytN8PZzjQcCpJXdpE0Sl9t3nySGLLe cGn/DvOiUHvm9A== X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 18:17:54 -0500 Message-Id: <1518736676-5994-2-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518736676-5994-1-git-send-email-cota@braap.org> References: <1518736676-5994-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.29 Subject: [Qemu-devel] [PATCH 1/3] target/sparc: convert to DisasJumpType 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: Mark Cave-Ayland , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- target/sparc/translate.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 71e0853..730e25d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -30,6 +30,7 @@ #include "exec/helper-gen.h" =20 #include "trace-tcg.h" +#include "exec/translator.h" #include "exec/log.h" #include "asi.h" =20 @@ -69,7 +70,7 @@ typedef struct DisasContext { target_ulong pc; /* current Program Counter: integer or DYNAMIC_PC = */ target_ulong npc; /* next PC: integer or DYNAMIC_PC or JUMP_PC */ target_ulong jump_pc[2]; /* used when JUMP_PC pc value is used */ - int is_br; + DisasJumpType is_jmp; int mem_idx; bool fpu_enabled; bool address_mask_32bit; @@ -995,7 +996,7 @@ static void gen_branch_a(DisasContext *dc, target_ulong= pc1) gen_set_label(l1); gen_goto_tb(dc, 1, npc + 4, npc + 8); =20 - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; } =20 static void gen_branch_n(DisasContext *dc, target_ulong pc1) @@ -1078,7 +1079,7 @@ static void gen_exception(DisasContext *dc, int which) t =3D tcg_const_i32(which); gen_helper_raise_exception(cpu_env, t); tcg_temp_free_i32(t); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; } =20 static void gen_check_align(TCGv addr, int mask) @@ -3346,7 +3347,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) =20 if (cond =3D=3D 8) { /* An unconditional trap ends the TB. */ - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; goto jmp_insn; } else { /* A conditional trap falls through to the next insn. = */ @@ -4326,7 +4327,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) save_state(dc); gen_op_next_insn(); tcg_gen_exit_tb(0); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; break; case 0x6: /* V9 wrfprs */ tcg_gen_xor_tl(cpu_tmp0, cpu_src1, cpu_src= 2); @@ -4335,7 +4336,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) save_state(dc); gen_op_next_insn(); tcg_gen_exit_tb(0); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; break; case 0xf: /* V9 sir, nop if user */ #if !defined(CONFIG_USER_ONLY) @@ -4463,7 +4464,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) save_state(dc); gen_op_next_insn(); tcg_gen_exit_tb(0); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; #endif } break; @@ -4619,7 +4620,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) save_state(dc); gen_op_next_insn(); tcg_gen_exit_tb(0); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; break; case 1: // htstate // XXX gen_op_wrhtstate(); @@ -5685,7 +5686,7 @@ static void disas_sparc_insn(DisasContext * dc, unsig= ned int insn) } else if (dc->npc =3D=3D JUMP_PC) { /* we can do a static jump */ gen_branch2(dc, dc->jump_pc[0], dc->jump_pc[1], cpu_cond); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; } else { dc->pc =3D dc->npc; dc->npc =3D dc->npc + 4; @@ -5747,6 +5748,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock * tb) pc_start =3D tb->pc; dc->pc =3D pc_start; last_pc =3D dc->pc; + dc->is_jmp =3D DISAS_NEXT; dc->npc =3D (target_ulong) tb->cs_base; dc->cc_op =3D CC_OP_DYNAMIC; dc->mem_idx =3D tb->flags & TB_FLAG_MMU_MASK; @@ -5791,7 +5793,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock * tb) } gen_helper_debug(cpu_env); tcg_gen_exit_tb(0); - dc->is_br =3D 1; + dc->is_jmp =3D DISAS_NORETURN; goto exit_gen_loop; } =20 @@ -5803,8 +5805,9 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock * tb) =20 disas_sparc_insn(dc, insn); =20 - if (dc->is_br) + if (dc->is_jmp =3D=3D DISAS_NORETURN) { break; + } /* if the next PC is different, we abort now */ if (dc->pc !=3D (last_pc + 4)) break; @@ -5825,7 +5828,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock * tb) if (tb_cflags(tb) & CF_LAST_IO) { gen_io_end(); } - if (!dc->is_br) { + if (dc->is_jmp !=3D DISAS_NORETURN) { if (dc->pc !=3D DYNAMIC_PC && (dc->npc !=3D DYNAMIC_PC && dc->npc !=3D JUMP_PC)) { /* static PC and NPC: we can use direct chaining */ --=20 2.7.4