Blame SOURCES/glibc-rh1240351-3.patch

147e83
    Backport of the following patches:
147e83
    
147e83
    commit 4393fc119c34e97519b9b7a4fc94066b283be452
147e83
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
    Date:   Thu Feb 27 09:45:41 2014 -0600
147e83
    
147e83
        PowerPC: Optimized isinf/isinff for POWER8
147e83
    
147e83
        This patch add a optimized isinf/isinff implementation for POWER8
147e83
        using the new Move From VSR Doubleword instruction to gains some
147e83
        cycles from FP to GRP register move.
147e83
    
147e83
        ChangeLog:
147e83
    	2014-02-27  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
147e83
    
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isinf power8
147e83
    	implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: New file:
147e83
    	POWER8 isinf ifunc implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinf): Add
147e83
    	POWER8 implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c (__isinff):
147e83
    	Likewise.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: New file:
147e83
    	POWER8 isinf implementation.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: New file.
147e83
    
147e83
    commit cac626d60a863e48ab75417064984769e58c5719
147e83
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
    Date:   Thu Feb 27 09:46:46 2014 -0600
147e83
    
147e83
        PowerPC: Optimized finite/finitef for POWER8
147e83
    
147e83
        This patch add a optimized finite/finitef implementation for POWER8
147e83
        using the new Move From VSR Doubleword instruction to gains some
147e83
        cycles from FP to GRP register move.
147e83
    
147e83
        ChangeLog:
147e83
    	2014-02-27  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
147e83
    
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add finite power8
147e83
    	implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: New file:
147e83
    	POWER8 finite ifunc implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finite): Add
147e83
    	POWER8 implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c (__finitef):
147e83
    	Likewise.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: New file:
147e83
    	POWER8 finite implementation.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: New file.
147e83
    
147e83
    commit 1ad8950a3ea4056ed343d681b5146f4b4aa27e10
147e83
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
    Date:   Tue Feb 18 09:29:29 2014 -0500
147e83
    
147e83
        PowerPC: llrint/llrintf POWER8 optimization
147e83
    
147e83
        This patch add a optimized llrint/llrintf implementation for POWER8
147e83
        using the new Move From VSR Doubleword instruction to gains some
147e83
        cycles from FP to GRP register move.
147e83
    
147e83
        ChangeLog:
147e83
    	2014-02-27  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
147e83
    
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llrint power8
147e83
    	implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: New file:
147e83
    	POWER8 llrint ifunc implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c (__lllrint): Add
147e83
    	POWER8 implementation.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: New file:
147e83
    	POWER8 llrint implementation.
147e83
    
147e83
    commit fe13a20c37578f08ce393ccaeb45caeb48815ca5
147e83
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
    Date:   Mon Feb 17 10:44:08 2014 -0600
147e83
    
147e83
        PowerPC: llround/llroundf POWER8 optimization
147e83
    
147e83
        This patch add a optimized llround/llroundf implementation for POWER8
147e83
        using the new Move From VSR Doubleword instruction to gains some
147e83
        cycles from FP to GRP register move.
147e83
    
147e83
        ChangeLog:
147e83
    	2014-02-27  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
147e83
    
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llround power8
147e83
    	implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: New file:
147e83
    	POWER8 llround ifunc implementation.
147e83
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c (__lllround): Add
147e83
    	POWER8 implementation.
147e83
    	* sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: New file:
147e83
    	POWER8 llround implementation.
147e83
    
147e83
    commit 757d9dd5c3efa56fac75965abc014faaae7b7895
147e83
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
    Date:   Mon Mar 31 08:00:38 2014 -0500
147e83
    
147e83
        PowerPC: Fix little endian enconding for mfvsrd
147e83
    
147e83
        This patch fixes the MFVSRD_R3_V1 macro that encodes 'mfvsrd  r3,vs1'
147e83
        (to support old binutils) for little endian.
147e83
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
147e83
index 4cd1c5d..3e2127b 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
147e83
@@ -4,7 +4,8 @@ sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
147e83
                   s_copysign-ppc64 s_finite-power7 s_finite-ppc64 \
147e83
                   s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \
147e83
                   s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \
147e83
-                  s_modff-power5+ s_modff-ppc64 s_isnan-power8
147e83
+                  s_modff-power5+ s_modff-ppc64 s_isnan-power8 \
147e83
+                  s_isinf-power8 s_finite-power8
147e83
 
147e83
 libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
147e83
                        s_isnan-power5 s_isnan-ppc64 s_llround-power6x \
147e83
@@ -22,7 +23,8 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
147e83
                        s_logbl-ppc64 s_modf-power5+ s_modf-ppc64 \
147e83
                        s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \
147e83
                        e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \
