From: Noah Goldstein Date: Thu, 20 Oct 2022 02:13:36 +0000 (-0700) Subject: x86: Use `testb` for case-locale check in str{n}casecmp-sse2 X-Git-Tag: glibc-2.37~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7775574ce0527c326eaea78370bc9f49cc4743a6;p=thirdparty%2Fglibc.git x86: Use `testb` for case-locale check in str{n}casecmp-sse2 `testb` saves a bit of code size is the imm-operand can be encoded 1-bytes. Tested on x86-64. --- diff --git a/sysdeps/x86_64/multiarch/strcmp-sse2.S b/sysdeps/x86_64/multiarch/strcmp-sse2.S index 3c69fc1df1b..a975c924d8b 100644 --- a/sysdeps/x86_64/multiarch/strcmp-sse2.S +++ b/sysdeps/x86_64/multiarch/strcmp-sse2.S @@ -104,7 +104,7 @@ ENTRY (STRCMP) # else mov (%rdx), %RAX_LP # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax) + testb $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax) jne __strcasecmp_l_nonascii # elif defined USE_AS_STRNCASECMP_L /* We have to fall back on the C implementation for locales @@ -114,7 +114,7 @@ ENTRY (STRCMP) # else mov (%rcx), %RAX_LP # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax) + testb $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax) jne __strncasecmp_l_nonascii # endif