summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/fpu/math_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/math_private.h')
-rw-r--r--sysdeps/powerpc/fpu/math_private.h32
1 files changed, 10 insertions, 22 deletions
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 6631535e82..37e7456bac 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -25,26 +25,17 @@
#include <fenv_private.h>
#include_next <math_private.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);
extern __always_inline double
__ieee754_sqrt (double __x)
{
double __z;
- if (__CPU_HAS_FSQRT)
- {
- /* Volatile is required to prevent the compiler from moving the
- fsqrt instruction above the branch. */
- __asm __volatile ("fsqrt %0,%1" : "=f" (__z) : "f" (__x));
- }
- else
- __z = __slow_ieee754_sqrt(__x);
+#ifdef _ARCH_PPCSQ
+ asm ("fsqrt %0,%1" : "=f" (__z) : "f" (__x));
+#else
+ __z = __slow_ieee754_sqrt(__x);
+#endif
return __z;
}
@@ -55,14 +46,11 @@ __ieee754_sqrtf (float __x)
{
float __z;
- if (__CPU_HAS_FSQRT)
- {
- /* Volatile is required to prevent the compiler from moving the
- fsqrts instruction above the branch. */
- __asm __volatile ("fsqrts %0,%1" : "=f" (__z) : "f" (__x));
- }
- else
- __z = __slow_ieee754_sqrtf(__x);
+#ifdef _ARCH_PPCSQ
+ asm ("fsqrts %0,%1" : "=f" (__z) : "f" (__x));
+#else
+ __z = __slow_ieee754_sqrtf(__x);
+#endif
return __z;
}