aboutsummaryrefslogtreecommitdiff
path: root/string
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 14:20:16 -0500
commitafd75351c2f3cae4a2daf88c50faad889e3a0f2b (patch)
tree67b2fc3dd6a65471372aaa968df90e0ace69bfce /string
parente5829d82c88117c9f4752cedfefc8516cb9ffdf7 (diff)
downloadglibc-afd75351c2f3cae4a2daf88c50faad889e3a0f2b.zip
glibc-afd75351c2f3cae4a2daf88c50faad889e3a0f2b.tar.gz
glibc-afd75351c2f3cae4a2daf88c50faad889e3a0f2b.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')
-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;