From af5462eb7be26d3efedf69c97e659d9c1fdde22f Mon Sep 17 00:00:00 2001 From: Daryl Poe Date: Mon, 6 Oct 2014 13:50:49 -0600 Subject: [PATCH] correct check for lzcnt cpu capability --- winpr/libwinpr/sysinfo/sysinfo.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index 6954b4e1d..1529d54b3 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -401,7 +401,7 @@ ULONGLONG GetTickCount64(void) #define D_BIT_3DN (1<<30) #define C_BIT_SSE3 (1<<0) #define C_BIT_PCLMULQDQ (1<<1) -#define C_BIT_LZCNT (1<<5) +#define C81_BIT_LZCNT (1<<5) #define C_BIT_3DNP (1<<8) #define C_BIT_3DNP (1<<8) #define C_BIT_SSSE3 (1<<9) @@ -699,9 +699,12 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) switch (ProcessorFeature) { case PF_EX_LZCNT: - if (c & C_BIT_LZCNT) - ret = TRUE; - + { + unsigned a81, b81, c81, d81; + cpuid(0x80000001, &a81, &b81, &c81, &d81); + if (c81 & C81_BIT_LZCNT) + ret = TRUE; + } break; case PF_EX_3DNOW_PREFETCH: