未知的寄存器名称“q0"在 asm (arm64) [英] Unknown register name "q0" in asm (arm64)

查看:59
本文介绍了未知的寄存器名称“q0"在 asm (arm64)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试为新的 arm64 架构编译我的库.我有一堆 NEON 程序集,对于所有这些程序集,我都收到错误

I'm currently trying to compile my lib for the new arm64 arch. I have a bunch of NEON assembly and for all of them I receive an error

asm 中未知的寄存器名称q0".

Unknown register name "q0" in asm.

即使我写得这么简单:

asm (
     ""
     :
     :
     : "q0", "q1", "q2", "q3"
     );

我认为 arm64 支持 NEON.我错过了什么吗?

I thought arm64 supports NEON. Am i missing something ?

推荐答案

v0":

scanon$ cat bar.c
int foo(void) {
  __asm__("":::"q0");
  return 0;
}
scanon$ xcrun -sdk iphoneos clang bar.c -arch arm64 -c
bar.c:2:16: error: unknown register name 'q0' in asm
  __asm__("":::"q0");
               ^
1 error generated.
scanon$ cat foo.c
int foo(void) {
  __asm__("":::"v0");
  return 0;
}
scanon$ xcrun -sdk iphoneos clang foo.c -arch arm64 -c
scanon$

arm64 是一个新的 ISA.实际的 NEON 指令和寄存器布局是全新的.您将需要为新架构重写或调整汇编代码.

arm64 is a new ISA. The actual NEON instructions and register layout are entirely new. You will need to re-write or adapt assembly code for the new architecture.

这篇关于未知的寄存器名称“q0"在 asm (arm64)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