]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Move STATIC_BMI2 block as-is to portability_macros.h
authorPavel P <pavlov.pavel@gmail.com>
Thu, 23 Jan 2025 22:05:03 +0000 (00:05 +0200)
committerPavel P <pavlov.pavel@gmail.com>
Fri, 24 Jan 2025 01:02:46 +0000 (03:02 +0200)
lib/common/compiler.h
lib/common/portability_macros.h

index c942b984cb0de8f7bef96316aa8b7ba0f96b2168..5ad212383376278366bb907ba47108c73c3599e3 100644 (file)
 #  pragma warning(disable : 4324)        /* disable: C4324: padded structure */
 #endif
 
-/* Like DYNAMIC_BMI2 but for compile time determination of BMI2 support */
-#ifndef STATIC_BMI2
-#  if defined(_MSC_VER)
-#    ifdef __AVX2__  /* MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 */
-#       define STATIC_BMI2 1
-#    endif
-#  elif defined(__BMI2__)
-#    define STATIC_BMI2 1
-#  endif
-#endif
-
-#ifndef STATIC_BMI2
-#  define STATIC_BMI2 0
-#endif
-
 /* compile time determination of SIMD support */
 #if !defined(ZSTD_NO_INTRINSICS)
 #  if defined(__AVX2__)
index b52394382ed443c229b35a46f41912f647ab1963..b4da8a7442a2b73babea07f84c113b76e083b807 100644 (file)
 # define ZSTD_HIDE_ASM_FUNCTION(func)
 #endif
 
+/* Like DYNAMIC_BMI2 but for compile time determination of BMI2 support */
+#ifndef STATIC_BMI2
+#  if defined(_MSC_VER)
+#    ifdef __AVX2__  /* MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 */
+#       define STATIC_BMI2 1
+#    endif
+#  elif defined(__BMI2__)
+#    define STATIC_BMI2 1
+#  endif
+#endif
+
+#ifndef STATIC_BMI2
+#  define STATIC_BMI2 0
+#endif
+
 /* Enable runtime BMI2 dispatch based on the CPU.
  * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
  */