]> 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)
committerSunil K Pandey <skpgkp2@gmail.com>
Tue, 17 May 2022 03:43:59 +0000 (20:43 -0700)
commit8cd840d5262395ffd48ad4654208425290cd4092
treeef64e17d451393d86a9ac2374ed1a6f8f3dbb38f
parent7a40676084e2290954deef41b1ee77397e7ae36b
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>
(cherry picked from commit 30d627d477d7255345a4b713cf352ac32d644d61)
sysdeps/x86_64/multiarch/strcspn-c.c