@@ -115,6 +115,11 @@ extern gotoblas_t gotoblas_ARMV8SVE;
115
115
#else
116
116
#define gotoblas_ARMV8SVE gotoblas_ARMV8
117
117
#endif
118
+ #ifdef DYN_ARMV9SME
119
+ extern gotoblas_t gotoblas_ARMV9SME ;
120
+ #else
121
+ #define gotoblas_ARMV9SME gotoblas_ARMV8
122
+ #endif
118
123
#ifdef DYN_CORTEX_A55
119
124
extern gotoblas_t gotoblas_CORTEXA55 ;
120
125
#else
@@ -148,6 +153,13 @@ extern gotoblas_t gotoblas_A64FX;
148
153
#define gotoblas_ARMV8SVE gotoblas_ARMV8
149
154
#define gotoblas_A64FX gotoblas_ARMV8
150
155
#endif
156
+
157
+ #ifndef NO_SME
158
+ extern gotoblas_t gotoblas_ARMV9SME ;
159
+ #else
160
+ #define gotoblas_ARMV9SME gotoblas_ARMV8SVE
161
+ #endif
162
+
151
163
extern gotoblas_t gotoblas_THUNDERX3T110 ;
152
164
#endif
153
165
#define gotoblas_NEOVERSEV2 gotoblas_NEOVERSEV1
@@ -168,6 +180,9 @@ extern void openblas_warning(int verbose, const char * msg);
168
180
#ifndef HWCAP_SVE
169
181
#define HWCAP_SVE (1 << 22)
170
182
#endif
183
+ #ifndef HWCAP2_SME
184
+ #define HWCAP2_SME 1<<23
185
+ #endif
171
186
172
187
#define get_cpu_ftr (id , var ) ({ \
173
188
__asm__ __volatile__ ("mrs %0, "#id : "=r" (var)); \
@@ -430,6 +445,13 @@ static gotoblas_t *get_coretype(void) {
430
445
snprintf (coremsg , 128 , "Unknown CPU model - implementer %x part %x\n" ,implementer ,part );
431
446
openblas_warning (1 , coremsg );
432
447
}
448
+
449
+ #if !defined(NO_SME ) && defined(HWCAP2_SME )
450
+ if ((getauxval (AT_HWCAP2 ) & HWCAP2_SME )) {
451
+ return & gotoblas_ARMV9SME ;
452
+ }
453
+ #endif
454
+
433
455
#ifndef NO_SVE
434
456
if ((getauxval (AT_HWCAP ) & HWCAP_SVE )) {
435
457
return & gotoblas_ARMV8SVE ;
@@ -480,3 +502,15 @@ void gotoblas_dynamic_init(void) {
480
502
void gotoblas_dynamic_quit (void ) {
481
503
gotoblas = NULL ;
482
504
}
505
+
506
+ int support_sme1 (void ) {
507
+ int ret = 0 ;
508
+
509
+ #if (defined OS_LINUX || defined OS_ANDROID )
510
+ ret = getauxval (AT_HWCAP2 ) & HWCAP2_SME ;
511
+ if (getauxval (AT_HWCAP2 ) & HWCAP2_SME ){
512
+ ret = 1 ;
513
+ }
514
+ #endif
515
+ return ret ;
516
+ }
0 commit comments