From 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 12 Jul 2007 18:26:36 +0000 Subject: 2.5-18.1 --- sysdeps/powerpc/fpu/bits/mathinline.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'sysdeps/powerpc/fpu/bits/mathinline.h') diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h index 44f7dbe..aed899e 100644 --- a/sysdeps/powerpc/fpu/bits/mathinline.h +++ b/sysdeps/powerpc/fpu/bits/mathinline.h @@ -1,5 +1,5 @@ /* Inline math functions for powerpc. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -123,20 +123,26 @@ __NTH (fdimf (float __x, float __y)) #endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ /* This code is used internally in the GNU libc. */ -# ifdef __LIBC_INTERNAL_MATH_INLINES +#ifdef __LIBC_INTERNAL_MATH_INLINES #include #include #include +# if __WORDSIZE == 64 || defined _ARCH_PWR4 +# define __CPU_HAS_FSQRT 1 +# else +# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) +# endif + extern double __slow_ieee754_sqrt (double); __MATH_INLINE double __NTH (__ieee754_sqrt (double __x)) { double __z; - /* If the CPU is 64-bit we can use the optional FP instructions we. */ - if ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) + /* If the CPU is 64-bit we can use the optional FP instructions. */ + if (__CPU_HAS_FSQRT) { /* Volatile is required to prevent the compiler from moving the fsqrt instruction above the branch. */ @@ -157,8 +163,8 @@ __NTH (__ieee754_sqrtf (float __x)) { float __z; - /* If the CPU is 64-bit we can use the optional FP instructions we. */ - if ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) + /* If the CPU is 64-bit we can use the optional FP instructions. */ + if (__CPU_HAS_FSQRT) { /* Volatile is required to prevent the compiler from moving the fsqrts instruction above the branch. */ @@ -172,5 +178,5 @@ __NTH (__ieee754_sqrtf (float __x)) return __z; } -# endif /* __LIBC_INTERNAL_MATH_INLINES */ +#endif /* __LIBC_INTERNAL_MATH_INLINES */ #endif /* __GNUC__ && !_SOFT_FLOAT */ -- cgit v1.1