This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Use integer constants in mpa.c
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org, Richard Henderson <rth at twiddle dot net>
- Date: Tue, 26 Mar 2013 16:06:00 +0100
- Subject: Re: [PATCH v2] Use integer constants in mpa.c
- References: <20130322100206 dot GJ2409 at spoyarek dot pnq dot redhat dot com> <514C69AF dot 8010107 at twiddle dot net> <CAAHN_R1EYv2Wco1bLDYeMATOzVyO-odQ1oP8c+NqVknji70X6A at mail dot gmail dot com> <20130326134922 dot GB15083 at spoyarek dot pnq dot redhat dot com>
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.
>