Skip to content

Commit

Permalink
[AArch64][SME] Fix broken compiler check for SME2 support in compiler…
Browse files Browse the repository at this point in the history
…-rt (llvm#121625)

This compile time test uses inline asm with `.arch` directives to set
the target feature. It is however broken and always fails, since each
`asm()` construct in LLVM sets up a new AsmParser, and therefore the
`.arch` directive has no effect on later `asm()` contents. To fix this
we need to use a single inline `asm()` call with the entire code chunk
to emit contained inside.
  • Loading branch information
aemerson authored Jan 6, 2025
1 parent eff1265 commit 3c8344f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler-rt/cmake/builtin-config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ asm(\"cas w0, w1, [x2]\");
builtin_check_c_compiler_source(COMPILER_RT_HAS_AARCH64_SME
"
void foo(void) __arm_streaming_compatible {
asm(\".arch armv9-a+sme2\");
asm(\"smstart\");
asm(\"ldr zt0, [sp]\");
asm(\".arch armv9-a+sme2\\n\"
\"smstart\\n\"
\"ldr zt0, [sp]\");
}
")

Expand Down

0 comments on commit 3c8344f

Please sign in to comment.