]> sourceware.org Git - glibc.git/commit
x86: Optimize L(less_vec) case in memcmp-evex-movbe.S
authorNoah Goldstein <goldstein.w.n@gmail.com>
Sat, 25 Dec 2021 00:54:41 +0000 (18:54 -0600)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Mon, 27 Dec 2021 09:17:59 +0000 (03:17 -0600)
commitabddd61de090ae84e380aff68a98bd94ef704667
tree1ad46343a6392a29d5140df5e6ac03fe0101e5c9
parent268d812c19ef30b2f9d52dc517c27a349df25ca9
x86: Optimize L(less_vec) case in memcmp-evex-movbe.S

No bug.
Optimizations are twofold.

1) Replace page cross and 0/1 checks with masked load instructions in
   L(less_vec). In applications this reduces branch-misses in the
   hot [0, 32] case.
2) Change controlflow so that L(less_vec) case gets the fall through.

Change 2) helps copies in the [0, 32] size range but comes at the cost
of copies in the [33, 64] size range.  From profiles of GCC and
Python3, 94%+ and 99%+ of calls are in the [0, 32] range so this
appears to the the right tradeoff.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/x86_64/multiarch/memcmp-evex-movbe.S
This page took 0.043598 seconds and 5 git commands to generate.