This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Minor tweak to mp multiplication
- From: Carlos O'Donell <carlos at systemhalted dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 13 Jan 2013 17:06:34 -0500
- Subject: Re: [PATCH] Minor tweak to mp multiplication
- References: <20130111112831.GE16859@spoyarek.pnq.redhat.com>
On 01/11/2013 06:28 AM, Siddhesh Poyarekar wrote:
> Hi,
>
> Attached is a minor tweak to the multiplication function (__mul) to
> help the compiler a bit to generate slightly faster code. It adds a
> local variable zk that acts as an accumulator across the loops (and
> within them) to reduce the reads to/writes from the array z.d. I took
> this idea from the powerpc code. This results in an improvement of
> about 5% on x86_64 for the pow function and no regressions in the
> testsuite due to this.
>
> For 100000 iterations of pow with input as (1.0000000000000020, 1.5):
>
> Without the patch:
>
> Total:43300983220, Fastest:421664, Slowest:1347553, Avg:433009.832200
>
> With the patch:
>
> Total:41006921512, Fastest:402743, Slowest:1326084, Avg:410069.215120
>
> The fastest time improved by about 4.5% and the average improved by
> about 5.3%.
>
> OK to commit?
>
> Siddhesh
>
> * sysdeps/ieee754/dbl-64/mpa.c (__mul): Add a local variable
> to optimize copies.
Looks good to me.
Could you please document this briefly here:
http://sourceware.org/glibc/wiki/benchmarking/results_2_18
That way we record the criteria for acceptance as +5.4% for x86_64
when we go back to look at 2.18.
Cheers,
Carlos.