tooling: decode v_mul_lo_i32, the quad SAD pair, v_interp_mov_f32_e64 and the d16_hi format buffer ops #1155

Merged
tedin7 merged 1 commit from upstream-pr/1162 into main 2026-11-24 02:48:52 +00:00
tedin7 commented 2026-11-24 02:06:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:06:00Z.


Change

Decodes six more gfx1013 forms in tools/disasm_rdna2.py and registers them in tools/scan_unsupported_shaders.py, so the shader scan no longer reports them as unknown. Decoding and recognition only; nothing is lowered.

  • VOP3: v_mul_lo_i32 (0x16b), v_qsad_pk_u16_u8 (0x172), v_mqsad_pk_u16_u8 (0x173), v_interp_mov_f32_e64 (0x202, printed with p10/p20/p0 and attrN.c as llvm-mc does).
  • MUBUF: buffer_load_format_d16_hi_x (0x26) and buffer_store_format_d16_hi_x (0x27).
  • Words llvm-mc rejects become eight-byte ..._unsupported records (abs/neg on all four VOP3 forms, clamp on v_mul_lo_i32, omod except on the interpolation move, a set src2 on two-source forms, parameter selector 3, the lds bit and a status dword past v255 on the MUBUF ops), so the next instruction keeps its offset. Special registers (vcc, exec, null, m0) and literals decode as LLVM prints them.
  • Shared helper for the clamp/omod suffix; the two existing tests that named the old unknown opcode (v_vop3_172) and the MUBUF table size are updated, nothing is weakened.

Refs #938

Verification

  • LLVM_LIB=libLLVM-15.so.1 LLVM_MC=llvm-mc-15 LLVM_OBJCOPY=llvm-objcopy-15 python3 -B tests/rdna2_tools_check.py (Debian LLVM 15.0.6): Ran 118 tests ... OK (skipped=1); the skip is the LLVM 19-only MUBUF comparison.
  • python3 -B tests/rdna2_tools_check.py without LLVM: Ran 118 tests ... OK (skipped=13).
  • With LLVM 19.1.7 the new tests pass, including the MUBUF check against LLVM. Three older tests fail on LLVM 19 on main as well (test_llvm_comparison, test_source_built_records_after_s_endpgm, test_interp_f16_llvm_round_trip); CI pins LLVM 15.
  • python3 -B tests/pso_readiness_check.py: passed. tests/pixel_aot_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1: exit 0.
  • Negative control: the same new tests against tools/ from origin/main fail (golden vectors, the 4096-word modifier grid, refusals, the scan test, and the MUBUF table size).
  • Mutation control: flipping the opcode or destination bit of every VOP3 golden word changes the decoded text, and the neighbouring opcodes 0x169..0x174 keep their own names.
  • A separate random comparison of 8000 VOP3 words and 8000 MUBUF words against LLVM 15 and 19 found no difference (script not committed; the committed grid covers the modifier bits).

