From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7844) id 8436A384D14D; Thu, 20 Oct 2022 19:04:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8436A384D14D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666292650; bh=+RA/B/AUw77gzHgZ3m/eO8UTGuU8soOl3oyrW3HKKls=; h=From:To:Subject:Date:From; b=foYIUjZvzMx2u7nwjyDhLhyt0cXt8HGxxaUFfTwYR0STixMbMeB/n3i0D9s8ELcSP 5MKnLbuz9ytGmO4XGht7Tz9zTMEaDRScCU4GOmvOow1byPyiThJpfwmVj8pai6+FHI e0PAsE/ADQhdYOJRP/OLiJge7wjGmoxrP57wL4/U= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Noah Goldstein To: glibc-cvs@sourceware.org Subject: [glibc] x86: Use `testb` for case-locale check in str{n}casecmp-sse2 X-Act-Checkin: glibc X-Git-Author: Noah Goldstein X-Git-Refname: refs/heads/master X-Git-Oldrev: b6d02d64570e83bedfdb946cb1bdf0c9fd6d3eb0 X-Git-Newrev: 7775574ce0527c326eaea78370bc9f49cc4743a6 Message-Id: <20221020190410.8436A384D14D@sourceware.org> Date: Thu, 20 Oct 2022 19:04:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7775574ce0527c326eaea78370bc9f49cc4743a6 commit 7775574ce0527c326eaea78370bc9f49cc4743a6 Author: Noah Goldstein 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