PATCH: Handle various cache size

Jakub Jelinek jakub@redhat.com
Wed Sep 8 19:15:00 GMT 2010


On Mon, Sep 06, 2010 at 10:13:58PM -0700, H.J. Lu wrote:
> Hi,
> 
> sysdeps/i386/i686/multiarch/memset-sse2.S doesn't work with odd shared
> cache size, like 1258291. This patch fixes it.  It is needd for both
> trunk and 2.12 branch.

Wouldn't it be better to make sure the __*shared_cache_size{,_half}
variables are rounded down to a multiple of 128 in the initialization?

> 2010-09-06  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* sysdeps/i386/i686/multiarch/memset-sse2.S: Handle various
> 	cache size.
> 
> diff --git a/sysdeps/i386/i686/multiarch/memset-sse2.S b/sysdeps/i386/i686/multiarch/memset-sse2.S
> index 09d2ea8..2211d69 100644
> --- a/sysdeps/i386/i686/multiarch/memset-sse2.S
> +++ b/sysdeps/i386/i686/multiarch/memset-sse2.S
> @@ -347,6 +347,10 @@ L(128bytesless_L2_normal):
>  	RESTORE_EBX_STATE
>  L(128bytesormore_nt_start):
>  	sub	%ebx, %ecx
> +	mov	%ebx, %eax
> +	and	$0x7f, %eax
> +	add	%eax, %ecx
> +	movd	%xmm0, %eax
>  	ALIGN (4)
>  L(128bytesormore_shared_cache_loop):
>  	prefetcht0	0x3c0(%edx)

	Jakub



More information about the Libc-alpha mailing list