This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Sync up powerpc __mp_dbl with default code
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: rsa at us dot ibm dot com
- Date: Thu, 21 Feb 2013 12:45:14 +0530
- Subject: Re: [PATCH] Sync up powerpc __mp_dbl with default code
- References: <20130214100844.GC11884@spoyarek.pnq.redhat.com>
Ping! A correction to the blurb I wrote earlier - this change results
in automatic inlining of norm() resulting in very a minor speedup on
Power7. This is where I had first typo'd the configure line
(--enable-cpu instead of --with-cpu).
Siddhesh
On Thu, Feb 14, 2013 at 03:38:44PM +0530, Siddhesh Poyarekar wrote:
> Hi,
>
> Here's another patch that syncs up changes I had made in default code
> with the powerpc code since it makes sense to do so. The result does
> not alter the output code, i.e. the output code is identical before
> and after this change. OK to commit?
>
> Siddhesh
>
> * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__mp_dbl): Sync
> up changes with default code.
> * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__mp_dbl):
> Likewise.
>
> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> index 517a9cd..25e88a3 100644
> --- a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> +++ b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> @@ -304,9 +304,7 @@ __mp_dbl (const mp_no *x, double *y, int p)
> return;
> }
>
> - if (EX > -42)
> - norm (x, y, p);
> - else if (EX == -42 && X[1] >= TWO10)
> + if (__glibc_likely (EX > -42 || (EX == -42 && X[1] >= TWO10)))
> norm (x, y, p);
> else
> denorm (x, y, p);
> diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> index 517a9cd..25e88a3 100644
> --- a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> +++ b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> @@ -304,9 +304,7 @@ __mp_dbl (const mp_no *x, double *y, int p)
> return;
> }
>
> - if (EX > -42)
> - norm (x, y, p);
> - else if (EX == -42 && X[1] >= TWO10)
> + if (__glibc_likely (EX > -42 || (EX == -42 && X[1] >= TWO10)))
> norm (x, y, p);
> else
> denorm (x, y, p);