This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix build failure on power4
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 02 Jan 2013 10:55:51 -0200
- Subject: Re: [PATCH] Fix build failure on power4
- References: <20130102120549.GC28968@spoyarek.pnq.redhat.com>
Hi Siddhesh
It fixes my builds for power4.
On 01/02/2013 10:05 AM, Siddhesh Poyarekar wrote:
> Hi,
>
> As Joseph correctly guessed, my recent changes to mp had broken power4
> builds. Attached patch is a quick fix to allow libm to build.
> Verified (build and testsuite) with --with-cpu=power4 for both
> powerpc-unknown-linux-gnu and powerpc64-unknown-linux-gnu. I am not
> trying to improve the implementations here since the final aim is to
> eliminate these files if possible. OK to commit?
>
> Siddhesh
>
> * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (mpone): Define
> mp_no value for 1.0 and 2.0.
> (norm): Use RADIXI instead of radixi.d.
> (denorm): Likewise.
> (__mul): Use 0.0 instead of zero.d.
> * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (mpone): Define
> mp_no value for 1.0 and 2.0.
> (norm): Use RADIXI instead of radixi.d.
> (denorm): Likewise.
> (__mul): Use 0.0 instead of zero.d.
>
> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> index 4bfe229..8f6d5aa 100644
> --- a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> +++ b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
> @@ -47,6 +47,10 @@
> #include "mpa.h"
> #include "mpa2.h"
> #include <sys/param.h> /* For MIN() */
> +
> +const mp_no mpone = {1, {1.0, 1.0}};
> +const mp_no mptwo = {1, {1.0, 2.0}};
> +
> /* mcr() compares the sizes of the mantissas of two multiple precision */
> /* numbers. Mantissas are compared regardless of the signs of the */
> /* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also */
> @@ -129,7 +133,7 @@ void __cpymn(const mp_no *x, int m, mp_no *y, int n) {
> /* number *y, normalized case (|x| >= 2**(-1022))) */
> static void norm(const mp_no *x, double *y, int p)
> {
> - #define R radixi.d
> + #define R RADIXI
> long i;
> #if 0
> int k;
> @@ -191,7 +195,7 @@ static void denorm(const mp_no *x, double *y, int p)
> double a,v;
> #endif
>
> -#define R radixi.d
> +#define R RADIXI
> if (EX<-44 || (EX==-44 && X[1]<TWO5))
> { *y=ZERO; return; }
>
> @@ -461,7 +465,7 @@ void __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) {
> zk2 = x->d[i2-1]*y->d[i1];
> }
> else
> - zk2 = zero.d;
> + zk2 = 0.0;
> /* Do two multiply/adds per loop iteration, using independent
> accumulators; zk and zk2. */
> for (i=i1,j=i2-1; i<i2-1; i+=2,j-=2)
> diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> index 4bfe229..8f6d5aa 100644
> --- a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> +++ b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
> @@ -47,6 +47,10 @@
> #include "mpa.h"
> #include "mpa2.h"
> #include <sys/param.h> /* For MIN() */
> +
> +const mp_no mpone = {1, {1.0, 1.0}};
> +const mp_no mptwo = {1, {1.0, 2.0}};
> +
> /* mcr() compares the sizes of the mantissas of two multiple precision */
> /* numbers. Mantissas are compared regardless of the signs of the */
> /* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also */
> @@ -129,7 +133,7 @@ void __cpymn(const mp_no *x, int m, mp_no *y, int n) {
> /* number *y, normalized case (|x| >= 2**(-1022))) */
> static void norm(const mp_no *x, double *y, int p)
> {
> - #define R radixi.d
> + #define R RADIXI
> long i;
> #if 0
> int k;
> @@ -191,7 +195,7 @@ static void denorm(const mp_no *x, double *y, int p)
> double a,v;
> #endif
>
> -#define R radixi.d
> +#define R RADIXI
> if (EX<-44 || (EX==-44 && X[1]<TWO5))
> { *y=ZERO; return; }
>
> @@ -461,7 +465,7 @@ void __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) {
> zk2 = x->d[i2-1]*y->d[i1];
> }
> else
> - zk2 = zero.d;
> + zk2 = 0.0;
> /* Do two multiply/adds per loop iteration, using independent
> accumulators; zk and zk2. */
> for (i=i1,j=i2-1; i<i2-1; i+=2,j-=2)
>