public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] x86: Use `testb` for FSRM check in memmove-vec-unaligned-erms
@ 2022-10-20 19:04 Noah Goldstein
  0 siblings, 0 replies; only message in thread
From: Noah Goldstein @ 2022-10-20 19:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8775479804cfea2bbe4dcdf19d6589264c96d5fb

commit 8775479804cfea2bbe4dcdf19d6589264c96d5fb
Author: Noah Goldstein <goldstein.w.n@gmail.com>
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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-20 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 19:04 [glibc] x86: Use `testb` for FSRM check in memmove-vec-unaligned-erms Noah Goldstein

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).