147e83
-                       s_isnan-power8
147e83
+                       s_isnan-power8 s_isinf-power8 s_finite-power8 \
147e83
+                       s_llrint-power8 s_llround-power8
147e83
 
147e83
 CFLAGS-s_logbf-power7.c = -mcpu=power7
147e83
 CFLAGS-s_logbl-power7.c = -mcpu=power7
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
147e83
new file mode 100644
147e83
index 0000000..3b9071f
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
147e83
@@ -0,0 +1,33 @@
147e83
+/* isnan().  PowerPC64/POWER7 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#undef hidden_def
147e83
+#define hidden_def(name)
147e83
+#undef weak_alias
147e83
+#define weak_alias(name, alias)
147e83
+#undef strong_alias
147e83
+#define strong_alias(name, alias)
147e83
+#undef compat_symbol
147e83
+#define compat_symbol(lib, name, symbol, ver)
147e83
+
147e83
+#define __finite __finite_power8
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S>
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
147e83
index f79a93e..b9e908d 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
147e83
@@ -23,10 +23,13 @@
147e83
 
147e83
 extern __typeof (__finite) __finite_ppc64 attribute_hidden;
147e83
 extern __typeof (__finite) __finite_power7 attribute_hidden;
147e83
+extern __typeof (__finite) __finite_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__finite,
147e83
-	    (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
-	    ? __finite_power7
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __finite_power8 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
+	      ? __finite_power7
147e83
             : __finite_ppc64);
147e83
 
147e83
 weak_alias (__finite, finite)
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
147e83
index a7243b5..30b34bc 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
147e83
@@ -23,10 +23,13 @@
147e83
 extern __typeof (__finitef) __finitef_ppc64 attribute_hidden;
147e83
 /* The double-precision version also works for single-precision.  */
147e83
 extern __typeof (__finitef) __finite_power7 attribute_hidden;
147e83
+extern __typeof (__finitef) __finite_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__finitef,
147e83
-	    (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
-	    ? __finite_power7
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __finite_power8 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
+	      ? __finite_power7
147e83
             : __finitef_ppc64);
147e83
 
147e83
 weak_alias (__finitef, finitef)
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
147e83
new file mode 100644
147e83
index 0000000..979816e
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
147e83
@@ -0,0 +1,33 @@
147e83
+/* isinf().  PowerPC64/POWER8 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#undef hidden_def
147e83
+#define hidden_def(name)
147e83
+#undef weak_alias
147e83
+#define weak_alias(name, alias)
147e83
+#undef strong_alias
147e83
+#define strong_alias(name, alias)
147e83
+#undef compat_symbol
147e83
+#define compat_symbol(lib, name, alias, ver)
147e83
+
147e83
+#define __isinf __isinf_power8
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S>
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
147e83
index 1ee230b..e349a06 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
147e83
@@ -23,10 +23,13 @@
147e83
 
147e83
 extern __typeof (__isinf) __isinf_ppc64 attribute_hidden;
147e83
 extern __typeof (__isinf) __isinf_power7 attribute_hidden;
147e83
+extern __typeof (__isinf) __isinf_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__isinf,
147e83
-	    (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
-	    ? __isinf_power7
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __isinf_power8 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
+	      ? __isinf_power7
147e83
             : __isinf_ppc64);
147e83
 
147e83
 weak_alias (__isinf, isinf)
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
147e83
index 1336feb..71da7a3 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
147e83
@@ -24,10 +24,13 @@
147e83
 extern __typeof (__isinff) __isinff_ppc64 attribute_hidden;
147e83
 /* The double-precision version also works for single-precision.  */
147e83
 extern __typeof (__isinff) __isinf_power7 attribute_hidden;
147e83
+extern __typeof (__isinff) __isinf_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__isinff,
147e83
-	    (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
-	    ? __isinf_power7
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __isinf_power8 :
147e83
+	      (hwcap & PPC_FEATURE_ARCH_2_06)
147e83
+	      ? __isinf_power7
147e83
             : __isinff_ppc64);
147e83
 
