From nobody Wed Nov 27 14:36:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698280971; cv=none; d=zohomail.com; s=zohoarc; b=KpwQDr942bFAKGefEqwmWQU5dhMOIHMYAOJrn3Lx1jwJH/lzOAgd/NIFiimWIggAQKxo218CJ99cXV2fCPhXToTw75sJcuNZ+P4RmGvkaJD3PT+Fc3Fw1vvc48yripb0fX5QJTWUayFRTYfSX8omAwMZs7NrPfQIGFjTm2fALoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698280971; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D3CDbvxaTN0BxklWFCzrNGwroWfsphJJp/UH4zaunfY=; b=CBz+B2nVWxuzAhsMJItwWRHWUCY7/IFyOgVui+SGR9WPUKTkRom4yTXeIaJbkK2UI+sEIKPK7Q4Hf1UE4isRWYWiRlp+k7T5ji1xUgvi/covPYE8ex8odfQWapPxihIP3j2ww1BYfwFZG/+phkEl9xy4kofcg5eFMvsotCs/pNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698280971830537.9132943479755; Wed, 25 Oct 2023 17:42:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo2x-0007Ju-J9; Wed, 25 Oct 2023 20:16:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvo2t-0007AK-Br for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:19 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2n-0004ud-Ta for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:19 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ca72f8ff3aso2323335ad.0 for ; Wed, 25 Oct 2023 17:16:13 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279372; x=1698884172; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D3CDbvxaTN0BxklWFCzrNGwroWfsphJJp/UH4zaunfY=; b=kOuaRh5CdRK+Wb/ZitPX74/84t2TJLnFvrKxoOpJp5/yvYruf9y5u3Q9dnAJXs2Fy7 BFla3bPw4i7TcYG7SlxZ29YA4+WIk+Aa+I7qA0aeWJ6xE8V4PBR+YMij1TkIQyCKPk7A Zn+I/F/7FY2ul/YjFq0mOH+6qq4c4jFTBU2Ht77wAANz6LnoDiEdF2NVBMjwYUrTiYh+ hmX1yciN5nL/gdPH1u8TDlDElmCYte691/i8JU7/xSLRZ99FFg2JXje4GBvqMYq7b6cK M1xZxiEH4nCFx3Ct+nLeOCm6VT8N3aZH8DmoDlcTUAntI/lof2ut2Sfg8fzXwNIbjH// BTvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279372; x=1698884172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D3CDbvxaTN0BxklWFCzrNGwroWfsphJJp/UH4zaunfY=; b=VxGoyECYOJ9jyqYg6DOkrpOOF2suZIgkYocmMQebfDusQTWYYGI7xA5odqcs2pKYWT LmCmkVHO8L0p9Czt0W8SPnlZyPJ6B05r+nUcZN8Fby39Yf277m5kH8G3iAIdOGhHMuLs PFISUi60evPEfocacTUK4YTrVUKyH7mIoc9kCJkWLAsaCVfZBeMUjcngpDuo9Kdda4Gt FKz/qI/7X9lpybjqUKHo0MyHVkjCFw6t4Kus0GwVjFviiZDYcc/lyE3nHM52vbzY95k7 Hb4Hiz4wKw8/J1vMpF0pC/a6UDOfiUHCy7P2KeEbx+BltPvsV8YYgyu4tXnxN6KrrKsT Z9kg== X-Gm-Message-State: AOJu0YwR6Hlu+uRPXCZcH3MgXbR6QEcyig3cGx1yj0rUawsf6ZjYOau1 Et6y74Nf6gGfyJ8Jmshh3ulqbzQr1mMd/HOdRSk= X-Google-Smtp-Source: AGHT+IG9dB/lI5Q3n/RHKuyYnx+X4l0oEd9F83M3nMkajvDW3LvnNQI/MUvdWsu1PLWaPOX9+Bq7cA== X-Received: by 2002:a17:903:23c2:b0:1ca:6abe:cb37 with SMTP id o2-20020a17090323c200b001ca6abecb37mr13698410plh.9.1698279372726; Wed, 25 Oct 2023 17:16:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 18/94] target/sparc: Merge gen_branch_[an] with only caller Date: Wed, 25 Oct 2023 17:14:14 -0700 Message-Id: <20231026001542.1141412-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698280973068100011 Content-Type: text/plain; charset="utf-8" Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 73 +++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index b8d51d6d64..503598ed93 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -900,47 +900,6 @@ static void gen_branch2(DisasContext *dc, target_ulong= pc1, gen_goto_tb(dc, 1, pc2, pc2 + 4); } =20 -static void gen_branch_a(DisasContext *dc, target_ulong pc1) -{ - TCGLabel *l1 =3D gen_new_label(); - target_ulong npc =3D dc->npc; - - tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_cond, 0, l1); - - gen_goto_tb(dc, 0, npc, pc1); - - gen_set_label(l1); - gen_goto_tb(dc, 1, npc + 4, npc + 8); - - dc->base.is_jmp =3D DISAS_NORETURN; -} - -static void gen_branch_n(DisasContext *dc, target_ulong pc1) -{ - target_ulong npc =3D dc->npc; - - if (npc & 3) { - switch (npc) { - case DYNAMIC_PC: - case DYNAMIC_PC_LOOKUP: - tcg_gen_mov_tl(cpu_pc, cpu_npc); - tcg_gen_addi_tl(cpu_npc, cpu_npc, 4); - tcg_gen_movcond_tl(TCG_COND_NE, cpu_npc, - cpu_cond, tcg_constant_tl(0), - tcg_constant_tl(pc1), cpu_npc); - dc->pc =3D npc; - break; - default: - g_assert_not_reached(); - } - } else { - dc->pc =3D npc; - dc->jump_pc[0] =3D pc1; - dc->jump_pc[1] =3D npc + 4; - dc->npc =3D JUMP_PC; - } -} - static void gen_generic_branch(DisasContext *dc) { TCGv npc0 =3D tcg_constant_tl(dc->jump_pc[0]); @@ -2942,10 +2901,38 @@ static bool advance_jump_uncond_always(DisasContext= *dc, bool annul, =20 static bool advance_jump_cond(DisasContext *dc, bool annul, target_ulong d= est) { + target_ulong npc =3D dc->npc; + if (annul) { - gen_branch_a(dc, dest); + TCGLabel *l1 =3D gen_new_label(); + + tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_cond, 0, l1); + gen_goto_tb(dc, 0, npc, dest); + gen_set_label(l1); + gen_goto_tb(dc, 1, npc + 4, npc + 8); + + dc->base.is_jmp =3D DISAS_NORETURN; } else { - gen_branch_n(dc, dest); + if (npc & 3) { + switch (npc) { + case DYNAMIC_PC: + case DYNAMIC_PC_LOOKUP: + tcg_gen_mov_tl(cpu_pc, cpu_npc); + tcg_gen_addi_tl(cpu_npc, cpu_npc, 4); + tcg_gen_movcond_tl(TCG_COND_NE, cpu_npc, + cpu_cond, tcg_constant_tl(0), + tcg_constant_tl(dest), cpu_npc); + dc->pc =3D npc; + break; + default: + g_assert_not_reached(); + } + } else { + dc->pc =3D npc; + dc->jump_pc[0] =3D dest; + dc->jump_pc[1] =3D npc + 4; + dc->npc =3D JUMP_PC; + } } return true; } --=20 2.34.1