public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.35/master] x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32
@ 2022-05-16 20:20 Sunil Pandey
  0 siblings, 0 replies; only message in thread
From: Sunil Pandey @ 2022-05-16 20:20 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bc35e22be4ca69f3e2c2e1403ac30d028e092a38

commit bc35e22be4ca69f3e2c2e1403ac30d028e092a38
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Apr 22 10:53:13 2022 -0700

    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>
    (cherry picked from commit 8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3)

Diff:
---
 sysdeps/x86_64/memcmp.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index b153694048..5718a7da86 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -46,6 +46,10 @@
 
 	.text
 ENTRY(MEMCMP)
+# ifdef __ILP32__
+	/* Clear the upper 32 bits.  */
+	movl	%edx, %edx
+# endif
 #ifdef USE_AS_WMEMCMP
 	/* Use 0xffff to test for mismatches on pmovmskb bitmask. Store
 	   in ecx for code size. This is preferable to using `incw` as


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-16 20:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16 20:20 [glibc/release/2.35/master] x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32 Sunil Pandey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).