diff mbox

[04/14] target-ppc: Replace isden by float64_is_zero_or_denormal

Message ID 1483615579-17618-5-git-send-email-nikunj@linux.vnet.ibm.com
State New
Headers show

Commit Message

Nikunj A Dadhania Jan. 5, 2017, 11:26 a.m. UTC
From: Bharata B Rao <bharata@linux.vnet.ibm.com>

Replace isden() by float64_is_zero_or_denormal() so that code in
helper_compute_fprf() can be reused to work with float128 argument.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 target-ppc/fpu_helper.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

David Gibson Jan. 5, 2017, 10:03 p.m. UTC | #1
On Thu, Jan 05, 2017 at 04:56:09PM +0530, Nikunj A Dadhania wrote:
> From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> Replace isden() by float64_is_zero_or_denormal() so that code in
> helper_compute_fprf() can be reused to work with float128 argument.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  target-ppc/fpu_helper.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c
> index 4da991a..5a7aa75 100644
> --- a/target-ppc/fpu_helper.c
> +++ b/target-ppc/fpu_helper.c
> @@ -47,15 +47,6 @@ uint32_t helper_float64_to_float32(CPUPPCState *env, uint64_t arg)
>      return f.l;
>  }
>  
> -static inline int isden(float64 d)
> -{
> -    CPU_DoubleU u;
> -
> -    u.d = d;
> -
> -    return ((u.ll >> 52) & 0x7FF) == 0;
> -}
> -
>  static inline int ppc_float32_get_unbiased_exp(float32 f)
>  {
>      return ((f >> 23) & 0xFF) - 127;
> @@ -96,7 +87,7 @@ void helper_compute_fprf(CPUPPCState *env, float64 arg)
>                  fprf = 0x02;
>              }
>          } else {
> -            if (isden(arg)) {
> +            if (float64_is_zero_or_denormal(arg)) {
>                  /* Denormalized numbers */
>                  fprf = 0x10;
>              } else {
diff mbox

Patch

diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c
index 4da991a..5a7aa75 100644
--- a/target-ppc/fpu_helper.c
+++ b/target-ppc/fpu_helper.c
@@ -47,15 +47,6 @@  uint32_t helper_float64_to_float32(CPUPPCState *env, uint64_t arg)
     return f.l;
 }
 
-static inline int isden(float64 d)
-{
-    CPU_DoubleU u;
-
-    u.d = d;
-
-    return ((u.ll >> 52) & 0x7FF) == 0;
-}
-
 static inline int ppc_float32_get_unbiased_exp(float32 f)
 {
     return ((f >> 23) & 0xFF) - 127;
@@ -96,7 +87,7 @@  void helper_compute_fprf(CPUPPCState *env, float64 arg)
                 fprf = 0x02;
             }
         } else {
-            if (isden(arg)) {
+            if (float64_is_zero_or_denormal(arg)) {
                 /* Denormalized numbers */
                 fprf = 0x10;
             } else {