Tool/software: TI C/C++ Compiler
Hi,
In FPU mode, is there any way to improve the performance of the code below?
static inline float32_t
MATH_sat(const float32_t in, const float32_t max, const float32_t min)
{
float32_t out = in;
// if(in < min)
// {
// out = min;
// }
// else if(in > max)
// {
// out = max;
// }
out = (out > max) ? max : out;
out = (out < min) ? min : out;
return(out);
} // end of MATH_sat() function
Customer has a lot of these kind of functions. It takes about 50 cycles.
Is there any way to decrease to less than 20 cycles?
Thanks a lot.
Br, Jordan