Technical data
Vector Processing Concepts
1.6 STRIPMINING
An array longer than the maximum vector register length of a vector
processor must be split into two or more subarrays or vectors, each
of which can fit into a vector register. This procedure is known as
stripmining (or sectioning), and it is performed automatically by a
vectorizing compiler when the source program operates on loops longer
than the maximum vector length.
For example, suppose the following FORTRAN loop is vectorized to be run
on a vector processor with registers that are 64 elements long:
DO 20 I=1,350
A(I) = B(I) + C(I)
20 CONTINUE
Because the vector registers can only hold 64 elements, the compiler
vectorizes the loop by splitting the vector into six subvectors to be
processed separately.
As typically happens, one subvector in this example is shorter than the
full length of a vector register. This short subvector is processed first.
Conceptually, the compiler generates vector instructions for the following
functions:
DO I = 1,30
A(I) = B(I) + C(I)
ENDDO
DO I = 31,350,64
DO J = I,I+63
A(J)=B(J) + C(J)
ENDDO
ENDDO
Note that the compiler must also generate code to set the Vector Length
Register to 30 before processing the short vector and then reset it to 64
before processing the remaining vectors.
1–14