TI中文支持网
TI专业的中文技术问题搜集分享网站

CCS 优化开到最高时,运算的cossp的math库的结果完全不正确了

CCS 优化开到最高时,运算的cossp的math库的结果完全不正确了,这是什么原因

把优化等级调整的1级才是正确的.2级\3级都是错的

Nancy Wang:

那这部分代码可能无法直接使用较高级别的优化。
In general, the compiler is capable of generating highly optimized code. However, in many cases, the
compiler, in order to assure the correct operation of the code, must take a conservative approach. For
such cases, additional information and instructions can be provided by the developer to guide the compiler
to maximally optimize the code.
建议使用额外的方法来进行优化,具体可以参考以下文档。
www.ti.com/…/sprabf2.pdf

user3688025:

回复 Nancy Wang:

如何指定某些函数不进行优化.
另外,这些math函数都是汇编写的.

Shine:

回复 user3688025:

请看一下有的变量是否用volatile关键字定义,防止被优化掉。

赞(0)
未经允许不得转载:TI中文支持网 » CCS 优化开到最高时,运算的cossp的math库的结果完全不正确了
分享到: 更多 (0)