This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Redux][PATCH] check-localplt failure associated with IBM long double 128 and PowerPC


On Wed, 2008-02-20 at 14:20 -0800, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Ryan S. Arnold wrote:
> > The following patch is a first pass at fixing the check-localplt make
> > check errors associated with PowerPC and IBM long double.
> > [...]
> 
> Far too invasive.  If you need something for ppc, then change it only
> for ppc.  Don't add aliases for platforms which don't need them.
> 
> - --
> â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> 
> iD8DBQFHvKeR2ijCOnn/RHQRAlOmAJ4hcrwF+mYcVGuE04HHc+fAHqDbTQCgjORZ
> w85KVa0pJ1Mkd+lVp+Vp2DA=
> =3zvo
> -----END PGP SIGNATURE-----

Hi Ulrich, et al,

The included patch corrects the problems associated with the previous
patch being too invasive to other architectures.

The fenv internal hidden prototypes have been pushed to a powerpc
specific header file sysdeps/powerpc/fenv_internal.h

The signbitl change required a bit more invasive approach.  Other
classification functions already have hidden prototypes in
include/math.h

My options were:

1.  Have each instance of code that calls __signbitl invoke ___signbitl
directly instead:  This doesn't work because not every long double
implementation provides ___signbitl.

2.  Create a powerpc specific header file, add hidden_proto(__signbitl)
to it and include that: This won't work because tmost invocations
against signbitl are in common code and every instance where it is
called would have to have a #include to that powerpc specific header.  I
also couldn't insert a math.h with the hidden_proto(__signbitl) in a
powerpc directory to be picked up before include/math.h because
-Iinclude comes first on the compilation string.

3.  Add hidden_proto(__signbitl) to include/math.h and then
hidden_def(__signbitl) or hidden_ver(___signbitl, __signbitl) in each
case where it is implemented.

I took approach #3 because it seemed the least invasive.

I did a successful build and make check for ppc32, ppc64, and i486
because those are the platforms that I have hardware for.  This covered
the case of ldbl-128ibm, and ldbl-96.  I'm pretty sure the nldbl-opt
case is covered as well but I'm not sure if there are any make check
tests for this.

I was NOT able to test ldbl-128 and ldb-64-128 but the ldbl-128 case is
similar to the ldbl-96 code and the ldbl-64-128 code is similar to the
ldbl-128ibm case.

Thanks.

