History

Add detection of AVX2

brly committed 11 years ago

Commit b7fb9411 parent f1d1af02 files · +10 −0Browse files

Showing the changes to codec/common/src/cpu.cpp (1 of 2 files). Show all

Unified · Split

codec/common/src/cpu.cpp+9−0
@@ -136,6 +136,15 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) { · 135 unmodified lines
136136 uiCPU |= WELS_CPU_MOVBE;
137137 }
138138
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+
139148 if (pNumberOfLogicProcessors != NULL) {
140149 if (uiCPU & WELS_CPU_HTT) {
141150 *pNumberOfLogicProcessors = (uiFeatureB & 0x00ff0000) >> 16; // feature bits: 23-16 on returned EBX

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t