147e83
 weak_alias (__isinff, isinff)
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
147e83
new file mode 100644
147e83
index 0000000..3962b7d
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
147e83
@@ -0,0 +1,31 @@
147e83
+/* Round double to long int.  PowerPC64/POWER6X default version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#undef weak_alias
147e83
+#define weak_alias(a,b)
147e83
+#undef strong_alias
147e83
+#define strong_alias(a,b)
147e83
+#undef compat_symbol
147e83
+#define compat_symbol(a,b,c,d)
147e83
+
147e83
+#define __llrint __llrint_power8
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S>
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
147e83
index 5818b53..cf1b2e4 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
147e83
@@ -30,10 +30,13 @@
147e83
 
147e83
 extern __typeof (__llrint) __llrint_ppc64 attribute_hidden;
147e83
 extern __typeof (__llrint) __llrint_power6x attribute_hidden;
147e83
+extern __typeof (__llrint) __llrint_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__llrint,
147e83
-	    (hwcap & PPC_FEATURE_POWER6_EXT)
147e83
-	    ? __llrint_power6x
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __llrint_power8 :
147e83
+	      (hwcap & PPC_FEATURE_POWER6_EXT)
147e83
+	      ? __llrint_power6x
147e83
             : __llrint_ppc64);
147e83
 
147e83
 weak_alias (__llrint, llrint)
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
147e83
new file mode 100644
147e83
index 0000000..41c61a1
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
147e83
@@ -0,0 +1,31 @@
147e83
+/* llround().  PowerPC64 default version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#undef weak_alias
147e83
+#define weak_alias(name, alias)
147e83
+#undef strong_alias
147e83
+#define strong_alias(name, alias)
147e83
+#undef compat_symbol
147e83
+#define compat_symbol(lib, name, alias, ver)
147e83
+
147e83
+#define __llround __llround_power8
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S>
147e83
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
147e83
index a4d1bf3..7dba17e 100644
147e83
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
147e83
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
147e83
@@ -27,12 +27,15 @@
147e83
 extern __typeof (__llround) __llround_ppc64 attribute_hidden;
147e83
 extern __typeof (__llround) __llround_power5plus attribute_hidden;
147e83
 extern __typeof (__llround) __llround_power6x attribute_hidden;
147e83
+extern __typeof (__llround) __llround_power8 attribute_hidden;
147e83
 
147e83
 libc_ifunc (__llround,
147e83
-	    (hwcap & PPC_FEATURE_POWER6_EXT)
147e83
-	    ? __llround_power6x :
147e83
-	      (hwcap & PPC_FEATURE_POWER5_PLUS)
147e83
-	      ? __llround_power5plus
147e83
+	    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
147e83
+	    ? __llround_power8 :
147e83
+	      (hwcap & PPC_FEATURE_POWER6_EXT)
147e83
+	      ? __llround_power6x :
147e83
+		(hwcap & PPC_FEATURE_POWER5_PLUS)
147e83
+		? __llround_power5plus
147e83
             : __llround_ppc64);
147e83
 
147e83
 weak_alias (__llround, llround)
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
147e83
new file mode 100644
147e83
index 0000000..3e98126
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
147e83
@@ -0,0 +1,56 @@
147e83
+/* isfinite().  PowerPC64/POWER8 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
147e83
+
147e83
+/* int [r3] __finite ([fp1] x)  */
147e83
+
147e83
+EALIGN (__finite, 4, 0)
147e83
+	CALL_MCOUNT 0
147e83
+	MFVSRD_R3_V1
147e83
+	lis     r9,0x8010
147e83
+	clrldi  r3,r3,1       /* r3 = r3 & 0x8000000000000000  */
147e83
+	rldicr  r9,r9,32,31   /* r9 = (r9 << 32) & 0xffffffff  */
147e83
+	add     r3,r3,r9
147e83
+	rldicl  r3,r3,1,63
147e83
+	blr
147e83
+END (__finite)
147e83
+
147e83
+hidden_def (__finite)
147e83
+weak_alias (__finite, finite)
147e83
+
147e83
+/* It turns out that the 'double' version will also always work for
147e83
+   single-precision.  */
147e83
+strong_alias (__finite, __finitef)
147e83
+hidden_def (__finitef)
147e83
+weak_alias (__finitef, finitef)
147e83
+
147e83
+#ifdef IS_IN_libm
147e83
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
147e83
+compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
147e83
+compat_symbol (libm, finite, finitel, GLIBC_2_0)
147e83
+# endif
147e83
+#else
147e83
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
147e83
+compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
147e83
+compat_symbol (libc, finite, finitel, GLIBC_2_0);
147e83
+# endif
147e83
+#endif
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S
147e83
new file mode 100644
147e83
index 0000000..54bd941
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S
147e83
@@ -0,0 +1 @@
147e83
+/* This function uses the same code as s_finite.S.  */
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
147e83
new file mode 100644
147e83
index 0000000..125de39
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
147e83
@@ -0,0 +1,61 @@
147e83
+/* isinf().  PowerPC64/POWER8 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
147e83
+
147e83
+/* int [r3] __isinf([fp1] x)  */
147e83
+
147e83
+EALIGN (__isinf, 4, 0)
147e83
+	CALL_MCOUNT 0
147e83
+	MFVSRD_R3_V1
147e83
+	lis     r9,0x7ff0     /* r9 = 0x7ff0  */
147e83
+	rldicl  r10,r3,0,1    /* r10 = r3 & (0x8000000000000000)  */
147e83
+	sldi    r9,r9,32      /* r9 = r9 << 52  */
147e83
+	cmpd    cr7,r10,r9    /* fp1 & 0x7ff0000000000000 ?  */
147e83
+	beq     cr7,L(inf)
147e83
+	li      r3,0          /* Not inf  */
147e83
+	blr
147e83
+L(inf):
147e83
+	sradi   r3,r3,63      /* r3 = r3 >> 63  */
147e83
+	ori     r3,r3,1       /* r3 = r3 | 0x1  */
147e83
+	blr
147e83
+END (__isinf)
147e83
+
147e83
+hidden_def (__isinf)
147e83
+weak_alias (__isinf, isinf)
147e83
+
147e83
+/* It turns out that the 'double' version will also always work for
147e83
+   single-precision.  */
147e83
+strong_alias (__isinf, __isinff)
147e83
+hidden_def (__isinff)
147e83
+weak_alias (__isinff, isinff)
147e83
+
147e83
+#ifdef NO_LONG_DOUBLE
147e83
+strong_alias (__isinf, __isinfl)
147e83
+weak_alias (__isinf, isinfl)
147e83
+#endif
147e83
+
147e83
+#ifndef IS_IN_libm
147e83
+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
147e83
+compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
147e83
+compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
147e83
+# endif
147e83
+#endif
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S
147e83
new file mode 100644
147e83
index 0000000..be759e0
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S
147e83
@@ -0,0 +1 @@
147e83
+/* This function uses the same code as s_isinf.S.  */
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
147e83
index c1ca9a5..cb96d03 100644
147e83
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
147e83
@@ -19,8 +19,8 @@
147e83
 #include <sysdep.h>
