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

Merged
LooperSalty merged 1 commit from upstream-pr/264 into main 2026-11-21 19:56:17 +00:00
LooperSalty commented 2026-11-21 19:41:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by LooperSalty on 2026-11-21T19:41:22Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533527814 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/264). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-21T19:41:22Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:42:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!261
No description provided.