public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Noah Goldstein <nwg@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] x86: Use `testb` for case-locale check in str{n}casecmp-sse2
Date: Thu, 20 Oct 2022 19:04:10 +0000 (GMT)	[thread overview]
Message-ID: <20221020190410.8436A384D14D@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7775574ce0527c326eaea78370bc9f49cc4743a6

commit 7775574ce0527c326eaea78370bc9f49cc4743a6
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Wed Oct 19 19:13:36 2022 -0700

    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:
---
 sysdeps/x86_64/multiarch/strcmp-sse2.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/x86_64/multiarch/strcmp-sse2.S b/sysdeps/x86_64/multiarch/strcmp-sse2.S
index 3c69fc1df1..a975c924d8 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

                 reply	other threads:[~2022-10-20 19:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221020190410.8436A384D14D@sourceware.org \
    --to=nwg@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).