]> git.ipfire.org Git - thirdparty/glibc.git/commit
[AArch64] Optimized memcmp.
authorWilco Dijkstra <wdijkstr@arm.com>
Thu, 10 Aug 2017 16:00:38 +0000 (17:00 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Fri, 6 Sep 2019 15:30:10 +0000 (16:30 +0100)
commit1896de3d926d299a1ed5c9f0a4f03f5a81969200
tree9fa12a28bcf39e3da4a4f5315ab587b536a172f9
parent54194d8b4d097fd3a9cb9528a0ad686622d6c182
[AArch64] Optimized memcmp.

This is an optimized memcmp for AArch64.  This is a complete rewrite
using a different algorithm.  The previous version split into cases
where both inputs were aligned, the inputs were mutually aligned and
unaligned using a byte loop.  The new version combines all these cases,
while small inputs of less than 8 bytes are handled separately.

This allows the main code to be sped up using unaligned loads since
there are now at least 8 bytes to be compared.  After the first 8 bytes,
align the first input.  This ensures each iteration does at most one
unaligned access and mutually aligned inputs behave as aligned.
After the main loop, process the last 8 bytes using unaligned accesses.

This improves performance of (mutually) aligned cases by 25% and
unaligned by >500% (yes >6 times faster) on large inputs.

* sysdeps/aarch64/memcmp.S (memcmp):
Rewrite of optimized memcmp.

(cherry picked from commit 922369032c604b4dcfd535e1bcddd4687e7126a5)
ChangeLog
sysdeps/aarch64/memcmp.S