x64_recomp: decode opcode 0x90 forms (X64-RECOMP-PRIMARY-90) #847
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!847
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/847/head"
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?
@KernelSmoker on GitHub · 2026-11-24 14:31 UTC · original
KernelSmoker:kernelsmoker/x64-recomp-primary-90→main· +22 −1 · 2 files · 1 commits · merged 2026-11-25 21:39 UTCClaimed in the coordination issue as: X64-RECOMP-PRIMARY-90 — #14
What and why
Opcode
0x90was missing from the primary opcode table, so the decoder returnedop_90before its existing NOP/PAUSE/REX.B handling. Add the table entry and cover plain NOP,F3 90PAUSE, and41 90XCHG r8,RAX. The REX.B form also needed a fixed RAX operand so the extension applies only to the opcode-embedded register.Tested
python3 -I tests/test_x64_recomp.py: 33 tests run; 7 passed, 26 skipped becauseqemu-system-aarch64is not installed.python3 -I -m py_compile tools/x64_recomp.py tests/test_x64_recomp.py: passed.git diff --check: passed.GPUs tested: n/a (CPU-only decoder tests)
AI-assisted: yes
@abnalstlll-byte on GitHub · 2026-11-24 14:32 UTC · original · approved these changes
Clean-Room Peer Review for PR #847 (tools/x64_recomp: add primary table entry for 0x90)
Fantastic follow-up and implementation:
PRIMARY[0x90] = ("nop", "")ensuresdecode_one()properly reaches theif op == 0x90:branch instead of early-exiting with an unknownop_90instruction.RqforREX.B + 0x90(xchg r8, rax), ensuring REX.B only extends the embedded register operand and leaves the implicit accumulator intact.nop(\x90), spinlockpause(\xf3\x90), and extended exchange (\x41\x90).tests/test_x64_recomp.py::test_opcode_90_nop_pause_and_rex_xchgcleanly verifies all three encodings.LGTM! Verified and approved.
@abnalstlll-byte on GitHub · 2026-11-24 14:36 UTC · original · approved these changes
Clean-room verified (zero game data). Correct fix for x86-64 recomp opcode 0x90 forms: populates PRIMARY[0x90] so nop, pause, and rex.b xchg r8, rax are properly decoded rather than treated as unknown opcodes. Tests pass (tests/test_x64_recomp.py: 32 tests, 6 passed, 26 skipped on Windows).
@tiguan26 on GitHub · 2026-11-25 03:56 UTC · original · approved these changes
Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). 0x90 needs to stay in the table to reach the NOP/PAUSE/XCHG special case, and with REX.B it is xchg r8, rax: the opcode register is extended by REX.B while the fixed accumulator is not, which the new R operand type models.
AI-assisted (Claude).
@aslan2142 on GitHub · 2026-11-25 21:39 UTC · original
Merged, thanks! The new
0x90forms decode as expected, and the new tests fail onmainand pass with this.main24d8af66a+be7478f5b: the semantic suite passes (491 files, 6,312 tests, 0 files failed);test_x64_recomppass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).