gen.py keeps 8 V registers per function in locals by default

K = 8 cut guest time 3.9-6.2% in the town on a 7900X against K = 0. func.py tests the same default; --v-locals 0
gives the previous output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-13 20:11:39 +03:00
1 parent eb8c7ea888
commit 44bc5887f0
4 files changed
+11 -6

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ MacNativeGames cannot run on x86-64 as is: its CPU path executes ARM64 code nati
- `gen.py --v-locals K` keeps the K most used V registers of each function in a local `u128 vr[32]` that clang
holds in XMM registers (`recomp/vlocals.py`, the `RT_VLOCALS` accessors of `runtime/simd.h`): loaded at entry,
stored where they may have changed before calls and exits, reloaded after calls; `--v-trust` does not reload
V8-V15, whose low halves AAPCS64 has the callee preserve. K = 0, the default, keeps every V register in the `Cpu`.
V8-V15, whose low halves AAPCS64 has the callee preserve. K is 8 by default; K = 0 keeps every V register in the `Cpu`.
- Coverage oracle: MacNativeGames' NSO rewriter lists every site where game code touches the OS (SVCs, TLS reads, counter reads, `x18`, exclusive windows, jump tables): 68,968 sites in 1.4.3 `main`. The lifter must handle every one.
- Memory: guest address equals host address, all below 2^39 (IPC encodes 39-bit addresses). The heap, stacks and the alias region are reserved with `MEM_WRITE_WATCH`, so the graphics back end can ask which pages the CPU wrote since the last upload (`runtime/memory.c`).
- Indirect branches go through `rt_dispatch` (`runtime/dispatch.c`), which looks the target up in the address table and tail-calls it.