no longer limit automated BMI2 detection to x64

this was previously no triggered in x86 32-bit mode,
due to a limitation in `bitstream.h`, that was fixed in #4248.

Now, `bmi2` will be automatically detected and triggered
at compilation time, if the corresponding instruction set is enabled,
even in 32-bit mode.

Also: updated library documentation, to feature STATIC_BMI2 build variable
This commit is contained in:
Yann Collet
2025-01-19 00:08:57 -08:00
parent e475dc4c05
commit a556559841
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -209,11 +209,11 @@
/* Like DYNAMIC_BMI2 but for compile time determination of BMI2 support */
#ifndef STATIC_BMI2
# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))
# 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__) && defined(__x86_64__) && defined(__GNUC__)
# elif defined(__BMI2__)
# define STATIC_BMI2 1
# endif
#endif