Technical data
Vector Processing Concepts
for which vectorization will yield correct results and generate vector
instructions for those operations. If the compiler cannot be certain that
a particular expression can be correctly vectorized, it will not vectorize
that portion of the source code. The vectorizing compiler can reorganize
sections of the program code (usually inside formal loops) that can be
vectorized.
Certain portions of all applications are nonvectorizable. Some
programming techniques, by their nature, cannot be vectorized. For
example, conditional branches into or out of a loop make it impossible
for the compiler to know the range of the loop (that is, the vector length)
before the code is executed.
In other instances, there may be an unclear relationship between multiple
references to the same memory location (called an unknown dependency).
In such a relationship, the final value of the location may or may not
depend on serial execution of the code, and the compiler does not have
enough information to determine whether it can vectorize.
Finally, there may be instances of constructs that could be vectorized
but are not. The compiler may not be sophisticated enough to do so, the
compiler may determine that vectorization would not be profitable in
terms of performance, or the compiler may have insufficient information
to determine that vectorization is safe.
1.4 VECTOR REGISTERS
A scalar register is a location in fast memory where data is stored or
status bits can be placed to be read at a later time. A register has a set
length, say 32 bits, or four consecutive 8-bit bytes.
A vector register is considerably larger. With the VAX, the vector register
has a maximum length of 64 elements. Each element can contain up to
64 bits. The elements used can be enabled or disabled by setting bits in
a Vector Mask Register (VMR). The programmer usually determines the
range, or limits the number of elements used through a Vector Length
Register (VLR) (see Figure 1–2). This range can vary, for example, from 0
to 64 elements. Of course, if the vector length = 0, no vector elements will
be processed.
1–9