MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / GetSSEVersion

Function GetSSEVersion

Libraries/unrar/system.cpp:187–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185SSE_VERSION _SSE_Version=GetSSEVersion();
186
187SSE_VERSION GetSSEVersion()
188{
189 int CPUInfo[4];
190 __cpuid(CPUInfo, 0x80000000);
191
192 // Maximum supported cpuid function. For example, Pentium M 755 returns 4 here.
193 uint MaxSupported=CPUInfo[0] & 0x7fffffff;
194
195 if (MaxSupported>=7)
196 {
197 __cpuid(CPUInfo, 7);
198 if ((CPUInfo[1] & 0x20)!=0)
199 return SSE_AVX2;
200 }
201 if (MaxSupported>=1)
202 {
203 __cpuid(CPUInfo, 1);
204 if ((CPUInfo[2] & 0x80000)!=0)
205 return SSE_SSE41;
206 if ((CPUInfo[2] & 0x200)!=0)
207 return SSE_SSSE3;
208 if ((CPUInfo[3] & 0x4000000)!=0)
209 return SSE_SSE2;
210 if ((CPUInfo[3] & 0x2000000)!=0)
211 return SSE_SSE;
212 }
213 return SSE_NONE;
214}
215#endif

Callers 1

system.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected