DSP_minval
Function
Arguments
Description
Algorithm
Special Requirements nx is a multiple of 4 and greater than or equal to 20.
Implementation Notes
Benchmarks
Minimum Value of Vector
short DSP_minval (const short *x, int nx)
x [nx]
Pointer to input vector of size nx.
Length of input data vector. Must be multiple of 4 and ≥20.
nx
return short
Maximum value of a vector.
This routine finds the minimum value of a vector and returns the value.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
short DSP_minval(short x[ ], int nx)
{
int i, min;
min = 32767;
for (i = 0; i < nx; i++)
if (x[i] < min)
min = x[i];
return min;
}
-
Bank Conflicts: No bank conflicts occur.
-
Interruptibility: The code is interrupt-tolerant but not interruptible.
-
The input data is loaded using double word wide loads, and the MIN2
instruction is used to get to the minimum.
Cycles
nx / 4 +10
Codesize
116 bytes
DSP_minval
C64x+ DSPLIB Reference
4-65