[PATCH v2] Use integer constants in mpa.c
Ondřej Bílka
neleai@seznam.cz
Tue Mar 26 15:10:00 GMT 2013
On Tue, Mar 26, 2013 at 07:19:23PM +0530, Siddhesh Poyarekar wrote:
> hi,
>
> Here's v2 of this patch, which is much simpler. The patch replaces
> all instances of constant doubles to their integer counterparts. This
> is good for architectures that benefit from using an integral mantissa
> since the compiler ends up adding additional instructions to perform
> operations in fp mode when the constants are expressed as doubles.
> powerpc (which is currently the only arch that uses double mantissa)
> sees no appreciable difference due to this patch since the compiler is
> smart enough to use the double form of the constants in this case.
>
> No regressions noted as a result of this change and a ~10% improvement
> in performance in x86_64 as seen in the benchmark. OK to commit?
>
Did you try compile with latest gcc? In some parts it is optimization
that gcc should do. I am not entirely sure where it is possible due sNAN
but gcc should certainly transform assignments.
> Siddhesh
>
> * sysdeps/ieee754/dbl-64/mpa.c (__acr): Use integral
> constants.
> (norm): Likewise.
> (denorm): Likewise.
> (__dbl_mp): Likewise.
> (add_magnitudes): Likewise.
> (sub_magnitudes): Likewise.
> (__add): Likewise.
> (__sub): Likewise.
> (__mul): Likewise.
> (__sqr): Likewise.
> (__inv): Likewise.
> (__dvd): Likewise.
>
More information about the Libc-alpha
mailing list