Example 3-19 Strip Mined Code - Intel ARCHITECTURE IA-32 Reference Manual

Architecture optimization
Table of Contents

Advertisement

Example 3-18 Pseudo-code Before Strip Mining (continued)
}
The main loop consists of two functions: transformation and lighting.
For each object, the main loop calls a transformation routine to update
some data, then calls the lighting routine to further work on the data. If
the size of array
that were cached during
v[i]
the cache by the time we do
will have to be fetched from main memory a second time, reducing
performance.

Example 3-19 Strip Mined Code

main()
{
Vertex_rec v[Num];
....
for (i=0; i < Num; i+=strip_size) {
for (j=i; j < min(Num, i+strip_size); j++) {
}
for (j=i; j < min(Num, i+strip_size); j++) {
}
}
}
for (i=0; i<Num; i++) {
Lighting(v[i]);
}
....
is larger than the cache, then the coordinates for
v[Num]
Transform(v[j]);
Lighting(v[j]);
Coding for SIMD Architectures
Transform(v[i])
. This means that
Lighting(v[i])
will be evicted from
v[i]
3
3-33

Advertisement

Table of Contents
loading

Table of Contents