diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-01-10 18:00:57 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-06 16:19:35 -0300 |
commit | 685e844a97ba0506dee575ba530b170edaa59fed (patch) | |
tree | 99800df5d60b81d2de6e8d038a0ea8bc8fa9c80f /sysdeps | |
parent | 350d8d13661a863e6b189f02d876fa265fe71302 (diff) | |
download | glibc-685e844a97ba0506dee575ba530b170edaa59fed.tar glibc-685e844a97ba0506dee575ba530b170edaa59fed.tar.gz glibc-685e844a97ba0506dee575ba530b170edaa59fed.tar.bz2 glibc-685e844a97ba0506dee575ba530b170edaa59fed.zip |
string: Improve generic strchrnul
New algorithm read the first aligned address and mask off the unwanted
bytes (this strategy is similar to arch-specific implementations used
on powerpc, sparc, and sh).
The loop now read word-aligned address and check using the has_zero_eq
function.
Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64-linux-gnu,
and powerpc-linux-gnu by removing the arch-specific assembly
implementation and disabling multi-arch (it covers both LE and BE
for 64 and 32 bits).
Co-authored-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c | 4 | ||||
-rw-r--r-- | sysdeps/s390/strchrnul-c.c | 2 |
2 files changed, 0 insertions, 6 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c index 88ce5dfffa..da03ac7c04 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c @@ -19,10 +19,6 @@ #include <string.h> #define STRCHRNUL __strchrnul_ppc - -#undef weak_alias -#define weak_alias(a,b ) - extern __typeof (strchrnul) __strchrnul_ppc attribute_hidden; #include <string/strchrnul.c> diff --git a/sysdeps/s390/strchrnul-c.c b/sysdeps/s390/strchrnul-c.c index e1248d1dbf..ff6aa38d4f 100644 --- a/sysdeps/s390/strchrnul-c.c +++ b/sysdeps/s390/strchrnul-c.c @@ -22,8 +22,6 @@ # if HAVE_STRCHRNUL_IFUNC # define STRCHRNUL STRCHRNUL_C # define __strchrnul STRCHRNUL -# undef weak_alias -# define weak_alias(name, alias) # endif # include <string/strchrnul.c> |