]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 22 Apr 2022 17:53:13 +0000 (10:53 -0700)
committerSunil K Pandey <skpgkp2@gmail.com>
Mon, 16 May 2022 19:34:52 +0000 (12:34 -0700)
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)

sysdeps/x86_64/memcmp.S

index b1536940482adf7793f80b4f9185f97e4217f246..5718a7da8628f15a96616919557eb064620119b8 100644 (file)
 
        .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