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]); }
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:
for (i=0; i<n; i++) { r[- i*3] = exp (a[-i*2]); }
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:
for (i=0; i<n; i++) { r[i] = a[i] * b[0]; }
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.