]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Use `testb` for FSRM check in memmove-vec-unaligned-erms
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Oct 2022 02:13:38 +0000 (19:13 -0700)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Oct 2022 18:29:05 +0000 (11:29 -0700)
`testb` saves a bit of code size is the imm-operand can be encoded
1-bytes.

Tested on x86-64.

sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S

index 5b758cae5e6c7beba66f845d42cba6ba4b5f6296..f6d7f3e88b9bf2e5d903f961571584a9455493f4 100644 (file)
@@ -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