Evidence and follow-up

  • Spelling and encodings come from llvm-mc 15.0.6 and 19.1.7 for gfx1013. LLVM 15 rejects both MUBUF opcodes on gfx1013 (instruction not supported on this GPU), so those two are checked against LLVM 19 only, and that comparison skips itself on LLVM 15. With tfe set LLVM 19 prints the status dword in the vdata range; the decoder does the same.
  • v_qsad_pk_u16_u8 and v_mqsad_pk_u16_u8 vectors use a destination that does not overlap a source, because LLVM 15 refuses to assemble an overlap.
  • No lowering and no store or atomic path is added, so there is no readback and no memory-window case in this change; the checks are decode-level.
  • Not covered: v_interp_p1_f32_e64 and v_interp_p2_f32_e64 (0x200 and 0x201 on gfx1013). The existing decoder names 0x270..0x272 as interpolation ops, which llvm-mc 19 does not decode for gfx1013; left unchanged here.
  • docs/experiments.md has a new section with the scope.
  • Fixtures are hand-written words and llvm-mc output; no game data. AI-assisted.

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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572957167 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1162). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:06:00Z. --- ## Change Decodes six more gfx1013 forms in `tools/disasm_rdna2.py` and registers them in `tools/scan_unsupported_shaders.py`, so the shader scan no longer reports them as unknown. Decoding and recognition only; nothing is lowered. - VOP3: `v_mul_lo_i32` (0x16b), `v_qsad_pk_u16_u8` (0x172), `v_mqsad_pk_u16_u8` (0x173), `v_interp_mov_f32_e64` (0x202, printed with `p10`/`p20`/`p0` and `attrN.c` as llvm-mc does). - MUBUF: `buffer_load_format_d16_hi_x` (0x26) and `buffer_store_format_d16_hi_x` (0x27). - Words llvm-mc rejects become eight-byte `..._unsupported` records (abs/neg on all four VOP3 forms, clamp on `v_mul_lo_i32`, omod except on the interpolation move, a set src2 on two-source forms, parameter selector 3, the lds bit and a status dword past v255 on the MUBUF ops), so the next instruction keeps its offset. Special registers (`vcc`, `exec`, `null`, `m0`) and literals decode as LLVM prints them. - Shared helper for the clamp/omod suffix; the two existing tests that named the old unknown opcode (`v_vop3_172`) and the MUBUF table size are updated, nothing is weakened. Refs #938 ## Verification - `LLVM_LIB=libLLVM-15.so.1 LLVM_MC=llvm-mc-15 LLVM_OBJCOPY=llvm-objcopy-15 python3 -B tests/rdna2_tools_check.py` (Debian LLVM 15.0.6): `Ran 118 tests ... OK (skipped=1)`; the skip is the LLVM 19-only MUBUF comparison. - `python3 -B tests/rdna2_tools_check.py` without LLVM: `Ran 118 tests ... OK (skipped=13)`. - With LLVM 19.1.7 the new tests pass, including the MUBUF check against LLVM. Three older tests fail on LLVM 19 on `main` as well (`test_llvm_comparison`, `test_source_built_records_after_s_endpgm`, `test_interp_f16_llvm_round_trip`); CI pins LLVM 15. - `python3 -B tests/pso_readiness_check.py`: passed. `tests/pixel_aot_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1`: exit 0. - Negative control: the same new tests against `tools/` from `origin/main` fail (golden vectors, the 4096-word modifier grid, refusals, the scan test, and the MUBUF table size). - Mutation control: flipping the opcode or destination bit of every VOP3 golden word changes the decoded text, and the neighbouring opcodes 0x169..0x174 keep their own names. - A separate random comparison of 8000 VOP3 words and 8000 MUBUF words against LLVM 15 and 19 found no difference (script not committed; the committed grid covers the modifier bits). ## Evidence and follow-up - Spelling and encodings come from llvm-mc 15.0.6 and 19.1.7 for gfx1013. LLVM 15 rejects both MUBUF opcodes on gfx1013 (`instruction not supported on this GPU`), so those two are checked against LLVM 19 only, and that comparison skips itself on LLVM 15. With `tfe` set LLVM 19 prints the status dword in the vdata range; the decoder does the same. - `v_qsad_pk_u16_u8` and `v_mqsad_pk_u16_u8` vectors use a destination that does not overlap a source, because LLVM 15 refuses to assemble an overlap. - No lowering and no store or atomic path is added, so there is no readback and no memory-window case in this change; the checks are decode-level. - Not covered: `v_interp_p1_f32_e64` and `v_interp_p2_f32_e64` (0x200 and 0x201 on gfx1013). The existing decoder names 0x270..0x272 as interpolation ops, which llvm-mc 19 does not decode for gfx1013; left unchanged here. - `docs/experiments.md` has a new section with the scope. - Fixtures are hand-written words and llvm-mc output; no game data. AI-assisted. ## 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.
upstream-sync closed this pull request 2026-11-24 06:46:36 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:50:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T02:39:50Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T02:44:50.490447Z c199a8e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120363124 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1162#issuecomment-7120363124). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T02:39:50Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c199a8ed64a6748ae828a173b18faa72fbcb5310","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T02:44:50.490447Z">2026-11-24T02:44:50.490447Z</relative-time> | `c199a8e` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
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!1155
No description provided.