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