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.

[参考译文] TMS320F280039C:编译器在生成的 CLA 指令中进行按位运算

Guru**** 2492385 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1557832/tms320f280039c-bitwise-operation-in-generated-cla-instructions-by-the-compiler

器件型号:TMS320F280039C


工具/软件:

尊敬的 champs:

我向我们的客户询问这个问题。

用户找到相同的位字段 C 代码进行按位操作、当 CPU 和 CLA 均使用-O2 时、CLA 通常使用比 CPU 更多的指令。

问题:

1.除了手动汇编之外、用户是否有任何更好、更高效的方法来为按位操作生成高效的 CLA 指令代码?

2.您建议使用-O3 和/或更高版本吗?

Wayne

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    对于发生这种情况的源文件...

    对于按位操作、使用相同的位字段 C 代码、当 CPU 和 CLA
    均使用-O2 时、CLA 通常使用比 CPU 更多的指令

    ... 请遵循文章 如何提交编译器测试案例中的指示。  如果没有测试用例、我只能猜测这些问题的答案。

    [quote userid=“4952" url="“ url="~“~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1557832/tms320f280039c-bitwise-operation-in-generated-cla-instructions-by-the-compiler 除了手动汇编之外、用户是否有任何更好、更高效的方法来为按位运算生成高效的 CLA 指令代码?

    我不这么认为。  我怀疑手动装配会更好。   

    [quote userid=“4952" url="“ url="~“~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1557832/tms320f280039c-bitwise-operation-in-generated-cla-instructions-by-the-compiler 您建议使用-O3 和/或更高版本吗?

    它很容易尝试。  我怀疑会有一些改进,但没有很多。

    谢谢。此致、

    -乔治