diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-12 11:27:51 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-12 11:27:51 -0400 |
commit | 0ac5ae2335292908f39031b1ea9fe8edce433c0f (patch) | |
tree | f9d26c8abc0de39d18d4c13e70f6022cdc6b461f /sysdeps/powerpc | |
parent | a843a204a3e8a0dd53584dad3668771abaec84ac (diff) | |
download | glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.gz glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.xz glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.zip |
Optimize libm
libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized.
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r-- | sysdeps/powerpc/fpu/e_hypot.c | 1 | ||||
-rw-r--r-- | sysdeps/powerpc/fpu/e_hypotf.c | 1 | ||||
-rw-r--r-- | sysdeps/powerpc/fpu/e_sqrt.c | 21 | ||||
-rw-r--r-- | sysdeps/powerpc/fpu/e_sqrtf.c | 19 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/fpu/e_sqrt.c | 3 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c | 3 |
6 files changed, 15 insertions, 33 deletions
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c index afbcc18e9e..a8d67d875e 100644 --- a/sysdeps/powerpc/fpu/e_hypot.c +++ b/sysdeps/powerpc/fpu/e_hypot.c @@ -115,3 +115,4 @@ __ieee754_hypot (double x, double y) } return __ieee754_sqrt (x * x + y * y); } +strong_alias (__ieee754_hypot, __hypot_finite) diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c index 02ad7732b9..915738c4d5 100644 --- a/sysdeps/powerpc/fpu/e_hypotf.c +++ b/sysdeps/powerpc/fpu/e_hypotf.c @@ -116,3 +116,4 @@ __ieee754_hypotf (float x, float y) } return __ieee754_sqrtf (x * x + y * y); } +strong_alias (__ieee754_hypotf, __hypotf_finite) diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c index e95b786a00..f9ded25717 100644 --- a/sysdeps/powerpc/fpu/e_sqrt.c +++ b/sysdeps/powerpc/fpu/e_sqrt.c @@ -1,5 +1,5 @@ /* Double-precision floating point square root. - Copyright (C) 1997, 2002, 2003, 2004, 2008 Free Software Foundation, Inc. + Copyright (C) 1997, 2002-2004, 2008, 2011 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 @@ -46,21 +46,15 @@ extern const float __t_sqrt[1024]; generated guesses (which mostly runs on the integer unit, while the Newton-Raphson is running on the FPU). */ -#ifdef __STDC__ double __slow_ieee754_sqrt (double x) -#else -double -__slow_ieee754_sqrt (x) - double x; -#endif { const float inf = a_inf.value; if (x > 0) { /* schedule the EXTRACT_WORDS to get separation between the store - and the load. */ + and the load. */ ieee_double_shape_type ew_u; ieee_double_shape_type iw_u; ew_u.value = (x); @@ -147,7 +141,7 @@ __slow_ieee754_sqrt (x) else if (x < 0) { /* For some reason, some PowerPC32 processors don't implement - FE_INVALID_SQRT. */ + FE_INVALID_SQRT. */ #ifdef FE_INVALID_SQRT feraiseexcept (FE_INVALID_SQRT); @@ -160,14 +154,8 @@ __slow_ieee754_sqrt (x) return f_wash (x); } -#ifdef __STDC__ double __ieee754_sqrt (double x) -#else -double -__ieee754_sqrt (x) - double x; -#endif { double z; @@ -175,7 +163,7 @@ __ieee754_sqrt (x) if (__CPU_HAS_FSQRT) { /* Volatile is required to prevent the compiler from moving the - fsqrt instruction above the branch. */ + fsqrt instruction above the branch. */ __asm __volatile (" fsqrt %0,%1\n" :"=f" (z):"f" (x)); } @@ -184,3 +172,4 @@ __ieee754_sqrt (x) return z; } +strong_alias (__ieee754_sqrt, __sqrt_finite) diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c index ca44fac559..965faee842 100644 --- a/sysdeps/powerpc/fpu/e_sqrtf.c +++ b/sysdeps/powerpc/fpu/e_sqrtf.c @@ -1,5 +1,5 @@ /* Single-precision floating point square root. - Copyright (C) 1997, 2003, 2004, 2008 Free Software Foundation, Inc. + Copyright (C) 1997, 2003, 2004, 2008, 2011 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 @@ -46,14 +46,8 @@ extern const float __t_sqrt[1024]; generated guesses (which mostly runs on the integer unit, while the Newton-Raphson is running on the FPU). */ -#ifdef __STDC__ float __slow_ieee754_sqrtf (float x) -#else -float -__slow_ieee754_sqrtf (x) - float x; -#endif { const float inf = a_inf.value; @@ -123,7 +117,7 @@ __slow_ieee754_sqrtf (x) else if (x < 0) { /* For some reason, some PowerPC32 processors don't implement - FE_INVALID_SQRT. */ + FE_INVALID_SQRT. */ #ifdef FE_INVALID_SQRT feraiseexcept (FE_INVALID_SQRT); @@ -137,14 +131,8 @@ __slow_ieee754_sqrtf (x) } -#ifdef __STDC__ float __ieee754_sqrtf (float x) -#else -float -__ieee754_sqrtf (x) - float x; -#endif { double z; @@ -152,7 +140,7 @@ __ieee754_sqrtf (x) if (__CPU_HAS_FSQRT) { /* Volatile is required to prevent the compiler from moving the - fsqrt instruction above the branch. */ + fsqrt instruction above the branch. */ __asm __volatile (" fsqrts %0,%1\n" :"=f" (z):"f" (x)); } @@ -161,3 +149,4 @@ __ieee754_sqrtf (x) return z; } +strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c index 0a229cbe27..314abba3b2 100644 --- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c +++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c @@ -1,5 +1,5 @@ /* Double-precision floating point square root. - Copyright (C) 1997, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 2002-2004, 2006, 2011 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 @@ -27,3 +27,4 @@ __ieee754_sqrt (double x) __asm __volatile ("fsqrt %0,%1" : "=f" (z) : "f" (x)); return z; } +strong_alias (__ieee754_sqrt, __sqrt_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c index 0f17a64a8a..7157214394 100644 --- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c +++ b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c @@ -1,5 +1,5 @@ /* Single-precision floating point square root. - Copyright (C) 1997, 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 2003, 2004, 2006, 2011 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 @@ -27,3 +27,4 @@ __ieee754_sqrtf (float x) __asm ("fsqrts %0,%1" : "=f" (z) : "f" (x)); return z; } +strong_alias (__ieee754_sqrtf, __sqrtf_finite) |