This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 3/3] Cleanup __ieee754_sqrt(f/l)
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 26 Sep 2017 13:25:20 +0000
- Subject: [PATCH 3/3] Cleanup __ieee754_sqrt(f/l)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Finally remove the now unused target specific__ieee754_sqrt(f/l) inlines.
ChangeLog:
2017-09-25 Wilco Dijkstra <wdijkstr@arm.com>
* sysdeps/aarch64/fpu/math_private.h (__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
* sysdeps/alpha/fpu/math_private.h (__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
* sysdeps/generic/math-type-macros.h (M_SQRT): Use __builtin_sqrt(f).
* sysdeps/m68k/m680x0/fpu/mathimpl.h (__ieee754_sqrt): Remove.
* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
* sysdeps/s390/fpu/bits/mathinline.h (__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
(sqrtl): Remove.
* sysdeps/sparc/fpu/bits/mathinline.h (sqrt) Remove.
(sqrtf): Remove.
(sqrtl): Remove.
(__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
(__ieee754_sqrtl): Remove.
* sysdeps/m68k/m680x0/fpu/mathimpl.h (__ieee754_sqrt): Remove.
* sysdeps/x86/fpu/math_private.h (__ieee754_sqrt): Remove.
* sysdeps/x86_64/fpu/math_private.h (__ieee754_sqrt): Remove.
(__ieee754_sqrtf): Remove.
(__ieee754_sqrtl): Remove.
--
diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h
index be10488f5df437bcdb28a136a2b9a4533e862275..8c04b675027a7ea6dc2b199a7ab876cb48c876e8 100644
--- a/sysdeps/aarch64/fpu/math_private.h
+++ b/sysdeps/aarch64/fpu/math_private.h
@@ -27,22 +27,6 @@
#define math_force_eval(x) \
({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "w" (__x)); })
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double res;
- asm __volatile__ ("fsqrt %d0, %d1" : "=w" (res) : "w" (d));
- return res;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float s)
-{
- float res;
- asm __volatile__ ("fsqrt %s0, %s1" : "=w" (res) : "w" (s));
- return res;
-}
-
static __always_inline void
libc_feholdexcept_aarch64 (fenv_t *envp)
{
diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h
index 1e97c867c38767a2237df21f84e9c55a53ad13bb..95dc32c969c1133add0d5a1c42e1f1bd0c9d0e2d 100644
--- a/sysdeps/alpha/fpu/math_private.h
+++ b/sysdeps/alpha/fpu/math_private.h
@@ -21,30 +21,4 @@
#include_next <math_private.h>
-#ifdef __alpha_fix__
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double ret;
-# ifdef _IEEE_FP_INEXACT
- asm ("sqrtt/suid %1,%0" : "=&f"(ret) : "f"(d));
-# else
- asm ("sqrtt/sud %1,%0" : "=&f"(ret) : "f"(d));
-# endif
- return ret;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float d)
-{
- float ret;
-# ifdef _IEEE_FP_INEXACT
- asm ("sqrts/suid %1,%0" : "=&f"(ret) : "f"(d));
-# else
- asm ("sqrts/sud %1,%0" : "=&f"(ret) : "f"(d));
-# endif
- return ret;
-}
-#endif /* FIX */
-
#endif /* ALPHA_MATH_PRIVATE_H */
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 6aaa2335b9b165ba5ec9384e730f10382e3b969c..26d338972d7ded66877bd0a2d8e822f929cee1c9 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -84,7 +84,7 @@
#define M_HYPOT M_SUF (__ieee754_hypot)
#define M_LOG M_SUF (__ieee754_log)
#define M_SINH M_SUF (__ieee754_sinh)
-#define M_SQRT M_SUF (__ieee754_sqrt)
+#define M_SQRT M_SUF (sqrt)
/* Needed to evaluate M_MANT_DIG below. */
#include <float.h>
diff --git a/sysdeps/m68k/m680x0/fpu/mathimpl.h b/sysdeps/m68k/m680x0/fpu/mathimpl.h
index 653df968735a3bc1f41cd137632fe7739d76c443..1c315150a532f5575104e2a154166d020c6b1617 100644
--- a/sysdeps/m68k/m680x0/fpu/mathimpl.h
+++ b/sysdeps/m68k/m680x0/fpu/mathimpl.h
@@ -30,7 +30,6 @@ __inline_mathop (__ieee754_exp10, tentox)
__inline_mathop (__ieee754_log10, log10)
__inline_mathop (__ieee754_log2, log2)
__inline_mathop (__ieee754_log, logn)
-__inline_mathop (__ieee754_sqrt, sqrt)
__inline_mathop (__ieee754_atanh, atanh)
__m81_defun (double, __ieee754_remainder, (double __x, double __y))
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index 396fd0562eda2f64bc5858a8e90b94cf5028f28b..f73b6efaa9d1c3f5dec0427965cdf25b1b61b843 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -35,36 +35,6 @@ __ieee754_sqrtf128 (_Float128 __x)
}
#endif
-extern double __slow_ieee754_sqrt (double);
-extern __always_inline double
-__ieee754_sqrt (double __x)
-{
- double __z;
-
-#ifdef _ARCH_PPCSQ
- asm ("fsqrt %0,%1" : "=f" (__z) : "f" (__x));
-#else
- __z = __slow_ieee754_sqrt(__x);
-#endif
-
- return __z;
-}
-
-extern float __slow_ieee754_sqrtf (float);
-extern __always_inline float
-__ieee754_sqrtf (float __x)
-{
- float __z;
-
-#ifdef _ARCH_PPCSQ
- asm ("fsqrts %0,%1" : "=f" (__z) : "f" (__x));
-#else
- __z = __slow_ieee754_sqrtf(__x);
-#endif
-
- return __z;
-}
-
#if defined _ARCH_PWR5X
# ifndef __round
diff --git a/sysdeps/s390/fpu/bits/mathinline.h b/sysdeps/s390/fpu/bits/mathinline.h
index 52e21db98d51254cee442989190923eef25b1b44..76b3be50c4e347281ed7790aa5eafbdb36d95052 100644
--- a/sysdeps/s390/fpu/bits/mathinline.h
+++ b/sysdeps/s390/fpu/bits/mathinline.h
@@ -63,38 +63,4 @@ __NTH (__signbitl (long double __x))
#endif /* C99 */
-/* This code is used internally in the GNU libc. */
-#ifdef __LIBC_INTERNAL_MATH_INLINES
-
-__MATH_INLINE double
-__NTH (__ieee754_sqrt (double x))
-{
- double res;
-
- __asm__ ( "sqdbr %0,%1" : "=f" (res) : "f" (x) );
- return res;
-}
-
-__MATH_INLINE float
-__NTH (__ieee754_sqrtf (float x))
-{
- float res;
-
- __asm__ ( "sqebr %0,%1" : "=f" (res) : "f" (x) );
- return res;
-}
-
-# if !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-__NTH (sqrtl (long double __x))
-{
- long double res;
-
- __asm__ ( "sqxbr %0,%1" : "=f" (res) : "f" (__x) );
- return res;
-}
-# endif /* !__NO_LONG_DOUBLE_MATH */
-
-#endif /* __LIBC_INTERNAL_MATH_INLINES */
-
#endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
index 60a2028f2ce7484883791c683be1a28586de0c13..2939af5bc623287bab02dab72d664509d435f2f9 100644
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ b/sysdeps/sparc/fpu/bits/mathinline.h
@@ -190,80 +190,7 @@ __NTH (__signbitl (long double __x))
# endif /* __USE_ISOC99 */
-# if !defined __NO_MATH_INLINES && !__GNUC_PREREQ (3, 2)
-
-__MATH_INLINE double
-__NTH (sqrt (double __x))
-{
- register double __r;
- __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-__MATH_INLINE float
-__NTH (sqrtf (float __x))
-{
- register float __r;
- __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-# if __WORDSIZE == 64
-__MATH_INLINE long double
-__NTH (sqrtl (long double __x))
-{
- long double __r;
- extern void _Qp_sqrt (long double *, const long double *);
- _Qp_sqrt (&__r, &__x);
- return __r;
-}
-# elif !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-sqrtl (long double __x) __THROW
-{
- extern long double _Q_sqrt (const long double);
- return _Q_sqrt (__x);
-}
-# endif /* sparc64 */
-
-# endif /* !__NO_MATH_INLINES && !GCC 3.2+ */
-
/* This code is used internally in the GNU libc. */
-# ifdef __LIBC_INTERNAL_MATH_INLINES
-__MATH_INLINE double
-__ieee754_sqrt (double __x)
-{
- register double __r;
- __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-__MATH_INLINE float
-__ieee754_sqrtf (float __x)
-{
- register float __r;
- __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-# if __WORDSIZE == 64
-__MATH_INLINE long double
-__ieee754_sqrtl (long double __x)
-{
- long double __r;
- extern void _Qp_sqrt (long double *, const long double *);
- _Qp_sqrt(&__r, &__x);
- return __r;
-}
-# elif !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-__ieee754_sqrtl (long double __x)
-{
- extern long double _Q_sqrt (const long double);
- return _Q_sqrt (__x);
-}
-# endif /* sparc64 */
-# endif /* __LIBC_INTERNAL_MATH_INLINES */
# endif /* gcc 2.8+ */
# ifdef __USE_ISOC99
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index bcd99bdf7435e8eff3bd60e5134a15a85d9320b8..a183693ae6978a875f80bfd61a1fa5e5333de204 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -950,7 +950,6 @@ __NTH (__finite (double __x))
/* This code is used internally in the GNU libc. */
# ifdef __LIBC_INTERNAL_MATH_INLINES
-__inline_mathop (__ieee754_sqrt, "fsqrt")
__inline_mathcode2_ (long double, __ieee754_atan2l, __y, __x,
register long double __value;
__asm __volatile__ ("fpatan\n\t"
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 027a6a3a4d0a68948f19ebaa129bf442a9f4f3e6..13052893ef9541e100d6d68b85ff16a2910a28e3 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -48,38 +48,6 @@
#include <sysdeps/i386/fpu/fenv_private.h>
#include_next <math_private.h>
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double res;
-#if defined __AVX__ || defined SSE2AVX
- asm ("vsqrtsd %1, %0, %0" : "=x" (res) : "xm" (d));
-#else
- asm ("sqrtsd %1, %0" : "=x" (res) : "xm" (d));
-#endif
- return res;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float d)
-{
- float res;
-#if defined __AVX__ || defined SSE2AVX
- asm ("vsqrtss %1, %0, %0" : "=x" (res) : "xm" (d));
-#else
- asm ("sqrtss %1, %0" : "=x" (res) : "xm" (d));
-#endif
- return res;
-}
-
-extern __always_inline long double
-__ieee754_sqrtl (long double d)
-{
- long double res;
- asm ("fsqrt" : "=t" (res) : "0" (d));
- return res;
-}
-
#ifdef __SSE4_1__
extern __always_inline double
__rint (double d)