int main(){
__asm volatile
{
// load data
vld1.16 {q0, q1}, [r0]!
使用命令
armcc --cpu=Cortex-A9 -O2 -Otime --vectorize --remarks -g --md --depend_format=unix_escaped --no_depend_system_headers -c -o test.o test.c
它的主要錯誤表明
"test.c", line 7: Error: #20: identifier "q0" is undefined
vld1.16 {q0, q1}, [r0]!
^
"test.c", line 8: Error: #20: identifier "q2" is undefined
vld1.16 {q2, q3}, [r0]!
^
我錯過任何armcc
命令中的標誌?
的armcc
版本
Product: ARM Compiler 5.05
Component: ARM Compiler 5.05 (build 41)
Tool: armcc [4d0eb9]
For support see http://www.arm.com/support/
Software supplied by: ARM Limited
只是FYI,手動向量化的內在因素通常是比內聯asm更好的選擇,因爲編譯器最近對它們做了很好的工作。 (至少gcc和clang可以;不瞭解armcc)。請參閱https://gcc.gnu.org/wiki/DontUseInlineAsm,其原因包括:通過阻止編譯器傳播常量,實際上會導致代碼變慢;或者其他優化。 –