Texas Instruments TMS320C64X Programmer's Reference Manual page 99

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

Advertisement

DSP_vecsumsq
Function
Arguments
Description
Algorithm
Special Requirements nx must be a multiple of 4 and greater than or equal to 32.
Implementation Notes
Benchmarks
Sum of Squares
int DSP_vecsumsq (const short *x, int nx)
x[nx]
Input vector
Number of elements in x. Must be multiple of 4 and ≥8.
nx
return int
Sum of the squares
This routine returns the sum of squares of the elements contained in the vector
x[ ].
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_vecsumsq(short x[ ], int nx)
{
int i, sum=0;
for(i=0; i<nx; i++)
{
sum += x[i]*x[i];
}
return(sum);
}
-
Bank Conflicts: No bank conflicts occur.
-
Interruptibility: The code is interrupt-tolerant but not interruptible.
-
The code is unrolled 4 times to enable full memory and multiplier
bandwidth to be utilized.
Cycles
nx/4 + 11
Codesize
188 bytes
DSP_vecsumsq
C64x+ DSPLIB Reference
4-71

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents