Texas Instruments TMS320C64X Programmer's Reference Manual page 100

Dsp little-endian dsp library
Hide thumbs Also See for TMS320C64X:
Table of Contents

Advertisement

DSP_w_vec
DSP_w_vec
Function
Arguments
Description
Algorithm
Special Requirements
Implementation Notes
Benchmarks
4-72
Weighted Vector Sum
void DSP_w_vec(const short * restrict x, const short * restrict y, short m, short
* restrict r, short nr)
x[nr]
Vector being weighted. Must be double-word aligned.
y[nr]
Summation vector. Must be double-word aligned.
m
Weighting factor
r[nr]
Output vector
Dimensions of the vectors. Must be multiple of 8 and ≥8.
nr
This routine is used to obtain the weighted vector sum. Both the inputs and
output are 16-bit numbers.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
void DSP_w_vec(short x[ ],short y[ ],short m,
short r[ ],short nr)
{
short i;
for (i=0; i<nr; i++) {
r[i] = ((m * x[i]) >> 15) + y[i];
}
}
nr must be a multiple of 8 and ≥ 8.
-
-
Vectors x[ ] and y[ ] must be double-word aligned.
-
Bank Conflicts: No bank conflicts occur.
-
Interruptibility: The code is interrupt-tolerant but not interruptible.
-
Input is loaded in double-words.
-
Use of packed data processing to sustain throughput.
Cycles
3 * nr/8 + 18
Codesize
144 bytes

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents