mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-09 19:36:29 +00:00
cpuinfo: use __cpuidex instead of __cpuid
The classic Intel Compiler does not clear the ecx register prior to executing the cpuid opcode.
This commit is contained in:

committed by
Anonymous Maarten

parent
904e4a6e7c
commit
09832c701c
@@ -246,11 +246,12 @@ done:
|
|||||||
__asm mov c, ecx \
|
__asm mov c, ecx \
|
||||||
__asm mov d, edx \
|
__asm mov d, edx \
|
||||||
}
|
}
|
||||||
#elif defined(_MSC_VER) && defined(_M_X64)
|
#elif (defined(_MSC_VER) && defined(_M_X64))
|
||||||
|
/* Use __cpuidex instead of __cpuid because ICL does not clear ecx register */
|
||||||
#define cpuid(func, a, b, c, d) \
|
#define cpuid(func, a, b, c, d) \
|
||||||
{ \
|
{ \
|
||||||
int CPUInfo[4]; \
|
int CPUInfo[4]; \
|
||||||
__cpuid(CPUInfo, func); \
|
__cpuidex(CPUInfo, func, 0); \
|
||||||
a = CPUInfo[0]; \
|
a = CPUInfo[0]; \
|
||||||
b = CPUInfo[1]; \
|
b = CPUInfo[1]; \
|
||||||
c = CPUInfo[2]; \
|
c = CPUInfo[2]; \
|
||||||
|
Reference in New Issue
Block a user