disasm_rdna2: decode 64-bit DS local data share instructions #621

Manually merged
github merged 3 commits from gh-pr/621/head into gh-pr/621/base 2026-11-26 22:06:29 +00:00
Owner

@⁠Neoplayer on GitHub · 2026-11-22 16:15 UTC · original
Neoplayer:disasm/ds-instructions → main · +429 −2 · 3 files · 3 commits · merged 2026-11-23 05:26 UTC

Change

Add decoding for 64-bit RDNA 2 (gfx1013) DS instructions ((w0 & 0xfc000000) == 0xd8000000, 154 forms) in tools/disasm_rdna2.py and synchronize tools/scan_unsupported_shaders.py:

  1. tools/disasm_rdna2.py:
    • Add DS_OPS (154 opcodes: mnemonic, vdst/data0/data1 widths, address presence, offset mode, gds mode), _format_ds_swizzle() (QUAD_PERM, SWAP, REVERSE, BROADCAST, BITMASK_PERM, decimal fallback, omitted when 0) and _decode_ds().
    • Single-offset ops print offset:<u16> when non-zero; dual-offset ops (read2*, write2*, wrxchg2*) print non-zero offset0:/offset1:; gds is printed when set.
    • Unknown opcodes, gds-only ops without gds, gds-invalid ops with gds, and ds_nop with an offset fall back to 8 bytes to keep stream alignment; short buffers give ds_truncated.
  2. tools/scan_unsupported_shaders.py: register all DS mnemonics in KNOWN_RDNA2_BASE_OPCODES.
  3. tests/rdna2_tools_check.py: 33 LLVM-15-assembled golden vectors, a synthetic sweep over all 154 opcodes, offset/swizzle/gds distinction and alignment tests, and DS entries in the exact-assembly LLVM comparison.

Verification

Commit under test: a741805, macOS arm64, Homebrew LLVM 15.0.7 (-mcpu=gfx1013):

  • LLVM_LIB=... LLVM_MC=... LLVM_OBJCOPY=... python3 -B tests/rdna2_tools_check.py: Ran 52 tests - OK.
  • Cross-check against pixel_aot.disassemble(..., libLLVM-15.dylib) over all 154 opcodes (gds/offset variants): Checked 653 DS encodings ... mismatches=0.
  • Swizzle formatter vs LLVM 15 over all 65536 imm16 values: 0 mismatches (checked before porting into the tool).
  • DS opcode set equals the 154 DS rows in docs/coverage/gfx1013.tsv.
  • pixel_aot_check.py binary, ffx_dispatch_aot_check.py and the other Python checks from .github/workflows/windows.yml that run without Windows: exit 0. git diff --check: exit 0.

MSVC, D3D12 and WARP were not run on this macOS host.

Evidence and follow-up

All fixtures are source-built synthetic sequences checked against LLVM 15.0.7. Remaining undecoded 64-bit encodings include SDWA/DPP.

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.
  • I updated README/docs when a capability or build requirement changed. (No docs or build requirements changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠Neoplayer** on GitHub · 2026-11-22 16:15 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/621) `Neoplayer:disasm/ds-instructions` → `main` · +429 −2 · 3 files · 3 commits · merged 2026-11-23 05:26 UTC ## Change Add decoding for 64-bit RDNA 2 (`gfx1013`) DS instructions (`(w0 & 0xfc000000) == 0xd8000000`, 154 forms) in `tools/disasm_rdna2.py` and synchronize `tools/scan_unsupported_shaders.py`: 1. `tools/disasm_rdna2.py`: - Add `DS_OPS` (154 opcodes: mnemonic, vdst/data0/data1 widths, address presence, offset mode, gds mode), `_format_ds_swizzle()` (QUAD_PERM, SWAP, REVERSE, BROADCAST, BITMASK_PERM, decimal fallback, omitted when 0) and `_decode_ds()`. - Single-offset ops print `offset:<u16>` when non-zero; dual-offset ops (`read2*`, `write2*`, `wrxchg2*`) print non-zero `offset0:`/`offset1:`; `gds` is printed when set. - Unknown opcodes, `gds`-only ops without `gds`, `gds`-invalid ops with `gds`, and `ds_nop` with an offset fall back to 8 bytes to keep stream alignment; short buffers give `ds_truncated`. 2. `tools/scan_unsupported_shaders.py`: register all DS mnemonics in `KNOWN_RDNA2_BASE_OPCODES`. 3. `tests/rdna2_tools_check.py`: 33 LLVM-15-assembled golden vectors, a synthetic sweep over all 154 opcodes, offset/swizzle/gds distinction and alignment tests, and DS entries in the exact-assembly LLVM comparison. ## Verification Commit under test: `a741805`, macOS arm64, Homebrew LLVM 15.0.7 (`-mcpu=gfx1013`): - `LLVM_LIB=... LLVM_MC=... LLVM_OBJCOPY=... python3 -B tests/rdna2_tools_check.py`: `Ran 52 tests - OK`. - Cross-check against `pixel_aot.disassemble(..., libLLVM-15.dylib)` over all 154 opcodes (gds/offset variants): `Checked 653 DS encodings ... mismatches=0`. - Swizzle formatter vs LLVM 15 over all 65536 `imm16` values: 0 mismatches (checked before porting into the tool). - DS opcode set equals the 154 `DS` rows in `docs/coverage/gfx1013.tsv`. - `pixel_aot_check.py binary`, `ffx_dispatch_aot_check.py` and the other Python checks from `.github/workflows/windows.yml` that run without Windows: exit 0. `git diff --check`: exit 0. MSVC, D3D12 and WARP were not run on this macOS host. ## Evidence and follow-up All fixtures are source-built synthetic sequences checked against LLVM 15.0.7. Remaining undecoded 64-bit encodings include `SDWA`/`DPP`. ## 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. - [ ] I updated README/docs when a capability or build requirement changed. (No docs or build requirements changed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:06:28 +00:00
github manually merged commit 7458f5e03c into gh-pr/621/base 2026-11-26 22:06:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.