about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-03-14 17:40:46 -0400
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-04-07 15:51:28 -0500
commit25dba0ad054723196fb633ba5d8a463ef5cb775c (patch)
tree03f9259662b03ea65b00bc6721afba2d47104bef /sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
parent1d2a8245ff7bcc1d8be54f01e26c49297e446aba (diff)
downloadglibc-25dba0ad054723196fb633ba5d8a463ef5cb775c.tar.gz
glibc-25dba0ad054723196fb633ba5d8a463ef5cb775c.tar.xz
glibc-25dba0ad054723196fb633ba5d8a463ef5cb775c.zip
powerpc: Add optimized P8 strspn
This utilizes vectors and bitmasks.  For small needle, large
haystack, the performance improvement is upto 8x.  For short
strings (0-4B), the cost of computing the bitmask dominates,
and is a tad slower.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c')
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 11a8215ee4..3e1f099d71 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -322,6 +322,14 @@ __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/strstr.c.  */
   IFUNC_IMPL (i, name, strstr,
              IFUNC_IMPL_ADD (array, i, strstr,