x64_recomp: decode opcode 0x90 forms (X64-RECOMP-PRIMARY-90) #847
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/847"
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 ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T14:31:09Z.
Claimed in the coordination issue as: X64-RECOMP-PRIMARY-90 — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7134430737
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
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:32:59Z.
Review: APPROVED
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.
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:36:56Z.
Review: APPROVED
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).
Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:56:13Z.
Review: APPROVED
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).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T21:39:52Z.
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).