Optimizing Cache Usage
6
6-21
Example 6-2
Populating an Array for Circular Pointer Chasing with
Constant Stride
register char ** p;
char
*next; // Populating pArray for circular pointer
// chasing with constant access stride
//
p = (char **)*p; loads a value pointing to next load
p = (char **)&pArray;
for (i = 0; i < aperture; i += stride) {
p = (char **)&pArray[i];
if (i + stride >= g_array_aperture) {
next = &pArray[0 ];
} else {
next = &pArray[i + stride];
}
*p = next; // populate the address of the next node
}
Summary of Contents for ARCHITECTURE IA-32
Page 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Page 220: ...IA 32 Intel Architecture Optimization 3 40...
Page 434: ...IA 32 Intel Architecture Optimization 9 20...
Page 514: ...IA 32 Intel Architecture Optimization B 60...
Page 536: ...IA 32 Intel Architecture Optimization C 22...