Changeset View
Changeset View
Standalone View
Standalone View
lib/Support/Host.cpp
Show First 20 Lines • Show All 817 Lines • ▼ Show 20 Lines | bool sys::getHostCPUFeatures(StringMap<bool> &Features) { | ||||
// AVX512 is only supported if the OS supports the context save for it. | // AVX512 is only supported if the OS supports the context save for it. | ||||
Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; | Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; | ||||
Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; | Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; | ||||
Features["avx512pf"] = HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save; | Features["avx512pf"] = HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save; | ||||
Features["avx512er"] = HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save; | Features["avx512er"] = HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save; | ||||
Features["avx512cd"] = HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save; | Features["avx512cd"] = HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save; | ||||
Features["avx512bw"] = HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save; | Features["avx512bw"] = HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save; | ||||
Features["avx512vl"] = HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save; | Features["avx512vl"] = HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save; | ||||
Features["avx515vbmi"] = HasLeaf7 && ((ECX >> 1) & 1) && HasAVX512Save; | |||||
delena: please take lower case avx512vbmi | |||||
bool HasLeafD = MaxLevel >= 0xd && | bool HasLeafD = MaxLevel >= 0xd && | ||||
!GetX86CpuIDAndInfoEx(0xd, 0x1, &EAX, &EBX, &ECX, &EDX); | !GetX86CpuIDAndInfoEx(0xd, 0x1, &EAX, &EBX, &ECX, &EDX); | ||||
// Only enable XSAVE if OS has enabled support for saving YMM state. | // Only enable XSAVE if OS has enabled support for saving YMM state. | ||||
Features["xsaveopt"] = HasAVXSave && HasLeafD && ((EAX >> 0) & 1); | Features["xsaveopt"] = HasAVXSave && HasLeafD && ((EAX >> 0) & 1); | ||||
Features["xsavec"] = HasAVXSave && HasLeafD && ((EAX >> 1) & 1); | Features["xsavec"] = HasAVXSave && HasLeafD && ((EAX >> 1) & 1); | ||||
Features["xsaves"] = HasAVXSave && HasLeafD && ((EAX >> 3) & 1); | Features["xsaves"] = HasAVXSave && HasLeafD && ((EAX >> 3) & 1); | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |
please take lower case avx512vbmi