Open zyedidia opened 4 days ago
Here is an example program that uses .arch in inline assembly to enable LSE instructions:
.arch
int main() { asm volatile ( ".arch armv8-a+lse\n" "casal x0, x1, [x2]\n" ); return 0; }
If compiled with clang -c test.c it works fine, but if I first emit to assembly and then attempt to compile, it no longer succeeds:
clang -c test.c
$ clang -S test.c $ clang -c test.s test.s:14:2: error: instruction requires: lse casal x0, x1, [x2] ^
The generated assembly does not include the .arch directive, causing the instruction to be illegal.
//APP casal x0, x1, [x2] //NO_APP
A similar issue exists for .arch_directive
.arch_directive
Example:
asm volatile ( ".arch_extension lse\n" "casal x0, x1, [x2]\n" );
Thanks!
I noticed that using -fno-integrated-as causes the directive to be emitted, so perhaps the fix could reuse whatever code is enabling that (or is the current behavior actually desired for some reason?).
-fno-integrated-as
Here is an example program that uses
.arch
in inline assembly to enable LSE instructions:If compiled with
clang -c test.c
it works fine, but if I first emit to assembly and then attempt to compile, it no longer succeeds:The generated assembly does not include the
.arch
directive, causing the instruction to be illegal.A similar issue exists for
.arch_directive
Example:
Thanks!