aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2014-03-03 08:06:41 -0600
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-03 08:06:41 -0600
commitc7debbdfacbef150aaf9113eb05ccaf2b9e7af6c (patch)
treebaf78c9b58faa86b3996ae3745cb81fd50e2fb58 /string
parent235eed8644eb2deebf839b13b418dbd47bb14c5a (diff)
downloadglibc-c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c.tar
glibc-c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c.tar.gz
glibc-c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c.tar.bz2
glibc-c7debbdfacbef150aaf9113eb05ccaf2b9e7af6c.zip
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.
Diffstat (limited to 'string')
-rw-r--r--string/strrchr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/string/strrchr.c b/string/strrchr.c
index b5b4bc6208..47ff08cfa3 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;