Ryan S. Arnold
IBM Linux Technology Center
Linux Toolchain Development
2008-03-04  Ryan S. Arnold  <rsa@us.ibm.com>

	* include/math.h (__signbitl): Add hidden_proto.
	* sysdeps/ia64/fpu/s_signbit.S (__signbitl): Add hidden_def.
	* sysdeps/ieee754/ldbl-128/s_signbitl.c (__signbitl): Add hidden_def.
	* sysdeps/ieee754/ldbl-128ibm/s_signbitl.c (___signbitl __signbitl):
	Add hidden_ver.
	* sysdeps/ieee754/ldbl-64-128/s_signbitl.c (___signbitl __signbitl):
	Add hidden_ver.
	* sysdeps/ieee754/ldbl-96/s_signbitl.c (__signbitl): Add hidden_def.
	* sysdeps/ieee754/ldbl-opt/nldbl-signbit.c (__signbitl): Add hidden_def.
	* math/s_significandl.c (__significandl): Change invocation of
	ilogbl() to __ilogbl().
	* scripts/data/localplt-powerpc64-linux-gnu.data: New file
	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Change invocations
	of finitel(), logl(), cosl(), sinl(), and sqrtl() to __finitel(),
	__logl(), __cosl(), __sinl(), and __sqrtl() respectively.
	(__ieee754_y0l): Change invocations of finitel(), logl(), cosl(),
	sinl(), and sqrtl() to __finitel(), __logl(), __cosl(), __sinl(), and
	__sqrtl() respectively.
	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_j1l): Change invocations
	of finitel(), cosl(), sinl(), and sqrtl() to __finitel(), __cosl(),
	__sinl(), and __sqrtl() respectively.
	(__ieee754_y1l): Change invocations of finitel(), logl(), cosl(),
	sinl(), and sqrtl() to __finitel(), __logl(), __cosl(), __sinl(), and
	__sqrtl() respectively.
	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Change invocation of
	ldexpl() to __ldexpl().
	* sysdeps/ieee754/ldbl-128/s_log1pl.c (frexpl ldexpl): Change
	prototypes to __frexpl and __ldexpl respectively.
	(__log1pl): Change frexpl() invocation to __frexpl().
	* sysdeps/ieee754/ldbl-128ibm/e_expl.c (__ieee754_expl): Change
	roundl() invocations to __roundl().
	* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Change ldexpl()
	invocation to __ldexpl().
	* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (frexpl ldexpl): Change
	prototypes to __frexpl and __ldexpl respectively.
	(__log1pl): Change frexpl() invocation to __frexpl().
	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c (__nearbyintl): Change
	invocations of nextafter() to __nextafter().
	* sysdeps/powerpc/fenv_internal.h (___fe_nomask_env __fegetexcept
	__fetestexcept): Add new prototypes and libm_hidden_proto to avoid
	check-localplt failures.
	* sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Change
	fetestexcept() invocation to __fetestexcept().  Include
	<fenv_internal.h> to pick up prototype for __fetestexcept.
	* sysdeps/powerpc/fpu/e_sqrtf.c (__slow_ieee754_sqrtf):  Change
	fetestexcept() invcation to __fetestexcept().  Include
	<fenv_internal.h> to pick up prototype for __fetestexcept.
	* sysdeps/powerpc/fpu/fedisblxcpt.c (fedisableexcept): Change
	fegetexcept() invocations to __fegetexcept().  Include
	<fenv_internal.h> to pick up prototype for __fegetexcept.
	* sysdeps/powerpc/fpu/feenablxcpt.c (feenableexcept): Change
	fegetexcept() invocations to __fegetexcept() and __fe_nomask_env()
	invocation to ___fe_nomask_env().  Include <fenv_internal.h> to pick
	up prototype for __fegetexcept and ___fe_nomask_env.
	* sysdeps/powerpc/fpu/fegetexcept.c (fegetexcept): Change definition
	to __fegetexcept.  Add libm_hidden_def for __fegetexcept and
	strong_alias fegetexcept to __fegetexcept.  Include <fenv_internal.h>
	to pick up prototype for __fegetexcept.
	* sysdeps/powerpc/fpu/fesetenv.c (__fesetenv): Change invocation of
	__fe_nomask_env() to ___fe_nomask_env().  Include <fenv_internal.h> to
	pick up prototype for ___fe_nomask_env.  Fixed a comment typo.
	* sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Change invocation of
	__fe_nomask_env() to ___fe_nomask_env().  Include <fenv_internal.h> to
	pick up prototype for ___fe_nomask_env.  Fixed a comment typo.
	* sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Change
	invocation of fetestexcept() to __fetestexcept().  Include
	<fenv_internal.h> to pick up prototype for __fetestexcept.
	* sysdeps/powerpc/fpu/ftestexcept.c (fetestexcept): Change definition
	to __fetestexcept.  Add libm_hidden_def for __fetestexcept and
	strong_alias fetestexcept to __fetestexcept.
	* sysdeps/powerpc/fpu/fe_nomask.c (__fe_nomask_env): Change definition
	to ___fe_nomask_env().  Add libm_hidden_def for ___fe_nomask_env and
	strong alias __fe_nomask_env to ___fe_nomask_env.  Include
	<fenv_internal.h> to pick up prototype for ___fe_nomask_env.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
	(__fe_nomask_env): Change definition to ___fe_nomask_env.  Add
	libm_hidden_def for ___fe_nomask_env and strong alias __fe_nomask_env
	to ___fe_nomask_env.  Include <fenv_internal.h> to pick up prototype
	for ___fe_nomask_env.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
	(__fe_nomask_env): Change definition to ___fe_nomask_env.  Add
	libm_hidden_def for ___fe_nomask_env and strong alias __fe_nomask_env
	to ___fe_nomask_env.  Include <fenv_internal.h> to pick up prototype
	for ___fe_nomask_env.

