From 7d2dc35fca5c5849a99a6b580e0f33930e20c444 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 5 Feb 2023 16:14:49 +0100 Subject: [PATCH] Fix AVX512 detection Older compilers (gcc-6) feature _mm512_fmadd_ps but lack macro pseudo functions _mm.*_reduce_(min|max)_ps and _mm.*_abs_ps --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index dab2ce47ff..0d3943641c 100644 --- a/wscript +++ b/wscript @@ -521,7 +521,7 @@ int main() { return 0; }''', if re.search ('x86_64-w64', str(conf.env['CC'])) is not None: conf.define ('FPU_AVX_FMA_SUPPORT', 1) elif conf.env['build_target'] == 'i386' or conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': - conf.check_cxx(fragment = "#include \nint main(void) { __m512 a; _mm512_fmadd_ps(a, a, a); return 0; }\n", + conf.check_cxx(fragment = "#include \nint main(void) { __m512 a; _mm512_abs_ps(a); _mm512_fmadd_ps(a, a, a); (void) _mm512_reduce_min_ps(a); (void)_mm512_reduce_max_ps(a); return 0; }\n", features = ['cxx'], cxxflags = [ conf.env['compiler_flags_dict']['avx512f'], conf.env['compiler_flags_dict']['fma'], conf.env['compiler_flags_dict']['avx'] ], mandatory = False,