From patchwork Thu Feb 2 05:13:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 722782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vDTjt522Nz9ryv for ; Thu, 2 Feb 2017 16:55:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="PRnFvSj5"; dkim-atps=neutral Received: from localhost ([::1]:54425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZAMS-0004nh-4Q for incoming@patchwork.ozlabs.org; Thu, 02 Feb 2017 00:55:12 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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; } -void helper_compute_fprf(CPUPPCState *env, uint64_t arg) +void helper_compute_fprf(CPUPPCState *env, float64 arg) { - CPU_DoubleU farg; int isneg; int fprf; - farg.ll = arg; - isneg = float64_is_neg(farg.d); - if (unlikely(float64_is_any_nan(farg.d))) { - if (float64_is_signaling_nan(farg.d, &env->fp_status)) { + isneg = 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 = 0x00; } else { /* Quiet NaN */ fprf = 0x11; } - } else if (unlikely(float64_is_infinity(farg.d))) { + } else if (unlikely(float64_is_infinity(arg))) { /* +/- infinity */ if (isneg) { fprf = 0x09; @@ -90,7 +88,7 @@ void helper_compute_fprf(CPUPPCState *env, uint64_t arg) fprf = 0x05; } } else { - if (float64_is_zero(farg.d)) { + if (float64_is_zero(arg)) { /* +/- zero */ if (isneg) { fprf = 0x12; @@ -98,7 +96,7 @@ void helper_compute_fprf(CPUPPCState *env, uint64_t arg) fprf = 0x02; } } else { - if (isden(farg.d)) { + if (isden(arg)) { /* Denormalized numbers */ fprf = 0x10; } else {