summaryrefslogtreecommitdiff
path: root/arch/tile/lib/strchr_64.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-08-01 19:52:17 (GMT)
committerChris Metcalf <cmetcalf@tilera.com>2013-08-01 20:23:12 (GMT)
commitc53c70a90fdce3e7a53a0412abf7cc2b2a645988 (patch)
tree0b1ec6d04be95ac07563ba518047be73973d25d8 /arch/tile/lib/strchr_64.c
parentdd78bc11fb2050b6a3990d0421feca4c68ca4335 (diff)
downloadlinux-c53c70a90fdce3e7a53a0412abf7cc2b2a645988.tar.xz
tile: optimize and clean up string functions
This change cleans up the string code in a number of ways: - For memcpy(), fix bug in prefetch and increase distance to 3 lines; optimize for unaligned data; do all loads before wh64 to make memcpy safe for forward-overlapping calls; etc. Performance is improved. - Use new copy_byte() function on tilegx to spread a single byte value out into a full word using the shufflebytes instruction. - Clean up header include ordering to be more canonical, and remove spurious #undefs of function names. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/lib/strchr_64.c')
-rw-r--r--arch/tile/lib/strchr_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/tile/lib/strchr_64.c b/arch/tile/lib/strchr_64.c
index f39f9dc..fe6e31c 100644
--- a/arch/tile/lib/strchr_64.c
+++ b/arch/tile/lib/strchr_64.c
@@ -26,7 +26,7 @@ char *strchr(const char *s, int c)
const uint64_t *p = (const uint64_t *)(s_int & -8);
/* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = 0x0101010101010101ULL * (uint8_t) c;
+ const uint64_t goal = copy_byte(c);
/* Read the first aligned word, but force bytes before the string to
* match neither zero nor goal (we make sure the high bit of each