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.

IQMath _IQSat() for FLOAT_MATH

Hi folks,

I am doing some unit testing with a C28x project that uses the IQmathLib.

The unit tests are compiled and executed in the host environment (Ubuntu, or rather Windows Subsystem for Linux) using GCC.

For this use I have added a -D definition at the command line for the IQ MATH_TYPE to be equal to 1, i.e. FLOAT_MATH.

I think this is possibly not what the FLOAT_MATH was intended for, but rather for use if switching to using floating point on CLA. Is that correct?

My reason to ask is that I have found that the _IQsat() used for FLOAT_MATH uses C28x compiler intrinsics:

#define   _IQsat(A, Pos, Neg)  (__fmax(((__fmin((A),(Pos)))),(Neg)))

Resorting to using the commented out implementation does not help:

extern  float _satf(float A, float Pos, float Neg);
#define   _IQsat(A, Pos, Neg)    _satf(A, Pos, Neg)

Is _satf in this latter case also referencing some compiler intrinsic (I couldn't find mention of it in the C28x C/C++ compiler user's guide) or how is it intended to be used?

Thanks, T

  • Hi Toby,

    Toby Mole said:
    I think this is possibly not what the FLOAT_MATH was intended for, but rather for use if switching to using floating point on CLA. Is that correct?

    Thats incorrect. The .lib was built for the C28x. The ISA is incompatible with the CLA. You could possibly use some of the macros in the IQMathLib.h in a CLA task but nothing that requires the .lib. The FLOAT_MATH was for C2000 devices that had floating point support in hardware. 

    Toby Mole said:
    Is _satf in this latter case also referencing some compiler intrinsic (I couldn't find mention of it in the C28x C/C++ compiler user's guide) or how is it intended to be used?

    In the latest compiler its _fsat (see SPRU514, table 7-7). Its possible that at the original time of writing the intrinsic was _satf.