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