[PATCH] Fix for logb/logbf/logbl (bz 13954/13955/13956)

Adhemerval Zanella azanella@linux.vnet.ibm.com
Fri May 25 20:21:00 GMT 2012


On 05/25/2012 02:16 PM, Andreas Schwab wrote:
>
> I think then the zero check at the top also only needs to look at hx:
>
> diff --git a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
> index 678b6ca..92ce2c1 100644
> --- a/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
> +++ b/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
> @@ -30,7 +30,7 @@ __logbl (long double x)
>
>    GET_LDOUBLE_WORDS64 (hx, lx, x);
>    hx &= 0x7fffffffffffffffLL;	/* high |x| */
> -  if ((hx | (lx & 0x7fffffffffffffffLL)) == 0)
> +  if (hx == 0)
>      return -1.0 / fabs (x);
>    if (hx >= 0x7ff0000000000000LL)
>      return x * x;
> @@ -38,10 +38,7 @@ __logbl (long double x)
>      {
>        /* POSIX specifies that denormal number is treated as
>           though it were normalized.  */
> -      int m1 = (hx == 0) ? 0 : __builtin_clzll (hx);
> -      int m2 = (lx == 0) ? 0 : __builtin_clzll (lx);
> -      int ma = (m1 == 0) ? m2 + 64 : m1;
> -      return -1022.0 + (long double)(11 - ma);
> +      rhx -= __builtin_clzll (hx) - 12;
>      }
>    return (long double) (rhx - 1023);
>  }
>
> Andreas.
>
Looks ok and passed on make check. 


-- 
Adhemerval Zanella Netto
  Software Engineer
  Linux Technology Center Brazil
  Toolchain / GLIBC on Power Architecture
  azanella@linux.vnet.ibm.com / azanella@br.ibm.com
  +55 61 8642-9890



More information about the Libc-alpha mailing list