This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Do not multiply by zero in bzero.
- From: Richard Henderson <rth at twiddle dot net>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 21 Mar 2013 13:15:05 -0700
- Subject: Re: [PATCH] Do not multiply by zero in bzero.
- References: <20130321162026 dot GA16603 at domone dot kolej dot mff dot cuni dot cz>
On 03/21/2013 09:20 AM, OndÅej BÃlka wrote:
> - mov %rsi,%rdx /* Adjust parameter. */
> - xorl %esi,%esi /* Fill with 0s. */
> - jmp L(memset_entry)
> + mov %rsi,%r8 /* Adjust parameter. */
Please update the comment. It's no longer to adjust the parameter,
it's to put the address where the body of memset wants it.
> + xor %rdx,%rdx /* Fill with 0s. */
edx avoids the rex prefix
> +
> + cmp $0x1,%r8
> + mov %rdi,%rax /* memset returns the dest address. */
But this is bzero, not memset. The return type is void.
You could in fact eliminate this insn.
r~