|
|
147e83 |
From ae7cc530d644d05ef11fe9a846dd5e4b51966734 Mon Sep 17 00:00:00 2001
|
|
|
147e83 |
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Wed, 30 Jul 2014 10:35:21 -0500
|
|
|
147e83 |
Subject: [PATCH] PowerPC: Cleaning up uneeded sqrt routines
|
|
|
147e83 |
|
|
|
147e83 |
commit c24517c9dd9e92b4fa81e192967c63e56c1726e2
|
|
|
147e83 |
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Fri Dec 13 14:56:09 2013 -0500
|
|
|
147e83 |
|
|
|
147e83 |
PowerPC: Cleaning up uneeded sqrt routines
|
|
|
147e83 |
|
|
|
147e83 |
For PPC64, all the wrappers at sysdeps are superfluous: they are
|
|
|
147e83 |
basically the same implementation from math/w_sqrt.c with the
|
|
|
147e83 |
'#ifdef _IEEE_LIBM'. And the power4 version just force the 'fsqrt'
|
|
|
147e83 |
instruction utilization with an inline assembly, which is already
|
|
|
147e83 |
handled by math_private.h __ieee754_sqrt implementation.
|
|
|
147e83 |
|
|
|
147e83 |
File sysdeps/powerpc/fpu/w_sqrt.c (part oforiginal commit)
|
|
|
147e83 |
is already deleted by some previous patch. Hence ignoring that.
|
|
|
147e83 |
---
|
|
|
147e83 |
sysdeps/powerpc/fpu/w_sqrtf.c | 46 ---------------------
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c | 55 --------------------------
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c | 53 -------------------------
|
|
|
147e83 |
3 files changed, 154 deletions(-)
|
|
|
147e83 |
delete mode 100644 sysdeps/powerpc/fpu/w_sqrtf.c
|
|
|
147e83 |
delete mode 100644 sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c
|
|
|
147e83 |
delete mode 100644 sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c
|
|
|
147e83 |
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/fpu/w_sqrtf.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/w_sqrtf.c
|
|
|
147e83 |
deleted file mode 100644
|
|
|
147e83 |
index 39b5b20..0000000
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/w_sqrtf.c
|
|
|
147e83 |
+++ /dev/null
|
|
|
147e83 |
@@ -1,46 +0,0 @@
|
|
|
147e83 |
-/* Single-precision floating point square root wrapper.
|
|
|
147e83 |
- Copyright (C) 2004, 2012 Free Software Foundation, Inc.
|
|
|
147e83 |
- This file is part of the GNU C Library.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
- License as published by the Free Software Foundation; either
|
|
|
147e83 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
- Lesser General Public License for more details.
|
|
|
147e83 |
-
|
|
|
147e83 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
- License along with the GNU C Library; if not, see
|
|
|
147e83 |
- <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
-
|
|
|
147e83 |
-#include <math.h>
|
|
|
147e83 |
-#include <math_private.h>
|
|
|
147e83 |
-#include <fenv_libc.h>
|
|
|
147e83 |
-
|
|
|
147e83 |
-#include <sysdep.h>
|
|
|
147e83 |
-#include <ldsodefs.h>
|
|
|
147e83 |
-
|
|
|
147e83 |
-float
|
|
|
147e83 |
-__sqrtf (float x) /* wrapper sqrtf */
|
|
|
147e83 |
-{
|
|
|
147e83 |
-#ifdef _IEEE_LIBM
|
|
|
147e83 |
- return __ieee754_sqrtf (x);
|
|
|
147e83 |
-#else
|
|
|
147e83 |
- float z;
|
|
|
147e83 |
- z = __ieee754_sqrtf (x);
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (_LIB_VERSION == _IEEE_ || (x != x))
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (x < (float) 0.0)
|
|
|
147e83 |
- /* sqrtf(negative) */
|
|
|
147e83 |
- return (float) __kernel_standard ((double) x, (double) x, 126);
|
|
|
147e83 |
- else
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
-}
|
|
|
147e83 |
-
|
|
|
147e83 |
-weak_alias (__sqrtf, sqrtf)
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c
|
|
|
147e83 |
deleted file mode 100644
|
|
|
147e83 |
index 1bd6a67..0000000
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c
|
|
|
147e83 |
+++ /dev/null
|
|
|
147e83 |
@@ -1,55 +0,0 @@
|
|
|
147e83 |
-/* Double-precision floating point square root wrapper.
|
|
|
147e83 |
- Copyright (C) 2004, 2007, 2012 Free Software Foundation, Inc.
|
|
|
147e83 |
- This file is part of the GNU C Library.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
- License as published by the Free Software Foundation; either
|
|
|
147e83 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
- Lesser General Public License for more details.
|
|
|
147e83 |
-
|
|
|
147e83 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
- License along with the GNU C Library; if not, see
|
|
|
147e83 |
- <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
-
|
|
|
147e83 |
-#include <math_ldbl_opt.h>
|
|
|
147e83 |
-#include <math.h>
|
|
|
147e83 |
-#include <math_private.h>
|
|
|
147e83 |
-#include <fenv_libc.h>
|
|
|
147e83 |
-
|
|
|
147e83 |
-double
|
|
|
147e83 |
-__sqrt (double x) /* wrapper sqrt */
|
|
|
147e83 |
-{
|
|
|
147e83 |
- double z;
|
|
|
147e83 |
-/* Power4 (ISA V2.0) and above implement sqrt in hardware. */
|
|
|
147e83 |
- __asm __volatile (
|
|
|
147e83 |
- " fsqrt %0,%1\n"
|
|
|
147e83 |
- : "=f" (z)
|
|
|
147e83 |
- : "f" (x));
|
|
|
147e83 |
-#ifdef _IEEE_LIBM
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-#else
|
|
|
147e83 |
- if (__builtin_expect (_LIB_VERSION == _IEEE_, 0))
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (__builtin_expect (x != x, 0))
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (__builtin_expect (x < 0.0, 0))
|
|
|
147e83 |
- return __kernel_standard (x, x, 26); /* sqrt(negative) */
|
|
|
147e83 |
- else
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
-}
|
|
|
147e83 |
-
|
|
|
147e83 |
-weak_alias (__sqrt, sqrt)
|
|
|
147e83 |
-#ifdef NO_LONG_DOUBLE
|
|
|
147e83 |
- strong_alias (__sqrt, __sqrtl) weak_alias (__sqrt, sqrtl)
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
|
|
|
147e83 |
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c
|
|
|
147e83 |
deleted file mode 100644
|
|
|
147e83 |
index 0e7e692..0000000
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/fpu/w_sqrtf.c
|
|
|
147e83 |
+++ /dev/null
|
|
|
147e83 |
@@ -1,53 +0,0 @@
|
|
|
147e83 |
-/* Single-precision floating point square root wrapper.
|
|
|
147e83 |
- Copyright (C) 2004, 2007, 2012 Free Software Foundation, Inc.
|
|
|
147e83 |
- This file is part of the GNU C Library.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
- License as published by the Free Software Foundation; either
|
|
|
147e83 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
-
|
|
|
147e83 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
- Lesser General Public License for more details.
|
|
|
147e83 |
-
|
|
|
147e83 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
- License along with the GNU C Library; if not, see
|
|
|
147e83 |
- <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
-
|
|
|
147e83 |
-#include <math.h>
|
|
|
147e83 |
-#include <math_private.h>
|
|
|
147e83 |
-#include <fenv_libc.h>
|
|
|
147e83 |
-
|
|
|
147e83 |
-#include <sysdep.h>
|
|
|
147e83 |
-#include <ldsodefs.h>
|
|
|
147e83 |
-
|
|
|
147e83 |
-float
|
|
|
147e83 |
-__sqrtf (float x) /* wrapper sqrtf */
|
|
|
147e83 |
-{
|
|
|
147e83 |
-#ifdef _IEEE_LIBM
|
|
|
147e83 |
- return __ieee754_sqrtf (x);
|
|
|
147e83 |
-#else
|
|
|
147e83 |
- float z;
|
|
|
147e83 |
-/* Power4 (ISA V2.0) and above implement sqrtf in hardware. */
|
|
|
147e83 |
- __asm __volatile (
|
|
|
147e83 |
- " fsqrts %0,%1\n"
|
|
|
147e83 |
- : "=f" (z)
|
|
|
147e83 |
- : "f" (x));
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (__builtin_expect (_LIB_VERSION == _IEEE_, 0))
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (__builtin_expect (x != x, 0))
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-
|
|
|
147e83 |
- if (__builtin_expect (x < 0.0, 0))
|
|
|
147e83 |
- /* sqrtf(negative) */
|
|
|
147e83 |
- return (float) __kernel_standard ((double) x, (double) x, 126);
|
|
|
147e83 |
- else
|
|
|
147e83 |
- return z;
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
-}
|
|
|
147e83 |
-
|
|
|
147e83 |
-weak_alias (__sqrtf, sqrtf)
|
|
|
147e83 |
--
|
|
|
147e83 |
1.8.3.1
|
|
|
147e83 |
|