]> sourceware.org Git - newlib-cygwin.git/commit
Improve strncmp for mutually misaligned inputs
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Fri, 29 Jun 2018 12:38:20 +0000 (18:08 +0530)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 13 Jul 2018 11:27:54 +0000 (13:27 +0200)
commitf44eee8f1bb88c235cea564106b9eab86e5ea29b
tree82ae60ab2a7b9c1bd70aaa1effa708e94ee179eb
parent5ed8f2354fd6476deb68845174f53fa8f13b42b7
Improve strncmp for mutually misaligned inputs

The mutually misaligned inputs on aarch64 are compared with a simple
byte copy, which is not very efficient.  Enhance the comparison
similar to strcmp by loading a double-word at a time.  The peak
performance improvement (i.e. 4k maxlen comparisons) due to this on
the strncmp microbenchmark in glibc is as follows:

falkor: 3.5x (up to 72% time reduction)
cortex-a73: 3.5x (up to 71% time reduction)
cortex-a53: 3.5x (up to 71% time reduction)

All mutually misaligned inputs from 16 bytes maxlen onwards show
upwards of 15% improvement and there is no measurable effect on the
performance of aligned/mutually aligned inputs.
newlib/libc/machine/aarch64/strncmp.S
This page took 0.065169 seconds and 5 git commands to generate.