From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7844) id 688A1384D171; Thu, 20 Oct 2022 19:04:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 688A1384D171 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666292645; bh=g6iXW/a4imxztkDGLFrC3vZ4c6RCn+ey5/6N8KjGmYs=; h=From:To:Subject:Date:From; b=Y2AgtO+pHUHLp0hX9qLWQTzNSiynL3fMJlatHW3dTzCT2ydeU2mOzKGPM2TG/i+Pb 70g47kBTqlCYUOvyYx5/vUmYltDOknWq7xoqQj16b2aw6331L0tsfbC/UHPHbtQI6O AZp/y11ZG791VsXDmiCAAFTsWtxpXlGEbNtIIgmg= 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-avx2 X-Act-Checkin: glibc X-Git-Author: Noah Goldstein X-Git-Refname: refs/heads/master X-Git-Oldrev: 5ce9766417782c1b57f239451d0400f1229e83f7 X-Git-Newrev: b6d02d64570e83bedfdb946cb1bdf0c9fd6d3eb0 Message-Id: <20221020190405.688A1384D171@sourceware.org> Date: Thu, 20 Oct 2022 19:04:05 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b6d02d64570e83bedfdb946cb1bdf0c9fd6d3eb0 commit b6d02d64570e83bedfdb946cb1bdf0c9fd6d3eb0 Author: Noah Goldstein Date: Wed Oct 19 19:13:35 2022 -0700 x86: Use `testb` for case-locale check in str{n}casecmp-avx2 `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-avx2.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S index 4c01d664e8..a24f886a27 100644 --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S @@ -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