diff -uNr libc-orig/include/math.h libc/include/math.h
--- libc-orig/include/math.h	2002-09-09 19:41:44.000000000 -0500
+++ libc/include/math.h	2008-02-29 10:44:03.000000000 -0600
@@ -17,6 +17,7 @@
 hidden_proto (__finitel)
 hidden_proto (__isinfl)
 hidden_proto (__isnanl)
+hidden_proto (__signbitl)
 #  endif
 # endif
 
diff -uNr libc-orig/sysdeps/ia64/fpu/s_signbit.S libc/sysdeps/ia64/fpu/s_signbit.S
--- libc-orig/sysdeps/ia64/fpu/s_signbit.S	2001-07-05 23:55:54.000000000 -0500
+++ libc/sysdeps/ia64/fpu/s_signbit.S	2008-03-04 13:26:58.000000000 -0600
@@ -33,5 +33,6 @@
 }	
 END (__signbit)
 
+hidden_def(__signbitl)
 strong_alias (__signbit, __signbitf)
 strong_alias (__signbit, __signbitl)
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128/s_signbitl.c libc/sysdeps/ieee754/ldbl-128/s_signbitl.c
--- libc-orig/sysdeps/ieee754/ldbl-128/s_signbitl.c	2001-07-05 23:55:55.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-128/s_signbitl.c	2008-03-04 13:06:00.000000000 -0600
@@ -30,3 +30,4 @@
   GET_LDOUBLE_MSW64 (e, x);
   return e < 0;
 }
+hidden_def (__signbitl)
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c libc/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
--- libc-orig/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c	2006-01-27 18:07:25.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c	2008-03-04 13:06:06.000000000 -0600
@@ -30,6 +30,7 @@
   GET_LDOUBLE_MSW64 (e, x);
   return e < 0;
 }
+hidden_ver (___signbitl, __signbitl)
 #ifdef IS_IN_libm
 long_double_symbol (libm, ___signbitl, __signbitl);
 #else
diff -uNr libc-orig/sysdeps/ieee754/ldbl-64-128/s_signbitl.c libc/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
--- libc-orig/sysdeps/ieee754/ldbl-64-128/s_signbitl.c	2006-01-14 06:08:47.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-64-128/s_signbitl.c	2008-03-04 13:06:06.000000000 -0600
@@ -1,9 +1,12 @@
 #include <math_ldbl_opt.h>
 #undef weak_alias
 #define weak_alias(n,a)
+#undef hidden_def
+#define hidden_def(x)
 #define __signbitl(arg) ___signbitl(arg)
 #include <sysdeps/ieee754/ldbl-128/s_signbitl.c>
 #undef __signbitl
+hidden_ver (___signbitl, __signbitl)
 #ifdef IS_IN_libm
 long_double_symbol (libm, ___signbitl, __signbitl);
 #else
diff -uNr libc-orig/sysdeps/ieee754/ldbl-96/s_signbitl.c libc/sysdeps/ieee754/ldbl-96/s_signbitl.c
--- libc-orig/sysdeps/ieee754/ldbl-96/s_signbitl.c	2001-07-05 23:55:55.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-96/s_signbitl.c	2008-03-04 13:05:55.000000000 -0600
@@ -30,3 +30,4 @@
   GET_LDOUBLE_EXP (e, x);
   return e & 0x8000;
 }
+hidden_def (__signbitl);
diff -uNr libc-orig/sysdeps/ieee754/ldbl-opt/nldbl-signbit.c libc/sysdeps/ieee754/ldbl-opt/nldbl-signbit.c
--- libc-orig/sysdeps/ieee754/ldbl-opt/nldbl-signbit.c	2006-01-14 06:08:46.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-opt/nldbl-signbit.c	2008-03-04 13:40:58.000000000 -0600
@@ -8,3 +8,4 @@
 {
   return __signbit (x);
 }
