Intel ARCHITECTURE IA-32 User Manual Page 311

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 310
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
}
Page view 310
1 2 ... 306 307 308 309 310 311 312 313 314 315 316 ... 567 568

Comments to this Manuals

No comments