Texas Instruments TMS320C64X Programmer's Reference Manual page 88

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

Advertisement

DSP_dotprod
DSP_dotprod
Function
Arguments
Description
Algorithm
Special Requirements
4-60
Vector Dot Product
int DSP_dotprod(const short * restrict x, const short * restrict y, int nx)
x[nx]
First vector array. Must be double-word aligned.
y[nx]
Second vector array. Must be double word-aligned.
nx
Number of elements of vector. Must be multiple of 4.
return int
Dot product of x and y.
This routine takes two vectors and calculates their dot product. The inputs are
16-bit short data and the output is a 32-bit number.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
int DSP_dotprod(short x[ ],short y[ ], int nx)
{
int sum;
int i;
sum = 0;
for(i=0; i<nx; i++){
sum += (x[i] * y[i]);
}
return (sum);
}
-
The input length must be a multiple of 4.
-
The input data x[ ] and y[ ] are stored on double-word aligned boundaries.
-
To avoid bank conflicts, the input arrays x[ ] and y[ ] must be offset by 4
half-words (8 bytes).

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents