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