This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: prefetch optimizations
On Thu, Jul 10, 2003 at 11:08:38AM -0700, Mike Stump wrote:
> On Thursday, July 10, 2003, at 04:37 AM, Niavis Panagiotis wrote:
> > I'm not sure if this is the right mailing list to post this.
>
> No, its not.
>
> > I'm using the function block_prefetch(follows) to prefetch a 4Kb array
> > in the cpu
> > cache.
>
> You might want to check out __builtin_prefetch in the gcc manual.
> However, notice that cache lines are usually 32 bytes, not 64, on some
> platforms, the lines increase to 128 bytes.
>
> > Can someone explain me or point me to some documents which explain this
> > behaviour?
>
> You will want to read documentation on your processor's architecture
> and specific implementation. You will want to read the documentation
> on your memory controller. You'll probably want to read up on locking
> regions in memory on your OS.
>
> Also, you can go view memory copy routines from all over the place,
> like the Linux kernel.
>
> Also, you can ask google for pointers...
>
Also see http://gcc.gnu.org/projects/prefetch.html, which has general
information about data prefetch support for several architectures that
GCC supports and references for more information.
Janis