mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
PowerPC: optimized strpbrk for POWER7
This patch add an optimized strpbrk 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 memory clear using VSX instructions.
This commit is contained in:
@ -15,21 +15,17 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined _LIBC || defined HAVE_CONFIG_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#undef strpbrk
|
||||
|
||||
#ifndef STRPBRK
|
||||
#define STRPBRK strpbrk
|
||||
#endif
|
||||
|
||||
/* Find the first occurrence in S of any character in ACCEPT. */
|
||||
char *
|
||||
strpbrk (s, accept)
|
||||
const char *s;
|
||||
const char *accept;
|
||||
STRPBRK (const char *s, const char *accept)
|
||||
{
|
||||
while (*s != '\0')
|
||||
{
|
||||
|
Reference in New Issue
Block a user