Showing the changes to codec/common/src/cpu.cpp (1 of 2 files). Show all
Unified · Split
| @@ -136,6 +136,15 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) { · 135 unmodified lines | |||
| 136 | uiCPU |= WELS_CPU_MOVBE; | 136 | uiCPU |= WELS_CPU_MOVBE; |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | if (uiMaxCpuidLevel >= 7) { | ||
| 140 | uiFeatureC = 0; | ||
| 141 | WelsCPUId (7, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD); | ||
| 142 | if ((uiCPU & WELS_CPU_AVX) && (uiFeatureB & 0x00000020)) { | ||
| 143 | /* AVX2 supported */ | ||
| 144 | uiCPU |= WELS_CPU_AVX2; | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 139 | if (pNumberOfLogicProcessors != NULL) { | 148 | if (pNumberOfLogicProcessors != NULL) { |
| 140 | if (uiCPU & WELS_CPU_HTT) { | 149 | if (uiCPU & WELS_CPU_HTT) { |
| 141 | *pNumberOfLogicProcessors = (uiFeatureB & 0x00ff0000) >> 16; // feature bits: 23-16 on returned EBX | 150 | *pNumberOfLogicProcessors = (uiFeatureB & 0x00ff0000) >> 16; // feature bits: 23-16 on returned EBX |