diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 7fe1060..d8ae668 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Mar 20 07:42:50 UTC 2014 - schwab@suse.de + +- Remove dependency on sysinit.target from nscd.service again (bnc#86422) + +------------------------------------------------------------------- +Wed Mar 19 14:39:55 UTC 2014 - schwab@suse.de + +- powerpc-opt-power8.patch: GLIBC Optimizations For POWER8 Hardware + (bnc#866711, fate#315443) + ------------------------------------------------------------------- Tue Mar 18 17:10:43 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 3658883..d2acd5d 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -97,6 +97,7 @@ BuildRequires: gd-devel # 3.0 is the SLES 11 SP3 kernel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 + Version: 2.19 Release: 0 %define glibc_major_version 2.19 @@ -237,6 +238,8 @@ Patch1001: sin-sign.patch Patch1002: pldd-wait-ptrace-stop.patch # PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) Patch1003: nscd-track-startup-failures.patch +# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware +Patch1004: powerpc-opt-power8.patch ### # Patches awaiting upstream approval @@ -445,6 +448,7 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 %patch3000 diff --git a/glibc-utils.changes b/glibc-utils.changes index 7fe1060..d8ae668 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Mar 20 07:42:50 UTC 2014 - schwab@suse.de + +- Remove dependency on sysinit.target from nscd.service again (bnc#86422) + +------------------------------------------------------------------- +Wed Mar 19 14:39:55 UTC 2014 - schwab@suse.de + +- powerpc-opt-power8.patch: GLIBC Optimizations For POWER8 Hardware + (bnc#866711, fate#315443) + ------------------------------------------------------------------- Tue Mar 18 17:10:43 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index dbd493b..1e6bc2b 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -96,6 +96,7 @@ BuildRequires: gd-devel # 3.0 is the SLES 11 SP3 kernel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 + Version: 2.19 Release: 0 %define glibc_major_version 2.19 @@ -236,6 +237,8 @@ Patch1001: sin-sign.patch Patch1002: pldd-wait-ptrace-stop.patch # PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) Patch1003: nscd-track-startup-failures.patch +# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware +Patch1004: powerpc-opt-power8.patch ### # Patches awaiting upstream approval @@ -445,6 +448,7 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 %patch3000 diff --git a/glibc.changes b/glibc.changes index 7fe1060..d8ae668 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Mar 20 07:42:50 UTC 2014 - schwab@suse.de + +- Remove dependency on sysinit.target from nscd.service again (bnc#86422) + +------------------------------------------------------------------- +Wed Mar 19 14:39:55 UTC 2014 - schwab@suse.de + +- powerpc-opt-power8.patch: GLIBC Optimizations For POWER8 Hardware + (bnc#866711, fate#315443) + ------------------------------------------------------------------- Tue Mar 18 17:10:43 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 8952fc0..0f1cf2f 100644 --- a/glibc.spec +++ b/glibc.spec @@ -97,6 +97,7 @@ BuildRequires: gd-devel # 3.0 is the SLES 11 SP3 kernel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 + Version: 2.19 Release: 0 %define glibc_major_version 2.19 @@ -237,6 +238,8 @@ Patch1001: sin-sign.patch Patch1002: pldd-wait-ptrace-stop.patch # PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) Patch1003: nscd-track-startup-failures.patch +# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware +Patch1004: powerpc-opt-power8.patch ### # Patches awaiting upstream approval @@ -445,6 +448,7 @@ rm nscd/s-stamp %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 %patch3000 diff --git a/nscd.service b/nscd.service index a49c287..bacc6e3 100644 --- a/nscd.service +++ b/nscd.service @@ -1,6 +1,5 @@ [Unit] Description=Name Service Cache Daemon -After=sysint.target [Service] Type=forking diff --git a/powerpc-opt-power8.patch b/powerpc-opt-power8.patch new file mode 100644 index 0000000..ce1af76 --- /dev/null +++ b/powerpc-opt-power8.patch @@ -0,0 +1,1916 @@ +2014-03-11 Vidya Ranganathan + + * sysdeps/powerpc/powerpc64/power7/strspn.S: New file: Optimization. + * sysdeps/powerpc/powerpc64/multiarch/strspn.c: New file: + multiarch strspn for PPC64. + * sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: New file + * sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S: New file + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: + (__libc_ifunc_impl_list): Likewise. + * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strspn + multiarch optimizations + * string/strspn.c (strspn): Using macro to redefine symbol name. + +2014-03-10 Vidya Ranganathan + Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/power7/strncat.S: New file: Optimization. + * sysdeps/powerpc/powerpc64/multiarch/strncat.c: New file: + multiarch strncat for PPC64. + * sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c: New file + * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S: New file + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: + (__libc_ifunc_impl_list): Likewise. + * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strncat + multiarch optimizations + +2014-03-03 Rajalakshmi Srinivasaraghavan + + * sysdeps/powerpc/powerpc64/power7/strrchr.S: New file. + * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strrchr multiarch + implementation. + * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: + (__libc_ifunc_impl_list): Likewise. + * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: New file. + * sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: New file. + * sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S: New file. + * string/strrchr.c: Define STRRCHR. + +2014-02-27 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llround power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: New file: + POWER8 llround ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c (__lllround): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: New file: + POWER8 llround implementation. + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llrint power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: New file: + POWER8 llrint ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c (__lllrint): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: New file: + POWER8 llrint implementation. + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add finite power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: New file: + POWER8 finite ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finite): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c (__finitef): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: New file: + POWER8 finite implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: New file. + + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isinf power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: New file: + POWER8 isinf ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinf): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c (__isinff): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: New file: + POWER8 isinf implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: New file. + + * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): + Add hwcap2 initialization. + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isnan power8 + implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: New file: + POWER8 isnan ifunc implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c (__isnan): Add + POWER8 implementation. + * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c (__isnanf): + Likewise. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: New file: + POWER8 isnan implementation. + * sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: New file. + +Index: glibc-2.19/string/strrchr.c +=================================================================== +--- glibc-2.19.orig/string/strrchr.c ++++ glibc-2.19/string/strrchr.c +@@ -19,9 +19,13 @@ + + #undef strrchr + ++#ifndef STRRCHR ++# define STRRCHR strrchr ++#endif ++ + /* Find the last occurrence of C in S. */ + char * +-strrchr (const char *s, int c) ++STRRCHR (const char *s, int c) + { + const char *found, *p; + +Index: glibc-2.19/string/strspn.c +=================================================================== +--- glibc-2.19.orig/string/strspn.c ++++ glibc-2.19/string/strspn.c +@@ -18,13 +18,14 @@ + #include + + #undef strspn ++#ifndef STRSPN ++#define STRSPN strspn ++#endif + + /* Return the length of the maximum initial segment + of S which contains only characters in ACCEPT. */ + size_t +-strspn (s, accept) +- const char *s; +- const char *accept; ++STRSPN (const char *s, const char *accept) + { + const char *p; + const char *a; +Index: glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h ++++ glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h +@@ -36,6 +36,7 @@ + and fills the previous ones. */ + #define INIT_ARCH() \ + unsigned long int hwcap = __GLRO(dl_hwcap); \ ++ unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \ + if (hwcap & PPC_FEATURE_ARCH_2_06) \ + hwcap |= PPC_FEATURE_ARCH_2_05 | \ + PPC_FEATURE_POWER5_PLUS | \ +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +@@ -4,7 +4,8 @@ sysdep_routines += s_isnan-power7 s_isna + s_copysign-ppc64 s_finite-power7 s_finite-ppc64 \ + s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \ + s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \ +- s_modff-power5+ s_modff-ppc64 ++ s_modff-power5+ s_modff-ppc64 s_isnan-power8 \ ++ s_isinf-power8 s_finite-power8 + + libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ + s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ +@@ -21,7 +22,9 @@ libm-sysdep_routines += s_isnan-power7 s + s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \ + s_logbl-ppc64 s_modf-power5+ s_modf-ppc64 \ + s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \ +- e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 ++ e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \ ++ s_isnan-power8 s_isinf-power8 s_finite-power8 \ ++ s_llrint-power8 s_llround-power8 + + CFLAGS-s_logbf-power7.c = -mcpu=power7 + CFLAGS-s_logbl-power7.c = -mcpu=power7 +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S +@@ -0,0 +1,33 @@ ++/* isnan(). PowerPC64/POWER7 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#undef hidden_def ++#define hidden_def(name) ++#undef weak_alias ++#define weak_alias(name, alias) ++#undef strong_alias ++#define strong_alias(name, alias) ++#undef compat_symbol ++#define compat_symbol(lib, name, symbol, ver) ++ ++#define __finite __finite_power8 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c +@@ -23,10 +23,13 @@ + + extern __typeof (__finite) __finite_ppc64 attribute_hidden; + extern __typeof (__finite) __finite_power7 attribute_hidden; ++extern __typeof (__finite) __finite_power8 attribute_hidden; + + libc_ifunc (__finite, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __finite_power7 ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __finite_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __finite_power7 + : __finite_ppc64); + + weak_alias (__finite, finite) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c +@@ -23,10 +23,13 @@ + extern __typeof (__finitef) __finitef_ppc64 attribute_hidden; + /* The double-precision version also works for single-precision. */ + extern __typeof (__finitef) __finite_power7 attribute_hidden; ++extern __typeof (__finitef) __finite_power8 attribute_hidden; + + libc_ifunc (__finitef, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __finite_power7 ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __finite_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __finite_power7 + : __finitef_ppc64); + + weak_alias (__finitef, finitef) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S +@@ -0,0 +1,33 @@ ++/* isinf(). PowerPC64/POWER8 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#undef hidden_def ++#define hidden_def(name) ++#undef weak_alias ++#define weak_alias(name, alias) ++#undef strong_alias ++#define strong_alias(name, alias) ++#undef compat_symbol ++#define compat_symbol(lib, name, alias, ver) ++ ++#define __isinf __isinf_power8 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c +@@ -23,10 +23,13 @@ + + extern __typeof (__isinf) __isinf_ppc64 attribute_hidden; + extern __typeof (__isinf) __isinf_power7 attribute_hidden; ++extern __typeof (__isinf) __isinf_power8 attribute_hidden; + + libc_ifunc (__isinf, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __isinf_power7 ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __isinf_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __isinf_power7 + : __isinf_ppc64); + + weak_alias (__isinf, isinf) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c +@@ -24,10 +24,13 @@ + extern __typeof (__isinff) __isinff_ppc64 attribute_hidden; + /* The double-precision version also works for single-precision. */ + extern __typeof (__isinff) __isinf_power7 attribute_hidden; ++extern __typeof (__isinff) __isinf_power8 attribute_hidden; + + libc_ifunc (__isinff, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __isinf_power7 ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __isinf_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __isinf_power7 + : __isinff_ppc64); + + weak_alias (__isinff, isinff) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S +@@ -0,0 +1,33 @@ ++/* isnan(). PowerPC64/POWER7 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#undef hidden_def ++#define hidden_def(name) ++#undef weak_alias ++#define weak_alias(name, alias) ++#undef strong_alias ++#define strong_alias(name, alias) ++#undef compat_symbol ++#define compat_symbol(lib, name, symbol, ver) ++ ++#define __isnan __isnan_power8 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c +@@ -26,16 +26,19 @@ extern __typeof (__isnan) __isnan_power5 + extern __typeof (__isnan) __isnan_power6 attribute_hidden; + extern __typeof (__isnan) __isnan_power6x attribute_hidden; + extern __typeof (__isnan) __isnan_power7 attribute_hidden; ++extern __typeof (__isnan) __isnan_power8 attribute_hidden; + + libc_ifunc (__isnan, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __isnan_power7 : +- (hwcap & PPC_FEATURE_POWER6_EXT) ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __isnan_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __isnan_power7 : ++ (hwcap & PPC_FEATURE_POWER6_EXT) + ? __isnan_power6x : +- (hwcap & PPC_FEATURE_ARCH_2_05) +- ? __isnan_power6 : +- (hwcap & PPC_FEATURE_POWER5) +- ? __isnan_power5 ++ (hwcap & PPC_FEATURE_ARCH_2_05) ++ ? __isnan_power6 : ++ (hwcap & PPC_FEATURE_POWER5) ++ ? __isnan_power5 + : __isnan_ppc64); + + weak_alias (__isnan, isnan) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c +@@ -25,16 +25,19 @@ extern __typeof (__isnanf) __isnan_power + extern __typeof (__isnanf) __isnan_power6 attribute_hidden; + extern __typeof (__isnanf) __isnan_power6x attribute_hidden; + extern __typeof (__isnanf) __isnan_power7 attribute_hidden; ++extern __typeof (__isnanf) __isnan_power8 attribute_hidden; + + libc_ifunc (__isnanf, +- (hwcap & PPC_FEATURE_ARCH_2_06) +- ? __isnan_power7 : +- (hwcap & PPC_FEATURE_POWER6_EXT) +- ? __isnan_power6x : +- (hwcap & PPC_FEATURE_ARCH_2_05) +- ? __isnan_power6 : +- (hwcap & PPC_FEATURE_POWER5) +- ? __isnan_power5 ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __isnan_power8 : ++ (hwcap & PPC_FEATURE_ARCH_2_06) ++ ? __isnan_power7 : ++ (hwcap & PPC_FEATURE_POWER6_EXT) ++ ? __isnan_power6x : ++ (hwcap & PPC_FEATURE_ARCH_2_05) ++ ? __isnan_power6 : ++ (hwcap & PPC_FEATURE_POWER5) ++ ? __isnan_power5 + : __isnan_ppc64); + + weak_alias (__isnanf, isnanf) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S +@@ -0,0 +1,31 @@ ++/* Round double to long int. PowerPC64/POWER6X default version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#undef weak_alias ++#define weak_alias(a,b) ++#undef strong_alias ++#define strong_alias(a,b) ++#undef compat_symbol ++#define compat_symbol(a,b,c,d) ++ ++#define __llrint __llrint_power8 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c +@@ -30,10 +30,13 @@ + + extern __typeof (__llrint) __llrint_ppc64 attribute_hidden; + extern __typeof (__llrint) __llrint_power6x attribute_hidden; ++extern __typeof (__llrint) __llrint_power8 attribute_hidden; + + libc_ifunc (__llrint, +- (hwcap & PPC_FEATURE_POWER6_EXT) +- ? __llrint_power6x ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __llrint_power8 : ++ (hwcap & PPC_FEATURE_POWER6_EXT) ++ ? __llrint_power6x + : __llrint_ppc64); + + weak_alias (__llrint, llrint) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S +@@ -0,0 +1,31 @@ ++/* llround(). PowerPC64 default version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#undef weak_alias ++#define weak_alias(name, alias) ++#undef strong_alias ++#define strong_alias(name, alias) ++#undef compat_symbol ++#define compat_symbol(lib, name, alias, ver) ++ ++#define __llround __llround_power8 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c +@@ -27,12 +27,15 @@ + extern __typeof (__llround) __llround_ppc64 attribute_hidden; + extern __typeof (__llround) __llround_power5plus attribute_hidden; + extern __typeof (__llround) __llround_power6x attribute_hidden; ++extern __typeof (__llround) __llround_power8 attribute_hidden; + + libc_ifunc (__llround, +- (hwcap & PPC_FEATURE_POWER6_EXT) +- ? __llround_power6x : +- (hwcap & PPC_FEATURE_POWER5_PLUS) +- ? __llround_power5plus ++ (hwcap2 & PPC_FEATURE2_ARCH_2_07) ++ ? __llround_power8 : ++ (hwcap & PPC_FEATURE_POWER6_EXT) ++ ? __llround_power6x : ++ (hwcap & PPC_FEATURE_POWER5_PLUS) ++ ? __llround_power5plus + : __llround_ppc64); + + weak_alias (__llround, llround) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/Makefile +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/multiarch/Makefile ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/Makefile +@@ -13,7 +13,9 @@ sysdep_routines += memcpy-power7 memcpy- + wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \ + wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \ + wordcopy-power7 wordcopy-power6 wordcopy-ppc64 \ +- strcpy-power7 strcpy-ppc64 stpcpy-power7 stpcpy-ppc64 ++ strcpy-power7 strcpy-ppc64 stpcpy-power7 stpcpy-ppc64 \ ++ strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \ ++ strspn-power7 strspn-ppc64 + + CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops + CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +@@ -238,5 +238,29 @@ __libc_ifunc_impl_list (const char *name + IFUNC_IMPL_ADD (array, i, wcscpy, 1, + __wcscpy_ppc)) + ++ /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */ ++ IFUNC_IMPL (i, name, strrchr, ++ IFUNC_IMPL_ADD (array, i, strrchr, ++ hwcap & PPC_FEATURE_HAS_VSX, ++ __strrchr_power7) ++ IFUNC_IMPL_ADD (array, i, strrchr, 1, ++ __strrchr_ppc)) ++ ++ /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */ ++ IFUNC_IMPL (i, name, strncat, ++ IFUNC_IMPL_ADD (array, i, strncat, ++ hwcap & PPC_FEATURE_HAS_VSX, ++ __strncat_power7) ++ IFUNC_IMPL_ADD (array, i, strncat, 1, ++ __strncat_ppc)) ++ ++ /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */ ++ IFUNC_IMPL (i, name, strspn, ++ IFUNC_IMPL_ADD (array, i, strspn, ++ hwcap & PPC_FEATURE_HAS_VSX, ++ __strspn_power7) ++ IFUNC_IMPL_ADD (array, i, strspn, 1, ++ __strspn_ppc)) ++ + return i; + } +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S +@@ -0,0 +1,42 @@ ++/* Optimized strncat implementation for POWER7. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#undef EALIGN ++#define EALIGN(name, alignt, words) \ ++ .section ".text"; \ ++ ENTRY_2(__strncat_power7) \ ++ .align ALIGNARG(alignt); \ ++ EALIGN_W_##words; \ ++ BODY_LABEL(__strncat_power7): \ ++ cfi_startproc; \ ++ LOCALENTRY(__strncat_power7) ++ ++#undef END ++#define END(name) \ ++ cfi_endproc; \ ++ TRACEBACK(__strncat_power7) \ ++ END_2(__strncat_power7) ++ ++#undef libc_hidden_builtin_def ++#define libc_hidden_builtin_def(name) ++ ++#define STRLEN __strlen_power7 ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c +@@ -0,0 +1,29 @@ ++/* Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#define STRNCAT __strncat_ppc ++#ifdef SHARED ++# undef libc_hidden_builtin_def ++# define libc_hidden_builtin_def(name) \ ++ __hidden_ver1 (__strncat_ppc, __GI_strncat, __strncat_ppc); ++#endif ++ ++extern __typeof (strncat) __strncat_ppc attribute_hidden; ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat.c +@@ -0,0 +1,31 @@ ++/* Multiple versions of strncat. PowerPC64 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#ifndef NOT_IN_libc ++# include ++# include ++# include "init-arch.h" ++ ++extern __typeof (strncat) __strncat_ppc attribute_hidden; ++extern __typeof (strncat) __strncat_power7 attribute_hidden; ++ ++libc_ifunc (strncat, ++ (hwcap & PPC_FEATURE_HAS_VSX) ++ ? __strncat_power7 ++ : __strncat_ppc); ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S +@@ -0,0 +1,39 @@ ++/* Optimized strrchr implementation for POWER7. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#undef ENTRY ++#define ENTRY(name) \ ++ .section ".text"; \ ++ ENTRY_2(__strrchr_power7) \ ++ .align ALIGNARG(2); \ ++ BODY_LABEL(__strrchr_power7): \ ++ cfi_startproc; \ ++ LOCALENTRY(__strrchr_power7) ++ ++#undef END ++#define END(name) \ ++ cfi_endproc; \ ++ TRACEBACK(__strrchr_power7) \ ++ END_2(__strrchr_power7) ++ ++#undef libc_hidden_builtin_def ++#define libc_hidden_builtin_def(name) ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#define STRRCHR __strrchr_ppc ++#undef weak_alias ++#define weak_alias(name, aliasname) \ ++ extern __typeof (__strrchr_ppc) aliasname \ ++ __attribute__ ((weak, alias ("__strrchr_ppc"))); ++#if !defined(NOT_IN_libc) && defined(SHARED) ++# undef libc_hidden_builtin_def ++# define libc_hidden_builtin_def(name) \ ++ __hidden_ver1(__strrchr_ppc, __GI_strrchr, __strrchr_ppc); ++#endif ++ ++extern __typeof (strrchr) __strrchr_ppc attribute_hidden; ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr.c +@@ -0,0 +1,35 @@ ++/* Multiple versions of strrchr. PowerPC64 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++/* Define multiple versions only for definition in libc. */ ++#ifndef NOT_IN_libc ++# include ++# include ++# include "init-arch.h" ++ ++extern __typeof (strrchr) __strrchr_ppc attribute_hidden; ++extern __typeof (strrchr) __strrchr_power7 attribute_hidden; ++ ++/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ++ ifunc symbol properly. */ ++libc_ifunc (strrchr, ++ (hwcap & PPC_FEATURE_HAS_VSX) ++ ? __strrchr_power7 ++ : __strrchr_ppc); ++weak_alias (strrchr, rindex) ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S +@@ -0,0 +1,40 @@ ++/* Optimized strspn implementation for POWER7. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#undef EALIGN ++#define EALIGN(name, alignt, words) \ ++ .section ".text"; \ ++ ENTRY_2(__strspn_power7) \ ++ .align ALIGNARG(alignt); \ ++ EALIGN_W_##words; \ ++ BODY_LABEL(__strspn_power7): \ ++ cfi_startproc; \ ++ LOCALENTRY(__strspn_power7) ++ ++#undef END ++#define END(name) \ ++ cfi_endproc; \ ++ TRACEBACK(__strspn_power7) \ ++ END_2(__strspn_power7) ++ ++#undef libc_hidden_builtin_def ++#define libc_hidden_builtin_def(name) ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++#define STRSPN __strspn_ppc ++#undef weak_alias ++#define weak_alias(name, aliasname) \ ++ extern __typeof (__strspn_ppc) aliasname \ ++ __attribute__ ((weak, alias ("__strspn_ppc"))); ++#if !defined(NOT_IN_libc) && defined(SHARED) ++# undef libc_hidden_builtin_def ++# define libc_hidden_builtin_def(name) \ ++ __hidden_ver1(__strspn_ppc, __GI_strspn, __strspn_ppc); ++#endif ++ ++extern __typeof (strspn) __strspn_ppc attribute_hidden; ++ ++#include +Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn.c +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn.c +@@ -0,0 +1,31 @@ ++/* Multiple versions of strspn. PowerPC64 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#if defined SHARED && !defined NOT_IN_libc ++# include ++# include ++# include "init-arch.h" ++ ++extern __typeof (strspn) __strspn_ppc attribute_hidden; ++extern __typeof (strspn) __strspn_power7 attribute_hidden; ++ ++libc_ifunc (strspn, ++ (hwcap & PPC_FEATURE_HAS_VSX) ++ ? __strspn_power7 ++ : __strspn_ppc); ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strncat.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strncat.S +@@ -0,0 +1,222 @@ ++/* Optimized strncat implementation for PowerPC64/POWER7. ++ ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++/* The algorithm is as follows for aligned memory access : ++ ++ if address of s2 is divisible by 0x7UL, ++ perform aligned doubleword catenation ++ else ++ perform unaligned catenation ++ ++ The aligned comparison are made using cmpb instructions. */ ++ ++/* char* [r3] strncat (const char *s1 [r3], ++ const char *s2 [r4], ++ size_t size [r5]) */ ++ ++#include ++ ++#ifndef STRNCAT ++# undef strncat ++# define STRNCAT strncat ++#endif ++ ++#ifndef STRLEN ++# define STRLEN __strlen_ppc ++#endif ++ ++#define FRAMESIZE (FRAME_MIN_SIZE+32) ++ ++ .machine power7 ++EALIGN(STRNCAT, 4, 0) ++ CALL_MCOUNT 3 ++ ++ mflr r0 /* Load link register LR to r0. */ ++ ++/* We shall use r29, r30 and r31 non volatile register for retention. ++ Save all the callee registers in the GPR save area. */ ++ std r29, -24(r1) /* Save callers register r29. */ ++ std r30, -16(r1) /* Save callers register r30. */ ++ std r31, -8(r1) /* Save callers register r31. */ ++ ++ std r0, 16(r1) /* Store the link register. */ ++ stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */ ++ ++/* Improve performance with CPU pre-fetch. */ ++ dcbt 0, r3 /* Pre-fetch str to avoid cache ++ miss. */ ++ dcbt 0, r4 /* Pre-fetch accept to avoid cache ++ miss. */ ++ ++ mr. r29, r5 /* Save "n" in r29. */ ++ mr r30, r3 /* Save "s1" in r30 from r3. */ ++ beq cr0,L(done) ++ ++ mr r31, r4 /* Save "s2" in r31 from r4. */ ++ bl STRLEN /* Call optimized strlen on s1; goto ++ end of s1. */ ++ nop ++ cmpldi cr7, r29, 7 /* If s2 is <=7 process ++ byte-by-byte. */ ++ add r3, r30, r3 /* Grab the last character of s1. */ ++ bgt cr7,L(alignment) /* Process by aligned strings. */ ++ ++ cmpldi cr7, r29, 3 /* If n is >= 4, we can ++ byte-unroll. */ ++ addi r9, r3, -1 /* Make "s1" point before next ++ character, increment when read. */ ++ bgt cr7, L(bytes_unroll) /* Process each byte. */ ++ ++L(byte_by_byte): ++ lbz r10, 0(r31) ++ addi r8, r9, 1 ++ cmpdi cr7, r10, 0 /* Check for NULL in "s2". */ ++ stb r10, 1(r9) ++ beq cr7, L(done) ++ add r9, r9, r29 ++ subf r9, r8, r9 ++ addi r9, r9, 1 ++ mtctr r9 ++ b L(branch2) ++ .p2align 4 ++L(branch1): ++ lbzu r10, 1(r31) ++ cmpdi cr7, r10, 0 ++ stbu r10, 1(r8) ++ beq cr7,L(done) ++L(branch2): ++ mr r9, r8 ++ bdnz L(branch1) ++ beq cr7,L(done) ++L(nullTerminate): ++ li r10, 0 /* Load NULL for termination. */ ++ stb r10, 1(r9) /* Append or terminate s1 with ++ NULL. */ ++ .p2align 4 /* A small section here. */ ++L(done): /* We return now. */ ++ addi r1, r1, FRAMESIZE /* Restore stack pointer. */ ++ mr r3, r30 /* Set the return value length of ++ string. */ ++ ld r0, 16(r1) /* Read the saved link register. */ ++ ld r29, -24(r1) /* Restore save register r29. */ ++ ld r30, -16(r1) /* Restore save register r30. */ ++ ld r31, -8(r1) /* Restore save register r31. */ ++ mtlr r0 /* Restore link register. */ ++ blr /* Branch to link register. */ ++ ++ .p2align 4 ++L(alignment): ++ rldicl. r9, r31, 0, 61 /* Check if s2 is 8byte aligned */ ++ beq cr0,L(dwordAligned) ++ ++ .p2align 4 ++/* Unaligned bytes in string, so process byte by byte. ++ POWER7 has performance gains over loop unroll. */ ++L(bytes_unroll): ++ addi r9, r3, -1 ++ srdi r10, r29, 2 ++ mtctr r10 ++ b L(L10) ++ .p2align 4 ++L(L44): ++ lbz r10, 1(r31) /* Load byte. */ ++ cmpdi cr7, r10, 0 /* Compare ; if byte not zero, ++ continue. */ ++ stb r10, 2(r9) /* Store byte */ ++ beq cr7, L(done) ++ addi r31, r31, 4 ++ ++ lbz r10, -2(r31) /* Perform loop unroll here on byte ++ load and store. */ ++ cmpdi cr7, r10, 0 ++ stb r10, 3(r9) ++ beq cr7, L(done) ++ ++ lbz r10, -1(r31) /* Loop unroll here. */ ++ cmpdi cr7, r10, 0 ++ stbu r10, 4(r9) ++ beq cr7, L(done) ++ ++ bdz L(leftNbytes) ++ ++L(L10): ++ lbz r10, 0(r31) /* Loop unroll here. */ ++ cmpdi cr7, r10, 0 ++ stb r10, 1(r9) ++ bne cr7,L(L44) ++ b L(done) ++ .p2align 4 ++/* If s2 is double word aligned, we load and store double word. */ ++L(dwordAligned): ++/* read, write 8 bytes at a time */ ++ srdi r8, r29, 3 /* Compute count for CTR to loop; ++ count = n/8. */ ++ li r7, 0 /* Load r7 with NULL. */ ++ li r10, 0 /* Load r10 with MASK '0'. */ ++ ++ mtctr r8 /* Move count to CTR. */ ++L(loop8): ++ ld r9, 0(r31) /* Read double word from s2. */ ++ cmpb r6, r9, r10 /* Compare bytes in s2 we read ++ just now. */ ++ cmpdi r6, 0 /* If cmpb returned NULL, ++ we continue. */ ++ bne+ L(a8) ++ std r9, 0(r3) /* Append double word from s2 ++ with s1. */ ++ addi r3, r3, 8 /* Increment s1. */ ++ addi r31, r31, 8 /* Increment s2. */ ++ subi r29, r29, 8 /* Decrement count by 8. */ ++ bdnz L(loop8) /* Continue until "count" is ++ non zero. */ ++ ++L(a8): ++ cmpdi r29, 0 /* If "n" is already zero, we skip. */ ++ beq+ L(align8align) ++ ++ mtctr r29 /* Process left over bytes in "n". */ ++L(unaligned0): ++ lbz r9, 0(r31) /* Read a byte from s2. */ ++ cmpw r9, r7 /* If byte is NULL, we stop here . */ ++ beq+ L(align8align) /* Skip processing further if NULL. */ ++ stb r9, 0(r3) /* If not NULL, store byte into s1. */ ++ addi r3, r3, 1 /* Increment s1 by 1. */ ++ addi r31, r31, 1 /* Increment s2 by 1. */ ++ bdnz L(unaligned0) /* Decrement counter "n" and loop ++ until non zero. */ ++L(align8align): ++ stb r7, 0(r3) /* Terminate s1 with NULL. */ ++ ++ addi r1, r1, FRAMESIZE /* Restore stack pointer. */ ++ mr r3, r30 /* Set the return value, length of ++ string. */ ++ ld r0, 16(r1) /* Read the saved link register. */ ++ ld r29, -24(r1) /* Restore save register r29. */ ++ ld r30, -16(r1) /* Restore save register r30. */ ++ ld r31, -8(r1) /* Restore save register r31. */ ++ mtlr r0 /* Restore link register. */ ++ blr /* Branch to link register */ ++ ++ .p2align 4 ++L(leftNbytes): ++ rldicl. r29, r29, 0, 62 /* Check if n>0 and n < 4 bytes. */ ++ bne cr0,L(byte_by_byte) /* Process bytes one by one. */ ++ b L(nullTerminate) /* Now, finish catenation with ++ NULL termination. */ ++END(STRNCAT) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strrchr.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strrchr.S +@@ -0,0 +1,255 @@ ++/* Optimized strrchr implementation for PowerPC64/POWER7 using cmpb insn. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++/* int [r3] strrchr (char *s [r3], int c [r4]) */ ++ .machine power7 ++ENTRY (strrchr) ++ CALL_MCOUNT 2 ++ dcbt 0,r3 ++ clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ ++ cmpdi cr7,r4,0 ++ ld r12,0(r8) /* Load doubleword from memory. */ ++ li r9,0 /* used to store last occurence */ ++ li r0,0 /* Doubleword with null chars to use ++ with cmpb. */ ++ ++ rlwinm r6,r3,3,26,28 /* Calculate padding. */ ++ ++ beq cr7,L(null_match) ++ ++ /* Replicate byte to doubleword. */ ++ insrdi r4,r4,8,48 ++ insrdi r4,r4,16,32 ++ insrdi r4,r4,32,0 ++ ++ /* r4 is changed now ,if its passed as more chars ++ check for null again */ ++ cmpdi cr7,r4,0 ++ beq cr7,L(null_match) ++ /* Now r4 has a doubleword of c bytes and r0 has ++ a doubleword of null bytes. */ ++ ++ cmpb r10,r12,r4 /* Compare each byte against c byte. */ ++ cmpb r11,r12,r0 /* Compare each byte against null byte. */ ++ ++ /* Move the doublewords left and right to discard the bits that are ++ not part of the string and bring them back as zeros. */ ++#ifdef __LITTLE_ENDIAN__ ++ srd r10,r10,r6 ++ srd r11,r11,r6 ++ sld r10,r10,r6 ++ sld r11,r11,r6 ++#else ++ sld r10,r10,r6 ++ sld r11,r11,r6 ++ srd r10,r10,r6 ++ srd r11,r11,r6 ++#endif ++ or r5,r10,r11 /* OR the results to speed things up. */ ++ cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes ++ have been found. */ ++ bne cr7,L(done) ++ ++L(align): ++ mtcrf 0x01,r8 ++ ++ /* Are we now aligned to a doubleword boundary? If so, skip to ++ the main loop. Otherwise, go through the alignment code. */ ++ ++ bt 28,L(loop) ++ ++ /* Handle WORD2 of pair. */ ++ ldu r12,8(r8) ++ cmpb r10,r12,r4 ++ cmpb r11,r12,r0 ++ or r5,r10,r11 ++ cmpdi cr7,r5,0 ++ bne cr7,L(done) ++ b L(loop) /* We branch here (rather than falling through) ++ to skip the nops due to heavy alignment ++ of the loop below. */ ++ .p2align 5 ++L(loop): ++ /* Load two doublewords, compare and merge in a ++ single register for speed. This is an attempt ++ to speed up the null-checking process for bigger strings. */ ++ ld r12,8(r8) ++ ldu r7,16(r8) ++ cmpb r10,r12,r4 ++ cmpb r11,r12,r0 ++ cmpb r6,r7,r4 ++ cmpb r7,r7,r0 ++ or r12,r10,r11 ++ or r5,r6,r7 ++ or r5,r12,r5 ++ cmpdi cr7,r5,0 ++ beq cr7,L(loop) ++ ++ /* OK, one (or both) of the doublewords contains a c/null byte. Check ++ the first doubleword and decrement the address in case the first ++ doubleword really contains a c/null byte. */ ++ cmpdi cr6,r12,0 ++ addi r8,r8,-8 ++ bne cr6,L(done) ++ ++ /* The c/null byte must be in the second doubleword. Adjust the ++ address again and move the result of cmpb to r10 so we can calculate ++ the pointer. */ ++ ++ mr r10,r6 ++ mr r11,r7 ++ addi r8,r8,8 ++ ++ /* r10/r11 have the output of the cmpb instructions, that is, ++ 0xff in the same position as the c/null byte in the original ++ doubleword from the string. Use that to calculate the pointer. */ ++ ++L(done): ++ /* if there are more than one 0xff in r11, find the first pos of ff ++ in r11 and fill r10 with 0 from that position */ ++ cmpdi cr7,r11,0 ++ beq cr7,L(no_null) ++#ifdef __LITTLE_ENDIAN__ ++ addi r3,r11,-1 ++ andc r3,r3,r11 ++ popcntd r0,r3 ++#else ++ cntlzd r0,r11 ++#endif ++ subfic r0,r0,63 ++ li r6,-1 ++#ifdef __LITTLE_ENDIAN__ ++ srd r0,r6,r0 ++#else ++ sld r0,r6,r0 ++#endif ++ and r10,r0,r10 ++L(no_null): ++#ifdef __LITTLE_ENDIAN__ ++ cntlzd r0,r10 /* Count leading zeros before c matches. */ ++ addi r3,r10,-1 ++ andc r3,r3,r10 ++ addi r10,r11,-1 ++ andc r10,r10,r11 ++ cmpld cr7,r3,r10 ++ bgt cr7,L(no_match) ++#else ++ addi r3,r10,-1 /* Count trailing zeros before c matches. */ ++ andc r3,r3,r10 ++ popcntd r0,r3 ++ cmpld cr7,r11,r10 ++ bgt cr7,L(no_match) ++#endif ++ srdi r0,r0,3 /* Convert trailing zeros to bytes. */ ++ subfic r0,r0,7 ++ add r9,r8,r0 /* Return address of the matching c byte ++ or null in case c was not found. */ ++ li r0,0 ++ cmpdi cr7,r11,0 /* If r11 == 0, no null's have been found. */ ++ beq cr7,L(align) ++ ++ .align 4 ++L(no_match): ++ mr r3,r9 ++ blr ++ ++/* We are here because strrchr was called with a null byte. */ ++ .align 4 ++L(null_match): ++ /* r0 has a doubleword of null bytes. */ ++ ++ cmpb r5,r12,r0 /* Compare each byte against null bytes. */ ++ ++ /* Move the doublewords left and right to discard the bits that are ++ not part of the string and bring them back as zeros. */ ++#ifdef __LITTLE_ENDIAN__ ++ srd r5,r5,r6 ++ sld r5,r5,r6 ++#else ++ sld r5,r5,r6 ++ srd r5,r5,r6 ++#endif ++ cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes ++ have been found. */ ++ bne cr7,L(done_null) ++ ++ mtcrf 0x01,r8 ++ ++ /* Are we now aligned to a quadword boundary? If so, skip to ++ the main loop. Otherwise, go through the alignment code. */ ++ ++ bt 28,L(loop_null) ++ ++ /* Handle WORD2 of pair. */ ++ ldu r12,8(r8) ++ cmpb r5,r12,r0 ++ cmpdi cr7,r5,0 ++ bne cr7,L(done_null) ++ b L(loop_null) /* We branch here (rather than falling through) ++ to skip the nops due to heavy alignment ++ of the loop below. */ ++ ++ /* Main loop to look for the end of the string. Since it's a ++ small loop (< 8 instructions), align it to 32-bytes. */ ++ .p2align 5 ++L(loop_null): ++ /* Load two doublewords, compare and merge in a ++ single register for speed. This is an attempt ++ to speed up the null-checking process for bigger strings. */ ++ ld r12,8(r8) ++ ldu r11,16(r8) ++ cmpb r5,r12,r0 ++ cmpb r10,r11,r0 ++ or r6,r5,r10 ++ cmpdi cr7,r6,0 ++ beq cr7,L(loop_null) ++ ++ /* OK, one (or both) of the doublewords contains a null byte. Check ++ the first doubleword and decrement the address in case the first ++ doubleword really contains a null byte. */ ++ ++ cmpdi cr6,r5,0 ++ addi r8,r8,-8 ++ bne cr6,L(done_null) ++ ++ /* The null byte must be in the second doubleword. Adjust the address ++ again and move the result of cmpb to r10 so we can calculate the ++ pointer. */ ++ ++ mr r5,r10 ++ addi r8,r8,8 ++ ++ /* r5 has the output of the cmpb instruction, that is, it contains ++ 0xff in the same position as the null byte in the original ++ doubleword from the string. Use that to calculate the pointer. */ ++L(done_null): ++#ifdef __LITTLE_ENDIAN__ ++ addi r0,r5,-1 ++ andc r0,r0,r5 ++ popcntd r0,r0 ++#else ++ cntlzd r0,r5 /* Count leading zeros before the match. */ ++#endif ++ srdi r0,r0,3 /* Convert trailing zeros to bytes. */ ++ add r3,r8,r0 /* Return address of the matching null byte. */ ++ blr ++END (strrchr) ++weak_alias (strrchr, rindex) ++libc_hidden_builtin_def (strrchr) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strspn.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strspn.S +@@ -0,0 +1,165 @@ ++/* Optimized strspn implementation for PowerPC64/POWER7. ++ ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++/* size_t [r3] strspn (const char *string [r3], ++ const char *needleAccept [r4] */ ++ ++/* Performance gains are grabbed through following techniques: ++ ++ > hashing of needle. ++ > hashing avoids scanning of duplicate entries in needle ++ across the string. ++ > initializing the hash table with Vector instructions ++ by quadword access. ++ > unrolling when scanning for character in string ++ across hash table. */ ++ ++/* Algorithm is as below: ++ 1. A empty hash table/dictionary is created comprising of ++ 256 ascii character set ++ 2. When hash entry is found in needle , the hash index ++ is initialized to 1 ++ 3. The string is scanned until end and for every character, ++ its corresponding hash index is compared. ++ 4. initial length of string (count) until first hit of ++ accept needle to be found is set to 0 ++ 4. If hash index is set to 1 for the index of string, ++ count is returned. ++ 5. Otherwise count is incremented and scanning continues ++ until end of string. */ ++ ++#include ++ ++#undef strspn ++ ++ .machine power7 ++EALIGN(strspn, 4, 0) ++ CALL_MCOUNT 2 ++ ++ lbz r10, 0(r4) /* load r10 with needle (r4) */ ++ addi r9, r1, -256 /* r9 is a hash of 256 bytes */ ++ ++ li r5, 16 /* set r5 = 16 as offset */ ++ li r6, 32 /* set r6 = 32 as offset */ ++ li r8, 48 /* set r8 = 48 as offset */ ++ ++/*Iniatliaze hash table with Zeroes in double indexed quadword accesses */ ++ xxlxor v0, v0, v0 /* prepare for initializing hash */ ++ ++ stxvd2x v0, r0, r9 /* initialize 1st quadword */ ++ stxvd2x v0, r9, r5 ++ stxvd2x v0, r9, r6 ++ stxvd2x v0, r9, r8 /* initialize 4th quadword */ ++ ++ addi r11, r9, 64 /* r11 is index to hash */ ++ ++ stxvd2x v0, r0, r11 /* initialize 5th quadword */ ++ stxvd2x v0, r11, r5 ++ stxvd2x v0, r11, r6 ++ stxvd2x v0, r11, r8 /* initialize 8th quadword */ ++ ++ addi r11, r9, 128 /* r11 is index to hash */ ++ ++ stxvd2x v0, r0, r11 /* initialize 9th quadword */ ++ stxvd2x v0, r11, r5 ++ stxvd2x v0, r11, r6 ++ stxvd2x v0, r11, r8 /* initialize 12th quadword */ ++ ++ addi r11, r9, 192 /* r11 is index to hash */ ++ ++ stxvd2x v0, r0, r11 /* initialize 13th quadword */ ++ stxvd2x v0, r11, r5 ++ stxvd2x v0, r11, r6 ++ stxvd2x v0, r11, r8 /* initialize 16th quadword */ ++ ++ li r8, 1 /* r8=1, marker into hash if found in ++ needle */ ++ ++ cmpdi cr7, r10, 0 /* accept needle is NULL */ ++ beq cr7, L(skipHashing) /* if needle is NULL, skip hashing */ ++ ++ .p2align 4 /* align section to 16 byte boundary */ ++L(hashing): ++ stbx r8, r9, r10 /* update hash with marker for the pivot of ++ the needle */ ++ lbzu r10, 1(r4) /* load needle into r10 and update to next */ ++ cmpdi cr7, r10, 0 /* if needle is has reached NULL, continue */ ++ bne cr7, L(hashing) /* loop to hash the needle */ ++ ++L(skipHashing): ++ li r10, 0 /* load counter = 0 */ ++ b L(beginScan) ++ ++ .p2align 4 /* align section to 16 byte boundary */ ++L(scanUnroll): ++ lbzx r8, r9, r8 /* load r8 with hash value at index */ ++ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found ++ accept needle */ ++ beq cr7, L(ret1stIndex) /* we have hit accept needle, return the ++ count */ ++ ++ lbz r8, 1(r3) /* load string[1] into r8 */ ++ addi r10, r10, 4 /* increment counter */ ++ lbzx r8, r9, r8 /* load r8 with hash value at index */ ++ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found ++ accept needle */ ++ beq cr7, L(ret2ndIndex) /* we have hit accept needle, return the ++ count */ ++ ++ lbz r8, 2(r3) /* load string[2] into r8 */ ++ lbzx r8, r9, r8 /* load r8 with hash value at index */ ++ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found ++ accept needle */ ++ beq cr7, L(ret3rdIndex) /* we have hit accept needle, return the ++ count */ ++ ++ lbz r8, 3(r3) /* load string[3] into r8 */ ++ lbzx r8, r9, r8 /* load r8 with hash value at index */ ++ addi r3, r3, 4 /* unroll factor , increment string by 4 */ ++ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found ++ accept needle */ ++ beq cr7,L(ret4thIndex) /* we have hit accept needle, return the ++ count */ ++ ++L(beginScan): ++ lbz r8, 0(r3) /* load string[0] into r8 */ ++ addi r6, r10, 1 /* place holder for counter + 1 */ ++ addi r5, r10, 2 /* place holder for counter + 2 */ ++ addi r4, r10, 3 /* place holder for counter + 3 */ ++ cmpdi cr7, r8, 0 /* if we hit marker in hash, we have found ++ accept needle */ ++ bne cr7, L(scanUnroll) /* continue scanning */ ++ ++L(ret1stIndex): ++ mr r3, r10 /* update r3 for return */ ++ blr /* return */ ++ ++L(ret2ndIndex): ++ mr r3, r6 /* update r3 for return */ ++ blr /* return */ ++ ++L(ret3rdIndex): ++ mr r3, r5 /* update r3 for return */ ++ blr /* return */ ++ ++L(ret4thIndex): ++ mr r3, r4 /* update r3 for return */ ++ blr /* done */ ++END(strspn) ++libc_hidden_builtin_def (strspn) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S +@@ -0,0 +1,56 @@ ++/* isfinite(). PowerPC64/POWER8 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ ++ ++/* int [r3] __finite ([fp1] x) */ ++ ++EALIGN (__finite, 4, 0) ++ CALL_MCOUNT 0 ++ MFVSRD_R3_V1 ++ lis r9,0x8010 ++ clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ ++ rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ ++ add r3,r3,r9 ++ rldicl r3,r3,1,63 ++ blr ++END (__finite) ++ ++hidden_def (__finite) ++weak_alias (__finite, finite) ++ ++/* It turns out that the 'double' version will also always work for ++ single-precision. */ ++strong_alias (__finite, __finitef) ++hidden_def (__finitef) ++weak_alias (__finitef, finitef) ++ ++#ifdef IS_IN_libm ++# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) ++compat_symbol (libm, __finite, __finitel, GLIBC_2_0) ++compat_symbol (libm, finite, finitel, GLIBC_2_0) ++# endif ++#else ++# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) ++compat_symbol (libc, __finite, __finitel, GLIBC_2_0); ++compat_symbol (libc, finite, finitel, GLIBC_2_0); ++# endif ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S +@@ -0,0 +1 @@ ++/* This function uses the same code as s_finite.S. */ +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S +@@ -0,0 +1,61 @@ ++/* isinf(). PowerPC64/POWER8 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ ++ ++/* int [r3] __isinf([fp1] x) */ ++ ++EALIGN (__isinf, 4, 0) ++ CALL_MCOUNT 0 ++ MFVSRD_R3_V1 ++ lis r9,0x7ff0 /* r9 = 0x7ff0 */ ++ rldicl r10,r3,0,1 /* r10 = r3 & (0x8000000000000000) */ ++ sldi r9,r9,32 /* r9 = r9 << 52 */ ++ cmpd cr7,r10,r9 /* fp1 & 0x7ff0000000000000 ? */ ++ beq cr7,L(inf) ++ li r3,0 /* Not inf */ ++ blr ++L(inf): ++ sradi r3,r3,63 /* r3 = r3 >> 63 */ ++ ori r3,r3,1 /* r3 = r3 | 0x1 */ ++ blr ++END (__isinf) ++ ++hidden_def (__isinf) ++weak_alias (__isinf, isinf) ++ ++/* It turns out that the 'double' version will also always work for ++ single-precision. */ ++strong_alias (__isinf, __isinff) ++hidden_def (__isinff) ++weak_alias (__isinff, isinff) ++ ++#ifdef NO_LONG_DOUBLE ++strong_alias (__isinf, __isinfl) ++weak_alias (__isinf, isinfl) ++#endif ++ ++#ifndef IS_IN_libm ++# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) ++compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); ++compat_symbol (libc, isinf, isinfl, GLIBC_2_0); ++# endif ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S +@@ -0,0 +1 @@ ++/* This function uses the same code as s_isinf.S. */ +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S +@@ -0,0 +1,53 @@ ++/* isnan(). PowerPC64/POWER8 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ ++ ++/* int [r3] __isnan([f1] x) */ ++ ++EALIGN (__isnan, 4, 0) ++ CALL_MCOUNT 0 ++ MFVSRD_R3_V1 ++ lis r9,0x7ff0 ++ clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ ++ rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ ++ subf r3,r3,r9 ++ rldicl r3,r3,1,63 ++ blr ++END (__isnan) ++ ++/* It turns out that the 'double' version will also always work for ++ single-precision. */ ++strong_alias (__isnan, __isnanf) ++hidden_def (__isnanf) ++weak_alias (__isnanf, isnanf) ++ ++#ifdef NO_LONG_DOUBLE ++strong_alias (__isnan, __isnanl) ++weak_alias (__isnan, isnanl) ++#endif ++ ++#ifndef IS_IN_libm ++# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) ++compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); ++compat_symbol (libc, isnan, isnanl, GLIBC_2_0); ++# endif ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S +@@ -0,0 +1 @@ ++/* This function uses the same code as s_isnan.S. */ +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S +@@ -0,0 +1,45 @@ ++/* Round double to long int. POWER8 PowerPC64 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ ++ ++/* long long int[r3] __llrint (double x[fp1]) */ ++ENTRY (__llrint) ++ CALL_MCOUNT 0 ++ fctid fp1,fp1 ++ MFVSRD_R3_V1 ++ blr ++END (__llrint) ++ ++strong_alias (__llrint, __lrint) ++weak_alias (__llrint, llrint) ++weak_alias (__lrint, lrint) ++ ++#ifdef NO_LONG_DOUBLE ++strong_alias (__llrint, __llrintl) ++weak_alias (__llrint, llrintl) ++strong_alias (__lrint, __lrintl) ++weak_alias (__lrint, lrintl) ++#endif ++#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) ++compat_symbol (libm, __llrint, llrintl, GLIBC_2_1) ++compat_symbol (libm, __lrint, lrintl, GLIBC_2_1) ++#endif +Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S +=================================================================== +--- /dev/null ++++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S +@@ -0,0 +1,47 @@ ++/* llround function. POWER8 PowerPC64 version. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++ ++#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ ++ ++/* long long [r3] llround (float x [fp1]) */ ++ ++ENTRY (__llround) ++ CALL_MCOUNT 0 ++ frin fp1,fp1 /* Round to nearest +-0.5. */ ++ fctidz fp1,fp1 /* Convert To Integer DW round toward 0. */ ++ MFVSRD_R3_V1 ++ blr ++END (__llround) ++ ++strong_alias (__llround, __lround) ++weak_alias (__llround, llround) ++weak_alias (__lround, lround) ++ ++#ifdef NO_LONG_DOUBLE ++weak_alias (__llround, llroundl) ++strong_alias (__llround, __llroundl) ++weak_alias (__lround, lroundl) ++strong_alias (__lround, __lroundl) ++#endif ++#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) ++compat_symbol (libm, __llround, llroundl, GLIBC_2_1) ++compat_symbol (libm, __lround, lroundl, GLIBC_2_1) ++#endif