147e83
 #include <math_ldbl_opt.h>
147e83
 
147e83
-#define MFVSRD_R3_V1  .byte 0x7c,0x23,0x00,0x66     /* mfvsrd  r3,vs1  */
147e83
-
147e83
+#define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
147e83
+        
147e83
 /* int [r3] __isnan([f1] x)  */
147e83
 
147e83
 EALIGN (__isnan, 4, 0)
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
147e83
new file mode 100644
147e83
index 0000000..ce48d4e
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
147e83
@@ -0,0 +1,45 @@
147e83
+/* Round double to long int.  POWER8 PowerPC64 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
147e83
+
147e83
+/* long long int[r3] __llrint (double x[fp1])  */
147e83
+ENTRY (__llrint)
147e83
+	CALL_MCOUNT 0
147e83
+	fctid	fp1,fp1
147e83
+	MFVSRD_R3_V1
147e83
+	blr
147e83
+END (__llrint)
147e83
+
147e83
+strong_alias (__llrint, __lrint)
147e83
+weak_alias (__llrint, llrint)
147e83
+weak_alias (__lrint, lrint)
147e83
+
147e83
+#ifdef NO_LONG_DOUBLE
147e83
+strong_alias (__llrint, __llrintl)
147e83
+weak_alias (__llrint, llrintl)
147e83
+strong_alias (__lrint, __lrintl)
147e83
+weak_alias (__lrint, lrintl)
147e83
+#endif
147e83
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
147e83
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
147e83
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
147e83
+#endif
147e83
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
147e83
new file mode 100644
147e83
index 0000000..2aea234
147e83
--- /dev/null
147e83
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
147e83
@@ -0,0 +1,47 @@
147e83
+/* llround function.  POWER8 PowerPC64 version.
147e83
+   Copyright (C) 2014 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 <sysdep.h>
147e83
+#include <math_ldbl_opt.h>
147e83
+
147e83
+#define MFVSRD_R3_V1  .long 0x7c230066     /* mfvsrd  r3,vs1  */
147e83
+
147e83
+/* long long [r3] llround (float x [fp1])  */
147e83
+
147e83
+ENTRY (__llround)
147e83
+	CALL_MCOUNT 0
147e83
+	frin	fp1,fp1	/* Round to nearest +-0.5.  */
147e83
+	fctidz	fp1,fp1	/* Convert To Integer DW round toward 0.  */
147e83
+	MFVSRD_R3_V1
147e83
+	blr
147e83
+END (__llround)
147e83
+
147e83
+strong_alias (__llround, __lround)
147e83
+weak_alias (__llround, llround)
147e83
+weak_alias (__lround, lround)
147e83
+
147e83
+#ifdef NO_LONG_DOUBLE
147e83
+weak_alias (__llround, llroundl)
147e83
+strong_alias (__llround, __llroundl)
147e83
+weak_alias (__lround, lroundl)
147e83
+strong_alias (__lround, __lroundl)
147e83
+#endif
147e83
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
147e83
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
147e83
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
147e83
+#endif