我正在尝试编译包含以下代码的.s文件:
.text
.globl memcpy_armneon
memcpy_armneon:
pld [r1, #0xC0]
vldm r1!,{d0-d7}
vstm r0!,{d0-d7}
subs r2,r2,#0x40
bge memcpy_armneon
但XCode 4.5抱怨:
“LLVM GCC 4.2错误没有这样的指令:'pld [r1,'。有没有办法编译它?
答案 0 :(得分:2)
$ gcc -arch armv7 -c -o example.o example.s
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
这让我相信您将此代码交给英特尔汇编程序。实际上,在执行此操作时,我准确地得到了文件的错误措辞:
$ gcc -c -o example.o example.s
example.s:5:no such instruction: `pld [r1,'
example.s:6:no such instruction: `vldm r1!,{d0-d7}'
example.s:7:no such instruction: `vstm r0!,{d0-d7}'
example.s:8:too many memory references for `sub'
example.s:9:no such instruction: `bge memcpy_armneon'
您可能希望使用clang以便实际使用ARM汇编程序:
clang -arch armv7 -c -o example.o example.s