Description
Algorithm
Special Requirements The x and y arrays must be double-word aligned.
Implementation Notes
Benchmarks
r
Pointer to output array.
n
Number of elements in arrays.
This routine performs an element by element floating-point multiply of the vec-
tors x[] and y[] and returns the values in r[].
This is the C equivalent of the Assembly Code without restrictions.
void DSPF_sp_vecmul(const float * x, const float * y,
float * restrict r, int n)
{
int i;
for(i = 0; i < n; i++)
r[i] = x[i] * y[i];
}
-
The inner loop is unrolled twice to allow calculation of 2 outputs in the ker-
nel. However the stores are executed conditionally to allow 'n' to be any
number > 0.
-
No extraneous loads occur except for the case when n is odd where a pad
of 4 bytes is required.
-
Endianess: This code is little endian.
-
Interruptibility: The code is interrupt-tolerant but not interruptible.
Cycles
2*floor((n-1)/2) + 18
e.g., for n = 200, cycles = 216
Code size
192
(in bytes)
DSPF_sp_vecmul
DSPLIB Reference
4-63
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers