Skip to content

Commit 18e2fe9

Browse files
authored
Add support for QEMU's virtual AMD cpu to avoid misdetection as Opteron
1 parent 9bdf051 commit 18e2fe9

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

driver/others/dynamic.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,18 @@ static gotoblas_t *get_coretype(void){
829829
}
830830
if (family == 0xf){
831831
if ((exfamily == 0) || (exfamily == 2)) {
832-
if (ecx & (1 << 0)) return &gotoblas_OPTERON_SSE3;
832+
if (exmodel == 6 && model == 11) { /*QEMU virtual cpu*/
833+
if (support_avx512_bf16())
834+
return &gotoblas_COOPERLAKE;
835+
if (support_avx512())
836+
return &gotoblas_SKYLAKEX;
837+
if (support_avx2())
838+
return &gotoblas_ZEN;
839+
else
840+
return &gotoblas_BARCELONA;
841+
}
842+
}
843+
if (ecx & (1 << 0)) return &gotoblas_OPTERON_SSE3;
833844
else return &gotoblas_OPTERON;
834845
} else if (exfamily == 5 || exfamily == 7) {
835846
return &gotoblas_BOBCAT;

0 commit comments

Comments
 (0)