std: add native cpu detection for apple m3 (#21116)

* std.c.darwin: add missing CPUFAMILY fields

* std.zig.system.detectNativeCpuAndFeatures: add missing darwin fields

* add comment so the prong isnt lost and easily discoverable during next llvm upgrade
This commit is contained in:
Meghan Denny
2024-08-19 11:49:02 -07:00
committed by GitHub
parent 82b676ef79
commit 7071d1b3c2
2 changed files with 10 additions and 0 deletions

View File

@@ -1156,6 +1156,11 @@ pub const CPUFAMILY = enum(u32) {
ARM_FIRESTORM_ICESTORM = 0x1b588bb3,
ARM_BLIZZARD_AVALANCHE = 0xda33d83d,
ARM_EVEREST_SAWTOOTH = 0x8765edea,
ARM_COLL = 0x2876f5b5,
ARM_IBIZA = 0xfa33415e,
ARM_LOBOS = 0x5f4dea93,
ARM_PALMA = 0x72015832,
ARM_DONAN = 0x6f5129ac,
_,
};

View File

@@ -419,6 +419,11 @@ pub fn detectNativeCpuAndFeatures() ?Target.Cpu {
.ARM_TYPHOON => &Target.aarch64.cpu.apple_a8,
.ARM_CYCLONE => &Target.aarch64.cpu.cyclone,
else => return null,
.ARM_COLL => &Target.aarch64.cpu.apple_a17,
.ARM_IBIZA => &Target.aarch64.cpu.apple_m3, // base
.ARM_LOBOS => &Target.aarch64.cpu.apple_m3, // pro
.ARM_PALMA => &Target.aarch64.cpu.apple_m3, // max
// .ARM_DONAN => &Target.aarch64.cpu.apple_m4, // decl not available until llvm 19
};
return Target.Cpu{