Skip to content

Commit 973ec72

Browse files
authored
Add sme/sme2 detection to mach/init.c.
I forgot to add this for `mach` when I did it for `linux` a while back (#262). I could not find `hw.optional.arm.FEAT_SME_*` features for all the `sme`-related bits in `cpuinfo_arm_isa`, but I've added the ones I could find.
1 parent 1e83a2f commit 973ec72

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/arm/mach/init.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,31 @@ void cpuinfo_arm_mach_init(void) {
399399
cpuinfo_isa.i8mm = true;
400400
}
401401

402+
const uint32_t has_feat_sme = get_sys_info_by_name("hw.optional.arm.FEAT_SME");
403+
if (has_feat_sme != 0) {
404+
cpuinfo_isa.sme = true;
405+
}
406+
407+
const uint32_t has_feat_sme2 = get_sys_info_by_name("hw.optional.arm.FEAT_SME2");
408+
if (has_feat_sme2 != 0) {
409+
cpuinfo_isa.sme2 = true;
410+
}
411+
412+
const uint32_t has_feat_sme2p1 = get_sys_info_by_name("hw.optional.arm.FEAT_SME2p1");
413+
if (has_feat_sme2p1 != 0) {
414+
cpuinfo_isa.sme2p1 = true;
415+
}
416+
417+
const uint32_t has_feat_sme_b16b16 = get_sys_info_by_name("hw.optional.arm.FEAT_SME_B16B16");
418+
if (has_feat_sme_b16b16 != 0) {
419+
cpuinfo_isa.sme_b16b16 = true;
420+
}
421+
422+
const uint32_t has_feat_sme_f16f16 = get_sys_info_by_name("hw.optional.arm.FEAT_SME_F16F16");
423+
if (has_feat_sme_f16f16 != 0) {
424+
cpuinfo_isa.sme_f16f16 = true;
425+
}
426+
402427
uint32_t num_clusters = 1;
403428
for (uint32_t i = 0; i < mach_topology.cores; i++) {
404429
cores[i] = (struct cpuinfo_core){

0 commit comments

Comments
 (0)