summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-20 11:24:52 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-20 11:24:52 -0500
commit6eaf95cbfa0031ea267682dc2c9c17ed3e3dc167 (patch)
tree93cf4f0efb9ce1654e9f298b6342953a7935965a /sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
parentae3a5dff0f4135cc57ddddf3c19ed5be80285b54 (diff)
downloadglibc-6eaf95cbfa0031ea267682dc2c9c17ed3e3dc167.tar.gz
PowerPC: optimized strcspn for PPC64/POWER7
This patch add a optimized strcspn for POWER7 by using a different algorithm than default implementation: it constructs a table based on the 'accept' argument and use this table to check for any occurance on the input string. The idea is similar as x86_64 uses. For PowerPC some tunings were added, such as unroll loops and align stack memory to table to 16 bytes (so VSX clean can ran without alignment issues).
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 20d79186c5..328b87e5a9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -262,5 +262,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
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,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strcspn_power7)
+ IFUNC_IMPL_ADD (array, i, strcspn, 1,
+ __strcspn_ppc))
+
return i;
}