From f0c0e0c6fa198ed3700be4a2bd8f3cc7d70fc127 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Sun, 25 Feb 2018 13:32:27 +0300 Subject: [PATCH] CPU dispatching: additional AVX-512 check for mingw-w64 --- cmake/checks/cpu_avx512.cpp | 3 +++ cmake/checks/cpu_avx512skx.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmake/checks/cpu_avx512.cpp b/cmake/checks/cpu_avx512.cpp index d0898ab3ee..ebb10c723d 100644 --- a/cmake/checks/cpu_avx512.cpp +++ b/cmake/checks/cpu_avx512.cpp @@ -3,6 +3,9 @@ void test() { __m512i zmm = _mm512_setzero_si512(); +#if defined __GNUC__ && defined __x86_64__ + asm volatile ("" : : : "zmm16", "zmm17", "zmm18", "zmm19"); +#endif } #else #error "AVX512 is not supported" diff --git a/cmake/checks/cpu_avx512skx.cpp b/cmake/checks/cpu_avx512skx.cpp index 375b62ea0c..2faa2bfaf8 100644 --- a/cmake/checks/cpu_avx512skx.cpp +++ b/cmake/checks/cpu_avx512skx.cpp @@ -7,6 +7,9 @@ void test() __m256i b = _mm256_abs_epi64(a); // VL __m512i c = _mm512_abs_epi8(zmm); // BW __m512i d = _mm512_broadcast_i32x8(b); // DQ +#if defined __GNUC__ && defined __x86_64__ + asm volatile ("" : : : "zmm16", "zmm17", "zmm18", "zmm19"); +#endif } #else #error "AVX512-SKX is not supported"