From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7844) id A199C384D16B; Thu, 20 Oct 2022 19:04:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A199C384D16B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666292655; bh=2gi9Pzq+1X6/AjbMdEPLosEqiH5JHEq2IsiqRuKw+fE=; h=From:To:Subject:Date:From; b=foAqQi8m9fmaKjgiwu/Yj4aFeIwGj8tmZqaGE5qz/u6Z+hbcYh1GREMv5SOlp3mJI WJEPpG9uZ+QW76cMtD6BBiyFRJSLpVuKFvxT16E160v8W5R76EA66+luZWPcvktrtT 9OLUtpRrPZgs9hAWFjwZqEgc4RTnakjpN7b7/pd0= 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-sse42 X-Act-Checkin: glibc X-Git-Author: Noah Goldstein X-Git-Refname: refs/heads/master X-Git-Oldrev: 7775574ce0527c326eaea78370bc9f49cc4743a6 X-Git-Newrev: f04f8373ddd71794050b904174fb06967be6393f Message-Id: <20221020190415.A199C384D16B@sourceware.org> Date: Thu, 20 Oct 2022 19:04:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f04f8373ddd71794050b904174fb06967be6393f commit f04f8373ddd71794050b904174fb06967be6393f Author: Noah Goldstein Date: Wed Oct 19 19:13:37 2022 -0700 x86: Use `testb` for case-locale check in str{n}casecmp-sse42 `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-sse4_2.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S index dc6fc90e14..6b540ff894 100644 --- a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S +++ b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S @@ -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