diff options
| author | Akinobu Mita <[email protected]> | 2012-03-23 15:02:14 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-03-23 16:58:35 -0700 |
| commit | f43804bf5f9ae1e60077c5f22aee5fdfe4f09837 (patch) | |
| tree | 61e2dcaef0ab774d5cd68a89859f569d54fa7f78 /scripts | |
| parent | a403d930c58eb8448f81fa90c125ac36dc8ef89d (diff) | |
string: memchr_inv() speed improvements
- Generate a 64-bit pattern more efficiently
memchr_inv needs to generate a 64-bit pattern filled with a target
character. The operation can be done by more efficient way.
- Don't call the slow check_bytes() if the memory area is 64-bit aligned
memchr_inv compares contiguous 64-bit words with the 64-bit pattern as
much as possible. The outside of the region is checked by check_bytes()
that scans for each byte. Unfortunately, the first 64-bit word is
unexpectedly scanned by check_bytes() even if the memory area is aligned
to a 64-bit boundary.
Both changes were originally suggested by Eric Dumazet.
Signed-off-by: Akinobu Mita <[email protected]>
Suggested-by: Eric Dumazet <[email protected]>
Cc: Brian Norris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions