This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Fix for logb/logbf/logbl (bz 13954/13955/13956)
From: Adhemerval Zanella <firstname.lastname@example.org>
Date: Thu, 03 May 2012 11:24:05 -0300
> On 05/02/2012 09:36 PM, David Miller wrote:
>> Well, first it didn't even build, here's a fix for that:
>> --- a/sysdeps/ieee754/ldbl-128/s_logbl.c~ 2012-05-02 16:55:43.650725269 -0700
>> +++ b/sysdeps/ieee754/ldbl-128/s_logbl.c 2012-05-02 17:04:49.200630094 -0700
>> @@ -42,7 +42,7 @@ __logbl (long double x)
>> /* POSIX specifies that denormal number is treated as
>> though it were normalized. */
>> int m1 = (hx == 0) ? 0 : __builtin_clzl (hx);
>> - int m2 = (lx == 0) ? 0 : __builtin_clz; (lx);
>> + int m2 = (lx == 0) ? 0 : __builtin_clzl (lx);
>> int ma = (m1 == 0) ? m2 + 64 : m1;
>> return -16382.0 + (long double)(15 - ma);
>> Next, all the logb tests fail for long double on sparc, see
>> the attached math/test-ldouble.out:
> Thank you very much for testing it and sorry for the gross mistake. The main issue (besides
> the misplaced ';') is I was using 'hx' instead of 'ex' in final calculations. I have corrected
> it and tested on simulated long double with two int64_t. I believe the implementation is now
> correct to test.
I'll try out your new patch on sparc later today.