This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do not multiply by zero in bzero.


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]