Hello CGT C2000 support team,
I noticed that the compiler does not optimize the following at compile time:
Instead, the generated assembly shows that an actual runtime call to sqrt is made.
I guess that this behavior fundamentally makes sense, as sqrt() is just a function call, and the compiler cannot really be expected to know what a function will return.
However, it seems that it would make sense for the compiler to recognize certain standard math functions, and to evaluate constant expressions.
After all, it does recognize sqrt, sin, cos, atan and atan2 in the context of utilizing the TMU.
Are there any configurations that can be made to also enable the compiler to optimize constant expressions using those functions?
Thank you in advance,