]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86: Optimize strcspn and strpbrk in strcspn-c.c
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 23 Mar 2022 21:57:22 +0000 (16:57 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Fri, 25 Mar 2022 16:46:13 +0000 (11:46 -0500)
commit30d627d477d7255345a4b713cf352ac32d644d61
tree164a5c3c1018c4fd515145bc189c469d62fe6d97
parentdc18cd6c818944fafbeae9ba1b50bd8d0d070a7c
x86: Optimize strcspn and strpbrk in strcspn-c.c

Use _mm_cmpeq_epi8 and _mm_movemask_epi8 to get strlen instead of
_mm_cmpistri. Also change offset to unsigned to avoid unnecessary
sign extensions.

geometric_mean(N=20) of all benchmarks that dont fallback on
sse2/strlen; New / Original: .928

All string/memory tests pass.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/x86_64/multiarch/strcspn-c.c