[PATCH] Do not multiply by zero in bzero.

Richard Henderson rth@twiddle.net
Thu Mar 21 20:15:00 GMT 2013


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~



More information about the Libc-alpha mailing list