+hidden_def (__signbitl)
diff -uNr libc-orig/math/s_significandl.c libc/math/s_significandl.c
--- libc-orig/math/s_significandl.c	2005-12-14 04:35:24.000000000 -0600
+++ libc/math/s_significandl.c	2008-02-21 16:51:02.000000000 -0600
@@ -34,6 +34,6 @@
 	long double x;
 #endif
 {
-	return __ieee754_scalbl(x,(long double) -ilogbl(x));
+	return __ieee754_scalbl(x,(long double) -__ilogbl(x));
 }
 weak_alias (__significandl, significandl)
diff -uNr libc-orig/scripts/data/localplt-powerpc64-linux-gnu.data libc/scripts/data/localplt-powerpc64-linux-gnu.data
--- libc-orig/scripts/data/localplt-powerpc64-linux-gnu.data	1969-12-31 18:00:00.000000000 -0600
+++ libc/scripts/data/localplt-powerpc64-linux-gnu.data	2008-02-21 16:51:02.000000000 -0600
@@ -0,0 +1,6 @@
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128/e_j0l.c libc/sysdeps/ieee754/ldbl-128/e_j0l.c
--- libc-orig/sysdeps/ieee754/ldbl-128/e_j0l.c	2003-12-28 14:50:20.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128/e_j0l.c	2008-02-21 16:51:02.000000000 -0600
@@ -679,7 +679,7 @@
 {
   long double xx, xinv, z, p, q, c, s, cc, ss;
 
-  if (! finitel (x))
+  if (! __finitel (x))
     {
       if (x != x)
 	return x;
@@ -768,16 +768,16 @@
      = 1/sqrt(2) * (sin(x) - cos(x))
      sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
      cf. Fdlibm.  */
-  c = cosl (xx);
-  s = sinl (xx);
+  c = __cosl (xx);
+  s = __sinl (xx);
   ss = s - c;
   cc = s + c;
-  z = -cosl (xx + xx);
+  z = -__cosl (xx + xx);
   if ((s * c) < 0)
     cc = z / ss;
   else
     ss = z / cc;
-  z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+  z = ONEOSQPI * (p * cc - q * ss) / __sqrtl (xx);
   return z;
 }
 
@@ -817,7 +817,7 @@
 {
   long double xx, xinv, z, p, q, c, s, cc, ss;
 
-  if (! finitel (x))
+  if (! __finitel (x))
     {
       if (x != x)
 	return x;
@@ -836,7 +836,7 @@
       /* 0 <= x <= 2 */
       z = xx * xx;
       p = neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
-      p = TWOOPI * logl(x) * __ieee754_j0l(x) + p;
+      p = TWOOPI * __logl(x) * __ieee754_j0l(x) + p;
       return p;
     }
 
@@ -908,15 +908,15 @@
      = 1/sqrt(2) * (sin(x) - cos(x))
      sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
      cf. Fdlibm.  */
-  c = cosl (x);
-  s = sinl (x);
+  c = __cosl (x);
+  s = __sinl (x);
   ss = s - c;
   cc = s + c;
-  z = -cosl (x + x);
+  z = -__cosl (x + x);
   if ((s * c) < 0)
     cc = z / ss;
   else
     ss = z / cc;
-  z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
+  z = ONEOSQPI * (p * ss + q * cc) / __sqrtl (x);
   return z;
 }
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128/e_j1l.c libc/sysdeps/ieee754/ldbl-128/e_j1l.c
--- libc-orig/sysdeps/ieee754/ldbl-128/e_j1l.c	2003-12-28 14:50:20.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128/e_j1l.c	2008-02-21 16:51:02.000000000 -0600
@@ -685,7 +685,7 @@
 {
   long double xx, xinv, z, p, q, c, s, cc, ss;
 
-  if (! finitel (x))
+  if (! __finitel (x))
     {
       if (x != x)
 	return x;
@@ -773,16 +773,16 @@
      sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
      = -1/sqrt(2) * (sin(x) + cos(x))
      cf. Fdlibm.  */
-  c = cosl (xx);
-  s = sinl (xx);
+  c = __cosl (xx);
+  s = __sinl (xx);
   ss = -s - c;
   cc = s - c;
-  z = cosl (xx + xx);
+  z = __cosl (xx + xx);
   if ((s * c) > 0)
     cc = z / ss;
   else
     ss = z / cc;
-  z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+  z = ONEOSQPI * (p * cc - q * ss) / __sqrtl (xx);
   if (x < 0)
     z = -z;
   return z;
@@ -824,7 +824,7 @@
 {
   long double xx, xinv, z, p, q, c, s, cc, ss;
 
-  if (! finitel (x))
+  if (! __finitel (x))
     {
       if (x != x)
 	return x;
@@ -844,7 +844,7 @@
       z = xx * xx;
       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
       p = -TWOOPI / xx + p;
-      p = TWOOPI * logl(x) * __ieee754_j1l (x) + p;
+      p = TWOOPI * __logl(x) * __ieee754_j1l (x) + p;
       return p;
     }
 
@@ -915,15 +915,15 @@
      sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
      = -1/sqrt(2) * (sin(x) + cos(x))
      cf. Fdlibm.  */
-  c = cosl (xx);
-  s = sinl (xx);
+  c = __cosl (xx);
+  s = __sinl (xx);
   ss = -s - c;
   cc = s - c;
-  z = cosl (xx + xx);
+  z = __cosl (xx + xx);
   if ((s * c) > 0)
     cc = z / ss;
   else
     ss = z / cc;
-  z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
+  z = ONEOSQPI * (p * ss + q * cc) / __sqrtl (xx);
   return z;
 }
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128/s_expm1l.c libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
--- libc-orig/sysdeps/ieee754/ldbl-128/s_expm1l.c	2002-09-09 19:57:17.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-128/s_expm1l.c	2008-02-21 16:51:02.000000000 -0600
@@ -153,7 +153,7 @@
   exp(x) - 1 = 2^k (qx + 1) - 1
              = 2^k qx + 2^k - 1.  */
 
-  px = ldexpl (1.0L, k);
+  px = __ldexpl (1.0L, k);
   x = px * qx + (px - 1.0);
   return x;
 }
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128/s_log1pl.c libc/sysdeps/ieee754/ldbl-128/s_log1pl.c
--- libc-orig/sysdeps/ieee754/ldbl-128/s_log1pl.c	2002-08-26 17:40:02.000000000 -0500
+++ libc/sysdeps/ieee754/ldbl-128/s_log1pl.c	2008-02-21 16:51:02.000000000 -0600
@@ -122,8 +122,8 @@
 
 #if 1
 /* Make sure these are prototyped.  */
-long double frexpl (long double, int *);
-long double ldexpl (long double, int);
+long double __frexpl (long double, int *);
+long double __ldexpl (long double, int);
 #endif
 
 
@@ -160,7 +160,7 @@
   /* Separate mantissa from exponent.  */
 
   /* Use frexp used so that denormal numbers will be handled properly.  */
-  x = frexpl (x, &e);
+  x = __frexpl (x, &e);
 
   /* Logarithm using log(x) = z + z^3 P(z^2)/Q(z^2),
      where z = 2(x-1)/x+1).  */
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128ibm/e_expl.c libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
--- libc-orig/sysdeps/ieee754/ldbl-128ibm/e_expl.c	2006-01-27 18:07:25.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c	2008-02-21 16:51:02.000000000 -0600
@@ -148,15 +148,15 @@
       fesetround (FE_TONEAREST);
 #endif
 
-      n = roundl(x*M_1_LN2);
+      n = __roundl(x*M_1_LN2);
       x = x-n*M_LN2_0;
       xl = n*M_LN2_1;
 
-      tval1 = roundl(x*TWO8);
+      tval1 = __roundl(x*TWO8);
       x -= __expl_table[T_EXPL_ARG1+2*tval1];
       xl -= __expl_table[T_EXPL_ARG1+2*tval1+1];
 
-      tval2 = roundl(x*TWO15);
+      tval2 = __roundl(x*TWO15);
       x -= __expl_table[T_EXPL_ARG2+2*tval2];
       xl -= __expl_table[T_EXPL_ARG2+2*tval2+1];
 
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
--- libc-orig/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c	2006-01-27 18:07:25.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c	2008-02-21 16:51:02.000000000 -0600
@@ -152,7 +152,7 @@
   exp(x) - 1 = 2^k (qx + 1) - 1
              = 2^k qx + 2^k - 1.  */
 
-  px = ldexpl (1.0L, k);
+  px = __ldexpl (1.0L, k);
   x = px * qx + (px - 1.0);
   return x;
 }
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c libc/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
--- libc-orig/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c	2006-01-27 18:07:25.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c	2008-02-21 16:51:02.000000000 -0600
@@ -123,8 +123,8 @@
 
 #if 1
 /* Make sure these are prototyped.  */
-long double frexpl (long double, int *);
-long double ldexpl (long double, int);
+long double __frexpl (long double, int *);
+long double __ldexpl (long double, int);
 #endif
 
 
@@ -161,7 +161,7 @@
   /* Separate mantissa from exponent.  */
 
   /* Use frexp used so that denormal numbers will be handled properly.  */
-  x = frexpl (x, &e);
+  x = __frexpl (x, &e);
 
   /* Logarithm using log(x) = z + z^3 P(z^2)/Q(z^2),
      where z = 2(x-1)/x+1).  */
diff -uNr libc-orig/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
--- libc-orig/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c	2006-01-27 18:07:25.000000000 -0600
+++ libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c	2008-02-21 16:51:02.000000000 -0600
@@ -85,7 +85,7 @@
 	      /* Else the high double is pre rounded and we need to
 	         adjust for that.  */
 	      
-	      tau = nextafter (u.dd[0], 0.0);
+	      tau = __nextafter (u.dd[0], 0.0);
 	      tau = (u.dd[0] - tau) * 2.0;
 	      high = u.dd[0] - tau;
 	      low = u.dd[1] + tau;
@@ -106,7 +106,7 @@
 	    {
 	      /* Else the high double is pre rounded and we need to
 	         adjust for that.  */
-	      tau = nextafter (u.dd[0], 0.0);
+	      tau = __nextafter (u.dd[0], 0.0);
 	      tau = (u.dd[0] - tau) * 2.0;
 	      high = u.dd[0] - tau;
 	      low = u.dd[1] + tau;
diff -uNr libc-orig/sysdeps/powerpc/fenv_internal.h libc/sysdeps/powerpc/fenv_internal.h
--- libc-orig/sysdeps/powerpc/fenv_internal.h	1969-12-31 18:00:00.000000000 -0600
+++ libc/sysdeps/powerpc/fenv_internal.h	2008-02-21 16:51:02.000000000 -0600
@@ -0,0 +1,33 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FENV_INTERNAL_H
+#define _FENV_INTERNAL_H
+
+#include <fenv.h>
+
+extern const fenv_t *___fe_nomask_env (void);
+libm_hidden_proto(___fe_nomask_env)
+
+extern int __fegetexcept (void);
+libm_hidden_proto(__fegetexcept)
+
+extern int __fetestexcept (int __excepts);
+libm_hidden_proto(__fetestexcept)
+
+#endif /* _FENV_INTERNAL_H  */
diff -uNr libc-orig/sysdeps/powerpc/fpu/e_sqrt.c libc/sysdeps/powerpc/fpu/e_sqrt.c
--- libc-orig/sysdeps/powerpc/fpu/e_sqrt.c	2006-04-14 00:44:30.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/e_sqrt.c	2008-02-21 16:51:02.000000000 -0600
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 #include <inttypes.h>
 
@@ -150,7 +151,7 @@
          FE_INVALID_SQRT.  */
 #ifdef FE_INVALID_SQRT
       feraiseexcept (FE_INVALID_SQRT);
-      if (!fetestexcept (FE_INVALID))
+      if (!__fetestexcept (FE_INVALID))
 #endif
 	feraiseexcept (FE_INVALID);
       x = a_nan.value;
diff -uNr libc-orig/sysdeps/powerpc/fpu/e_sqrtf.c libc/sysdeps/powerpc/fpu/e_sqrtf.c
--- libc-orig/sysdeps/powerpc/fpu/e_sqrtf.c	2006-04-14 00:44:30.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/e_sqrtf.c	2008-02-21 16:51:02.000000000 -0600
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 #include <inttypes.h>
 
@@ -126,7 +127,7 @@
          FE_INVALID_SQRT.  */
 #ifdef FE_INVALID_SQRT
       feraiseexcept (FE_INVALID_SQRT);
-      if (!fetestexcept (FE_INVALID))
+      if (!__fetestexcept (FE_INVALID))
 #endif
 	feraiseexcept (FE_INVALID);
       x = a_nan.value;
diff -uNr libc-orig/sysdeps/powerpc/fpu/fe_nomask.c libc/sysdeps/powerpc/fpu/fe_nomask.c
--- libc-orig/sysdeps/powerpc/fpu/fe_nomask.c	2007-05-07 01:21:08.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/fe_nomask.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv.h>
 #include <errno.h>
 
@@ -25,9 +26,11 @@
    normally involve a syscall.  */
 
 const fenv_t *
-__fe_nomask_env(void)
+___fe_nomask_env(void)
 {
   __set_errno (ENOSYS);
   return FE_ENABLED_ENV;
 }
+libm_hidden_def(___fe_nomask_env)
+strong_alias(___fe_nomask_env, __fe_nomask_env)
 stub_warning (__fe_nomask_env)
diff -uNr libc-orig/sysdeps/powerpc/fpu/fedisblxcpt.c libc/sysdeps/powerpc/fpu/fedisblxcpt.c
--- libc-orig/sysdeps/powerpc/fpu/fedisblxcpt.c	2007-05-07 01:21:26.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/fedisblxcpt.c	2008-02-21 16:51:02.000000000 -0600
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 
 int
@@ -26,7 +27,7 @@
   fenv_union_t fe;
   int result, new;
 
-  result = fegetexcept ();
+  result = __fegetexcept ();
 
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
     excepts = (excepts | FE_INVALID) & ~ FE_ALL_INVALID;
@@ -44,7 +45,7 @@
     fe.l[1] &= ~(1 << (31 - FPSCR_VE));
   fesetenv_register (fe.fenv);
 
-  new = fegetexcept ();
+  new = __fegetexcept ();
   if (new == 0 && result != 0)
     (void)__fe_mask_env ();
 
diff -uNr libc-orig/sysdeps/powerpc/fpu/feenablxcpt.c libc/sysdeps/powerpc/fpu/feenablxcpt.c
--- libc-orig/sysdeps/powerpc/fpu/feenablxcpt.c	2001-07-05 23:56:02.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/feenablxcpt.c	2008-02-21 16:51:02.000000000 -0600
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 
 int
@@ -26,7 +27,7 @@
   fenv_union_t fe;
   int result, new;
 
-  result = fegetexcept ();
+  result = __fegetexcept ();
 
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
     excepts = (excepts | FE_INVALID) & ~ FE_ALL_INVALID;
@@ -44,9 +45,9 @@
     fe.l[1] |= (1 << (31 - FPSCR_VE));
   fesetenv_register (fe.fenv);
 
-  new = fegetexcept ();
+  new = __fegetexcept ();
   if (new != 0 && result == 0)
-    (void)__fe_nomask_env ();
+    (void)___fe_nomask_env ();
 
   if ((new & excepts) != excepts)
     result = -1;
diff -uNr libc-orig/sysdeps/powerpc/fpu/fegetexcept.c libc/sysdeps/powerpc/fpu/fegetexcept.c
--- libc-orig/sysdeps/powerpc/fpu/fegetexcept.c	2001-07-05 23:56:02.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/fegetexcept.c	2008-02-21 16:51:02.000000000 -0600
@@ -18,10 +18,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 
 int
-fegetexcept (void)
+__fegetexcept (void)
 {
   fenv_union_t fe;
   int result = 0;
@@ -41,3 +42,5 @@
 
   return result;
 }
+libm_hidden_def (__fegetexcept)
+strong_alias(__fegetexcept, fegetexcept)
diff -uNr libc-orig/sysdeps/powerpc/fpu/fesetenv.c libc/sysdeps/powerpc/fpu/fesetenv.c
--- libc-orig/sysdeps/powerpc/fpu/fesetenv.c	2007-05-07 01:22:06.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/fesetenv.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 #include <bp-sym.h>
 
@@ -34,9 +35,9 @@
      the hardware into "precise mode" and may cause the FPU to run slower on
      some hardware.  */
   if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
-    (void)__fe_nomask_env ();
+    (void)___fe_nomask_env ();
   
-  /* If the old env had any eabled exceptions and the new env has no enabled
+  /* If the old env had any enabled exceptions and the new env has no enabled
      exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
      FPU to run faster because it always takes the default action and can not 
      generate SIGFPE. */
diff -uNr libc-orig/sysdeps/powerpc/fpu/feupdateenv.c libc/sysdeps/powerpc/fpu/feupdateenv.c
--- libc-orig/sysdeps/powerpc/fpu/feupdateenv.c	2007-05-07 01:22:29.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/feupdateenv.c	2008-02-21 16:51:02.000000000 -0600
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 #include <bp-sym.h>
 
@@ -40,9 +41,9 @@
      the hardware into "precise mode" and may cause the FPU to run slower on
      some hardware.  */
   if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
-    (void)__fe_nomask_env ();
+    (void)___fe_nomask_env ();
   
-  /* If the old env had any eabled exceptions and the new env has no enabled
+  /* If the old env had any enabled exceptions and the new env has no enabled
      exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
      FPU to run faster because it always takes the default action and can not 
      generate SIGFPE. */
diff -uNr libc-orig/sysdeps/powerpc/fpu/fraiseexcpt.c libc/sysdeps/powerpc/fpu/fraiseexcpt.c
--- libc-orig/sysdeps/powerpc/fpu/fraiseexcpt.c	2002-09-09 20:26:37.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/fraiseexcpt.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 #include <bp-sym.h>
 
@@ -49,7 +50,7 @@
       /* For some reason, some PowerPC chips (the 601, in particular)
 	 don't have FE_INVALID_SOFTWARE implemented.  Detect this
 	 case and raise FE_INVALID_SNAN instead.  */
-      && !fetestexcept (FE_INVALID))
+      && !__fetestexcept (FE_INVALID))
     set_fpscr_bit (FPSCR_VXSNAN);
 
   /* Success.  */
