klauspost / cpuid

CPU feature identification for Go
MIT License
1.04k stars 128 forks source link

L1 icache and dcache on M1 are the same sysctl #121

Closed ironiridis closed 1 year ago

ironiridis commented 1 year ago

https://github.com/klauspost/cpuid/blob/e32428e6729530015b46da6a4eafce536b19de49/os_darwin_arm64.go#L85-L86

It's not clear if this was intentional, but it seems possible to get the dcache value on macOS. Currently both L1I and L1D are filled from the same sysctl.

klauspost commented 1 year ago

@ironiridis I do not have access to HW, nor MacOSX, so you are welcome to send a PR with tested changes.