This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Handle various cache size
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 7 Sep 2010 15:27:38 +0200
- Subject: Re: PATCH: Handle various cache size
- References: <20100907051358.GA26445@intel.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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