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.

Using Math Library for C674x floating point DSPs

Other Parts Discussed in Thread: MATHLIB

What do TI recommend using the optimized math library in a custom algorithms? Including mathlib.h so the optimized math operation source gets statically linked in a custom algorithm library or ask algorithm user to link TI's fast math lib to build the application ?

Based on this link - http://www.ti.com/tool/mathlib#supportandcommunity, Ti suggests "These new functions can be called with the current run-time-support library names or the new names included in the math library." But, when I use "sqrt" function then it always uses from rts6470.lib instead fast mathlib. I have to use different function name i.e. "sqrtsp" in order to use the optimized sqrt function.

Does that mean I need to modify my algorithm source to replace sqrt  with sqrtsp ?

 Any idea how to force not to use rts6470.lib's math functions?

 

Thanks!

ARM

  • Hi.

    Thanks for your post.

    There are appropriate pre-compiles libraries seperately for Mathlib & RTSlib which needs to be included explicitly to over ride RTS library function and to use only MATH library functions. There are differences between functions used in RTS lib & MATHlib override library. To know more details on this, please walk through the below E2E thread;

    http://e2e.ti.com/support/embedded/tirtos/f/355/t/289024.aspx

    In the above thread, you will understand the exact difference between Mathlib & Mathlib override library.

    Also, please see the below wiki:

    http://processors.wiki.ti.com/index.php?title=Software_libraries#MathLIB

    There are known pragma issues in MATH lib too, please go through the below E2E thread:

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/228422.aspx

    For floating point questions on Mathlib, please see the below E2E thread:

    http://e2e.ti.com/support/development_tools/compiler/f/343/t/187519.aspx

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------
  • Thanks Sivaraj K!

    I have seen significant CPU performance improvement by using optimized MATHLIB math functions over runtime library's math functions.

    So, after going through above links and other forum resources on MATHLIB, I have decided to implement my own MACROs pointing to MATHLIB's math functions i.e. #define MY_SQRT sqrtsp and added extern declaration for all fast math operation indicating its coming from external library. Using completely different function name instead common math function name i.e. sqrt, it will ensure that it does not require any override like it does for common math function name as I do not find clear instructions on overriding runtime math functions by MATHLIB math functions.

    We are going to tell our library consumer to download the TI's MATHLIB to link it when they build an application using our algorithm so it finds the optimized MATHLIB symbols instead using runtime library math symbols. 

    Your comments are most welcome if  you think of a better approach or solution.

    ~ARM