mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
committed by
Adhemerval Zanella
parent
ba9cc0714e
commit
e65caf1f1d
@ -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;
|
||||
|
Reference in New Issue
Block a user