cpuid: exclude AVX512 flag when target not enabled

If we have a fat runtime build without AVX512 enabled, we should not
pick up the AVX512 flag from cpuid.
This commit is contained in:
Matthew Barr 2017-06-29 11:05:21 +10:00
parent d317d75615
commit 345897f096
2 changed files with 5 additions and 1 deletions

View 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

View 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