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.

TMS320C6672: RTS vs. MATHLIB

Part Number: TMS320C6672
Other Parts Discussed in Thread: MATHLIB

Hi,

Could you explain the difference between the Run-Time-Support (RTS) library and MATHLIB? I know MATHLIB contains routines optimized by hand to run faster on C667x (such as "divsp"), but on the other hand, standard operators such as "/" invoke RTS functions (such as "__c6xabi_divf"). Both libraries are built for DSP, and both use instructions like "RCPSP" (reciprocal of single-precision floating-point number). Then, why does MATHLIB execute faster than RTS does? If MATHLIB is always faster, then why is it not used by default?

I've read the CPU and instruction set reference guide (SPRUGH7) and the optimizing compiler v8.2.x user’s guide (SPRUI04B), the latter of which mentions RTS, but it does not cover any advantages or drawbacks of using it over MATHLIB.

Kind regards,
Silacko

  • Hello!

    One may recall juxtaposition of latency versus throughput. IMO the main purpose of run-time support library is to deliver reasonably performing functions for routine use. Keeping in mind there is no native division instruction besides rough approximation, they provide programmer with reasonable tools for daily use without requirement to dig for numerical methods. On the other hand, DSPs work a lot with large sequences of data requiring similar processing. At that time it's worth to plan processing in a conveyor fashion in effort to squeeze every last bit of performance. DSPs can achieve exceptional efficiency in doing these repetitive jobs. However, that is achieved not by using some magic efficient instruction, but rather their careful scheduling with overlapping phases of processing on different functional units. And that does not come for free. Normally, it takes several iterations to load pipeline and accelerate to "full speed", as well as few iterations might be required to break from that speed to stop. So there is a situation, when single division or couple of the could be executed with acceptable speed just with RTS, even beating mathlib. However, when count goes for dozens and above, there might be a chance mathlib implementation will be well ahead.

  • Hello again,

    Thanks for the explanation and sorry for my rather delayed reply.

    I infer from your response that RTS is better in terms of latency while MATHLIB is optimal for better throughput; is that correct? Also, could you provide an official source (such as a user guide or reference manual published by TI) that touches upon this comparison between the two libraries? Because I want to cover the difference between RTS and MATHLIB in an academic work, but so far I could not find an official source that I can cite. 

    Thanks again,

    Regards,

    Silacko

  • Silacko,

    IMO, Victor has explained it so well.

    There is no such userguide/refernce manual existing to show up the comparison between these two libraries.

    Regards

    Shankari G

  • Hi, Shankari,

    Thanks for your response. 
    Have a good week. 

    Silacko

  • Silacko,

    I received a notification that this answer has been rejected by you.

    Please let us know, if any of your questions are unattended. Otherwise, shall we close this thread?, with your permission.

    Regards

    Shankari G