Visible to Intel only — GUID: GUID-24C575A2-4564-4A21-9660-E86F1112984B
Visible to Intel only — GUID: GUID-24C575A2-4564-4A21-9660-E86F1112984B
Vector Indexing Methods
Classic VM mathematical functions work with unit stride. Strided VM mathematical functions (names with “I” suffix) work with arbitrary integer increments. Increments may be positive, negative or equal to zero. For example:
VSEXPI (n, a, inca, r, incr)
is equivalent to:
for (i=0; i<n; i++) { r[i * incr] = exp (a[i * inca]); }
do i=1, n r((i-1)*incr+1) = EXP (a((i-1)*inca+1)) end do
where
i – current index,
inca – input index increment,
incr – output index increment.
n – the number of elements to be computed (important: n is not the maximum array size).
So, when calling VSEXPI(n, a, inca, r, incr) be sure that the input vector a is allocated at least for 1 + (n-1)*inca elements and the result vector r has a space for 1 + (n-1)*incr elements.
For output index increment, equal to 0, the result is not deterministic and generally nonsensical.
Use negative increments to step from base pointers in reverse order.
For example:
VSEXPI (n, a, -2, r, -3)
is equivalent to:
do i=1, n r((i-1)*(-3)+1) = EXP (a((i-1)*(-2)+1)); end do
For example:
VSEXPI (n, a, 2, r(1000:), -3)
Use a zero increment for one fixed argument rather than an array.
For example:
VSMULI (n, a, 1, b, 0, r, 1)
is equivalent to:
do i=1, n r(i) = a(i) * b(1) end do
VM Pack/Unpack functions use the following indexing methods to do this task:
positive increment
index vector
mask vector
The indexing method used in a particular function is indicated by the indexing modifier (see the description of the <mod> field in Function Naming Conventions). For more information on the indexing methods, see Vector Arguments in VM.