From nobody Wed Nov 12 11:56:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1570183041; cv=none; d=zoho.com; s=zohoarc; b=Rc5r0hy63F1pW45iTz4hW/UmjaXDPyYjeG00tN09bLLhyw/Pl0p3cV9wN319cNcUP7ikkfXWqg1G7q7qLy1d4VN7usgJ7AKY5aOkgiFUgnYBBHmNbq/poAbBMAxWWxOqBPOA75QJd7zUKdVZZvRWcWJ7AirnG8/3QGrKn5Zaq2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570183041; 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:ARC-Authentication-Results; bh=1Z7YuInV+Zo/0Mq35hNpy3UR+ID7zwsb+kkZKOEW9zA=; b=oikILqpIM2wb9Sc+68wk1SdysuhAk9tQKOgIP+isZGf7HmgwMSCcDPj4UOA9FdAkE65ZiYDw7D5nooxZBHM+B2Ze/eYztKvjcFId5Nre9v8qQp5K4KY9UiHedFTLl41rmDB5QjFBso0VAugi8lxUO1gupTMDt7HIK8J4O0m+8ls= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1570183041615403.7746624817911; Fri, 4 Oct 2019 02:57:21 -0700 (PDT) Received: from localhost ([::1]:43954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGKKt-0007n0-Ok for importer@patchew.org; Fri, 04 Oct 2019 05:57:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52778) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGK2i-0005Lf-8p for qemu-devel@nongnu.org; Fri, 04 Oct 2019 05:38:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGK2g-0005Tt-HO for qemu-devel@nongnu.org; Fri, 04 Oct 2019 05:38:32 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:38251 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGK2g-0005RR-2Z; Fri, 04 Oct 2019 05:38:30 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46l4YL5N2Mz9sRw; Fri, 4 Oct 2019 19:37:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1570181878; bh=mcYe6Whs+n4x6tJ7GY0LQhcrxugvkVwyWbic5PeYlWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbceV4dWOdnE96x47Itx3ck2EWu2eJGP1xjgSqjXrPeubgvUkC1YgBE0GRxc2jbhS xewc2HY3tdx/U0VUZ+ZVFJQ5APOOv+6aqviSQpWXon0Pf8B3B+VJkXOtJYJW9injUf D197f5VtXU5M7iqfF/8vT9ZrZENN014HyHCVhefo= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 28/53] target/ppc: remove unnecessary if() around calls to set_dfp{64, 128}() in DFP macros Date: Fri, 4 Oct 2019 19:37:22 +1000 Message-Id: <20191004093747.31350-29-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191004093747.31350-1-david@gibson.dropbear.id.au> References: <20191004093747.31350-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 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: lvivier@redhat.com, aik@ozlabs.ru, Richard Henderson , Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.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: Mark Cave-Ayland Now that the parameters to both set_dfp64() and set_dfp128() are exactly the same, there is no need for an explicit if() statement to determine which function should be called based upon size. Instead we can simply use the preprocessor to generate the call to set_dfp##size() directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20190926185801.11176-8-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/dfp_helper.c | 60 +++++++---------------------------------- 1 file changed, 10 insertions(+), 50 deletions(-) diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index c2bb458a78..2c65badae4 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -427,11 +427,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *a, \ dnop(&dfp.t, &dfp.a, &dfp.b, &dfp.context); = \ dfp_finalize_decimal##size(&dfp); = \ postprocs(&dfp); = \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); = \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); = \ - } = \ + set_dfp##size(t, &dfp.vt); = \ } =20 static void ADD_PPs(struct PPC_DFP *dfp) @@ -747,11 +743,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *b, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_QUAI(dquai, 64) @@ -769,11 +761,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *a, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_QUA(dqua, 64) @@ -851,11 +839,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *a, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_RRND(drrnd, 64) @@ -874,11 +858,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *b, \ dfp_finalize_decimal##size(&dfp); = \ postprocs(&dfp); = \ = \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); = \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); = \ - } = \ + set_dfp##size(t, &dfp.vt); = \ } =20 static void RINTX_PPs(struct PPC_DFP *dfp) @@ -978,11 +958,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_= fprp_t *b) \ dfp_finalize_decimal##size(&dfp); = \ CFFIX_PPs(&dfp); = \ = \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); = \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); = \ - } = \ + set_dfp##size(t, &dfp.vt); = \ } =20 static void CFFIX_PPs(struct PPC_DFP *dfp) @@ -1088,11 +1064,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, pp= c_fprp_t *b, \ dfp_set_sign_##size(&dfp.vt, sgn); \ } \ \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_DEDPD(ddedpd, 64) @@ -1160,11 +1132,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, pp= c_fprp_t *b, \ } = \ dfp_finalize_decimal##size(&dfp); = \ dfp_set_FPRF_from_FRT(&dfp); = \ - if ((size) =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); = \ - } else if ((size) =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); = \ - } = \ + set_dfp##size(t, &dfp.vt); = \ } =20 DFP_HELPER_ENBCD(denbcd, 64) @@ -1264,11 +1232,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, pp= c_fprp_t *a, \ dfp.t.exponent =3D exp - bias; = \ dfp_finalize_decimal##size(&dfp); \ } \ - if (size =3D=3D 64) { = \ - set_dfp64(t, &dfp.vt); \ - } else if (size =3D=3D 128) { = \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_IEX(diex, 64) @@ -1356,11 +1320,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, pp= c_fprp_t *a, \ } \ } \ \ - if ((size) =3D=3D 64) { \ - set_dfp64(t, &dfp.vt); \ - } else { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } =20 DFP_HELPER_SHIFT(dscli, 64, 1) --=20 2.21.0