From: Mat Date: Mon, 29 May 2017 09:06:26 +0000 (+0200) Subject: Fix: wrong register for BMI1 bit (#112) X-Git-Tag: 1.9.9-b1~660^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb5552727c44e08793b89fdd8aab48559a12fa9;p=thirdparty%2Fzlib-ng.git Fix: wrong register for BMI1 bit (#112) The BMI1 bit is in the ebx register and not in ecx. See reference: https://software.intel.com/sites/default/files/article/405250/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family.pdf --- diff --git a/arch/x86/x86.c b/arch/x86/x86.c index cd933745f..45bd63de2 100644 --- a/arch/x86/x86.c +++ b/arch/x86/x86.c @@ -54,5 +54,7 @@ void ZLIB_INTERNAL x86_check_features(void) { cpuid(7, &eax, &ebx, &ecx, &edx); - x86_cpu_has_tzcnt = ecx & 0x8; + // check BMI1 bit + // Reference: https://software.intel.com/sites/default/files/article/405250/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family.pdf + x86_cpu_has_tzcnt = ebx & 0x8; }