Fix x86 detection error

This commit is contained in:
Honglin Zhu 2023-04-13 00:08:27 +08:00
parent 58de28f332
commit ac650225c1
1 changed files with 11 additions and 7 deletions

View File

@ -1936,7 +1936,8 @@ static char *corename[] = {
"ZEN", "ZEN",
"SKYLAKEX", "SKYLAKEX",
"DHYANA", "DHYANA",
"COOPERLAKE" "COOPERLAKE",
"SAPPHIRERAPIDS",
}; };
static char *corename_lower[] = { static char *corename_lower[] = {
@ -1970,7 +1971,8 @@ static char *corename_lower[] = {
"zen", "zen",
"skylakex", "skylakex",
"dhyana", "dhyana",
"cooperlake" "cooperlake",
"sapphirerapids",
}; };
@ -2276,16 +2278,18 @@ int get_coretype(void){
return CORE_NEHALEM; return CORE_NEHALEM;
} }
if (model == 15) { // Sapphire Rapids if (model == 15) { // Sapphire Rapids
if(support_amx_bf16())
return CORE_SAPPHIRERAPIDS;
if(support_avx512_bf16()) if(support_avx512_bf16())
return CPUTYPE_COOPERLAKE; return CORE_COOPERLAKE;
if(support_avx512()) if(support_avx512())
return CPUTYPE_SKYLAKEX; return CORE_SKYLAKEX;
if(support_avx2()) if(support_avx2())
return CPUTYPE_HASWELL; return CORE_HASWELL;
if(support_avx()) if(support_avx())
return CPUTYPE_SANDYBRIDGE; return CORE_SANDYBRIDGE;
else else
return CPUTYPE_NEHALEM; return CORE_NEHALEM;
} }
break; break;