From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 37D323858C83; Fri, 22 Apr 2022 18:54:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37D323858C83 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: H.J. Lu To: glibc-cvs@sourceware.org Subject: [glibc] x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32 X-Act-Checkin: glibc X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: 198abcbb94618730dae1b3f4393efaa49e0ec8c7 X-Git-Newrev: 8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3 Message-Id: <20220422185426.37D323858C83@sourceware.org> Date: Fri, 22 Apr 2022 18:54:26 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2022 18:54:26 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3 commit 8ea20ee5f6145de4bff9481d3e09ac36ba9df8f3 Author: H.J. Lu 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 Diff: --- sysdeps/x86_64/memcmp.S | 4 ++++ sysdeps/x86_64/multiarch/memmove-ssse3.S | 4 ++++ 2 files changed, 8 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 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