aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-10-19 19:13:38 -0700
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-10-20 11:29:05 -0700
commit8775479804cfea2bbe4dcdf19d6589264c96d5fb (patch)
tree30638b90a3c7ba416a9f5cc868eaf8040b5037fc /sysdeps/x86_64
parentf04f8373ddd71794050b904174fb06967be6393f (diff)
downloadglibc-8775479804cfea2bbe4dcdf19d6589264c96d5fb.tar
glibc-8775479804cfea2bbe4dcdf19d6589264c96d5fb.tar.gz
glibc-8775479804cfea2bbe4dcdf19d6589264c96d5fb.tar.bz2
glibc-8775479804cfea2bbe4dcdf19d6589264c96d5fb.zip
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.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S4
1 files changed, 4 insertions, 0 deletions
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