How do I check if a computer supports SSE2 in C++, I need to do that prior installing a software that needs the support for it. Any idea? Thank you.
Edit
from what I understand, I came up with this :
bool TestSSE2(char * szErrorMsg)
{
__try
{
__asm
{
xorpd xmm0, xmm0 // executing SSE2 instruction
}
}
#pragma warning (suppress: 6320)
__except (EXCEPTION_EXECUTE_HANDLER)
{
if (_exception_code() == STATUS_ILLEGAL_INSTRUCTION)
{
_tcscpy_s(szErrorMsg,MSGSIZE, _T("Streaming SIMD Extensions 2(SSE2) is not supported by the CPU.\r\n Unable to launch APP"));
return false;
}
_tcscpy_s(szErrorMsg,MSGSIZE, _T("Streaming SIMD Extensions 2(SSE2) is not supported by the CPU.\r\n Unable to launch APP"));
return false;
}
return true;
}
Would this work? I'm not really sure how to test, since my cpu supports it, so I don't get false from the function call.