This is the mail archive of the libc-alpha@sources.redhat.com 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: Optimize memcmp for ia32


On Wed, Feb 04, 2004 at 04:11:26PM -0800, H. J. Lu wrote:

> +L(find_diff):
> +	cmpb	%cl, %al
> +	jne	L(set)
> +	cmpw	%cx, %ax

	cmpb	%ch, %ah	This cmpb vs. cmpw will save 1 byte of
				code and add another 1% of performance.

> +	jne	L(set)
> +	shrl	$16,%eax
> +	shrl	$16,%ecx
> +	cmpb	%cl, %al
> +	jne	L(set)
> +	/* We get there only if we already know there is a
> +	   difference.  */
> +	cmpl	%ecx, %eax
> +L(set):

I'm sorry for my intervence.  :)  But 16-bit operations are the big
performance penalties in 32-bit mode.


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