Updates to Hand-Tuning Loops on C6000 Application Note
From Texas Instruments Embedded Processors Wiki
Introduction
This page contains updates to the application note tidoc:spra666 Hand-Tuning Loops and Control Code on the TMS320C6000. Updates may arise as the compiler changes release to release, or new techniques are discovered. All such changes are collected in this article. Eventually, a revision of the application note may be issued.
Update to Section 5.2.7 Optimizing Conditional Expressions
Some readers have taken from this section that is always good to transform conditional expressions like:
if (cond1 && cond2) // note && { ... }
to:
if (cond1 & cond2) // note & { ... }
This is not the case. One reason this is not the case is that the compiler may perform this transformation for you. The likelihood of the compiler performing this transformation automatically has gone up in recent releases. However, that does not mean you will never need to apply this technique manually. It is possible that, in an important inner loop, manually changing "&&" to "&" (or "||" to "|") could cause a loop to perform much better.
All that said, do not perform this change indiscriminately. Wait until you find a loop that is performing poorly and contains "&&". Then manually change to "&" to see if it helps.
Leave a Comment