aboutsummaryrefslogtreecommitdiff
path: root/string/strspn.c
diff options
context:
space:
mode:
authorVidya Ranganathan <vidya@linux.vnet.ibm.com>2014-03-10 12:20:36 -0400
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-11 08:54:33 -0500
commite65caf1f1df4ecc122da3d30689ee2e8e2bd354f (patch)
tree512c80cac0072cacd0fe600c85eb208016406138 /string/strspn.c
parentba9cc0714e58a9e8fa73cf6b0e205cbf1e6b71f2 (diff)
downloadglibc-e65caf1f1df4ecc122da3d30689ee2e8e2bd354f.zip
glibc-e65caf1f1df4ecc122da3d30689ee2e8e2bd354f.tar.gz
glibc-e65caf1f1df4ecc122da3d30689ee2e8e2bd354f.tar.bz2
PowerPC: strspn optimization for PPC64/POWER7
The optimization is achieved by following techniques: > hashing of needle. > hashing avoids scanning of duplicate entries in needle across the string. > initializing the hash table with Vector instructions (VSX) by quadword access. > unrolling when scanning for character in string across hash table.
Diffstat (limited to 'string/strspn.c')
-rw-r--r--string/strspn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/string/strspn.c b/string/strspn.c
index 37e8161..c2d6364 100644
--- a/string/strspn.c
+++ b/string/strspn.c
@@ -18,13 +18,14 @@
#include <string.h>
#undef strspn
+#ifndef STRSPN
+#define STRSPN strspn
+#endif
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t
-strspn (s, accept)
- const char *s;
- const char *accept;
+STRSPN (const char *s, const char *accept)
{
const char *p;
const char *a;