about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-06-23 11:29:38 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-06-23 11:29:38 -0700
commitacecb3f7de4892b68ec1b464a576ee84b3f97527 (patch)
treef433c7ae9b498e9fefdc297a2f6f1c333f653582
parent67145d84d9719d270f63f4399e337a4bdcb778f5 (diff)
downloadglibc-acecb3f7de4892b68ec1b464a576ee84b3f97527.tar.gz
glibc-acecb3f7de4892b68ec1b464a576ee84b3f97527.tar.xz
glibc-acecb3f7de4892b68ec1b464a576ee84b3f97527.zip
x86-64: Optimize L(between_2_3) in memcmp-avx2-movbe.S hjl/pr21666/master
Turn

	movzbl	-1(%rdi, %rdx), %edi
	movzbl	-1(%rsi, %rdx), %esi
	orl	%edi, %eax
	orl	%esi, %ecx

into

	movb	-1(%rdi, %rdx), %al
	movb	-1(%rsi, %rdx), %cl

	* sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S (between_2_3):
	Replace movzbl and orl with movb.
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S8
1 files changed, 3 insertions, 5 deletions
diff --git a/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
index 9d1921033e..abcc61c381 100644
--- a/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
+++ b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
@@ -144,11 +144,9 @@ L(between_2_3):
 	shll	$8, %ecx
 	bswap	%eax
 	bswap	%ecx
-	movzbl	-1(%rdi, %rdx), %edi
-	movzbl	-1(%rsi, %rdx), %esi
-	orl	%edi, %eax
-	orl	%esi, %ecx
-	/* Subtraction is okay because the upper 8 bits a zero.  */
+	movb	-1(%rdi, %rdx), %al
+	movb	-1(%rsi, %rdx), %cl
+	/* Subtraction is okay because the upper 8 bits are zero.  */
 	subl	%ecx, %eax
 	ret