From nobody Sat Jul 12 15:20:17 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.zoho.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 1486014943065636.3016371535566; Wed, 1 Feb 2017 21:55:43 -0800 (PST) Received: from localhost ([::1]:54425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZAMv-0004nh-AA for importer@patchew.org; Thu, 02 Feb 2017 00:55:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZ9jt-0007RL-1u for qemu-devel@nongnu.org; Thu, 02 Feb 2017 00:15:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZ9jp-0003pJ-Ax for qemu-devel@nongnu.org; Thu, 02 Feb 2017 00:15:20 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:58909) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cZ9jo-0003kk-Pj; Thu, 02 Feb 2017 00:15:17 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vDSqR4qkSz9s82; Thu, 2 Feb 2017 16:14:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1486012499; bh=GNtuLVUkn0RvVtevANhxM6dWUFlDs3ca65Xdhzd3ZsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PRnFvSj5IpI5O6naISzMLL9YzvCz26+niJqNf90Mk2h/59xgvOKc68BkZHpLomfEl fEvkoSbqjFlWrTTWzaPcgxRquCwGUrn3ju9Ba0txj+W9TZq5zruJgzX5m6R2xR7Sdf Dwv3+UHvW2WZ0FRBjE443dkeYVJOR8OnQHdGfsq0= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 2 Feb 2017 16:13:49 +1100 Message-Id: <20170202051445.5735-52-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170202051445.5735-1-david@gibson.dropbear.id.au> References: <20170202051445.5735-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 051/107] target-ppc: Use float64 arg in helper_compute_fprf() 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: lvivier@redhat.com, thuth@redhat.com, Nikunj A Dadhania , qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, aik@ozlabs.ru, qemu-ppc@nongnu.org, Bharata B Rao , David Gibson 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" From: Bharata B Rao Use float64 argument instead of unit64_t in helper_compute_fprf() This allows code in helper_compute_fprf() to be reused later to work with float128 argument too. Signed-off-by: Bharata B Rao Signed-off-by: Nikunj A Dadhania Signed-off-by: David Gibson --- target/ppc/fpu_helper.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 1ccd5e6..4da991a 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -66,23 +66,21 @@ static inline int ppc_float64_get_unbiased_exp(float64 = f) return ((f >> 52) & 0x7FF) - 1023; } =20 -void helper_compute_fprf(CPUPPCState *env, uint64_t arg) +void helper_compute_fprf(CPUPPCState *env, float64 arg) { - CPU_DoubleU farg; int isneg; int fprf; =20 - farg.ll =3D arg; - isneg =3D float64_is_neg(farg.d); - if (unlikely(float64_is_any_nan(farg.d))) { - if (float64_is_signaling_nan(farg.d, &env->fp_status)) { + isneg =3D float64_is_neg(arg); + if (unlikely(float64_is_any_nan(arg))) { + if (float64_is_signaling_nan(arg, &env->fp_status)) { /* Signaling NaN: flags are undefined */ fprf =3D 0x00; } else { /* Quiet NaN */ fprf =3D 0x11; } - } else if (unlikely(float64_is_infinity(farg.d))) { + } else if (unlikely(float64_is_infinity(arg))) { /* +/- infinity */ if (isneg) { fprf =3D 0x09; @@ -90,7 +88,7 @@ void helper_compute_fprf(CPUPPCState *env, uint64_t arg) fprf =3D 0x05; } } else { - if (float64_is_zero(farg.d)) { + if (float64_is_zero(arg)) { /* +/- zero */ if (isneg) { fprf =3D 0x12; @@ -98,7 +96,7 @@ void helper_compute_fprf(CPUPPCState *env, uint64_t arg) fprf =3D 0x02; } } else { - if (isden(farg.d)) { + if (isden(arg)) { /* Denormalized numbers */ fprf =3D 0x10; } else { --=20 2.9.3