Skip to content

Commit f0b9e77

Browse files
authored
Apple M2: add tentative entry in the JSON file (#55)
This includes output from darwin `sysctl` and a sample of /proc/cpuinfo from asahi linux
1 parent 28cee9c commit f0b9e77

3 files changed

Lines changed: 227 additions & 1 deletion

File tree

cpu/microarchitectures.json

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,37 @@
22172217
]
22182218
}
22192219
},
2220+
"armv8.5a": {
2221+
"from": ["armv8.4a"],
2222+
"vendor": "generic",
2223+
"features": [],
2224+
"compilers": {
2225+
"gcc": [
2226+
{
2227+
"versions": "9:",
2228+
"flags": "-march=armv8.5-a -mtune=generic"
2229+
}
2230+
],
2231+
"clang": [
2232+
{
2233+
"versions": "11:",
2234+
"flags": "-march=armv8.5-a -mtune=generic"
2235+
}
2236+
],
2237+
"apple-clang": [
2238+
{
2239+
"versions": ":",
2240+
"flags": "-march=armv8.5-a -mtune=generic"
2241+
}
2242+
],
2243+
"arm": [
2244+
{
2245+
"versions": ":",
2246+
"flags": "-march=armv8.5-a -mtune=generic"
2247+
}
2248+
]
2249+
}
2250+
},
22202251
"thunderx2": {
22212252
"from": ["armv8.1a"],
22222253
"vendor": "Cavium",
@@ -2551,7 +2582,7 @@
25512582
}
25522583
},
25532584
"m1": {
2554-
"from": ["aarch64"],
2585+
"from": ["armv8.4a"],
25552586
"vendor": "Apple",
25562587
"features": [
25572588
"fp",
@@ -2616,6 +2647,76 @@
26162647
]
26172648
}
26182649
},
2650+
"m2": {
2651+
"from": ["m1", "armv8.5a"],
2652+
"vendor": "Apple",
2653+
"features": [
2654+
"fp",
2655+
"asimd",
2656+
"evtstrm",
2657+
"aes",
2658+
"pmull",
2659+
"sha1",
2660+
"sha2",
2661+
"crc32",
2662+
"atomics",
2663+
"fphp",
2664+
"asimdhp",
2665+
"cpuid",
2666+
"asimdrdm",
2667+
"jscvt",
2668+
"fcma",
2669+
"lrcpc",
2670+
"dcpop",
2671+
"sha3",
2672+
"asimddp",
2673+
"sha512",
2674+
"asimdfhm",
2675+
"dit",
2676+
"uscat",
2677+
"ilrcpc",
2678+
"flagm",
2679+
"ssbs",
2680+
"sb",
2681+
"paca",
2682+
"pacg",
2683+
"dcpodp",
2684+
"flagm2",
2685+
"frint",
2686+
"ecv",
2687+
"bf16",
2688+
"i8mm",
2689+
"bti"
2690+
],
2691+
"compilers": {
2692+
"gcc": [
2693+
{
2694+
"versions": "8.0:",
2695+
"flags" : "-march=armv8.5-a -mtune=generic"
2696+
}
2697+
],
2698+
"clang" : [
2699+
{
2700+
"versions": "9.0:12.0",
2701+
"flags" : "-march=armv8.5-a"
2702+
},
2703+
{
2704+
"versions": "13.0:",
2705+
"flags" : "-mcpu=apple-m1"
2706+
}
2707+
],
2708+
"apple-clang": [
2709+
{
2710+
"versions": "11.0:12.5",
2711+
"flags" : "-march=armv8.5-a"
2712+
},
2713+
{
2714+
"versions": "13.0:",
2715+
"flags" : "-mcpu=vortex"
2716+
}
2717+
]
2718+
}
2719+
},
26192720
"arm": {
26202721
"from": [],
26212722
"vendor": "generic",

tests/targets/darwin-monterey-m2

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
hw.ncpu: 8
2+
hw.byteorder: 1234
3+
hw.memsize: 17179869184
4+
hw.activecpu: 8
5+
hw.perflevel0.physicalcpu: 4
6+
hw.perflevel0.physicalcpu_max: 4
7+
hw.perflevel0.logicalcpu: 4
8+
hw.perflevel0.logicalcpu_max: 4
9+
hw.perflevel0.l1icachesize: 196608
10+
hw.perflevel0.l1dcachesize: 131072
11+
hw.perflevel0.l2cachesize: 16777216
12+
hw.perflevel0.cpusperl2: 4
13+
hw.perflevel1.physicalcpu: 4
14+
hw.perflevel1.physicalcpu_max: 4
15+
hw.perflevel1.logicalcpu: 4
16+
hw.perflevel1.logicalcpu_max: 4
17+
hw.perflevel1.l1icachesize: 131072
18+
hw.perflevel1.l1dcachesize: 65536
19+
hw.perflevel1.l2cachesize: 4194304
20+
hw.perflevel1.cpusperl2: 4
21+
hw.optional.arm.FEAT_FlagM: 1
22+
hw.optional.arm.FEAT_FlagM2: 1
23+
hw.optional.arm.FEAT_FHM: 1
24+
hw.optional.arm.FEAT_DotProd: 1
25+
hw.optional.arm.FEAT_SHA3: 1
26+
hw.optional.arm.FEAT_RDM: 1
27+
hw.optional.arm.FEAT_LSE: 1
28+
hw.optional.arm.FEAT_SHA256: 1
29+
hw.optional.arm.FEAT_SHA512: 1
30+
hw.optional.arm.FEAT_SHA1: 1
31+
hw.optional.arm.FEAT_AES: 1
32+
hw.optional.arm.FEAT_PMULL: 1
33+
hw.optional.arm.FEAT_SPECRES: 0
34+
hw.optional.arm.FEAT_SB: 1
35+
hw.optional.arm.FEAT_FRINTTS: 1
36+
hw.optional.arm.FEAT_LRCPC: 1
37+
hw.optional.arm.FEAT_LRCPC2: 1
38+
hw.optional.arm.FEAT_FCMA: 1
39+
hw.optional.arm.FEAT_JSCVT: 1
40+
hw.optional.arm.FEAT_PAuth: 1
41+
hw.optional.arm.FEAT_PAuth2: 1
42+
hw.optional.arm.FEAT_FPAC: 1
43+
hw.optional.arm.FEAT_DPB: 1
44+
hw.optional.arm.FEAT_DPB2: 1
45+
hw.optional.arm.FEAT_BF16: 1
46+
hw.optional.arm.FEAT_I8MM: 1
47+
hw.optional.arm.FEAT_ECV: 1
48+
hw.optional.arm.FEAT_LSE2: 1
49+
hw.optional.arm.FEAT_CSV2: 1
50+
hw.optional.arm.FEAT_CSV3: 1
51+
hw.optional.arm.FEAT_FP16: 1
52+
hw.optional.arm.FEAT_SSBS: 1
53+
hw.optional.arm.FEAT_BTI: 1
54+
hw.optional.floatingpoint: 1
55+
hw.optional.neon: 1
56+
hw.optional.neon_hpfp: 1
57+
hw.optional.neon_fp16: 1
58+
hw.optional.armv8_1_atomics: 1
59+
hw.optional.armv8_2_fhm: 1
60+
hw.optional.armv8_2_sha512: 1
61+
hw.optional.armv8_2_sha3: 1
62+
hw.optional.armv8_3_compnum: 1
63+
hw.optional.watchpoint: 4
64+
hw.optional.breakpoint: 6
65+
hw.optional.armv8_crc32: 1
66+
hw.optional.armv8_gpi: 1
67+
hw.optional.AdvSIMD: 1
68+
hw.optional.AdvSIMD_HPFPCvt: 1
69+
hw.optional.ucnormal_mem: 1
70+
hw.optional.arm64: 1
71+
hw.features.allows_security_research: 0
72+
hw.physicalcpu: 8
73+
hw.physicalcpu_max: 8
74+
hw.logicalcpu: 8
75+
hw.logicalcpu_max: 8
76+
hw.cputype: 16777228
77+
hw.cpusubtype: 2
78+
hw.cpu64bit_capable: 1
79+
hw.cpufamily: -634136515
80+
hw.cpusubfamily: 2
81+
hw.cacheconfig: 8 1 4 0 0 0 0 0 0 0
82+
hw.cachesize: 3697410048 65536 4194304 0 0 0 0 0 0 0
83+
hw.pagesize: 16384
84+
hw.pagesize32: 16384
85+
hw.cachelinesize: 128
86+
hw.l1icachesize: 131072
87+
hw.l1dcachesize: 65536
88+
hw.l2cachesize: 4194304
89+
hw.tbfrequency: 24000000
90+
hw.packages: 1
91+
hw.osenvironment:
92+
hw.ephemeral_storage: 0
93+
hw.use_recovery_securityd: 0
94+
hw.use_kernelmanagerd: 1
95+
hw.serialdebugmode: 0
96+
hw.nperflevels: 2
97+
hw.targettype: J413
98+
machdep.cpu.cores_per_package: 8
99+
machdep.cpu.core_count: 8
100+
machdep.cpu.logical_per_package: 8
101+
machdep.cpu.thread_count: 8
102+
machdep.cpu.brand_string: Apple M2
103+
machdep.user_idle_level: 0
104+
machdep.wake_abstime: 5418683402971
105+
machdep.time_since_reset: 6671416324
106+
machdep.wake_conttime: 22097060794869
107+
machdep.deferred_ipi_timeout: 64000
108+
machdep.lck_mtx_adaptive_spin_mode: 1
109+
machdep.virtual_address_size: 47
110+
machdep.report_phy_read_delay: 0
111+
machdep.report_phy_write_delay: 0
112+
machdep.trace_phy_read_delay: 0
113+
machdep.trace_phy_write_delay: 0
114+
machdep.report_phy_read_osbt: 0
115+
machdep.report_phy_write_osbt: 0
116+
machdep.phy_read_delay_panic: 0
117+
machdep.phy_writedelay_panic: 0

tests/targets/linux-asahi-m2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
processor : 0
2+
BogoMIPS : 48.00
3+
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bf16 bti ecv
4+
CPU implementer : 0x61
5+
CPU architecture: 8
6+
CPU variant : 0x1
7+
CPU part : 0x032
8+
CPU revision : 0

0 commit comments

Comments
 (0)