views:

723

answers:

2

I am interested in mastering prefetch-related functions such as

_mm_prefetch(...)

so when I perform operations that loop over arrays, the memory bandwidth is fully utilized. What are the best resources for learning about this?

I am doing this work in C using GCC 4 series on an intel linux platform.

+4  A: 

This site contains details on gcc prefetch support including prefetch options and functions and includes details on several architectures including Intel. The gcc manual contains details on the __builtin_prefetch built-in function in section 5.46.

Robert Gamble
+6  A: 

There is also an excellent paper by Ulrich Drepper, What Every Programmer Should Know About Memory. He covers prefetching, plus many other topics dealing with memory performance optimization. It was released in Nov 2007, and is extremely relevant for today's processors. If you're performing operations on very large arrays and believe your bottleneck is getting to memory, you should read it.

DGentry