0b26f7
commit f2413f2710d5d5cc884b413b83fcf8198e3717fa
0b26f7
Author: H.J. Lu <hjl.tools@gmail.com>
0b26f7
Date:   Sat Aug 28 06:10:38 2021 -0700
0b26f7
0b26f7
    x86-64: Use testl to check __x86_string_control
0b26f7
    
0b26f7
    Use testl, instead of andl, to check __x86_string_control to avoid
0b26f7
    updating __x86_string_control.
0b26f7
    
0b26f7
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
0b26f7
    (cherry picked from commit 3c8b9879cab6d41787bc5b14c1748f62fd6d0e5f)
0b26f7
0b26f7
diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
0b26f7
index 9f02624375c07b26..abde8438d41f2320 100644
0b26f7
--- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
0b26f7
+++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
0b26f7
@@ -325,7 +325,7 @@ L(movsb):
0b26f7
 	/* Avoid slow backward REP MOVSB.  */
0b26f7
 	jb	L(more_8x_vec_backward)
0b26f7
 # if AVOID_SHORT_DISTANCE_REP_MOVSB
0b26f7
-	andl	$X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip)
0b26f7
+	testl	$X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip)
0b26f7
 	jz	3f
0b26f7
 	movq	%rdi, %rcx
0b26f7
 	subq	%rsi, %rcx
0b26f7
@@ -333,7 +333,7 @@ L(movsb):
0b26f7
 # endif
0b26f7
 1:
0b26f7
 # if AVOID_SHORT_DISTANCE_REP_MOVSB
0b26f7
-	andl	$X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip)
0b26f7
+	testl	$X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, __x86_string_control(%rip)
0b26f7
 	jz	3f
0b26f7
 	movq	%rsi, %rcx
0b26f7
 	subq	%rdi, %rcx