tooling: decode six gfx1013 VOP1 and VOP2 opcodes #1063

Merged
tedin7 merged 1 commit from upstream-pr/1070 into main 2026-11-24 00:34:28 +00:00
tedin7 commented 2026-11-24 00:15:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T00:15:29Z.


Change

Refs #938. Add six gfx1013 e32 mnemonics to the Python disassembler opcode tables. VOP1 gains v_movreld_b32, v_movrels_b32, v_movrelsd_b32 and v_movrelsd_2_b32. VOP2 gains v_fmac_f16 and v_ldexp_f16. The production diff is confined to VOP1_OPS and VOP2_OPS in the shared decoder.

Verification

Linux x86-64 (Debian 13), commit 389fe728, negative control on d33845b9 with the new golden test.

  • python3 -B tests/rdna2_tools_check.py -k test_vop1_vop2_e32_gfx1013 against the base decoder reported six failing subtests, one per fallback mnemonic.
  • LLVM_LIB=libLLVM.so.19.1 LLVM_MC=llvm-mc-19 LLVM_OBJCOPY=llvm-objcopy-19 python3 -B tests/rdna2_tools_check.py -k test_vop1_vop2_e32 passed both tests with LLVM 19.1.7. All six instructions round-tripped byte for byte (24 bytes).
  • llvm-mc-19 -triple=amdgcn-amd-amdhsa -mcpu=gfx1013 -show-encoding on the six assembly lines printed the same six words.

LLVM 15.0.6 was extracted locally under out/. The build-a-turno wrapper was used for the three LLVM 15 checks.

llvm15="$PWD/out/vop12-llvm15/usr"
export LD_LIBRARY_PATH="$llvm15/lib/x86_64-linux-gnu"
export LLVM_LIB="$LD_LIBRARY_PATH/libLLVM-15.so.1"
export LLVM_MC="$llvm15/lib/llvm-15/bin/llvm-mc"
export LLVM_OBJCOPY="$llvm15/lib/llvm-15/bin/llvm-objcopy"
build-a-turno python3 -B tests/rdna2_tools_check.py
build-a-turno python3 -B tests/pixel_aot_check.py binary "$LLVM_MC" "$LLVM_OBJCOPY" "$LLVM_LIB"
build-a-turno python3 -B tests/compute_store_check.py binary "$LLVM_MC" "$LLVM_OBJCOPY" "$LLVM_LIB"
python3 -B tests/pso_readiness_check.py
env -u LLVM_LIB python3 -B tests/rdna2_tools_check.py

rdna2_tools_check.py passed all 99 tests with LLVM 15. Both binary checks and pso_readiness_check.py exited 0. With LLVM disabled, 90 tests passed and the nine LLVM-only tests were skipped. git diff --check passed.

Evidence and follow-up

The six register-only instructions are original synthetic fixtures contributed under the repository's MIT license. The round-trip check compares the Python output with LLVM's disassembly of the same bytes and checks that reassembly reproduces those bytes. This is decoder coverage.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for the checks.
  • I verified the new fixture against the base decoder as a negative control.
  • The existing testing entry points and build requirements cover this change.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6571623342 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1070). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T00:15:29Z. --- ## Change Refs #938. Add six gfx1013 e32 mnemonics to the Python disassembler opcode tables. VOP1 gains `v_movreld_b32`, `v_movrels_b32`, `v_movrelsd_b32` and `v_movrelsd_2_b32`. VOP2 gains `v_fmac_f16` and `v_ldexp_f16`. The production diff is confined to `VOP1_OPS` and `VOP2_OPS` in the shared decoder. ## Verification Linux x86-64 (Debian 13), commit `389fe728`, negative control on `d33845b9` with the new golden test. - `python3 -B tests/rdna2_tools_check.py -k test_vop1_vop2_e32_gfx1013` against the base decoder reported six failing subtests, one per fallback mnemonic. - `LLVM_LIB=libLLVM.so.19.1 LLVM_MC=llvm-mc-19 LLVM_OBJCOPY=llvm-objcopy-19 python3 -B tests/rdna2_tools_check.py -k test_vop1_vop2_e32` passed both tests with LLVM 19.1.7. All six instructions round-tripped byte for byte (24 bytes). - `llvm-mc-19 -triple=amdgcn-amd-amdhsa -mcpu=gfx1013 -show-encoding` on the six assembly lines printed the same six words. LLVM 15.0.6 was extracted locally under `out/`. The `build-a-turno` wrapper was used for the three LLVM 15 checks. ```sh llvm15="$PWD/out/vop12-llvm15/usr" export LD_LIBRARY_PATH="$llvm15/lib/x86_64-linux-gnu" export LLVM_LIB="$LD_LIBRARY_PATH/libLLVM-15.so.1" export LLVM_MC="$llvm15/lib/llvm-15/bin/llvm-mc" export LLVM_OBJCOPY="$llvm15/lib/llvm-15/bin/llvm-objcopy" build-a-turno python3 -B tests/rdna2_tools_check.py build-a-turno python3 -B tests/pixel_aot_check.py binary "$LLVM_MC" "$LLVM_OBJCOPY" "$LLVM_LIB" build-a-turno python3 -B tests/compute_store_check.py binary "$LLVM_MC" "$LLVM_OBJCOPY" "$LLVM_LIB" python3 -B tests/pso_readiness_check.py env -u LLVM_LIB python3 -B tests/rdna2_tools_check.py ``` `rdna2_tools_check.py` passed all 99 tests with LLVM 15. Both binary checks and `pso_readiness_check.py` exited 0. With LLVM disabled, 90 tests passed and the nine LLVM-only tests were skipped. `git diff --check` passed. ## Evidence and follow-up The six register-only instructions are original synthetic fixtures contributed under the repository's MIT license. The round-trip check compares the Python output with LLVM's disassembly of the same bytes and checks that reassembly reproduces those bytes. This is decoder coverage. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for the checks. - [x] I verified the new fixture against the base decoder as a negative control. - [x] The existing testing entry points and build requirements cover this change. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:46:08 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:49:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:15:41Z.


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-24T00:18:59.424912Z 389fe72 PR opened
ℹ️ 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:7117879194 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1070#issuecomment-7117879194). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T00:15:41Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"389fe728f16b973603d03aa4f6bc93953f94dc71","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-24T00:18:59.424912Z">2026-11-24T00:18:59.424912Z</relative-time> | `389fe72` | PR opened | <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!1063
No description provided.