Merge pull request #3485 from martin-frbg/issue3453

Add feature-based fallback for unknown x86_64 cpus
This commit is contained in:
Martin Kroeker 2021-12-17 11:08:36 +01:00 committed by GitHub
commit b3f4b8c95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1061,7 +1061,13 @@ void gotoblas_dynamic_init(void) {
#ifdef ARCH_X86 #ifdef ARCH_X86
if (gotoblas == NULL) gotoblas = &gotoblas_KATMAI; if (gotoblas == NULL) gotoblas = &gotoblas_KATMAI;
#else #else
if (gotoblas == NULL) gotoblas = &gotoblas_PRESCOTT; if (gotoblas == NULL) {
if (support_avx512_bf16()) gotoblas = &gotoblas_COOPERLAKE;
else if (support_avx512()) gotoblas = &gotoblas_SKYLAKEX;
else if (support_avx2()) gotoblas = &gotoblas_HASWELL;
else if (support_avx()) gotoblas = &gotoblas_SANDYBRIDGE;
else gotoblas = &gotoblas_PRESCOTT;
}
/* sanity check, if 64bit pointer we can't have a 32 bit cpu */ /* sanity check, if 64bit pointer we can't have a 32 bit cpu */
if (sizeof(void*) == 8) { if (sizeof(void*) == 8) {
if (gotoblas == &gotoblas_KATMAI || if (gotoblas == &gotoblas_KATMAI ||