From c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Mon, 3 Mar 2014 08:06:41 -0600 Subject: PowerPC: strrchr optimization for POWER7/PPC64 This patch optimizes strrchr() for ppc64. It uses aligned memory access along with cmpb instruction and CPU prefetch to avoid cache misses for speed improvement. --- string/strrchr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'string') diff --git a/string/strrchr.c b/string/strrchr.c index b5b4bc6..47ff08c 100644 --- a/string/strrchr.c +++ b/string/strrchr.c @@ -19,9 +19,13 @@ #undef strrchr +#ifndef STRRCHR +# define STRRCHR strrchr +#endif + /* Find the last occurrence of C in S. */ char * -strrchr (const char *s, int c) +STRRCHR (const char *s, int c) { const char *found, *p; -- cgit v1.1