Improve intel and apple detection

This commit is contained in:
kd-11 2024-08-03 05:09:10 +03:00 committed by kd-11
parent 3e7c1e207d
commit dd708166aa
1 changed files with 22 additions and 2 deletions

View File

@ -751,10 +751,30 @@ llvm::StringRef fallback_cpu_detection()
return "znver5"; // Return newest known model here return "znver5"; // Return newest known model here
} }
} }
else if (brand.startswith("Virtual Apple")) else if (brand.contains("Intel"))
{
if (!utils::has_avx())
{
return "nehalem";
}
if (!utils::has_avx2())
{
return "ivybridge";
}
if (!utils::has_avx512())
{
return "skylake";
}
if (utils::has_avx512_icl())
{
return "cannonlake";
}
return "icelake-client";
}
else if (brand.startswith("VirtualApple"))
{ {
// No AVX. This will change in MacOS 15+, at which point we may revise this. // No AVX. This will change in MacOS 15+, at which point we may revise this.
return "nehalem"; return utils::has_avx() ? "haswell" : "nehalem";
} }
#elif defined(ARCH_ARM64) #elif defined(ARCH_ARM64)