]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
cpuid: exclude AVX512 flag when target not enabled
authorMatthew Barr <matthew.barr@intel.com>
Thu, 29 Jun 2017 01:05:21 +0000 (11:05 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Jul 2017 05:51:23 +0000 (15:51 +1000)
If we have a fat runtime build without AVX512 enabled, we should not
pick up the AVX512 flag from cpuid.

cmake/config.h.in
src/util/cpuid_flags.c

index 9c250b4c75445d14545c6f6e2a386c42e2b367c0..203f0afde127ca62422565efc8f4f7d0ab40f6d4 100644 (file)
@@ -21,6 +21,9 @@
 /* Define if building "fat" runtime. */
 #cmakedefine FAT_RUNTIME
 
+/* Define if building AVX-512 in the fat runtime. */
+#cmakedefine BUILD_AVX512
+
 /* Define to 1 if `backtrace' works. */
 #cmakedefine HAVE_BACKTRACE
 
index c0ab09afb7a1a989e15be01fe2d3e4b75d8c11f5..3c62c07bf1a64a67c82621afa13dc576bb8fa2e3 100644 (file)
@@ -192,7 +192,8 @@ u64a cpuid_flags(void) {
     cap &= ~HS_CPU_FEATURES_AVX2;
 #endif
 
-#if !defined(FAT_RUNTIME) && !defined(HAVE_AVX512)
+#if (!defined(FAT_RUNTIME) && !defined(HAVE_AVX512)) ||                        \
+    (defined(FAT_RUNTIME) && !defined(BUILD_AVX512))
     cap &= ~HS_CPU_FEATURES_AVX512;
 #endif