DSPF_sp_minval
Implementation Notes
Benchmarks
DSPF_sp_minval
Function
Arguments
Description
Algorithm
4-58
-
The loop is unrolled three times.
-
Three maximums are maintained in each iteration.
-
MPY instructions are used for move.
-
Endianess: This code is endian neutral.
-
Interruptibility: This code is interrupt-tolerant butnot interruptible.
Cycles
2*nx/3 + 13
For nx=60, cycles=53
For nx=30, cycles=33
Code size
256
(in bytes)
Minimum element of single-precision vector
float DSPF_sp_minval (const float* x, int nx)
x
Pointer to input array.
nx
Number of inputs in the input array.
This routine finds out and returns the minimum number in the input array.
float DSPF_sp_minval(const float* x, int nx)
{
int i,index;
float min;
*((int *)&min) = 0x7f800000;
for (i = 0; i < nx; i++)
if (x[i] < min)
{
min = x[i];
index = i;
}
return min;
}
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers