Add detection of AVX2
This commit is contained in:
@@ -136,6 +136,15 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) {
|
||||
uiCPU |= WELS_CPU_MOVBE;
|
||||
}
|
||||
|
||||
if (uiMaxCpuidLevel >= 7) {
|
||||
uiFeatureC = 0;
|
||||
WelsCPUId (7, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD);
|
||||
if ((uiCPU & WELS_CPU_AVX) && (uiFeatureB & 0x00000020)) {
|
||||
/* AVX2 supported */
|
||||
uiCPU |= WELS_CPU_AVX2;
|
||||
}
|
||||
}
|
||||
|
||||
if (pNumberOfLogicProcessors != NULL) {
|
||||
if (uiCPU & WELS_CPU_HTT) {
|
||||
*pNumberOfLogicProcessors = (uiFeatureB & 0x00ff0000) >> 16; // feature bits: 23-16 on returned EBX
|
||||
|
||||
Reference in New Issue
Block a user