Issue |
117221
|
Summary |
[MC] Assembly emission removes `.arch`/`.arch_extension` directives
|
Labels |
new issue
|
Assignees |
|
Reporter |
zyedidia
|
Here is an example program that uses `.arch` in inline assembly to enable LSE instructions:
```c
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 -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`
Example:
```c
asm volatile (
".arch_extension lse\n"
"casal x0, x1, [x2]\n"
);
```
Thanks!
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs