Hi,
I am trying to compile a .cc file using clang 5.0 for ARM 64-bit that has
some inline assembly. The inline assembly loads some value to 'q0'. I am
getting the error: *'unknown register name `q0`'*
I reproduced the issue with a simple file that only has the following:





*int foo(void){   __asm__("ldr q0, [x0]":::"q0");   return 0;}*

I am compiling it with: *clang++ --target=aarch64-none-linux-android -c
foo.cc*

Note that if the same code is in an assembly file (e.g. foo.S) like the
following:







*.text.align 5.global foo.type foo, %functionfoo:   ldr q0, [x0]   ret*

The above compiles without any issue.

My question is: Is this a bug or is there any other flag that I need to
specify to compile such C++ files with inline assembly?

I know that using v0 instead of q0 fixes the issue here. But that requires
a lot of change in my project and according to the ARM Architecture
Reference Manual the v0-v31 registers can also be accessed by q0-q31.

Also note that the same files compile with gcc without any error.

Any suggestion is appreciated.

Regards,

Rakib Hasan
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to