Recompiler: far jumps ignore incoming branches into the address calculation #857
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by nova-aryan on 2026-11-24T06:59:38Z.
The far-jump recognizer assumes that a four-instruction GETPC/add/addc/SETPC sequence always starts at GETPC. A direct branch into its low add, high add or SETPC can bypass that initialization, so the resulting SETPC target depends on the incoming SGPR state. Current main nevertheless annotates it with a fixed target.
I reproduced this with synthetic decoder tests on
beaa245. An ordinary uninterrupted add/subtract sequence passes, while a conditional branch into the sequence and a resolved far jump into a later sequence both fail the new assertions.Plan: collect direct and prospective far targets before publishing annotations, and leave a sequence indirect if any target enters after GETPC. Add regression coverage for both add/subtract and far-to-far edges.
Tested so far with a standalone harness importing the repository's unchanged decoder/spec modules under Rust 1.100.0 on WSL Linux. This is not a Windows crate build or GPU/retail run. Windows MSVC tools and a retail smoke-test title are unavailable in this checkout.
AI use: Codex, GPT-6.1-sol, reproduced the issue and drafted the proposed tests and fix.
upstream-sync referenced this issue2026-11-24 19:06:45 +00:00