]> sourceware.org Git - glibc.git/commitdiff
x86: Use `testb` for case-locale check in str{n}casecmp-sse42
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Oct 2022 02:13:37 +0000 (19:13 -0700)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Oct 2022 18:29:05 +0000 (11:29 -0700)
`testb` saves a bit of code size is the imm-operand can be encoded
1-bytes.

Tested on x86-64.

sysdeps/x86_64/multiarch/strcmp-sse4_2.S

index dc6fc90e14a07f5f7bdd869ecfd958f7152bd05a..6b540ff894b3ebdef7f4ede63cf83dac26923a68 100644 (file)
@@ -119,7 +119,7 @@ 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
 # endif
 # ifdef USE_AS_STRNCASECMP_L
@@ -130,7 +130,7 @@ 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
 
This page took 0.050043 seconds and 5 git commands to generate.