Merge pull request #4264 from pps83/dev-static-bmi2
Move STATIC_BMI2 define to portability_macros.h
This commit is contained in:
@@ -207,21 +207,6 @@
|
|||||||
# pragma warning(disable : 4324) /* disable: C4324: padded structure */
|
# pragma warning(disable : 4324) /* disable: C4324: padded structure */
|
||||||
#endif
|
#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 */
|
/* compile time determination of SIMD support */
|
||||||
#if !defined(ZSTD_NO_INTRINSICS)
|
#if !defined(ZSTD_NO_INTRINSICS)
|
||||||
# if defined(__AVX2__)
|
# if defined(__AVX2__)
|
||||||
|
|||||||
@@ -74,6 +74,19 @@
|
|||||||
# define ZSTD_HIDE_ASM_FUNCTION(func)
|
# define ZSTD_HIDE_ASM_FUNCTION(func)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Compile time determination of BMI2 support */
|
||||||
|
#ifndef STATIC_BMI2
|
||||||
|
# if defined(__BMI2__)
|
||||||
|
# define STATIC_BMI2 1
|
||||||
|
# elif defined(_MSC_VER) && defined(__AVX2__)
|
||||||
|
# define STATIC_BMI2 1 /* MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef STATIC_BMI2
|
||||||
|
# define STATIC_BMI2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable runtime BMI2 dispatch based on the CPU.
|
/* Enable runtime BMI2 dispatch based on the CPU.
|
||||||
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
|
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user