From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7844) id BB0A0384D174; Thu, 20 Oct 2022 19:04:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB0A0384D174 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666292660; bh=GA9jkMdd22gDAiNYAFzDImXHWMY3I2InZa2bdQKovfk=; h=From:To:Subject:Date:From; b=jiIIIOL8HTRv3xPyKBNZ934FAnNF8rPBdqH/TGqKuqU8kD47lDa1Ruvg37nHrpLrL MBU2n22t6zbrPmgeSZY7cBW6GHmo5HRqLbQB43TmMutAKuHrXNmQRb6MvYq66+f0vv i8dNsx91U5zpUX5AUaiP7VL0R76NlfryhlnX+4rU= 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 FSRM check in memmove-vec-unaligned-erms X-Act-Checkin: glibc X-Git-Author: Noah Goldstein X-Git-Refname: refs/heads/master X-Git-Oldrev: f04f8373ddd71794050b904174fb06967be6393f X-Git-Newrev: 8775479804cfea2bbe4dcdf19d6589264c96d5fb Message-Id: <20221020190420.BB0A0384D174@sourceware.org> Date: Thu, 20 Oct 2022 19:04:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8775479804cfea2bbe4dcdf19d6589264c96d5fb commit 8775479804cfea2bbe4dcdf19d6589264c96d5fb Author: Noah Goldstein Date: Wed Oct 19 19:13:38 2022 -0700 x86: Use `testb` for FSRM check in memmove-vec-unaligned-erms `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/memmove-vec-unaligned-erms.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S index 5b758cae5e..f6d7f3e88b 100644 --- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S @@ -616,7 +616,11 @@ L(movsb): jae L(large_memcpy_2x_check) # if AVOID_SHORT_DISTANCE_REP_MOVSB || ALIGN_MOVSB /* Only avoid short movsb if CPU has FSRM. */ +# if X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB < 256 + testb $X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip) +# else testl $X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip) +# endif jz L(skip_short_movsb_check) # if AVOID_SHORT_DISTANCE_REP_MOVSB /* Avoid "rep movsb" if RCX, the distance between source and