Home > Article > Backend Development > How Can I Reliably Determine SSE3 Instruction Set Support on Windows XP?
Problem:
Determining CPU support for the SSE3 instruction set using the IsProcessorFeaturePresent() function is unreliable on Windows XP.
Solution: Alternate Approach
Here's an alternative method for checking SSE3 support:
Code Example:
#include <cpuid.h> bool CheckSSE3() { int CPUInfo[4]; __cpuid_count(0, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); if (CPUInfo[0] >= 1) { __cpuid_count(1, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); bool bSSE3NewInstructions = (CPUInfo[2] & 0x1) || false; return bSSE3NewInstructions; } return false; }
Additional Notes:
The above is the detailed content of How Can I Reliably Determine SSE3 Instruction Set Support on Windows XP?. For more information, please follow other related articles on the PHP Chinese website!