From nobody Mon Feb 9 23:58:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1622708830; cv=none; d=zohomail.com; s=zohoarc; b=l0mn3JmVQR4c79O1GadnYKwHFF70O9LXsLqEvh0XPTqggnQCHm2tnfWcLqiGvR2wOleKt/etEE6Q0sC72k6ewo/JBRpN/VvSgWWNAO89M9R410LvXHQg0zq7ywnvSAfv0xdq88ZgrJwNxdWQXXEJfFLFih4bcYE76Bws3+ZvQMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622708830; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JLXzbWTZt9wIwB8BATKFWFUrYaFsET4JvoxVfTpnJtc=; b=gHGRFq5rs4ouYns5eHwg0dc0HNXf9TInv/2SzPnLQ083IhL58LMA6JtZ5JV7LlRmsK5yxDr7RWKXuZ0SfCW64B5F0uVoM7nSOYk62x53aIyh7JlmMxNbl2O4h7FD9KdBroiUGDuhGWs6oAn44RTZNFYnrg4hXor2XXwMchAcyP0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622708830737619.46577341202; Thu, 3 Jun 2021 01:27:10 -0700 (PDT) Received: from localhost ([::1]:55770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loih3-0007mJ-M6 for importer@patchew.org; Thu, 03 Jun 2021 04:27:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loid0-0006DU-Er; Thu, 03 Jun 2021 04:22:58 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:49395 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loicx-0008Tr-PL; Thu, 03 Jun 2021 04:22:58 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4Fwf5l6SBJz9sXb; Thu, 3 Jun 2021 18:22:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1622708555; bh=c98nJZ4c64o65mzlMjbL0PuZ3N/AVk0rWT8H+x6cjsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oPlDoLSVJWP0+nEqtb0eLCS6ln97FtmA1I09VQ56v7tYknlc2cRZCeNwkQ4Q2Rg5W 5RGxEr7zIaaIhF5m71qRNF0XXKeaHkUg42Rxp5ak92Dx2SZ8YQHrHjF78dV2Ez+GDc bcEyCfMLWTyn/1tmN2yMcV9h0UTkFfPOpDMLAXQ0= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 12/42] target/ppc: used ternary operator when registering MAS Date: Thu, 3 Jun 2021 18:22:01 +1000 Message-Id: <20210603082231.601214-13-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603082231.601214-1-david@gibson.dropbear.id.au> References: <20210603082231.601214-1-david@gibson.dropbear.id.au> 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=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Bruno Larsen (billionai)" The write calback decision when registering the MAS SPR has been turned into a ternary operation, rather than an if-then-else block. This was done because when building without TCG, even though the compiler will optimize away the pointers to spr_write_generic*, it doesn't optimize away the decision and assignment to the local pointer, creating compiler errors. This cleanup looked better than using ifdefs, so we decided to with it. Signed-off-by: Bruno Larsen (billionai) Reviewed-by: Richard Henderson Message-Id: <20210525115355.8254-2-bruno.larsen@eldorado.org.br> Signed-off-by: David Gibson --- target/ppc/cpu_init.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 310dfbd26a..a32893fde8 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -1205,15 +1205,12 @@ static void register_BookE206_sprs(CPUPPCState *env= , uint32_t mas_mask, /* TLB assist registers */ /* XXX : not implemented */ for (i =3D 0; i < 8; i++) { - void (*uea_write)(DisasContext *ctx, int sprn, int gprn) =3D - &spr_write_generic32; - if (i =3D=3D 2 && (mas_mask & (1 << i)) && (env->insns_flags & PPC= _64B)) { - uea_write =3D &spr_write_generic; - } if (mas_mask & (1 << i)) { spr_register(env, mas_sprn[i], mas_names[i], SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, uea_write, + &spr_read_generic, + (i =3D=3D 2 && (env->insns_flags & PPC_64B)) + ? &spr_write_generic : &spr_write_generic32, 0x00000000); } } --=20 2.31.1