This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: memcmp-avx2-movbe.S needs saturating subtraction [BZ #21662]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Richard Henderson <rth at twiddle dot net>, libc-alpha at sourceware dot org
- Date: Fri, 23 Jun 2017 22:52:13 +0200
- Subject: Re: [PATCH] x86-64: memcmp-avx2-movbe.S needs saturating subtraction [BZ #21662]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9AD95116081
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9AD95116081
- References: <20170623132026.82F2D4017D45E@oldenburg.str.redhat.com> <6fec374c-177f-b8e8-d7a3-ab10d7dab136@redhat.com> <e1130142-6ec3-8a92-af60-b3163e98f96e@twiddle.net>
On 06/23/2017 10:48 PM, Richard Henderson wrote:
> On 06/23/2017 06:51 AM, Florian Weimer wrote:
>> + shll $8, %eax
>> + shll $8, %ecx
>> bswap %eax
>> bswap %ecx
>> + movzbl -1(%rdi, %rdx), %edi
>> + movzbl -1(%rsi, %rdx), %esi
>> + orl %edi, %eax
>> + orl %esi, %ecx
>
> Do you really need to re-load and merge the final byte?
> It would appear you could leave the low byte zero.
Sorry, I don't understand. Is this the same issue as H.J. raised and
improved?
The final/third byte certainly can affect the outcome of the comparison.
Thanks,
Florian