about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-04-22 10:53:13 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-04-22 11:23:15 -0700
commit8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3 (patch)
tree0b55037af7f84a79e8849190c50acd0921e1f9f5 /sysdeps/x86_64/multiarch
parent198abcbb94618730dae1b3f4393efaa49e0ec8c7 (diff)
downloadglibc-8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3.tar.gz
glibc-8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3.tar.xz
glibc-8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3.zip
x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32
Clear the upper 32 bits in RDX (memory size) for x32 to fix

FAIL: string/tst-size_t-memcmp
FAIL: string/tst-size_t-memcmp-2
FAIL: string/tst-size_t-memcpy
FAIL: wcsmbs/tst-size_t-wmemcmp

on x32 introduced by

8804157ad9 x86: Optimize memcmp SSE2 in memcmp.S
26b2478322 x86: Reduce code size of mem{move|pcpy|cpy}-ssse3

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/multiarch')
-rw-r--r--sysdeps/x86_64/multiarch/memmove-ssse3.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/memmove-ssse3.S b/sysdeps/x86_64/multiarch/memmove-ssse3.S
index 215583e7bd..310ff62b86 100644
--- a/sysdeps/x86_64/multiarch/memmove-ssse3.S
+++ b/sysdeps/x86_64/multiarch/memmove-ssse3.S
@@ -27,6 +27,10 @@ ENTRY(MEMMOVE_CHK)
 END(MEMMOVE_CHK)
 
 ENTRY_P2ALIGN(MEMMOVE, 6)
+# ifdef __ILP32__
+	/* Clear the upper 32 bits.  */
+	movl	%edx, %edx
+# endif
 	movq	%rdi, %rax
 L(start):
 	cmpq	$16, %rdx