From 4f8082f6bcad240c3a74228c847daa9e40d605ae Mon Sep 17 00:00:00 2001 From: kimwalisch Date: Sun, 19 Jul 2020 19:04:23 +0200 Subject: [PATCH] Simplify preprocessor logic --- libpopcnt.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libpopcnt.h b/libpopcnt.h index bb7ccb6..3b9b1b5 100644 --- a/libpopcnt.h +++ b/libpopcnt.h @@ -102,7 +102,7 @@ #define HAVE_AVX512 #endif -/* Windows: MSVC compatible compilers */ +/* MSVC compatible compilers (Windows) */ #if defined(_MSC_VER) && \ defined(HAVE_CPUID) /* clang-cl (LLVM 10 from 2020) requires /arch:AVX2 or @@ -117,15 +117,14 @@ #endif /* MSVC 2017 or later does not require * /arch:AVX2 or /arch:AVX512 */ - #elif (_MSC_VER >= 1910) + #elif _MSC_VER >= 1910 #define HAVE_AVX2 #define HAVE_AVX512 #endif -#else /* Unix-like OSes */ +#else /* Clang (Unix-like OSes) */ #if defined(HAVE_CPUID) && \ CLANG_PREREQ(3, 8) && \ __has_attribute(target) && \ - (!defined(_MSC_VER) || defined(__AVX2__)) && \ (!defined(__apple_build_version__) || __apple_build_version__ >= 8000000) #define HAVE_AVX2 #define HAVE_AVX512