tooling: consume DPP extension dword in disassembled VOPC #1976

Merged
RenzoWit35 merged 1 commit from upstream-pr/1983 into main 2026-11-24 22:41:35 +00:00
RenzoWit35 commented 2026-11-24 22:36:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T22:36:45Z.


Change

The VOPC branch of decode_instruction in tools/disasm_rdna2.py handled only src0 249 (SDWA) and 255 (literal). For src0 250 (DPP16), 233 (DPP8) and 234 (DPP8 FI) the 4-byte extension dword was not consumed: the compare was printed as a 4-byte v_cmp_*_e32 vcc_lo, s250, ... and the extension dword was then decoded as a separate bogus instruction, which desynchronised everything after it.

These src0 values are now routed to the existing _vop_extension helper (as VOP1/VOP2 do for forms they do not decode). The compare becomes one 8-byte record, v_cmp_gt_f32_dpp <unsupported DPP16> (or DPP8), and the next instruction is at the right offset. The operands are still not decoded; VOP1/VOP2 output is unchanged.

Verification

Environment: Windows 11, Python 3.14.5.

  • python -B tools/disasm_rdna2.py --hex "fa02087c00010000000081bf"
    • before: v_cmp_gt_f32_e32 vcc_lo, s250, v1 (4 bytes), v_vop2_00 (Unknown VOP2), s_endpgm
    • after: v_cmp_gt_f32_dpp <unsupported DPP16> (8 bytes) at +0x0000, s_endpgm at +0x0008
    • same for e902087c... and ea02087c... (DPP8, DPP8 FI).
  • New assertions in tests/rdna2_tools_check.py (next to the VOPC SDWA case): record length 8, opcode vopc_dpp16/vopc_dpp8, assembly, s_endpgm offset 8, and a 4-byte prefix is vopc_truncated.
  • python -B tests/rdna2_tools_check.py: after the fix Ran 152 tests ... OK (skipped=19).
  • Negative control: same test file against unmodified tools/disasm_rdna2.py fails in test_vopc_opcode_table_synthetic_forms: ['v_cmp_gt_f32_e32', 'v_vop2_00', 's_endpgm'] != ['vopc_dpp16', 's_endpgm'] : fa02087c00010000 (FAILED (failures=1)).

Not run: other test files; no LLVM comparison (LLVM not installed), so the unsupported-DPP text is a placeholder like the existing VOP1/VOP2 fallback.

Evidence and follow-up

Rebased on current main. No open PR touches tools/disasm_rdna2.py. The sibling PRs for the CLI input errors and the SMEM signed offset change other parts of the same two files; the three merge in any order. Full VOPC DPP operand decoding (as _decode_vop2_dpp does) is a possible follow-up.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592797735 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1983). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-24T22:36:45Z. --- ## Change The VOPC branch of `decode_instruction` in `tools/disasm_rdna2.py` handled only src0 249 (SDWA) and 255 (literal). For src0 250 (DPP16), 233 (DPP8) and 234 (DPP8 FI) the 4-byte extension dword was not consumed: the compare was printed as a 4-byte `v_cmp_*_e32 vcc_lo, s250, ...` and the extension dword was then decoded as a separate bogus instruction, which desynchronised everything after it. These src0 values are now routed to the existing `_vop_extension` helper (as VOP1/VOP2 do for forms they do not decode). The compare becomes one 8-byte record, `v_cmp_gt_f32_dpp <unsupported DPP16>` (or `DPP8`), and the next instruction is at the right offset. The operands are still not decoded; VOP1/VOP2 output is unchanged. ## Verification Environment: Windows 11, Python 3.14.5. - `python -B tools/disasm_rdna2.py --hex "fa02087c00010000000081bf"` - before: `v_cmp_gt_f32_e32 vcc_lo, s250, v1` (4 bytes), `v_vop2_00` (Unknown VOP2), `s_endpgm` - after: `v_cmp_gt_f32_dpp <unsupported DPP16>` (8 bytes) at +0x0000, `s_endpgm` at +0x0008 - same for `e902087c...` and `ea02087c...` (DPP8, DPP8 FI). - New assertions in `tests/rdna2_tools_check.py` (next to the VOPC SDWA case): record length 8, opcode `vopc_dpp16`/`vopc_dpp8`, assembly, `s_endpgm` offset 8, and a 4-byte prefix is `vopc_truncated`. - `python -B tests/rdna2_tools_check.py`: after the fix `Ran 152 tests ... OK (skipped=19)`. - Negative control: same test file against unmodified `tools/disasm_rdna2.py` fails in `test_vopc_opcode_table_synthetic_forms`: `['v_cmp_gt_f32_e32', 'v_vop2_00', 's_endpgm'] != ['vopc_dpp16', 's_endpgm'] : fa02087c00010000` (`FAILED (failures=1)`). Not run: other test files; no LLVM comparison (LLVM not installed), so the unsupported-DPP text is a placeholder like the existing VOP1/VOP2 fallback. ## Evidence and follow-up Rebased on current `main`. No open PR touches `tools/disasm_rdna2.py`. The sibling PRs for the CLI input errors and the SMEM signed offset change other parts of the same two files; the three merge in any order. Full VOPC DPP operand decoding (as `_decode_vop2_dpp` does) is a possible follow-up. AI-assisted.
upstream-sync closed this pull request 2026-11-24 23:03:25 +00:00
tedin7 commented 2026-11-24 23:03:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:40:48Z.

