The AArch32 guests' fixups over a32.sail, each with why: what user mode on the 3DS's ARM11, the GBA's ARM7TDMI, the NDS's ARM946E-S, the Vita's Cortex-A9 and a 32-bit Switch program's Cortex-A57 makes of the architecture, and where ScarletNX's AArch32 CPU (arm.h's SnxArmCPU) keeps the registers. sailgen reads this file after a32.sail (--overlay), and a definition here takes the place of a32.sail's of the same name; a top-level let is a constant the generated code folds. a32.roots stops the extraction at the names defined here, so a32.sail holds only sail-arm's own text. What differs from one architecture to the next asks ArchVersion(), the guest's (mach_a32.h), as the ARMv7 ARM's ASL does; which encodings each one has is a32.profile's ---- the registers ---- ScarletNX's AArch32 CPU keeps R0 to R15 in one array (SnxArmCPU.r), and a guest runs in user mode alone, which banks none of them: sail-arm's Rmode_read and Rmode_set pick a mode's bank, here GPR's elements, which the back end loads and stores where the CPU keeps them (sg_GPR_read). R15 is read through R_read, the pc of the instruction plus 8 or 4
register GPR : vector(16, bits(32))
Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.