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.

Inlining of DSPLIB and MATHLIB function calls

Other Parts Discussed in Thread: MATHLIB

Hi all,

I have a C6000 program that makes function calls to some DSPLIB and MATHLIB functions inside a loop. According to the performance advisor, these calls prevent the loop from beeing optimized, so I tried to inline the functions (code size is not critical for now, but performance is).

How can I inline these library functions? I use compiler switches -O3, -mf5, --single_inline and played a bit with the --auto_inline parameter, but the compiler seems to resist to  inline the calls.

Can you give me some hints how to use inlining here?

Thanks a lot,

Marcus

  • Inlining is only possible when the full source code to the function is available at compile time.  Library functions (i.e. functions not implemented by you) intended for inlining usually (always?) have an implementation in a header file.  For these particular functions, that is probably not the case.  Therefore, it is probably not possible to inline these functions.

    Thanks and regards,

    -George

  • I could solve the problem by eliminating the DSPLIB function from the loop and using the inline versions of the MATHLIB functions. Unfortunately, in the MATHLIB documentation does not say anything about inlining except that it is possible, so it took some time to find out how to do so.

    However, after these changes, the compiler can optimize the loop which results in an significant  performance gain.

    Thank you very much

    Marcus