]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Check the proper bit for BMI2
authorAdam Stylinski <kungfujesus06@gmail.com>
Sat, 16 Aug 2025 15:35:33 +0000 (11:35 -0400)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 18 Aug 2025 20:56:21 +0000 (22:56 +0200)
We were actually checking for BMI1 support here. This is unlikely to have
caused any issues because to date there have not been any x86 CPUs with
AVX2 support but no BMI2 support.

arch/x86/x86_features.c

index c94a129235d750a960162906ed5e5bad269c6931..bed1df3d12724a05b8bf4767bfd8d92cfc5f0687 100644 (file)
@@ -101,7 +101,7 @@ void Z_INTERNAL x86_check_features(struct x86_cpu_features *features) {
         cpuidex(7, 0, &eax, &ebx, &ecx, &edx);
 
         // check BMI2 bit
-        features->has_bmi2 = ebx & 0x8;
+        features->has_bmi2 = ebx & 0x100;
 
         // check AVX2 bit if the OS supports saving YMM registers
         if (features->has_os_save_ymm) {