Skip to content

Commit 3c8344f

Browse files
authored
[AArch64][SME] Fix broken compiler check for SME2 support in compiler-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.
1 parent eff1265 commit 3c8344f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/cmake/builtin-config-ix.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ asm(\"cas w0, w1, [x2]\");
4343
builtin_check_c_compiler_source(COMPILER_RT_HAS_AARCH64_SME
4444
"
4545
void foo(void) __arm_streaming_compatible {
46-
asm(\".arch armv9-a+sme2\");
47-
asm(\"smstart\");
48-
asm(\"ldr zt0, [sp]\");
46+
asm(\".arch armv9-a+sme2\\n\"
47+
\"smstart\\n\"
48+
\"ldr zt0, [sp]\");
4949
}
5050
")
5151

0 commit comments

Comments
 (0)