Skip to content

Commit 02ef20a

Browse files
authored
Merge pull request #1786 from martin-frbg/immintrin
Check for Immintrin.h presence in the AVX512 compatibility test as well
2 parents 544b069 + 4c3643e commit 02ef20a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

c_check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ $binformat = bin64 if ($data =~ /BINARY_64/);
205205
$no_avx512= 0;
206206
if (($architecture eq "x86") || ($architecture eq "x86_64")) {
207207
$code = '"vbroadcastss -4 * 4(%rsi), %zmm2"';
208-
print $tmpf "int main(void){ __asm__ volatile($code); }\n";
208+
print $tmpf "#include <immintrin.h>\n\nint main(void){ __asm__ volatile($code); }\n";
209209
$args = " -march=skylake-avx512 -o $tmpf.o -x c $tmpf";
210210
my @cmd = ("$compiler_name $args >/dev/null 2>/dev/null");
211211
system(@cmd) == 0;

cmake/system_check.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ else()
6767
endif()
6868

6969
if (X86_64 OR X86)
70-
file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "int main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
70+
file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "#include <immintrin.h>\n\nint main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
7171
execute_process(COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512)
7272
if (NO_AVX512 EQUAL 1)
7373
set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")

0 commit comments

Comments
 (0)