Subject: Re: bzero
To: Simon Burge <>
From: Bill Studenmund <>
List: port-powerpc
Date: 11/13/2001 15:27:23
On Wed, 14 Nov 2001, Simon Burge wrote:

> Bill Studenmund wrote:
> > This is for code in libc, correct? Making cache line size a constant would
> > be bad as we want to be able to use the same libc on all powerpc ports.
> > We'd like to be able to use the same userland in general on all ports of
> > the same arch. :-)
> The latest code drop from Martin includes fetching the cache line size
> with the machdep.cachelinesize sysctl.

The problem is won't getting this variable wipe out any savings we had?
ESPECIALLY if it's a system call!?!?

How about something where libc has code that does what Jason suggests -
there's a variable indicating the cache size which we init if it's zero.
The code then does the right thing depending on the CPU.

What'd be quite nice is something like libm387 but just for the memset
calls; libcppc16, libcppc32, libcppc128 would have 16, 32, and
128-byte-cache versions of routines, and would get loaded before
That way you get linked to the right version, rather than having to test
each time. I'm assuming the libc versions would do the ask-and-cache
behavior Jason proposed, so that static binaries work right.

Take care,