Skip to content

Commit 76d6a88

Browse files
committed
cmake: require YMM asm for inline AVX probe (#2385)
1 parent 9b5e52b commit 76d6a88

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

cmake/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ int main()
3737
int edx = 0;
3838
__asm__(
3939
\"xgetbv ;\"
40-
\"vzeroupper \"
40+
//
41+
// This feature probe is specifically used to decide whether we can
42+
// compile the DWA fast path that contains GCC-style inline asm using
43+
// AVX/YMM instructions. Some toolchains (notably older Apple 'as'
44+
// invoked by GCC on legacy macOS) can assemble xgetbv/vzeroupper but
45+
// still reject YMM/VEX instructions with errors like:
46+
// no such instruction: `vmovaps (%rsi), %ymm0'
47+
// So include a representative YMM instruction in the try-compile.
48+
//
49+
\"vmovaps %%ymm0, %%ymm0 ;\"
50+
\"vzeroupper \"
4151
: \"=a\"(eax), \"=d\"(edx) : \"c\"(n) : );
4252
#else
4353
# error No SSE support enabled to query AVX support

0 commit comments

Comments
 (0)