Skip to content

Commit d26960a

Browse files
authored
Merge pull request #5719 from martin-frbg/issue5713
ARM64 DYNAMIC_ARCH: add CortexA75/76 and restore VORTEX for DYNAMIC_LIST
2 parents 0f9f6e4 + 16211b7 commit d26960a

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

driver/others/dynamic_arm64.c

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@
3838
/*********************************************************************/
3939

4040
#include "common.h"
41-
42-
#ifndef _MSC_VER
4341
#include <strings.h>
44-
#else
45-
#define strncasecmp _strnicmp
46-
#endif
47-
4842
#if (defined OS_LINUX || defined OS_ANDROID)
4943
#include <asm/hwcap.h>
5044
#include <sys/auxv.h>
@@ -135,10 +129,16 @@ extern gotoblas_t gotoblas_ARMV9SME;
135129
#else
136130
#define gotoblas_ARMV9SME gotoblas_ARMV8
137131
#endif
132+
#ifdef DYN_VORTEX
133+
extern gotoblas_t gotoblas_VORTEX;
134+
#elif defined(DYN_NEOVERSEN1)
135+
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
136+
#else
137+
#define gotoblas_VORTEX gotoblas_ARMV8
138+
#endif
138139
#ifdef DYN_VORTEXM4
139140
extern gotoblas_t gotoblas_VORTEXM4;
140141
#else
141-
#error "dont have vortexm4"
142142
#define gotoblas_VORTEXM4 gotoblas_ARMV8
143143
#endif
144144
#ifdef DYN_CORTEXA55
@@ -151,7 +151,7 @@ extern gotoblas_t gotoblas_A64FX;
151151
#else
152152
#define gotoblas_A64FX gotoblas_ARMV8
153153
#endif
154-
#else
154+
#else //not a user-specified dynamic_list
155155
extern gotoblas_t gotoblas_CORTEXA53;
156156
#define gotoblas_CORTEXA55 gotoblas_CORTEXA53
157157
extern gotoblas_t gotoblas_CORTEXA57;
@@ -163,6 +163,7 @@ extern gotoblas_t gotoblas_THUNDERX2T99;
163163
extern gotoblas_t gotoblas_TSV110;
164164
extern gotoblas_t gotoblas_EMAG8180;
165165
extern gotoblas_t gotoblas_NEOVERSEN1;
166+
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
166167
#ifndef NO_SVE
167168
extern gotoblas_t gotoblas_NEOVERSEV1;
168169
extern gotoblas_t gotoblas_NEOVERSEN2;
@@ -198,7 +199,7 @@ extern void openblas_warning(int verbose, const char * msg);
198199
#define FALLBACK_VERBOSE 1
199200
#define NEOVERSEN1_FALLBACK "OpenBLAS : Your OS does not support SVE instructions. OpenBLAS is using Neoverse N1 kernels as a fallback, which may give poorer performance.\n"
200201

201-
#define NUM_CORETYPES 20
202+
#define NUM_CORETYPES 21
202203

203204
/*
204205
* In case asm/hwcap.h is outdated on the build system, make sure
@@ -238,6 +239,7 @@ static char *corename[] = {
238239
"armv8sve",
239240
"a64fx",
240241
"armv9sme",
242+
"vortex",
241243
"vortexm4",
242244
"unknown"
243245
};
@@ -262,7 +264,8 @@ char *gotoblas_corename(void) {
262264
if (gotoblas == &gotoblas_ARMV8SVE) return corename[16];
263265
if (gotoblas == &gotoblas_A64FX) return corename[17];
264266
if (gotoblas == &gotoblas_ARMV9SME) return corename[18];
265-
if (gotoblas == &gotoblas_VORTEXM4) return corename[19];
267+
if (gotoblas == &gotoblas_VORTEX) return corename[19];
268+
if (gotoblas == &gotoblas_VORTEXM4) return corename[20];
266269
return corename[NUM_CORETYPES];
267270
}
268271

@@ -301,7 +304,8 @@ static gotoblas_t *force_coretype(char *coretype) {
301304
case 16: return (&gotoblas_ARMV8SVE);
302305
case 17: return (&gotoblas_A64FX);
303306
case 18: return (&gotoblas_ARMV9SME);
304-
case 19: return (&gotoblas_VORTEXM4);
307+
case 19: return (&gotoblas_VORTEX);
308+
case 20: return (&gotoblas_VORTEXM4);
305309
}
306310
snprintf(message, 128, "Core not found: %s\n", coretype);
307311
openblas_warning(1, message);
@@ -318,7 +322,7 @@ static gotoblas_t *get_coretype(void) {
318322
return &gotoblas_VORTEXM4;
319323
}
320324
#endif
321-
return &gotoblas_NEOVERSEN1;
325+
return &gotoblas_VORTEX;
322326
#endif
323327

324328
#if (!defined OS_LINUX && !defined OS_ANDROID)
@@ -403,6 +407,8 @@ static gotoblas_t *get_coretype(void) {
403407
case 0xd08: // Cortex A72
404408
return &gotoblas_CORTEXA72;
405409
case 0xd09: // Cortex A73
410+
case 0xd0a: // Cortex A75
411+
case 0xd0b: // Cortex A76
406412
return &gotoblas_CORTEXA73;
407413
case 0xd0c: // Neoverse N1
408414
return &gotoblas_NEOVERSEN1;
@@ -492,7 +498,7 @@ static gotoblas_t *get_coretype(void) {
492498
break;
493499
case 0x61: // Apple
494500
if (support_sme1()) return &gotoblas_VORTEXM4;
495-
return &gotoblas_NEOVERSEN1;
501+
return &gotoblas_VORTEX;
496502
break;
497503
default:
498504
snprintf(coremsg, 128, "Unknown CPU model - implementer %x part %x\n",implementer,part);

0 commit comments

Comments
 (0)