我用omap138的dsp核测试了一个函数,发现执行时间过长;
于是,我做了如下验证,只执行了一个float乘法,为什么花费了172个机器周期,请问这正常吗?为什么耗时这么长?
PS: 计时器已做了清零

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.
为什么花费了172个机器周期,请问这正常吗?
只进行了一次浮点运算吗?如果是的话,时间花费较长。
也可以再使用TSCH/TSCL寄存器测试一下,打开反汇编窗口看看执行了哪些指令。
以下贴子的讨论看一下:
https://e2echina.ti.com/support/processors/f/processors-forum/167921/omapl138
开启优化也是可以的,只能建议您在编写完c代码的基础上通过编译器进行优化,另外您也可以看一下是否有合适的内联函数帮助你提升效率。
Table 7-7. TMS320C6700, C6700+, C6740, and C6600 C/C++ Compiler Intrinsics (continued)
https://www.ti.com/lit/ug/spru187u/spru187u.pdf
开启cache或者将数据放到片上ram也是提升效率的方式。