shader: decode GFX10 null and ttmp scalar operands in disasm_rdna2 #264

Manually merged
github merged 1 commit from gh-pr/264/head into gh-pr/264/base 2026-11-26 21:38:36 +00:00
Owner

@⁠LooperSalty on GitHub · 2026-11-21 19:41 UTC · original
LooperSalty:shader/gfx10-null-ttmp-operands → main · +7 −2 · 2 files · 1 commits · merged 2026-11-21 19:56 UTC

Change

decode_s_reg in tools/disasm_rdna2.py printed scalar operand code 108 as null and code 125 as s125. On GFX10 / RDNA 2:

  • codes 108-123 are ttmp0-ttmp15;
  • code 125 is null;

as in LLVM's gfx10 MC tests (for example, s_waitcnt_vscnt null, 0x0 encodes sdst = 0x7d). The function now returns ttmpN for 108-123 and null for 125.

This PR is independent of #251 and of the scalar/VOP1 opcode-table PR.

Verification

  • python -B -m unittest tests.rdna2_tools_check on Windows 11 26300, Python 3.12: Ran 19 tests … OK (skipped=1). The skip is test_llvm_comparison, which needs LLVM_LIB.
  • New golden vectors on s_sub_u32, whose opcode is already correct on main:
    • 007d8080 → s_sub_u32 s0, s0, null;
    • 006c8080 → s_sub_u32 s0, s0, ttmp0.

Evidence and follow-up

Operand codes cross-checked against LLVM's gfx10 MC tests and an independent decoder (PrototypeScarlett/emu/rdna2_operands.py in LooperSalty/AnyXboxX).

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture: before the change, 007d8080 printed s125.
  • I updated README/docs when a capability or build requirement changed (no change needed).
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code). I reviewed the change and ran the checks above.

**@⁠LooperSalty** on GitHub · 2026-11-21 19:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/264) `LooperSalty:shader/gfx10-null-ttmp-operands` → `main` · +7 −2 · 2 files · 1 commits · merged 2026-11-21 19:56 UTC ## Change `decode_s_reg` in `tools/disasm_rdna2.py` printed scalar operand code 108 as `null` and code 125 as `s125`. On GFX10 / RDNA 2: - codes 108-123 are `ttmp0`-`ttmp15`; - code 125 is `null`; as in LLVM's gfx10 MC tests (for example, `s_waitcnt_vscnt null, 0x0` encodes `sdst` = 0x7d). The function now returns `ttmpN` for 108-123 and `null` for 125. This PR is independent of #251 and of the scalar/VOP1 opcode-table PR. ## Verification - `python -B -m unittest tests.rdna2_tools_check` on Windows 11 26300, Python 3.12: `Ran 19 tests … OK (skipped=1)`. The skip is `test_llvm_comparison`, which needs `LLVM_LIB`. - **New golden vectors** on `s_sub_u32`, whose opcode is already correct on `main`: - `007d8080` → `s_sub_u32 s0, s0, null`; - `006c8080` → `s_sub_u32 s0, s0, ttmp0`. ## Evidence and follow-up Operand codes cross-checked against LLVM's gfx10 MC tests and an independent decoder (`PrototypeScarlett/emu/rdna2_operands.py` in [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX)). ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture: before the change, `007d8080` printed `s125`. - [x] I updated README/docs when a capability or build requirement changed (no change needed). - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Claude Code). I reviewed the change and ran the checks above.
decode_s_reg printed operand code 108 as null and 125 as s125. On GFX10,
codes 108-123 are ttmp0-ttmp15 and 125 is null, as in LLVM's gfx10 MC tests.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:38:34 +00:00
github manually merged commit be2f0f8f6c into gh-pr/264/base 2026-11-26 21:38:36 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.