about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
diff options
context:
space:
mode:
authorRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2017-04-18 11:28:56 +0530
committerRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2017-04-18 11:28:56 +0530
commit6c6ab1fc49d524ab1892cb20ee74352ace0b8034 (patch)
tree716e71e31d63e0b534e2ff47fe6bb8f192f81d76 /sysdeps/powerpc/powerpc64/multiarch/strrchr.c
parent2604882cefd3281679b8177245fdebc7061b8695 (diff)
downloadglibc-6c6ab1fc49d524ab1892cb20ee74352ace0b8034.tar.gz
glibc-6c6ab1fc49d524ab1892cb20ee74352ace0b8034.tar.xz
glibc-6c6ab1fc49d524ab1892cb20ee74352ace0b8034.zip
powerpc64: strrchr optimization for power8
P7 code is used for <=32B strings and for > 32B vectorized loops are used.
This shows as an average 25% improvement depending on the position of search
character.  The performance is same for shorter strings.
Tested on ppc64 and ppc64le.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strrchr.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index dc1d3d0bb7..0f94c9d6a1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -25,11 +25,14 @@
 
 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_redirected (__redirect_strrchr, strrchr,
+		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       ? __strrchr_power8 :
 		       (hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __strrchr_power7
 		       : __strrchr_ppc);