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.

TMS320F280037: How can I call strict FP functions within a relaxed FP project?

Part Number: TMS320F280037

Tool/software:

Hello, my project is in relaxed FP mode, but there is one place where I would like to use the strict sinf() and sqrtf() functions for maximum precision.  My main question: Is it possible to directly call the strict (library) functions from user code?

I saw these definitions in math.h.  These are active in relaxed mode and reroute calls to sqrtf() and sinf() to their relaxed (builtin) equivalents, correct?

And if I were in the opposite situation (i.e. if I were wanting to call the relaxed functions in a strict-mode project), the answer would be to call __sinf() instead of sinf(), correct?

I saw in another thread that the relaxed sinf() has a precision of "1 ULP".  What does ULP stand for?

Thanks

  • Hi Chris,

    One option would be to change the compiler settings for the one-specific file where you are making this call and want the strict implementation. You can do this in CCS by right-clicking on the file and going to properties etc. just like you would for the entire project. Or if you are using CCS projectspec, you could do it there as well - let me know if you are using this option, and I can send you the syntax.

    For the other way around, yes, you can use intrinsics.

    ULP = unit of least precision. In floating-point, the precision isn't fixed, so the notion of precision is variable - ULP increases with the magnitude of the number.

    Thanks,

    Sira

  • Thanks, I didn't realise the FP mode can be changed for individual files.  But if the difference in precision is that small, I'll just keep it in relaxed mode.