summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/multiarch
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/Makefile36
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bzero.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c64
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/init-arch.h2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr.c5
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S176
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr.c11
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power6.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S18
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c12
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c6
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c32
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S33
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c34
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr.c37
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr.c17
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul.c5
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp.c22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn.c35
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen.c11
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase.c27
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase_l.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c31
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat.c7
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy.c18
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr.c15
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn.c35
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr.c12
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c2
136 files changed, 1307 insertions, 959 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 3b0e3a0117..4df6b45c4c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -1,25 +1,35 @@
ifeq ($(subdir),string)
-sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
- memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
- memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
+sysdep_routines += memcpy-power8-cached memcpy-power7 memcpy-a2 memcpy-power6 \
+ memcpy-cell memcpy-power4 memcpy-ppc64 \
+ memcmp-power8 memcmp-power7 memcmp-power4 memcmp-ppc64 \
+ memset-power7 memset-power6 memset-power4 \
memset-ppc64 memset-power8 \
- mempcpy-power7 mempcpy-ppc64 memchr-power7 memchr-ppc64 \
- memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
- rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
- strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \
+ mempcpy-power7 mempcpy-ppc64 \
+ memchr-power8 memchr-power7 memchr-ppc64 \
+ memrchr-power8 memrchr-power7 memrchr-ppc64 \
+ rawmemchr-power7 rawmemchr-ppc64 \
+ strlen-power7 strlen-ppc64 \
+ strnlen-power8 strnlen-power7 strnlen-ppc64 \
+ strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 \
- strncmp-power8 strncmp-power7 strncmp-power4 strncmp-ppc64 \
- strchr-power7 strchr-ppc64 \
- strchrnul-power7 strchrnul-ppc64 \
+ strncmp-power9 strncmp-power8 strncmp-power7 \
+ strncmp-power4 strncmp-ppc64 \
+ strchr-power8 strchr-power7 strchr-ppc64 \
+ strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
stpcpy-power7 stpcpy-ppc64 \
- strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \
+ strrchr-power8 strrchr-power7 strrchr-ppc64 \
+ strncat-power8 strncat-power7 strncat-ppc64 \
strncpy-power7 strncpy-ppc64 \
stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
- strcmp-power8 strcmp-power7 strcmp-ppc64 \
+ strcmp-power9 strcmp-power8 strcmp-power7 strcmp-ppc64 \
strcat-power8 strcat-power7 strcat-ppc64 \
memmove-power7 memmove-ppc64 wordcopy-ppc64 bcopy-ppc64 \
- strncpy-power8 strstr-power7 strstr-ppc64
+ strncpy-power8 strstr-power7 strstr-ppc64 \
+ strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
+ strlen-power8 strcasestr-power8 strcasestr-ppc64 \
+ strcasecmp-ppc64 strcasecmp-power8 strncase-ppc64 \
+ strncase-power8
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
index ddd9bfde5a..f28be7bf37 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default bcopy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
index ff271a0859..1c4a229b1f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
@@ -1,5 +1,5 @@
/* PowerPC64 multiarch bcopy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
index 56073fc587..f8cb05bea8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -1,5 +1,5 @@
/* Multiple versions of bzero. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 11a8215ee4..38a21e478e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -51,6 +51,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memcpy_power8_cached)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
__memcpy_power7)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
@@ -101,6 +103,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */
IFUNC_IMPL (i, name, strlen,
+ IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strlen_power8)
IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
__strlen_power7)
IFUNC_IMPL_ADD (array, i, strlen, 1,
@@ -108,6 +112,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
IFUNC_IMPL (i, name, strncmp,
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+ __strncmp_power9)
IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
__strncmp_power8)
IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
@@ -120,6 +126,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
IFUNC_IMPL (i, name, strchr,
IFUNC_IMPL_ADD (array, i, strchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strchr_power8)
+ IFUNC_IMPL_ADD (array, i, strchr,
hwcap & PPC_FEATURE_HAS_VSX,
__strchr_power7)
IFUNC_IMPL_ADD (array, i, strchr, 1,
@@ -128,6 +137,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
IFUNC_IMPL (i, name, strchrnul,
IFUNC_IMPL_ADD (array, i, strchrnul,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strchrnul_power8)
+ IFUNC_IMPL_ADD (array, i, strchrnul,
hwcap & PPC_FEATURE_HAS_VSX,
__strchrnul_power7)
IFUNC_IMPL_ADD (array, i, strchrnul, 1,
@@ -136,6 +148,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
IFUNC_IMPL (i, name, memcmp,
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memcmp_power8)
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
__memcmp_power7)
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
@@ -171,6 +185,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
IFUNC_IMPL (i, name, memchr,
IFUNC_IMPL_ADD (array, i, memchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memchr_power8)
+ IFUNC_IMPL_ADD (array, i, memchr,
hwcap & PPC_FEATURE_HAS_VSX,
__memchr_power7)
IFUNC_IMPL_ADD (array, i, memchr, 1,
@@ -179,6 +196,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
IFUNC_IMPL (i, name, memrchr,
IFUNC_IMPL_ADD (array, i, memrchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memrchr_power8)
+ IFUNC_IMPL_ADD (array, i, memrchr,
hwcap & PPC_FEATURE_HAS_VSX,
__memrchr_power7)
IFUNC_IMPL_ADD (array, i, memrchr, 1,
@@ -194,6 +214,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
IFUNC_IMPL (i, name, strnlen,
+ IFUNC_IMPL_ADD (array, i, strnlen,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strnlen_power8)
IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
__strnlen_power7)
IFUNC_IMPL_ADD (array, i, strnlen, 1,
@@ -202,6 +225,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
IFUNC_IMPL (i, name, strcasecmp,
IFUNC_IMPL_ADD (array, i, strcasecmp,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcasecmp_power8)
+ IFUNC_IMPL_ADD (array, i, strcasecmp,
hwcap & PPC_FEATURE_HAS_VSX,
__strcasecmp_power7)
IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc))
@@ -217,6 +243,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
IFUNC_IMPL (i, name, strncasecmp,
IFUNC_IMPL_ADD (array, i, strncasecmp,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strncasecmp_power8)
+ IFUNC_IMPL_ADD (array, i, strncasecmp,
hwcap & PPC_FEATURE_HAS_VSX,
__strncasecmp_power7)
IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
@@ -265,6 +294,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
IFUNC_IMPL (i, name, strrchr,
IFUNC_IMPL_ADD (array, i, strrchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strrchr_power8)
+ IFUNC_IMPL_ADD (array, i, strrchr,
hwcap & PPC_FEATURE_HAS_VSX,
__strrchr_power7)
IFUNC_IMPL_ADD (array, i, strrchr, 1,
@@ -273,6 +305,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
IFUNC_IMPL (i, name, strncat,
IFUNC_IMPL_ADD (array, i, strncat,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strncat_power8)
+ IFUNC_IMPL_ADD (array, i, strncat,
hwcap & PPC_FEATURE_HAS_VSX,
__strncat_power7)
IFUNC_IMPL_ADD (array, i, strncat, 1,
@@ -303,6 +338,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
IFUNC_IMPL (i, name, strcmp,
IFUNC_IMPL_ADD (array, i, strcmp,
+ hwcap2 & PPC_FEATURE2_ARCH_3_00,
+ __strcmp_power9)
+ IFUNC_IMPL_ADD (array, i, strcmp,
hwcap2 & PPC_FEATURE2_ARCH_2_07,
__strcmp_power8)
IFUNC_IMPL_ADD (array, i, strcmp,
@@ -322,6 +360,22 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcat, 1,
__strcat_ppc))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */
+ IFUNC_IMPL (i, name, strspn,
+ IFUNC_IMPL_ADD (array, i, strspn,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strspn_power8)
+ IFUNC_IMPL_ADD (array, i, strspn, 1,
+ __strspn_ppc))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */
+ IFUNC_IMPL (i, name, strcspn,
+ IFUNC_IMPL_ADD (array, i, strcspn,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcspn_power8)
+ IFUNC_IMPL_ADD (array, i, strcspn, 1,
+ __strcspn_ppc))
+
/* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */
IFUNC_IMPL (i, name, strstr,
IFUNC_IMPL_ADD (array, i, strstr,
@@ -331,5 +385,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strstr_ppc))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcasestr.c. */
+ IFUNC_IMPL (i, name, strcasestr,
+ IFUNC_IMPL_ADD (array, i, strcasestr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcasestr_power8)
+ IFUNC_IMPL_ADD (array, i, strcasestr, 1,
+ __strcasestr_ppc))
+
return i;
}
diff --git a/sysdeps/powerpc/powerpc64/multiarch/init-arch.h b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
index 98089b20f3..207add351a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
+++ b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
index df947f5f89..33b565f1e5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__memchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__memchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__memchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memchr_power7) \
- END_2(__memchr_power7)
+#define MEMCHR __memchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
new file mode 100644
index 0000000000..cb1f0face9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define MEMCHR __memchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
index 896824c5ce..48cbe601eb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
index 71f89c4e88..cd71db972f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -23,10 +23,13 @@
extern __typeof (__memchr) __memchr_ppc attribute_hidden;
extern __typeof (__memchr) __memchr_power7 attribute_hidden;
+extern __typeof (__memchr) __memchr_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__memchr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memchr_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __memchr_power7
: __memchr_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
index 1d74e37feb..26879a2b0f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcmp_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcmp_power4): \
- cfi_startproc; \
- LOCALENTRY(__memcmp_power4)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memcmp_power4) \
- END_2(__memcmp_power4)
+#define MEMCMP __memcmp_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
index 9993e7266b..9715d11d8d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__memcmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memcmp_power7) \
- END_2(__memcmp_power7)
+#define MEMCMP __memcmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
new file mode 100644
index 0000000000..c4da81c64e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memcmp implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define MEMCMP __memcmp_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
index d88f908d12..8180ed122b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index e8cf6ae23d..2c7a083a65 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -18,6 +18,7 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define memcmp __redirect_memcmp
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,15 +26,19 @@
extern __typeof (memcmp) __memcmp_ppc attribute_hidden;
extern __typeof (memcmp) __memcmp_power4 attribute_hidden;
extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power8 attribute_hidden;
+# undef memcmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (memcmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memcmp_power7 :
- (hwcap & PPC_FEATURE_POWER4)
- ? __memcmp_power4
- : __memcmp_ppc);
+libc_ifunc_redirected (__redirect_memcmp, memcmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memcmp_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcmp_power7
+ : (hwcap & PPC_FEATURE_POWER4)
+ ? __memcmp_power4
+ : __memcmp_ppc);
#else
#include <string/memcmp.c>
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
index bbe1b32033..91eddcebe9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC A2.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_a2) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_a2): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_a2)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_a2,mask) \
- END_2(__memcpy_a2)
+#define MEMCPY __memcpy_a2
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
index 11bab911d4..a93f5146fb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/CELL.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_cell) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_cell): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_cell)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_cell,mask) \
- END_2(__memcpy_cell)
+#define MEMCPY __memcpy_cell
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
index e414819208..bc6844535b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power4): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power4)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power4,mask) \
- END_2(__memcpy_power4)
+#define MEMCPY __memcpy_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
index 819f015d32..9d4c9927d9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power6) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power6): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power6)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power6,mask) \
- END_2(__memcpy_power6)
+#define MEMCPY __memcpy_power6
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
index d48b54f4c1..b24452e29c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power7,mask) \
- END_2(__memcpy_power7)
+#define MEMCPY __memcpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
new file mode 100644
index 0000000000..6b69e57212
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
@@ -0,0 +1,176 @@
+/* Optimized memcpy implementation for cached memory on PowerPC64/POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+
+/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+ Returns 'dst'. */
+
+ .machine power8
+ENTRY_TOCLESS (__memcpy_power8_cached, 5)
+ CALL_MCOUNT 3
+
+ cmpldi cr7,r5,15
+ bgt cr7,L(ge_16)
+ andi. r9,r5,0x1
+ mr r9,r3
+ beq cr0,1f
+ lbz r10,0(r4)
+ addi r9,r3,1
+ addi r4,r4,1
+ stb r10,0(r3)
+1:
+ andi. r10,r5,0x2
+ beq cr0,2f
+ lhz r10,0(r4)
+ addi r9,r9,2
+ addi r4,r4,2
+ sth r10,-2(r9)
+2:
+ andi. r10,r5,0x4
+ beq cr0,3f
+ lwz r10,0(r4)
+ addi r9,9,4
+ addi r4,4,4
+ stw r10,-4(r9)
+3:
+ andi. r10,r5,0x8
+ beqlr cr0
+ ld r10,0(r4)
+ std r10,0(r9)
+ blr
+
+ .align 4
+L(ge_16):
+ cmpldi cr7,r5,32
+ ble cr7,L(ge_16_le_32)
+ cmpldi cr7,r5,64
+ ble cr7,L(gt_32_le_64)
+
+ /* Align dst to 16 bytes. */
+ andi. r9,r3,0xf
+ mr r12,r3
+ beq cr0,L(dst_is_align_16)
+ lxvd2x v0,0,r4
+ subfic r12,r9,16
+ subf r5,r12,r5
+ add r4,r4,r12
+ add r12,r3,r12
+ stxvd2x v0,0,r3
+L(dst_is_align_16):
+ cmpldi cr7,r5,127
+ ble cr7,L(tail_copy)
+ mr r9,r12
+ srdi r10,r5,7
+ li r11,16
+ li r6,32
+ li r7,48
+ mtctr r10
+ clrrdi r0,r5,7
+
+ /* Main loop, copy 128 bytes each time. */
+ .align 4
+L(copy_128):
+ lxvd2x v10,0,r4
+ lxvd2x v11,r4,r11
+ addi r8,r4,64
+ addi r10,r9,64
+ lxvd2x v12,r4,r6
+ lxvd2x v0,r4,r7
+ addi r4,r4,128
+ stxvd2x v10,0,r9
+ stxvd2x v11,r9,r11
+ stxvd2x v12,r9,r6
+ stxvd2x v0,r9,r7
+ addi r9,r9,128
+ lxvd2x v10,0,r8
+ lxvd2x v11,r8,r11
+ lxvd2x v12,r8,r6
+ lxvd2x v0,r8,r7
+ stxvd2x v10,0,r10
+ stxvd2x v11,r10,r11
+ stxvd2x v12,r10,r6
+ stxvd2x v0,r10,r7
+ bdnz L(copy_128)
+
+ add r12,r12,r0
+ rldicl r5,r5,0,57
+L(tail_copy):
+ cmpldi cr7,r5,63
+ ble cr7,L(tail_le_64)
+ li r8,16
+ li r10,32
+ lxvd2x v10,0,r4
+ li r9,48
+ addi r5,r5,-64
+ lxvd2x v11,r4,r8
+ lxvd2x v12,r4,r10
+ lxvd2x v0,r4,r9
+ addi r4,r4,64
+ stxvd2x v10,0,r12
+ stxvd2x v11,r12,r8
+ stxvd2x v12,r12,r10
+ stxvd2x v0,r12,9
+ addi r12,r12,64
+
+L(tail_le_64):
+ cmpldi cr7,r5,32
+ bgt cr7,L(tail_gt_32_le_64)
+ cmpdi cr7,r5,0
+ beqlr cr7
+ addi r5,r5,-32
+ li r9,16
+ add r8,r4,r5
+ add r10,r12,r5
+ lxvd2x v12,r4,r5
+ lxvd2x v0,r8,r9
+ stxvd2x v12,r12,r5
+ stxvd2x v0,r10,r9
+ blr
+
+ .align 4
+L(ge_16_le_32):
+ addi r5,r5,-16
+ lxvd2x v0,0,r4
+ lxvd2x v1,r4,r5
+ stxvd2x v0,0,r3
+ stxvd2x v1,r3,r5
+ blr
+
+ .align 4
+L(gt_32_le_64):
+ mr r12,r3
+
+ .align 4
+L(tail_gt_32_le_64):
+ li r9,16
+ lxvd2x v0,0,r4
+ addi r5,r5,-32
+ lxvd2x v1,r4,r9
+ add r8,r4,r5
+ lxvd2x v2,r4,r5
+ add r10,r12,r5
+ lxvd2x v3,r8,r9
+ stxvd2x v0,0,r12
+ stxvd2x v1,r12,r9
+ stxvd2x v2,r12,r5
+ stxvd2x v3,r10,r9
+ blr
+
+END_GEN_TB (__memcpy_power8_cached,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
index 6e2b64fa7d..55036676b3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
@@ -1,5 +1,5 @@
/* Default memcpy implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,24 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_ppc): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_ppc)
-
-# undef END_GEN_TB
-# define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_ppc,mask) \
- END_2(__memcpy_ppc)
+# define MEMCPY __memcpy_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
index 8549515c25..44dea594f3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -35,18 +35,21 @@ extern __typeof (__redirect_memcpy) __memcpy_cell attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_power6 attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_a2 attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_power7 attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_power8_cached attribute_hidden;
libc_ifunc (__libc_memcpy,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memcpy_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __memcpy_a2 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __memcpy_power6 :
- (hwcap & PPC_FEATURE_CELL_BE)
- ? __memcpy_cell :
- (hwcap & PPC_FEATURE_POWER4)
- ? __memcpy_power4
+ ((hwcap2 & PPC_FEATURE2_ARCH_2_07) && use_cached_memopt)
+ ? __memcpy_power8_cached :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcpy_power7 :
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __memcpy_a2 :
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memcpy_power6 :
+ (hwcap & PPC_FEATURE_CELL_BE)
+ ? __memcpy_cell :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcpy_power4
: __memcpy_ppc);
#undef memcpy
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
index 5f35f16d9b..0b251d0f5f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
@@ -1,5 +1,5 @@
/* Optimized memmove implementation for PowerPC64/POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memmove_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memmove_power7): \
- cfi_startproc; \
- LOCALENTRY(__memmove_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memmove_power7,mask) \
- END_2(__memmove_power7)
+#define MEMMOVE __memmove_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
index fc9bed3c25..a185190360 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove.c b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
index 2775c2c8d4..39987155cc 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
@@ -1,5 +1,5 @@
/* Multiple versions of memmove. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
index de5caae4cb..bee44f0364 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized mempcpy implementation for PowerPC/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__mempcpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__mempcpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__mempcpy_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__mempcpy_power7,mask) \
- END_2(__mempcpy_power7)
+#define MEMPCPY __mempcpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
index 27c6e877b2..a03748e8c6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 3c77b5f1bd..35e2368fa6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,23 +17,27 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__mempcpy) __mempcpy_ppc attribute_hidden;
extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+# undef mempcpy
+# undef __mempcpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__mempcpy,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __mempcpy_power7
- : __mempcpy_ppc);
+libc_ifunc_redirected (__redirect___mempcpy, __mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc);
weak_alias (__mempcpy, mempcpy)
-libc_hidden_def (mempcpy)
#else
# include <string/mempcpy.c>
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
index 0e41b6c9f5..afaae46dec 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memrchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__memrchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__memrchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__memrchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memrchr_power7) \
- END_2(__memrchr_power7)
+#define MEMRCHR __memrchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
new file mode 100644
index 0000000000..453e2b620e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memrchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define MEMRCHR __memrchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
index 3db538f120..e6d60c3fc3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -15,5 +15,4 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-
#include <sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
index 7603343947..48be9515e4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -23,13 +23,16 @@
extern __typeof (__memrchr) __memrchr_ppc attribute_hidden;
extern __typeof (__memrchr) __memrchr_power7 attribute_hidden;
+extern __typeof (__memrchr) __memrchr_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__memrchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memrchr_power7
- : __memrchr_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memrchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memrchr_power7
+ : __memrchr_ppc);
weak_alias (__memrchr, memrchr)
#else
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
index 34707382f1..78d6de9e19 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power4): \
- cfi_startproc; \
- LOCALENTRY(__memset_power4)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power4,mask) \
- END_2(__memset_power4)
+#define MEMSET __memset_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
index c11db16890..79d93c7615 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power6) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power6): \
- cfi_startproc; \
- LOCALENTRY(__memset_power6)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power6,mask) \
- END_2(__memset_power6)
+#define MEMSET __memset_power6
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
index 61191815dc..02d1855186 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power7): \
- cfi_startproc; \
- LOCALENTRY(__memset_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power7,mask) \
- END_2(__memset_power7)
+#define MEMSET __memset_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
index ceafa7e83b..932eeefca1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER8.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power8): \
- cfi_startproc; \
- LOCALENTRY(__memset_power8)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power8,mask) \
- END_2(__memset_power8)
+#define MEMSET __memset_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
index 7b3aa3acd1..61f4bc5089 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -1,5 +1,5 @@
/* Default memset/bzero implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -30,21 +30,7 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_ppc): \
- cfi_startproc; \
- LOCALENTRY(__memset_ppc)
-
-# undef END_GEN_TB
-# define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_ppc,mask) \
- END_2(__memset_ppc)
+# define MEMSET __memset_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index 8f0489e65b..1a7c46fecf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -1,5 +1,5 @@
/* Multiple versions of memset.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
index f1515bccce..a268376729 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized rawmemchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,21 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__rawmemchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__rawmemchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__rawmemchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__rawmemchr_power7) \
- END_2(__rawmemchr_power7)
+#define RAWMEMCHR __rawmemchr_power7
#include <sysdeps/powerpc/powerpc64/power7/rawmemchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
index 066a838dc7..e5daa9225b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index f06030eeeb..02bac49b53 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,19 +17,21 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define __rawmemchr __redirect___rawmemchr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__rawmemchr) __rawmemchr_ppc attribute_hidden;
extern __typeof (__rawmemchr) __rawmemchr_power7 attribute_hidden;
+# undef __rawmemchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__rawmemchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __rawmemchr_power7
- : __rawmemchr_ppc);
+libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __rawmemchr_power7
+ : __rawmemchr_ppc);
weak_alias (__rawmemchr, rawmemchr)
#else
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
index 5e66a21224..611eff4bf6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
index 06e8fb5d17..9ec081aebd 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
index fb383799f5..44e9f15e9b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
@@ -1,5 +1,5 @@
/* Multiarch stpcpy for POWER7/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
index 8aeaa7c6ad..7718869370 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized stpcpy implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpcpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpcpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__stpcpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpcpy_power8) \
- END_2(__stpcpy_power8)
+#define STPCPY __stpcpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
index d607d8a6de..8359b7b4ca 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
@@ -1,5 +1,5 @@
/* Multiarch stpcpy for PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -27,9 +27,7 @@ extern __typeof (stpcpy) __stpcpy_ppc attribute_hidden;
#define strlen __strlen_ppc
#undef weak_alias
-#define weak_alias(name, aliasname) \
- extern __typeof (__stpcpy_ppc) aliasname \
- __attribute__ ((weak, alias ("__stpcpy_ppc")));
+#define weak_alias(name, aliasname)
#undef libc_hidden_def
#define libc_hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index bbc169180b..34c8896441 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define __NO_STRING_INLINES
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
# include <shlib-compat.h>
@@ -26,14 +27,15 @@ extern __typeof (__stpcpy) __stpcpy_ppc attribute_hidden;
extern __typeof (__stpcpy) __stpcpy_power7 attribute_hidden;
extern __typeof (__stpcpy) __stpcpy_power8 attribute_hidden;
-libc_ifunc (__stpcpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __stpcpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __stpcpy_power7
- : __stpcpy_ppc);
+libc_ifunc_hidden (__stpcpy, __stpcpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __stpcpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __stpcpy_power7
+ : __stpcpy_ppc);
weak_alias (__stpcpy, stpcpy)
+libc_hidden_def (__stpcpy)
libc_hidden_def (stpcpy)
#else
# include <string/stpcpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
index fa1572ce01..6af2557c5d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,29 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#define USE_AS_STPNCPY
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpncpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpncpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__stpncpy_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpncpy_power7) \
- END_2(__stpncpy_power7)
+#define STPNCPY __stpncpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#define MEMSET __memset_power7
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/stpncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
index 804e499023..4fea202a54 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,24 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define STPNCPY __stpncpy_power8
-#define USE_AS_STPNCPY
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpncpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpncpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__stpncpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpncpy_power8) \
- END_2(__stpncpy_power8)
+#define MEMSET __memset_power8
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power8/stpncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
index 593ae2324e..8f9dc08599 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
@@ -1,5 +1,5 @@
/* Default stpncpy implementation for PowerPC64.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
index b1484b1e36..28e3c97b72 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpncpy. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,13 +26,14 @@
extern __typeof (__stpncpy) __stpncpy_ppc attribute_hidden;
extern __typeof (__stpncpy) __stpncpy_power7 attribute_hidden;
extern __typeof (__stpncpy) __stpncpy_power8 attribute_hidden;
+# undef stpncpy
+# undef __stpncpy
-libc_ifunc (__stpncpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __stpncpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __stpncpy_power7
- : __stpncpy_ppc);
-
+libc_ifunc_redirected (__redirect___stpncpy, __stpncpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __stpncpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __stpncpy_power7
+ : __stpncpy_ppc);
weak_alias (__stpncpy, stpncpy)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
index 013dc62867..bec2f30703 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
@@ -1,5 +1,5 @@
-/* Optimized strcasecmp implementation foOWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Optimized strcasecmp implementation for POWER7.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strcasecmp_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strcasecmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcasecmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcasecmp_power7) \
- END_2(__strcasecmp_power7)
-
+#define __strcasecmp __strcasecmp_power7
#undef weak_alias
#define weak_alias(name, alias)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
new file mode 100644
index 0000000000..29453ff80d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strcasecmp implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define __strcasecmp __strcasecmp_power8
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c
new file mode 100644
index 0000000000..b477255196
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c
@@ -0,0 +1,21 @@
+/* Multiarch strcasecmp for PPC64.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define strcasecmp __strcasecmp_ppc
+
+#include <string/strcasecmp.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
index 1f22336d49..1a6661e49c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -1,5 +1,5 @@
-/* Multiple versions of strcasecmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Multiple versions of strcasecmp
+ Copyright (C) 2013-2018 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
@@ -16,25 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
-# include <string.h>
-# define strcasecmp __strcasecmp_ppc
-extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
-extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
-#endif
+#include <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-#include <string/strcasecmp.c>
-#undef strcasecmp
+extern __typeof (__strcasecmp) __libc_strcasecmp;
-#if IS_IN (libc)
-# include <shlib-compat.h>
-# include "init-arch.h"
+extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power8 attribute_hidden;
-extern __typeof (__strcasecmp) __libc_strcasecmp;
libc_ifunc (__libc_strcasecmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcasecmp_power7
- : __strcasecmp_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcasecmp_power8:
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_power7
+ : __strcasecmp_ppc);
weak_alias (__libc_strcasecmp, strcasecmp)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
index d4706e1755..07e716950a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcasecmp_l implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strcasecmp_l_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strcasecmp_l_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcasecmp_l_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcasecmp_l_power7) \
- END_2(__strcasecmp_l_power7)
+#define __strcasecmp_l __strcasecmp_l_power7
#undef weak_alias
#define weak_alias(name, alias)
@@ -40,5 +25,7 @@
#define libc_hidden_builtin_def(name)
#define USE_IN_EXTENDED_LOCALE_MODEL
+#define __STRCMP __strcasecmp_l
+#define STRCMP strcasecmp_l
#include <sysdeps/powerpc/powerpc64/power7/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
index d05b1c8a86..3edccc4333 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcasecmp_l.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
new file mode 100644
index 0000000000..985f4e4e7d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
@@ -0,0 +1,33 @@
+/* Optimized strcasestr implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRCASESTR __strcasestr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+/* The following definitions are used in strcasestr optimization. */
+
+/* strlen is used to calculate len of r4. */
+#define STRLEN __strlen_power8
+/* strnlen is used to check if len of r3 is more than r4. */
+#define STRNLEN __strnlen_power8
+/* strchr is used to check if first char of r4 is present in r3. */
+#define STRCHR __strchr_power8
+
+#include <sysdeps/powerpc/powerpc64/power8/strcasestr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c
new file mode 100644
index 0000000000..0805b6f939
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c
@@ -0,0 +1,34 @@
+/* PowerPC64 default implementation of strcasestr.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <string.h>
+
+#define STRCASESTR __strcasestr_ppc
+#if IS_IN (libc) && defined(SHARED)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1(__strcasestr_ppc, __GI_strcasestr, __strcasestr_ppc);
+#endif
+
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+extern __typeof (strcasestr) __strcasestr_ppc attribute_hidden;
+
+#include <string/strcasestr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
new file mode 100644
index 0000000000..dc46bfd474
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strcasestr.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#if IS_IN (libc)
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasestr) __strcasestr_ppc attribute_hidden;
+extern __typeof (__strcasestr) __strcasestr_power8 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__strcasestr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcasestr_power8
+ : __strcasestr_ppc);
+
+weak_alias (__strcasestr, strcasestr)
+#else
+#include <string/strcasestr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
index 58563162ed..31966827ed 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
@@ -27,4 +27,4 @@ extern typeof (strlen) __strlen_power7;
#define strcpy __strcpy_power7
#define strlen __strlen_power7
-#include <sysdeps/powerpc/strcat.c>
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
index be17631411..996a3b6a28 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 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
@@ -23,8 +23,8 @@
#define libc_hidden_def(name)
extern typeof (strcpy) __strcpy_power8;
-extern typeof (strlen) __strlen_power7;
+extern typeof (strlen) __strlen_power8;
#define strcpy __strcpy_power8
-#define strlen __strlen_power7
-#include <sysdeps/powerpc/strcat.c>
+#define strlen __strlen_power8
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
index 3f8953eebe..fc3ef2a2bf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
@@ -26,4 +26,4 @@
extern __typeof (strcat) __strcat_ppc attribute_hidden;
-#include <sysdeps/powerpc/strcat.c>
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index a2894ae027..48035ed3c0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcat. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define strcat __redirect_strcat
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +25,12 @@
extern __typeof (strcat) __strcat_ppc attribute_hidden;
extern __typeof (strcat) __strcat_power7 attribute_hidden;
extern __typeof (strcat) __strcat_power8 attribute_hidden;
+# undef strcat
-libc_ifunc (strcat,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcat_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcat_power7
- : __strcat_ppc);
+libc_ifunc_redirected (__redirect_strcat, strcat,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcat_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcat_power7
+ : __strcat_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
index 47f4fe734c..f91b809984 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__strchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchr_power7) \
- END_2(__strchr_power7)
+#define STRCHR __strchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
new file mode 100644
index 0000000000..16a484dbda
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strchr implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRCHR __strchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
index 8641d262cb..cdbb9c151e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#ifdef SHARED
-# undef ENTRY
-# define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchr_ppc) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchr_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strchr_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchr_ppc) \
- END_2(__strchr_ppc)
+# define STRCHR __strchr_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index 2cfde632cb..6528469ee3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -18,18 +18,25 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strchr __redirect_strchr
+/* Omit the strchr inline definitions because it would redefine strchr. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strchr) __strchr_ppc attribute_hidden;
extern __typeof (strchr) __strchr_power7 attribute_hidden;
+extern __typeof (strchr) __strchr_power8 attribute_hidden;
+# undef strchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strchr_power7
- : __strchr_ppc);
+libc_ifunc_redirected (__redirect_strchr, strchr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc);
weak_alias (strchr, index)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
index 977286da48..fee140926b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchrnul implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchrnul_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchrnul_power7): \
- cfi_startproc; \
- LOCALENTRY(__strchrnul_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchrnul_power7) \
- END_2(__strchrnul_power7)
+#define STRCHRNUL __strchrnul_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
new file mode 100644
index 0000000000..e17e918d00
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strchrnul implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRCHRNUL __strchrnul_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strchrnul.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
index 2ec52432da..59c6bc37f7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
index 682aa0fef7..ead31f791c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -23,10 +23,13 @@
extern __typeof (__strchrnul) __strchrnul_ppc attribute_hidden;
extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+extern __typeof (__strchrnul) __strchrnul_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__strchrnul,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strchrnul_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __strchrnul_power7
: __strchrnul_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
index d44114bcd9..814d472680 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_power7) \
- END_2(__strcmp_power7)
+#define STRCMP __strcmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
index e35251ca25..68803ffc1b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,25 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_power8): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_power8) \
- END_2(__strcmp_power8)
+#if IS_IN (libc)
+#define STRCMP __strcmp_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
new file mode 100644
index 0000000000..8b569d38be
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
@@ -0,0 +1,26 @@
+/* Optimized strcmp implementation for POWER9/PPC64.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#if IS_IN (libc)
+#define STRCMP __strcmp_power9
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power9/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
index a9515112d8..43e1c6f697 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
@@ -1,5 +1,5 @@
/* Default strcmp implementation for PowerPC64.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,28 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_ppc) \
- END_2(__strcmp_ppc)
+# define STRCMP __strcmp_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
.globl __GI_strcmp; __GI_strcmp = __strcmp_ppc
-#endif
+#endif /* SHARED && IS_IN */
#include <sysdeps/powerpc/powerpc64/strcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index aee888a4b7..b669053166 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcmp. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -17,6 +17,9 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define strcmp __redirect_strcmp
+/* Omit the strcmp inline definitions because it would redefine strcmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +27,16 @@
extern __typeof (strcmp) __strcmp_ppc attribute_hidden;
extern __typeof (strcmp) __strcmp_power7 attribute_hidden;
extern __typeof (strcmp) __strcmp_power8 attribute_hidden;
+extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
-libc_ifunc (strcmp,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcmp_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcmp_power7
- : __strcmp_ppc);
+# undef strcmp
+
+libc_ifunc_redirected (__redirect_strcmp, strcmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+ ? __strcmp_power9 :
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcmp_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcmp_power7
+ : __strcmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
index f75abb95a4..0a719519a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
@@ -1,5 +1,5 @@
/* Multiarch strcpy for POWER7/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
index 213c77a69b..5b68fc970e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized strcpy implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__strcpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcpy_power8) \
- END_2(__strcpy_power8)
+#define STRCPY __strcpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
index 1d75d2aaf2..22831974ab 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
@@ -1,5 +1,5 @@
/* Multiarch strcpy for PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index d2c38589e7..b18a92a62a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define strcpy __redirect_strcpy
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +25,12 @@
extern __typeof (strcpy) __strcpy_ppc attribute_hidden;
extern __typeof (strcpy) __strcpy_power7 attribute_hidden;
extern __typeof (strcpy) __strcpy_power8 attribute_hidden;
+#undef strcpy
-libc_ifunc (strcpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcpy_power7
- : __strcpy_ppc);
+libc_ifunc_redirected (__redirect_strcpy, strcpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcpy_power7
+ : __strcpy_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
new file mode 100644
index 0000000000..23bf1c1e5f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
@@ -0,0 +1,23 @@
+/* Optimized strcspn implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRSPN __strcspn_power8
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strcspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c
new file mode 100644
index 0000000000..03eac0d183
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c
@@ -0,0 +1,26 @@
+/* Default strcspn implementation for PowerPC64.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRCSPN __strcspn_ppc
+
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+#endif
+
+#include <string/strcspn.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
new file mode 100644
index 0000000000..308aab5970
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcspn. PowerPC64 version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+#undef strcspn
+extern __typeof (strcspn) __libc_strcspn;
+
+extern __typeof (strcspn) __strcspn_ppc attribute_hidden;
+extern __typeof (strcspn) __strcspn_power8 attribute_hidden;
+
+libc_ifunc (__libc_strcspn,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcspn_power8
+ : __strcspn_ppc);
+
+weak_alias (__libc_strcspn, strcspn)
+libc_hidden_builtin_def (strcspn)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
index ee60e434aa..5f4591ff6c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strlen_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strlen_power7): \
- cfi_startproc; \
- LOCALENTRY(__strlen_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strlen_power7) \
- END_2(__strlen_power7)
+#define STRLEN __strlen_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
new file mode 100644
index 0000000000..fb8ffbf970
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strlen implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRLEN __strlen_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
index 2a4327a054..3e9e4814c9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
@@ -1,5 +1,5 @@
/* Default strlen implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,23 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef ENTRY
-# define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strlen_ppc) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strlen_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strlen_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strlen_ppc) \
- END_2(__strlen_ppc)
+# define STRLEN __strlen_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
index 94501fdf2f..74810dab99 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strlen. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -29,11 +29,14 @@ extern __typeof (__redirect_strlen) __libc_strlen;
extern __typeof (__redirect_strlen) __strlen_ppc attribute_hidden;
extern __typeof (__redirect_strlen) __strlen_power7 attribute_hidden;
+extern __typeof (__redirect_strlen) __strlen_power8 attribute_hidden;
libc_ifunc (__libc_strlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strlen_power7
- : __strlen_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strlen_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strlen_power7
+ : __strlen_ppc);
#undef strlen
strong_alias (__libc_strlen, strlen)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
index 1e147aedb2..27ca40c40a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
new file mode 100644
index 0000000000..c0a0901a28
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strncasecmp implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define __strncasecmp __strncasecmp_power8
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strncase.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c
new file mode 100644
index 0000000000..31ed9510c6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c
@@ -0,0 +1,21 @@
+/* Multiarch strncasecmp for PPC64.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define strncasecmp __strncasecmp_ppc
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
index 2729fcea83..8cf7154c59 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,26 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
-# include <string.h>
-# define strncasecmp __strncasecmp_ppc
-extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
-extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
-#endif
+#include <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-#include <string/strncase.c>
-#undef strncasecmp
+extern __typeof (__strncasecmp) __libc_strncasecmp;
-#if IS_IN (libc)
-# include <shlib-compat.h>
-# include "init-arch.h"
+extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden;
-/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
- ifunc symbol properly. */
-extern __typeof (__strncasecmp) __libc_strncasecmp;
libc_ifunc (__libc_strncasecmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncasecmp_power8:
(hwcap & PPC_FEATURE_HAS_VSX)
? __strncasecmp_power7
: __strncasecmp_ppc);
+
weak_alias (__libc_strncasecmp, strncasecmp)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
index 21fba18836..ae2c4a3554 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
@@ -18,8 +18,10 @@
#include <string.h>
#define __strncasecmp_l __strncasecmp_l_power7
-#define USE_IN_EXTENDED_LOCALE_MODEL 1
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
-#include <string/strncase.c>
+#include <string/strncase_l.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
index 33a1d8b639..d3c4bf18c1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp_l
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
index bbc31e1abb..a393c2ed60 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
new file mode 100644
index 0000000000..7842a507a0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/ >. */
+
+#include <string.h>
+
+#define STRNCAT __strncat_power8
+
+extern __typeof (strncat) __strncat_power8 attribute_hidden;
+extern __typeof (strlen) __strlen_power8 attribute_hidden;
+extern __typeof (strnlen) __strnlen_power8 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
+
+#define strlen __strlen_power8
+#define __strnlen __strnlen_power8
+#define memcpy __memcpy_power7
+
+#include <string/strncat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
index 5b364c8341..dd0f166514 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat.c b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
index 0f6f29cccc..a2e5038e53 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncat. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -23,9 +23,12 @@
extern __typeof (strncat) __strncat_ppc attribute_hidden;
extern __typeof (strncat) __strncat_power7 attribute_hidden;
+extern __typeof (strncat) __strncat_power8 attribute_hidden;
libc_ifunc (strncat,
- (hwcap & PPC_FEATURE_HAS_VSX)
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncat_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
? __strncat_power7
: __strncat_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
index d1aebbbc93..860f2ec18a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
@@ -15,23 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power4): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power4)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power4) \
- END_2(__strncmp_power4)
+#define STRNCMP __strncmp_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
index 3edc4fce62..8d4108e1ba 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
@@ -15,24 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power7) \
- END_2(__strncmp_power7)
-
+#define STRNCMP __strncmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
index 771986ec77..e8a5fb804f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 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
@@ -15,26 +15,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power8): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power8) \
- END_2(__strncmp_power8)
-
+#if IS_IN (libc)
+#define STRNCMP __strncmp_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#include <sysdeps/powerpc/powerpc64/power8/strncmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
new file mode 100644
index 0000000000..3356f72527
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#if IS_IN (libc)
+#define STRNCMP __strncmp_power9
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power9/strncmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
index 30b139aa78..1b5704a079 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
@@ -15,24 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_ppc)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_ppc) \
- END_2(__strncmp_ppc)
+# define STRNCMP __strncmp_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index 1eb6e517af..c4a40d1ec7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -18,6 +18,9 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strncmp __redirect_strncmp
+/* Omit the strncmp inline definitions because it would redefine strncmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -26,15 +29,19 @@ extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
extern __typeof (strncmp) __strncmp_power8 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
+# undef strncmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strncmp,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strncmp_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncmp_power7 :
- (hwcap & PPC_FEATURE_POWER4)
- ? __strncmp_power4
- : __strncmp_ppc);
+libc_ifunc_redirected (__redirect_strncmp, strncmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+ ? __strncmp_power9 :
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncmp_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7
+ : (hwcap & PPC_FEATURE_POWER4)
+ ? __strncmp_power4
+ : __strncmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
index 14efab3604..a044c11327 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized strncpy implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,27 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strncpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__strncpy_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncpy_power7) \
- END_2(__strncpy_power7)
+#define STRNCPY __strncpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#define MEMSET __memset_power7
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/strncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
index 3263bbd70a..10b8453f58 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized strncpy implementation for POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,25 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strncpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__strncpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncpy_power8) \
- END_2(__strncpy_power8)
+#define STRNCPY __strncpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
+/* memset is used to pad the end of the string. */
+#define MEMSET __memset_power8
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
+
#include <sysdeps/powerpc/powerpc64/power8/strncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
index 6f5907eb9f..7efbe10905 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index 0176514c1e..41e5ea8446 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncpy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -18,6 +18,9 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strncpy __redirect_strncpy
+/* Omit the strncpy inline definitions because it would redefine strncpy. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,14 +28,15 @@
extern __typeof (strncpy) __strncpy_ppc attribute_hidden;
extern __typeof (strncpy) __strncpy_power7 attribute_hidden;
extern __typeof (strncpy) __strncpy_power8 attribute_hidden;
+# undef strncpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strncpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strncpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncpy_power7
- : __strncpy_ppc);
+libc_ifunc_redirected (__redirect_strncpy, strncpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncpy_power7
+ : __strncpy_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
index ae4e6c05bb..565937b534 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strnlen version for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strnlen_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strnlen_power7): \
- cfi_startproc; \
- LOCALENTRY(__strnlen_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strnlen_power7) \
- END_2(__strnlen_power7)
+#define STRNLEN __strnlen_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
new file mode 100644
index 0000000000..ed5b67e607
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strnlen version for POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define __strnlen __strnlen_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/strnlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
index de17a38f83..ce710e218d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index c4907e9ec8..298bfa0dc1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strnlen.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,19 +17,24 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__strnlen) __strnlen_ppc attribute_hidden;
extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
-
-libc_ifunc (__strnlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strnlen_power7
- : __strnlen_ppc);
+extern __typeof (__strnlen) __strnlen_power8 attribute_hidden;
+# undef strnlen
+# undef __strnlen
+libc_ifunc_redirected (__redirect___strnlen, __strnlen,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strnlen_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strnlen_power7
+ : __strnlen_ppc);
weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
#else
#include <string/strnlen.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
index 464e74a5e8..949803031e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strrchr implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -16,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#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)
+#define STRRCHR __strrchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
new file mode 100644
index 0000000000..342d02a38c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strrchr implementation for POWER8.
+ Copyright (C) 2017-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRRCHR __strrchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
index 151bd35ea6..bcf049a2ed 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 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
@@ -18,10 +18,10 @@
#include <string.h>
#define STRRCHR __strrchr_ppc
+
#undef weak_alias
-#define weak_alias(name, aliasname) \
- extern __typeof (__strrchr_ppc) aliasname \
- __attribute__ ((weak, alias ("__strrchr_ppc")));
+#define weak_alias(name, aliasname)
+
#if IS_IN (libc) && defined(SHARED)
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index 45742bc910..d46f7c0403 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strrchr. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 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
@@ -18,18 +18,23 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strrchr __redirect_strrchr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strrchr) __strrchr_ppc attribute_hidden;
extern __typeof (strrchr) __strrchr_power7 attribute_hidden;
+extern __typeof (strrchr) __strrchr_power8 attribute_hidden;
+#undef strrchr
/* 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);
+libc_ifunc_redirected (__redirect_strrchr, strrchr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strrchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strrchr_power7
+ : __strrchr_ppc);
weak_alias (strrchr, rindex)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
new file mode 100644
index 0000000000..bc9f493cf7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
@@ -0,0 +1,23 @@
+/* Optimized strspn implementation for POWER8.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRSPN __strspn_power8
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
new file mode 100644
index 0000000000..05a240b252
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
@@ -0,0 +1,25 @@
+/* Default strspn implementation for PowerPC64.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+#define STRSPN __strspn_ppc
+#ifdef SHARED
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#endif
+
+#include <string/strspn.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
new file mode 100644
index 0000000000..61251610e7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strspn. PowerPC64 version.
+ Copyright (C) 2016-2018 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
+ <http://www.gnu.org/licenses/>. */
+
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+#undef strspn
+extern __typeof (strspn) __libc_strspn;
+
+extern __typeof (strspn) __strspn_ppc attribute_hidden;
+extern __typeof (strspn) __strspn_power8 attribute_hidden;
+
+libc_ifunc (__libc_strspn,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strspn_power8
+ : __strspn_ppc);
+
+weak_alias (__libc_strspn, strspn)
+libc_hidden_builtin_def (strspn)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
index 68b93b07e7..a24ab585f4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strstr implementation for POWER7.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -16,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strstr_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strstr_power7): \
- cfi_startproc; \
- LOCALENTRY(__strstr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strstr_power7) \
- END_2(__strstr_power7)
+#define STRSTR __strstr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
@@ -40,5 +24,10 @@
#define STRLEN __strlen_power7
#define STRNLEN __strnlen_power7
#define STRCHR __strchr_power7
+#ifdef SHARED
+#define STRLEN_is_local
+#define STRNLEN_is_local
+#define STRCHR_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/strstr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
index 2ca62c4b74..971bb18f7a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr.c b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
index 7efc4b0913..264b5d88d5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strstr. PowerPC64 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 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
@@ -18,17 +18,19 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strstr __redirect_strstr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strstr) __strstr_ppc attribute_hidden;
extern __typeof (strstr) __strstr_power7 attribute_hidden;
+# undef strstr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strstr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strstr_power7
- : __strstr_ppc);
+libc_ifunc_redirected (__redirect_strstr, strstr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strstr_power7
+ : __strstr_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
index b78fdd3533..52f562b613 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
index 3374ba26ef..0acad04706 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
index 5192fe8704..f72865241b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
index 44c9b971ce..9976a63afa 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcschr
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
# include <wchar.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,15 +26,16 @@
extern __typeof (wcschr) __wcschr_ppc attribute_hidden;
extern __typeof (wcschr) __wcschr_power6 attribute_hidden;
extern __typeof (wcschr) __wcschr_power7 attribute_hidden;
+# undef wcschr
+# undef __wcschr
-libc_ifunc (__wcschr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __wcschr_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __wcschr_power6
- : __wcschr_ppc);
+libc_ifunc_redirected (__redirect___wcschr, __wcschr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcschr_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcschr_power6
+ : __wcschr_ppc);
weak_alias (__wcschr, wcschr)
-libc_hidden_builtin_def (wcschr)
#else
#undef libc_hidden_def
#define libc_hidden_def(a)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
index cc655942c2..ef0f7ccdc7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
@@ -1,5 +1,5 @@
/* wcscpy.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
index 7aec88dc94..2712f58156 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
@@ -1,5 +1,5 @@
/* wcscpy.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
index f48a65f0ef..4bcf792544 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
index 5c919f56ff..76fc3569b8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
index 184dc941d7..05414b00e3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
@@ -1,5 +1,5 @@
/* wcsrchr.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
index 927d5c8cc3..35a56386d2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
@@ -1,5 +1,5 @@
/* wcsrchr.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
index bb796726dd..708575042b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
index dc4b796723..06e4b61d11 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
index 7a0694be39..486003f0c9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 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