From 50da5c2b347d5ea3c2a5884a36a5c6036af78c16 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 12 Nov 2024 15:20:21 -0800 Subject: [PATCH] Add Apple M4 as VORTEX with HAVE_SME --- cpuid_arm64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpuid_arm64.c b/cpuid_arm64.c index 5d25d2ff69..aaf5084395 100644 --- a/cpuid_arm64.c +++ b/cpuid_arm64.c @@ -281,6 +281,7 @@ int detect(void) if (value64 ==131287967|| value64 == 458787763 ) return CPU_VORTEX; //A12/M1 if (value64 == 3660830781) return CPU_VORTEX; //A15/M2 if (value64 == 2271604202) return CPU_VORTEX; //A16/M3 + if (value64 == 1867590060) return CPU_VORTEX; //M4 #endif return CPU_ARMV8; #endif @@ -558,6 +559,8 @@ void get_cpuconfig(void) case CPU_VORTEX: printf("#define VORTEX \n"); #ifdef __APPLE__ + sysctlbyname("hw.cpufamily",&value64,&length64,NULL,0); + if (value64 == 1867590060) printf("#define HAVE_SME 1\n");; //M4 sysctlbyname("hw.l1icachesize",&value64,&length64,NULL,0); printf("#define L1_CODE_SIZE %lld \n",value64); sysctlbyname("hw.cachelinesize",&value64,&length64,NULL,0);