This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28075: Float limit code performance improve

Part Number: TMS320F28075


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