Skip to content

Commit 2347cdd

Browse files
authored
Merge pull request #5781 from martin-frbg/zhaoxin_cpuids
Add AVX2 capability check to generic Zhaoxin cpu autodetection
2 parents 7367af6 + feca8f9 commit 2347cdd

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

cpuid_x86.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,9 +1843,11 @@ int get_cpuname(void)
18431843
if (support_avx2()) return CPUTYPE_ZEN;
18441844
else return CPUTYPE_DUNNINGTON;
18451845
default:
1846+
if (support_avx2()) return CPUTYPE_ZEN;
18461847
return CPUTYPE_NEHALEM;
18471848
}
18481849
default:
1850+
if (support_avx2()) return CPUTYPE_ZEN;
18491851
return CPUTYPE_NEHALEM;
18501852
}
18511853
}

driver/others/dynamic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,15 @@ static gotoblas_t *get_coretype(void){
951951
else
952952
return &gotoblas_DUNNINGTON;
953953
default:
954+
if (support_avx2())
955+
return &gotoblas_ZEN;
956+
else
954957
return &gotoblas_NEHALEM;
955958
}
956959
default:
960+
if (support_avx2())
961+
return &gotoblas_ZEN;
962+
else
957963
return &gotoblas_NEHALEM;
958964
}
959965
}

0 commit comments

Comments
 (0)