Browse Source

Merge pull request #4971 from martin-frbg/m4init

Add initial autodetection support for Apple M4 as VORTEX with HAVE_SME
tags/v0.3.29
Martin Kroeker GitHub 10 months ago
parent
commit
2057cd75fd
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      cpuid_arm64.c

+ 3
- 0
cpuid_arm64.c View File

@@ -281,6 +281,7 @@ int detect(void)
if (value64 ==131287967|| value64 == 458787763 ) return CPU_VORTEX; //A12/M1 if (value64 ==131287967|| value64 == 458787763 ) return CPU_VORTEX; //A12/M1
if (value64 == 3660830781) return CPU_VORTEX; //A15/M2 if (value64 == 3660830781) return CPU_VORTEX; //A15/M2
if (value64 == 2271604202) return CPU_VORTEX; //A16/M3 if (value64 == 2271604202) return CPU_VORTEX; //A16/M3
if (value64 == 1867590060) return CPU_VORTEX; //M4
#endif #endif
return CPU_ARMV8; return CPU_ARMV8;
#endif #endif
@@ -558,6 +559,8 @@ void get_cpuconfig(void)
case CPU_VORTEX: case CPU_VORTEX:
printf("#define VORTEX \n"); printf("#define VORTEX \n");
#ifdef __APPLE__ #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); sysctlbyname("hw.l1icachesize",&value64,&length64,NULL,0);
printf("#define L1_CODE_SIZE %lld \n",value64); printf("#define L1_CODE_SIZE %lld \n",value64);
sysctlbyname("hw.cachelinesize",&value64,&length64,NULL,0); sysctlbyname("hw.cachelinesize",&value64,&length64,NULL,0);


Loading…
Cancel
Save