[PATCH v2] Convert mantissa storage in mp_no to int
Carlos O'Donell
carlos@systemhalted.org
Mon Jan 28 18:57:00 GMT 2013
On 12/20/2012 09:48 PM, Siddhesh Poyarekar wrote:
> Hi,
>
> Here's v2 of the patch with the problem of truncation of an
> intermediate value fixed as Joseph pointed out. The code is not used
> by i386, so I couldn't test it to see it break and then fixed.
>
> Siddhesh
>
> ChangeLog:
>
> 2012-12-21 Siddhesh Poyarekar <siddhesh@redhat.com>
>
> * sysdeps/ieee754/dbl-64/mpa.c (I_RADIX): New macro.
> (TWOPOW): Likewise.
> (__acr): Juggle logic a bit to make it faster and use int
> instead of doubles.
> (__mp_dbl): Use int values instead of double.
> (__dbl_mp): Likewise.
> (add_magnitudes): Likewise.
> (sub_magnitudes): Likewise.
> (__add): Likewise.
> (__sub): Likewise.
> (__mul): Likewise.
> * sysdeps/ieee754/dbl-64/mpa.h (mp_no): Change type of D to int
> array.
> * sysdeps/ieee754/dbl-64/mpa.c (__mpatan): Use int values
> instead of double.
> * sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Likewise.
> * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Likewise.
> * sysdeps/ieee754/dbl-64/mpsqrt.c (__mpsqrt): Likewise.
> * sysdeps/ieee754/dbl-64/mptan.c (__mptan): Likewise.
> * sysdeps/ieee754/dbl-64/sincos32.c (__c32): Likewise.
> (__mpranred): Likewise.
> * sysdeps/ieee754/dbl-64/sincos32.h (oofac27): Likewise.
> (pi): Likewise.
> (hp): Likewise.
> * sysdeps/ieee754/dbl-64/slowpow.c (__slowpow): Likewise.
This looks good to me.
Is Power using this code?
What does the performance look like there?
I'm getting more nervous of these kinds of micro-optimizations
in isolation without a global view of our libm performance.
I'd really like to see more progress on a libm micro-benchmark
that we can use to see how these changes impact *ALL* of the
functions in libm. At a minimum we need to test the inputs
identified in the current testsuite.
Cheers,
Carlos.
More information about the Libc-alpha
mailing list