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.

F29H859TU-Q1: How the compiler implements trigonometric functions

Expert 4716 points

Part Number: F29H859TU-Q1

Hi Champs,

When using the C29x with FPU/TMU64 and -ffast-math enabled, my customer observed approximately 3x improvement in execution performance, with a corresponding reduction in CPU load compared with the configuration in which these options are disabled.

Could you please clarify how the compiler implements trigonometric functions such as sinf() and cosf() in the following configurations?

  • FPU/TMU64 and -ffast-math enabled
  • FPU/TMU64 enabled but -ffast-math disabled
  • FPU/TMU64 disabled

In particular, they would like to understand whether these functions are implemented using TMU instructions, compiler intrinsics, inline approximations, or runtime library calls in each configuration.

Regards,

Kien

  • Kien,

    With -ffast-math enabled, sinf() and cosf() and other RTS library functions that have equivalent C29 instructions are implemented using those instructions instead of the RTS library call, leading to performance improvement.

    These instructions are not generated if -ffast-math is not used.

    Regards,

    Sira