From 8caeeb886a67c8314df4f9f5abd5f55aec6b2e82 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Fri, 22 Nov 2013 16:45:56 -0800 Subject: [PATCH] Added cpuid compatibility for older MSVC versions Change-Id: I891bf936e03411ca611620e7cb2eb5081993a346 --- vpx_ports/x86.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vpx_ports/x86.h b/vpx_ports/x86.h index e5e97e706..fdbed2524 100644 --- a/vpx_ports/x86.h +++ b/vpx_ports/x86.h @@ -71,6 +71,7 @@ typedef enum { #endif #else /* end __SUNPRO__ */ #if ARCH_X86_64 +#if defined(_MSC_VER) && _MSC_VER > 1500 void __cpuidex(int CPUInfo[4], int info_type, int ecxvalue); #pragma intrinsic(__cpuidex) #define cpuid(func, func2, a, b, c, d) do {\ @@ -79,6 +80,15 @@ void __cpuidex(int CPUInfo[4], int info_type, int ecxvalue); a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\ } while(0) #else +void __cpuid(int CPUInfo[4], int info_type); +#pragma intrinsic(__cpuid) +#define cpuid(func, func2, a, b, c, d) do {\ + int regs[4];\ + __cpuid(regs, func); \ + a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\ + } while (0) +#endif +#else #define cpuid(func, func2, a, b, c, d)\ __asm mov eax, func\ __asm mov ecx, func2\ -- 2.40.0