]> sourceware.org Git - glibc.git/commitdiff
x86: Use `testb` for case-locale check in str{n}casecmp-avx2
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Oct 2022 02:13:35 +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-avx2.S

index 4c01d664e8769fbcd0768000b9cf923d17f0eae1..a24f886a278aff6a041daa36a4d20245edfec79a 100644 (file)
@@ -214,7 +214,7 @@ STRCMP:
 #  else
        mov     (%LOCALE_REG), %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
        leaq    _nl_C_LC_CTYPE_tolower + 128 * 4(%rip), TOLOWER_BASE
 # endif
This page took 0.043304 seconds and 5 git commands to generate.