prefetch optimizations

Mike Stump mrs@apple.com
Thu Jul 10 18:38:00 GMT 2003


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...



More information about the Gcc mailing list