Can you tell me if the TMS320F28069PNT Microcontroller (or the Control Law Accelerator) has any built in optimization for multiplication and division operations that automatically use shift operations "under the hood" to increase performance?
-Jim
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.
Can you tell me if the TMS320F28069PNT Microcontroller (or the Control Law Accelerator) has any built in optimization for multiplication and division operations that automatically use shift operations "under the hood" to increase performance?
-Jim
For integer divide, multiply by 2 i do believe the optimizer will use arithmetic shifts on both the c28x and the CLA. Both cores have the assembly instructions to do them.
Thank You Vishal.
So this happens automatically without any special setup or configuration?
-Jim
Use the build flag --opt_level=[0-4] to enable optimization. Generally speaking, the higher the level used, the more optimization occurs.
As for a multiply or divide by a power of 2 ... Such expressions are changed to shifts. This occurs without regard to the --opt_level setting.
For more general information on this topic, please see the section titled What Kind of Optimization Is Being Performed in the C2000 compiler manual.
Thanks and regards,
-George
It is highly likely. To be sure, build with the option -s, then inspect the resulting compiler generated assembly. It is in a file with same name as the source file, but the extension changed to .asm.
Thanks and regards,
-George