diff -uNr libc-orig/sysdeps/powerpc/fpu/ftestexcept.c libc/sysdeps/powerpc/fpu/ftestexcept.c
--- libc-orig/sysdeps/powerpc/fpu/ftestexcept.c	2001-07-05 23:56:02.000000000 -0500
+++ libc/sysdeps/powerpc/fpu/ftestexcept.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,10 +17,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv_libc.h>
 
 int
-fetestexcept (int excepts)
+__fetestexcept (int excepts)
 {
   fenv_union_t u;
 
@@ -31,3 +32,5 @@
      just:  */
   return u.l[1] & excepts;
 }
+libm_hidden_def (__fetestexcept)
+strong_alias(__fetestexcept, fetestexcept)
diff -uNr libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
--- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c	2007-05-07 01:19:27.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv.h>
 #include <errno.h>
 #include <signal.h>
@@ -41,7 +42,7 @@
 #endif
 
 const fenv_t *
-__fe_nomask_env (void)
+___fe_nomask_env (void)
 {
 #if __ASSUME_NEW_PRCTL_SYSCALL == 0
 # if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
@@ -66,3 +67,5 @@
 
   return FE_ENABLED_ENV;
 }
+libm_hidden_def(___fe_nomask_env)
+strong_alias(___fe_nomask_env, __fe_nomask_env)
diff -uNr libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
--- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c	2007-05-07 01:19:33.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c	2008-02-21 16:51:02.000000000 -0600
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <fenv_internal.h>
 #include <fenv.h>
 #include <errno.h>
 #include <sysdep.h>
@@ -25,7 +26,7 @@
 #include <kernel-features.h>
 
 const fenv_t *
-__fe_nomask_env (void)
+___fe_nomask_env (void)
 {
 #if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
   int result;
@@ -41,3 +42,5 @@
 #endif
   return FE_ENABLED_ENV;
 }
+libm_hidden_def(___fe_nomask_env)
+strong_alias(___fe_nomask_env, __fe_nomask_env)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]