From nobody Wed Nov 27 15:48:40 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=1698280279; cv=none; d=zohomail.com; s=zohoarc; b=bFj5uFCUue41KxLOq5WSqHkxJFQkHeNR+Xqi2p8+DTt/L5EHF5D++xr0E9quXs7pC4ytYBz+tI1aXlAhZA8ZDNtywIM4D7UFxIECVFmyKpjM5hW/sPn5kmBjfBS7X9QoDXiUI5wvlVKJfoZ7U01TqOX07ug9CUcVFuwnKSo7+BU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698280279; 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=Die0E9thWWJCvlQ5xUUN0v+CHdwVm8XQRwC6LlIs3H8=; b=EDmj9+gS8yQ9mfu4m3+dKreCUl3/k3DoAPvjG7Tg5OhySOtwl0VT3ZtKdDrypBetJmrhM8pohahf0UYULMWHGdwZbjOoVVymJbTSPHu3vTN2rkSzdJFZAjnXauDiNgQkbDBFRjWyumilxVgUHNoY5FrP67caoClyaCXoTp62fL8= 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 1698280279809391.1565350323084; Wed, 25 Oct 2023 17:31:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo2y-0007LL-DD; Wed, 25 Oct 2023 20:16:24 -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 1qvo2u-0007CJ-RI for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:20 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2p-0004vG-Km for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:20 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1ca3a54d2c4so2280205ad.3 for ; Wed, 25 Oct 2023 17:16:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279374; x=1698884174; 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=Die0E9thWWJCvlQ5xUUN0v+CHdwVm8XQRwC6LlIs3H8=; b=A5XwRmpsjEPyFLPEB/9X2gZ83oXiKRVKELx6duFkJwn0XQRthmr15g6cllYQPX/0Oa SYMCw6A+oZ5Xa3RQzMyaAQf4ckoMWyvxhg33Bp7hZCCw0r7Gqtb+mH1o/dZ7ZNG8rlgv qpYCgke7GONysd8sZXSHEwy20TJMjwnMGCqymkz2EM9CVznlu/mRtQ9/DY4Ns4MJ4DYs U1H2rMyhCzbz7WDjCGBX3TnatelFZqZA3gyTce8qSzIAJWq3vGOV1F5LOT88z1yA1DxD QnszUnjuHjz05YJ15kfJbAPJwmhPt7attK7o2t40H3HV3/OfCEgPj3StR49EhcqThFba qogw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279374; x=1698884174; 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=Die0E9thWWJCvlQ5xUUN0v+CHdwVm8XQRwC6LlIs3H8=; b=p92Mjfd04Fm45Uikhgc35r/FjBENnvrjXlFXemtODAV8BitVMin2mmCOznmBDKQ3hr DHL7lTFURxQjf8yEQ04mLgvUddEXMJVdrkVDT9E0x2usasRnAjHQISv64BFfXiL+6C/s YsHCeuNT4jZEm32wApcSWD3WNp6Yt83zedBaAU1XOCTZkUBz2Fje52Bl82YLXKz9uzli Dtusqe838u4DKCVuy37rayR168V8xLWalRGxEYi8jkxt1N6MyQS2Fr8OcptzNbeuQ8gs AVpTN3CgNFYQB5Fci81etGKlNdluq0712AKXjccNPhLT3hcdfOIulE0dWoWsM/xoPF9w Hfbg== X-Gm-Message-State: AOJu0YyU6u9KCp+4p1ewiBmcqi6ZF7kJfc9ySeJbPAPVPCksLe+O+zvH kdROJ74UwgaFWCeos9eLR6pcNtgxIpBOjz/F5JU= X-Google-Smtp-Source: AGHT+IE8i6BjrU8owR23quEVcVeBw3uHBYhA39+MkiuIYQUqjKDIqUGH+h+PYWPWnFrcdPrpscszkQ== X-Received: by 2002:a17:903:27d0:b0:1c9:ccb3:2352 with SMTP id km16-20020a17090327d000b001c9ccb32352mr16129432plb.12.1698279374429; Wed, 25 Oct 2023 17:16:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 19/94] target/sparc: Pass DisasCompare to advance_jump_cond Date: Wed, 25 Oct 2023 17:14:16 -0700 Message-Id: <20231026001542.1141412-38-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: 1698280281918100009 Content-Type: text/plain; charset="utf-8" Fold the condition into the branch or movcond when possible. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 503598ed93..d12f2b4b87 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2899,14 +2899,15 @@ static bool advance_jump_uncond_always(DisasContext= *dc, bool annul, return true; } =20 -static bool advance_jump_cond(DisasContext *dc, bool annul, target_ulong d= est) +static bool advance_jump_cond(DisasContext *dc, DisasCompare *cmp, + bool annul, target_ulong dest) { target_ulong npc =3D dc->npc; =20 if (annul) { TCGLabel *l1 =3D gen_new_label(); =20 - tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_cond, 0, l1); + tcg_gen_brcond_tl(tcg_invert_cond(cmp->cond), cmp->c1, cmp->c2, l1= ); gen_goto_tb(dc, 0, npc, dest); gen_set_label(l1); gen_goto_tb(dc, 1, npc + 4, npc + 8); @@ -2919,8 +2920,8 @@ static bool advance_jump_cond(DisasContext *dc, bool = annul, target_ulong dest) 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_gen_movcond_tl(cmp->cond, cpu_npc, + cmp->c1, cmp->c2, tcg_constant_tl(dest), cpu_npc); dc->pc =3D npc; break; @@ -2932,6 +2933,11 @@ static bool advance_jump_cond(DisasContext *dc, bool= annul, target_ulong dest) dc->jump_pc[0] =3D dest; dc->jump_pc[1] =3D npc + 4; dc->npc =3D JUMP_PC; + if (cmp->is_bool) { + tcg_gen_mov_tl(cpu_cond, cmp->c1); + } else { + tcg_gen_setcond_tl(cmp->cond, cpu_cond, cmp->c1, cmp->c2); + } } } return true; @@ -2951,12 +2957,7 @@ static bool do_bpcc(DisasContext *dc, arg_bcc *a) flush_cond(dc); =20 gen_compare(&cmp, a->cc, a->cond, dc); - if (cmp.is_bool) { - tcg_gen_mov_tl(cpu_cond, cmp.c1); - } else { - tcg_gen_setcond_tl(cmp.cond, cpu_cond, cmp.c1, cmp.c2); - } - return advance_jump_cond(dc, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, target); } } =20 @@ -2980,12 +2981,7 @@ static bool do_fbpfcc(DisasContext *dc, arg_bcc *a) flush_cond(dc); =20 gen_fcompare(&cmp, a->cc, a->cond); - if (cmp.is_bool) { - tcg_gen_mov_tl(cpu_cond, cmp.c1); - } else { - tcg_gen_setcond_tl(cmp.cond, cpu_cond, cmp.c1, cmp.c2); - } - return advance_jump_cond(dc, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, target); } } =20 @@ -3006,8 +3002,7 @@ static bool trans_BPr(DisasContext *dc, arg_BPr *a) =20 flush_cond(dc); gen_compare_reg(&cmp, a->cond, gen_load_gpr(dc, a->rs1)); - tcg_gen_setcond_tl(cmp.cond, cpu_cond, cmp.c1, cmp.c2); - return advance_jump_cond(dc, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, target); } =20 static bool trans_CALL(DisasContext *dc, arg_CALL *a) --=20 2.34.1