]> sourceware.org Git - glibc.git/commit
x86: Optimize strcmp-avx2.S
authorNoah Goldstein <goldstein.w.n@gmail.com>
Mon, 10 Jan 2022 21:35:38 +0000 (15:35 -0600)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 3 Feb 2022 22:41:38 +0000 (16:41 -0600)
commitb77b06e0e296f1a2276c27a67e1d44f2cfa38d45
tree76e602ea1fafa769ccad9cce1d5c97a6302e140b
parent1a908d9074102bf3dbe2451ad12f2fbc1abbd7dd
x86: Optimize strcmp-avx2.S

Optimization are primarily to the loop logic and how the page cross
logic interacts with the loop.

The page cross logic is at times more expensive for short strings near
the end of a page but not crossing the page. This is done to retest
the page cross conditions with a non-faulty check and to improve the
logic for entering the loop afterwards. This is only particular cases,
however, and is general made up for by more than 10x improvements on
the transition from the page cross -> loop case.

The non-page cross cases are improved most for smaller sizes [0, 128]
and go about even for (128, 4096]. The loop page cross logic is
improved so some more significant speedup is seen there as well.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
sysdeps/x86_64/multiarch/strcmp-avx2.S
This page took 0.041681 seconds and 5 git commands to generate.