SPU: add some AVX-512 variants

This commit is contained in:
Nekotekina 2017-12-16 03:19:21 +03:00
parent 4aee4ed6d7
commit 6d34dcd75f
5 changed files with 229 additions and 41 deletions

View file

@ -19,6 +19,12 @@ bool utils::has_avx()
return g_value;
}
bool utils::has_avx2()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && get_cpuid(7, 0)[1] & 0x20;
return g_value;
}
bool utils::has_rtm()
{
// Check RTM and MPX extensions in order to filter out TSX on Haswell CPUs
@ -26,6 +32,13 @@ bool utils::has_rtm()
return g_value;
}
bool utils::has_512()
{
// Check AVX512F, AVX512CD, AVX512DQ, AVX512BW, AVX512VL extensions (Skylake-X level support)
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[1] & 0xd0030000) == 0xd0030000;
return g_value;
}
std::string utils::get_system_info()
{
std::string result;
@ -68,7 +81,17 @@ std::string utils::get_system_info()
if (has_avx())
{
result += " | AVX+";
result += " | AVX";
if (has_avx2())
{
result += '+';
}
if (has_512())
{
result += '+';
}
}
if (has_rtm())