diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-29 09:39:25 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-29 20:49:48 -0400 |
| commit | c0643a675b1382cfa7357626a63a623b56a72666 (patch) | |
| tree | fb19a274b962c118c5397800c1d1e0aabb91a0b9 /src/video_core/gpu_thread.cpp | |
| parent | e2847fa5dd87d64f86d0c2a580f47fe9e8f4fceb (diff) | |
video_core: compile Turing MME macro code to x86-64
Title 1 calls macros ~1.3 million times a second; most were replayed from the macro memo,
whose lookups missed the CPU caches inside the GPU thread (~8%), and the rest interpreted.
macro_turing_jit.h compiles all of the uploaded macro memory with Xbyak: each instruction a
block falling through to the next, branches and loops through a jump table, with the
interpreter's semantics (lanes reading operands before either writes, predication as two
variants, the END delay slot, loops, carry). Loop checks only where a loop can end, END
checks only after an END, the instruction limit counted on indirect jumps. Emits and register
reads call back into C++. It is recompiled when the macro code changes and used for 3D and
compute macros on x86-64; EDEN_NX2_MME_JIT=0 goes back to the memo and the interpreter.
Checked against the interpreter on 200,000 recorded calls (registers, data RAM, every
method write, FIFO use): identical. In the game: macro calls 148 ns instead of 174 (two
profiled runs each), no failures, 0 crashes in 3 runs. NX2_GPU_THREAD_SPLIT.md describes
the next step, splitting the GPU thread.
Diffstat (limited to 'src/video_core/gpu_thread.cpp')
0 files changed, 0 insertions, 0 deletions
