Check if the CPU supports the code for MMX instructions

zhaozj2021-02-08  229

That is to use the CPUID instruction. This is the instruction joined by the Pentinum processor, but VC actually does not support it. I don't understand what Microsoft is doing. But it doesn't matter, we come by himself.

#define cpuid __asm ​​_emit 0x0f __asm ​​_emit 0xa2 // CPUID instruction code is 0x0fa2__asm ​​{MOV EAX, 1; CPUID; // EAX = 1, the CPUID instruction returns EAX = CPU version information, EDX = CPU supported Test EDX, 0x800000 jz _NO_SUPPORT_MMX; ..._ no_support_mmx: ...}

转载请注明原文地址:https://www.9cbs.com/read-1485.html

New Post(0)