summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fpu/bits/mathinline.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/powerpc/fpu/bits/mathinline.h
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
2.5-18.1
Diffstat (limited to 'sysdeps/powerpc/fpu/bits/mathinline.h')
-rw-r--r--sysdeps/powerpc/fpu/bits/mathinline.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h
index 44f7dbec52..aed899e882 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 <sysdep.h>
#include <ldsodefs.h>
#include <dl-procinfo.h>
+# 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 */