Adam Stylinski
Adam Stylinski
I agree identifying if apple silicon by a cpuid-like instruction is the way to go. Parsing /proc/cpuinfo is not portable outside of Linux, though. We'd have to figure out how...
https://elixir.bootlin.com/linux/v6.13/source/arch/arm64/kernel/cpuinfo.c#L277
Tested it in the M2 - it's about an order of magnitude faster for the largest buffer size. It seems that Apple is the only Arm implementation that actually implements...
@nmoinvaz try this [0001-Add-methods-to-detect-if-on-apple-silicon.patch](https://github.com/user-attachments/files/24040072/0001-Add-methods-to-detect-if-on-apple-silicon.patch)
I did but only after I wrote that. Asahi seems able to do MIDR_EL1 in user mode, what are you testing on? You'll get a sigill if the CPUID HWCAP...
Hah, oh, you have a somewhat working whitelist there. The MIDR_EL1 system register has not produced issues for me, but if you're testing on mac OS or windows I guess...
> If we only enable this on macOS it can be a compile time ifdef. Check out my patch. I unconditionally enable it compile time if compiling on Mac OS...
Are you trying that on Linux? It works perfectly for me on asahi. My patch only checks if it's apple silicon on Linux and assumes it is if on Mac...
If one exists it's probably worth keeping, even if it requires high end arm servers