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