EasyManua.ls Logo

Intel ARCHITECTURE IA-32 - Example 6-2 Populating an Array for Circular Pointer Chasing with Constant Stride

Intel ARCHITECTURE IA-32
568 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
}

Table of Contents

Related product manuals