The items' "Now", "Where" and "How" were written before LLVM left the recompiler (#3017), and describe its emitters, which are deleted: #3027 re-plans them for the native back ends.
Start here: First CPU milestone: one measured SIMD improvement. Profile lane-helper cost, replace one hot instruction group with exact vector code, and compare the same game scene before and after. That is the active implementation scope. The sections below are the supporting backlog, and their phase labels do not require finishing every tool or redesign before the first measured change.
Rosetta 2 translates x86-64 code into arm64 code for one host family, Apple silicon. ScarletNX translates A64 code into the code of every host it supports. The README lists Linux, Windows, FreeBSD, Solaris and Android, and Install builds for x86-64, AArch64, PowerPC64 (little and big endian), RISC-V and LoongArch, and macOS and iOS built in CI, and MIPS64 (little and big endian) and s390x built from their presets. This plan takes each part of Rosetta 2's design, finds the code in ScarletNX that does the same job, and describes how to adapt the technique to each host and to the Horizon behavior that ScarletNX must provide. Whoever implements it should start with the guide: setup, rules and how work is handed back.
Much of Rosetta's shape is already here. scarletnx -r compiles a game ahead of time into a native module with the
host's native back end, a runtime JIT compiles what the recompile missed, and both results are kept between runs. The parts that still
fall short are the cost of guest state at guest calls, calls that go through the dispatch table, the wait on the first
run of missed code, and the lack of measurements that would rank these. Rosetta also leans on Apple hardware made to
behave like x86. ScarletNX's hosts offer no such features, except the AArch64 host, which shares the guest's own
architecture. The plan relies instead on what the recompiler can know ahead of time, such as the AArch64 calling
standard and the executables' relocations, and on profiles of real runs.
Made from docs/layers/cpu/plan.md at 69237645142c. GPL-3.0-or-later.