This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix x86_64 memchr for large input sizes
On 20/12/2016 15:07, Richard Henderson wrote:
> On 12/20/2016 06:03 AM, Adhemerval Zanella wrote:
>> + sbb %eax, %eax
>> + movslq %eax, %rax
>
> This should be "sbb %rax, %rax" in one step.
>
>> + orq %rdx, %rax
>> + mov %rax, %rdx
>
> Given that the comment says you wanted the result in %rdx,
> why not "or %rax, %rdx"?
Indeed it seems the 4 instructions can be simplified to just
sbb %rax, %rax
or %rax, %rdx
Thanks for the advice.