From: Adam Stylinski Date: Sat, 16 Aug 2025 15:35:33 +0000 (-0400) Subject: Check the proper bit for BMI2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8bcae0d8d15284a87322f3cebf6d794bedf64be;p=thirdparty%2Fzlib-ng.git Check the proper bit for BMI2 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. --- diff --git a/arch/x86/x86_features.c b/arch/x86/x86_features.c index c94a1292..bed1df3d 100644 --- a/arch/x86/x86_features.c +++ b/arch/x86/x86_features.c @@ -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) {