From 6f23d0939e9651d8ac3c77a835fb6464b35a1dc4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 20 Mar 2014 15:28:07 -0500 Subject: 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. --- string/strpbrk.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'string') diff --git a/string/strpbrk.c b/string/strpbrk.c index ce33b684ef..a694242161 100644 --- a/string/strpbrk.c +++ b/string/strpbrk.c @@ -15,21 +15,17 @@ License along with the GNU C Library; if not, see . */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#if defined _LIBC || defined HAVE_CONFIG_H -# include -#endif +#include #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') { -- cgit v1.2.3