tooling: decode v_cvt_off_f32_i4, v_sat_pk_u8_i16 and the two swaps in disasm_rdna2 #1587

Merged
vladbondarenko97 merged 1 commit from upstream-pr/1594 into main 2026-11-24 15:26:13 +00:00
vladbondarenko97 commented 2026-11-24 14:40:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by vladbondarenko97 on 2026-11-24T14:40:13Z.


Change

VOP1 opcodes 0x0e, 0x62, 0x65 and 0x68 printed as v_vop1_NN (also through VOP3). They now decode as llvm-mc prints them for gfx1013: v_cvt_off_f32_i4 and v_sat_pk_u8_i16 in e32, e64, SDWA and DPP; v_swap_b32 and v_swaprel_b32 as 32-bit VOP1 only, with the VOP3A, SDWA and DPP spellings kept as eight-byte refusals. The scanner recognizes v_swaprel_b32. Decoding only. Refs #938.

Verification

Commit e7e1e928 on main e09b3302, macOS, Python 3.14.

  • python -B tests/rdna2_tools_check.py: Ran 143, OK (skipped=18). The new tests fail with tools/ from main (failures=22).
  • Docs and bidi checks: OK.
  • 3,000 random words compared with llvm-mc 23.1.6: only the difference classes existing integer-source VOP1 opcodes already have.

Not run: the Windows ctest, and LLVM 15.

Evidence and follow-up

A non-VGPR source of a swap prints like any VOP1 source; llvm-mc prints it with an "invalid register" note. No hardware measurement. Fixtures are hand-assembled words and llvm-mc output, no game data.

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.
  • I did not include game files, dumps, distribution links or secrets.

AI use: Claude Code. Claude Sonnet 5.5 wrote the change, the tests and the llvm-mc sweep; Claude Opus 5.5 reviewed the diff and reran the suite. I reviewed it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584308775 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1594). Originally posted by [vladbondarenko97](https://github.com/vladbondarenko97) on 2026-11-24T14:40:13Z. --- ## Change VOP1 opcodes 0x0e, 0x62, 0x65 and 0x68 printed as `v_vop1_NN` (also through VOP3). They now decode as llvm-mc prints them for gfx1013: `v_cvt_off_f32_i4` and `v_sat_pk_u8_i16` in e32, e64, SDWA and DPP; `v_swap_b32` and `v_swaprel_b32` as 32-bit VOP1 only, with the VOP3A, SDWA and DPP spellings kept as eight-byte refusals. The scanner recognizes `v_swaprel_b32`. Decoding only. Refs #938. ## Verification Commit e7e1e928 on main e09b3302, macOS, Python 3.14. - `python -B tests/rdna2_tools_check.py`: Ran 143, OK (skipped=18). The new tests fail with `tools/` from main (failures=22). - Docs and bidi checks: OK. - 3,000 random words compared with llvm-mc 23.1.6: only the difference classes existing integer-source VOP1 opcodes already have. Not run: the Windows ctest, and LLVM 15. ## Evidence and follow-up A non-VGPR source of a swap prints like any VOP1 source; llvm-mc prints it with an "invalid register" note. No hardware measurement. Fixtures are hand-assembled words and llvm-mc output, no game data. ## 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. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI use: Claude Code. Claude Sonnet 5.5 wrote the change, the tests and the llvm-mc sweep; Claude Opus 5.5 reviewed the diff and reran the suite. I reviewed it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 16:03:12 +00:00
tedin7 commented 2026-11-24 16:03:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:27:26Z.

Review: COMMENTED


Reviewed at commit e7e1e928f94cf583bb377ef5dbced90ec21a6393.

Findings

  • tools/disasm_rdna2.py: adds v_cvt_off_f32_i4_e32 (0x0e), v_sat_pk_u8_i16_e32 (0x62), v_swap_b32 (0x65), and v_swaprel_b32 (0x68) to VOP1_OPS, and refuses VOP3A encodings of v_swap_b32 and v_swaprel_b32 while preserving the 8-byte instruction boundary.
  • tools/scan_unsupported_shaders.py: adds v_swaprel_b32 to KNOWN_RDNA2_BASE_OPCODES.
  • tests/rdna2_tools_check.py: tests _e32, _e64, _sdwa, _dpp, 8-byte VOP3A/SDWA/DPP16 refusals for the two swaps, neighbouring undefined opcodes (0x66, 0x67), and binary scanner recognition. Cross-checked against llvm-mc-19 -arch=amdgcn -mcpu=gfx1013 for the e32, SDWA, DPP16, swap, and e64 opcodes/modifiers.

Verification

  • Linux:
    • python3 -B tests/docs_links_check.py -> passed (16 Markdown files, 345 links).
    • python3 -B tests/bidi_controls_check.py -> passed (1255 tracked files).
    • python3 -B tests/rdna2_tools_check.py -> 143 tests ran, OK (skipped=18).
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): ctest --preset dev -R '^(pixel_aot_.*_warp|pso_readiness_check|rdna2_tools_check)$' (68 direct downstream tests) -> 68/68 passed (76.23s).
    • Release /O2 (--preset release): same 68-test suite -> 68/68 passed (71.84s).

No blocking issues found.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6042190532 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1594#pullrequestreview-6042190532). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T15:27:26Z. **Review:** COMMENTED --- Reviewed at commit `e7e1e928f94cf583bb377ef5dbced90ec21a6393`. ### Findings - `tools/disasm_rdna2.py`: adds `v_cvt_off_f32_i4_e32` (`0x0e`), `v_sat_pk_u8_i16_e32` (`0x62`), `v_swap_b32` (`0x65`), and `v_swaprel_b32` (`0x68`) to `VOP1_OPS`, and refuses VOP3A encodings of `v_swap_b32` and `v_swaprel_b32` while preserving the 8-byte instruction boundary. - `tools/scan_unsupported_shaders.py`: adds `v_swaprel_b32` to `KNOWN_RDNA2_BASE_OPCODES`. - `tests/rdna2_tools_check.py`: tests `_e32`, `_e64`, `_sdwa`, `_dpp`, 8-byte VOP3A/SDWA/DPP16 refusals for the two swaps, neighbouring undefined opcodes (`0x66`, `0x67`), and binary scanner recognition. Cross-checked against `llvm-mc-19 -arch=amdgcn -mcpu=gfx1013` for the e32, SDWA, DPP16, swap, and e64 opcodes/modifiers. ### Verification - Linux: - `python3 -B tests/docs_links_check.py` -> passed (16 Markdown files, 345 links). - `python3 -B tests/bidi_controls_check.py` -> passed (1255 tracked files). - `python3 -B tests/rdna2_tools_check.py` -> **143 tests ran, OK (skipped=18)**. - Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP): - Debug (`--preset dev`): `ctest --preset dev -R '^(pixel_aot_.*_warp|pso_readiness_check|rdna2_tools_check)$'` (68 direct downstream tests) -> **68/68 passed** (`76.23s`). - Release `/O2` (`--preset release`): same 68-test suite -> **68/68 passed** (`71.84s`). No blocking issues found. 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!1587
No description provided.