Review: COMMENTED


Review of head 7205fcd8bb (comment only).

Diff: tools/disasm_rdna2.py (+2) routes VOPC with src0 in 233/234/250 through the existing _vop_extension, so the DPP8/DPP16 extension dword is consumed (length 8) like VOP1/VOP2. tests/rdna2_tools_check.py (+14) covers DPP16, DPP8 and DPP8 FI plus the truncated case. No CMake changes. Clean-room: no external code.

Commands executed locally:

  • git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflicts
  • python3 tests/rdna2_tools_check.py: OK (152 tests, 19 skipped)
  • python3 tests/docs_links_check.py: pass
  • python3 tests/bidi_controls_check.py: pass
  • git diff --check origin/main...HEAD: pass
  • Win2025 (x2w_pipe.py win2025 1983 --wait 900): Debug 18/18 passed, Release /O2 18/18 passed
  • GitHub CI on this head: Windows, Linux, gfx1013 fixtures all pass

Mutations (both reverted):

  • src0 tuple (233, 234, 250) -> (233, 250): test fails (killed)
  • (233, 234, 250) -> (233, 234): test fails (killed)

P1: 0. P2: 0.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048534781 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1983#pullrequestreview-6048534781). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:40:48Z. **Review:** COMMENTED --- Review of head 7205fcd8bbe43f0b73c058b3dde2e5e7d31b96e2 (comment only). Diff: `tools/disasm_rdna2.py` (+2) routes VOPC with src0 in 233/234/250 through the existing `_vop_extension`, so the DPP8/DPP16 extension dword is consumed (length 8) like VOP1/VOP2. `tests/rdna2_tools_check.py` (+14) covers DPP16, DPP8 and DPP8 FI plus the truncated case. No CMake changes. Clean-room: no external code. Commands executed locally: - `git merge-tree --write-tree --name-only origin/main HEAD`: clean, no conflicts - `python3 tests/rdna2_tools_check.py`: OK (152 tests, 19 skipped) - `python3 tests/docs_links_check.py`: pass - `python3 tests/bidi_controls_check.py`: pass - `git diff --check origin/main...HEAD`: pass - Win2025 (`x2w_pipe.py win2025 1983 --wait 900`): Debug 18/18 passed, Release /O2 18/18 passed - GitHub CI on this head: Windows, Linux, gfx1013 fixtures all pass Mutations (both reverted): - src0 tuple `(233, 234, 250)` -> `(233, 250)`: test fails (killed) - `(233, 234, 250)` -> `(233, 234)`: test fails (killed) P1: 0. P2: 0. AI-assisted; commands listed were executed locally.
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!1976
No description provided.