This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug string/21662] memcmp-avx2-movbe.S lacks saturating subtraction for between_2_3
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 23 Jun 2017 15:39:18 +0000
- Subject: [Bug string/21662] memcmp-avx2-movbe.S lacks saturating subtraction for between_2_3
- Auto-submitted: auto-generated
- References: <bug-21662-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21662
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 3ec7c02cc3e922b9364dc8cfd1d4546671b91003 (commit)
from 7fa1d9462baabc5a1058efc13a48444af4678acf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3ec7c02cc3e922b9364dc8cfd1d4546671b91003
commit 3ec7c02cc3e922b9364dc8cfd1d4546671b91003
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Jun 23 17:23:44 2017 +0200
x86-64: memcmp-avx2-movbe.S needs saturating subtraction [BZ #21662]
This code:
L(between_2_3):
/* Load as big endian with overlapping loads and bswap to avoid
branches. */
movzwl -2(%rdi, %rdx), %eax
movzwl -2(%rsi, %rdx), %ecx
shll $16, %eax
shll $16, %ecx
movzwl (%rdi), %edi
movzwl (%rsi), %esi
orl %edi, %eax
orl %esi, %ecx
bswap %eax
bswap %ecx
subl %ecx, %eax
ret
needs a saturating subtract because the full register is used.
With this commit, only the lower 24 bits of the register are used,
so a regular subtraction suffices.
The test case change adds coverage for these kinds of bugs.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
string/test-memcmp.c | 11 ++++++-----
sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S | 20 ++++++++++----------
3 files changed, 23 insertions(+), 15 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.