blob: 79e3e1487c4fea372444a8380512bec33b31dea7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
From f0c0e0c6fa198ed3700be4a2bd8f3cc7d70fc127 Mon Sep 17 00:00:00 2001
From: Maksim Shabunin <maksim.shabunin@gmail.com>
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 d0898ab3ee0..ebb10c723d5 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 375b62ea0c3..2faa2bfaf81 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"
|