Is there a good article explaining what is shared between ARM processors (ie. M1 / Graviton), what makes them "compatible" ? and how they can add specific features still keeping them compatible ?
ARM defines the Instruction Set Architecture for ARM-compatible CPUs.
It has major versions, like Armv8-A and Armv9-A.
The major versions have minor subversions, like Armv8.2-A and Armv8.5-A.
The versions and subversions have mandatory features, which must be implemented by everybody who claims to make an ARM CPU, and optional features.
Like on x86, where there is the CPUID instruction, on an ARM CPU it is possible to determine what version and subversion of the ISA is implemented, and which optional features are implemented, by reading some special registers.
It is possible to make a program that on newer CPUs will take advantage of some features, but on older CPUs it will have a fall-back code path of lower performance.
Because Apple writes software only for their CPUs, they do not bother to write programs that will also run on CPUs made by others, which may lack some of the features implemented on Apple CPUs.
As mentioned in the parent article, Rosetta needs FEAT_FlagM, which is implemented only on ISA versions of Armv8.4-A or newer.
All the ARM cores licensed from the ARM company with the exception of those introduced in 2021 (and also NVIDIA Carmel and the last cores designed by Samsung before giving up), support only Armv8.2-A, and those older than Cortex-A55 (e.g. Cortex-A73, Cortex-A72, NVIDIA Denver) support only Armv8.0-A.
This leaves very few non-Apple CPUs which can execute Rosetta, i.e. only the latest smartphones of 2022 with Armv9.0-A CPUs (Cortex-X2, Cortex-A710, Cortex-A510) and the Graviton 3 servers with Armv8.4-A CPUs (Neoverse V1).
Besides the ISA level compatibility, there is also the problem with the standard peripherals, e.g. timers, which also may differ between ARM CPU implementations.
As explained in the parent article, Rosetta is not written to work with any timer frequency, but accepts only a few values, so it had to be tricked to work on Graviton 3.
Because on any ARM system it is possible to determine the frequency of the timers, it would have been possible to write Rosetta to work with any frequency, but again, there was no reason for Apple to make it more flexible, when they want it to run only on their hardware.
adrian_b|3 years ago
Like on x86, where there is the CPUID instruction, on an ARM CPU it is possible to determine what version and subversion of the ISA is implemented, and which optional features are implemented, by reading some special registers.
It is possible to make a program that on newer CPUs will take advantage of some features, but on older CPUs it will have a fall-back code path of lower performance.
Because Apple writes software only for their CPUs, they do not bother to write programs that will also run on CPUs made by others, which may lack some of the features implemented on Apple CPUs.
As mentioned in the parent article, Rosetta needs FEAT_FlagM, which is implemented only on ISA versions of Armv8.4-A or newer.
All the ARM cores licensed from the ARM company with the exception of those introduced in 2021 (and also NVIDIA Carmel and the last cores designed by Samsung before giving up), support only Armv8.2-A, and those older than Cortex-A55 (e.g. Cortex-A73, Cortex-A72, NVIDIA Denver) support only Armv8.0-A.
This leaves very few non-Apple CPUs which can execute Rosetta, i.e. only the latest smartphones of 2022 with Armv9.0-A CPUs (Cortex-X2, Cortex-A710, Cortex-A510) and the Graviton 3 servers with Armv8.4-A CPUs (Neoverse V1).
Besides the ISA level compatibility, there is also the problem with the standard peripherals, e.g. timers, which also may differ between ARM CPU implementations.
As explained in the parent article, Rosetta is not written to work with any timer frequency, but accepts only a few values, so it had to be tricked to work on Graviton 3.
Because on any ARM system it is possible to determine the frequency of the timers, it would have been possible to write Rosetta to work with any frequency, but again, there was no reason for Apple to make it more flexible, when they want it to run only on their hardware.
my123|3 years ago
personjerry|3 years ago
DaiPlusPlus|3 years ago
No idea, but I found this comment from last year which is interesting and goes towards answering your question: https://news.ycombinator.com/item?id=27077545