disasm_rdna2: decode v_madmk_f32 and v_madak_f32 with their literal #609

Merged
JB2WIN merged 1 commit from upstream-pr/615 into main 2026-11-22 16:34:08 +00:00
JB2WIN commented 2026-11-22 15:59:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-22T15:59:02Z.


Change

tools/disasm_rdna2.py did not know VOP2 opcodes 0x20 (v_madmk_f32) and 0x21 (v_madak_f32). It printed v_vop2_20/21, and because it did not consume their mandatory 32-bit literal, the next word was decoded as a separate instruction. That meant the scanner could not recognise the forms that #595 made pixel_aot lower. The two opcodes now join the literal set with v_fmamk_f32/v_fmaak_f32 (0x2c/0x2d), using the same operand order: K second for madmk, last for madak.

Follow-up to #595 (noted there). AI-assisted (Claude Code).

Verification

  • The opcodes come from LLVM 15.0.7 llvm-mc -mcpu=gfx1013 -show-encoding. The disassembler tests add the two encodings as golden vectors:
    • v_madmk_f32 v5, v1, 0x11213141, v3 encodes as [0x01,0x07,0x0a,0x40,0x41,0x31,0x21,0x11]
    • v_madak_f32 v5, v1, v2, 0x11213141 encodes as [0x01,0x05,0x0a,0x42,0x41,0x31,0x21,0x11]
  • python -B tests/rdna2_tools_check.py: OK (skipped=1). Without the change to tools/disasm_rdna2.py the new vectors fail: AssertionError: 2 != 1 : Failed for 01070a4041312111, because the literal decoded as a second instruction.
  • python -B tests/pixel_aot_check.py (controls): passed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6544510036 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/615). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-22T15:59:02Z. --- ## Change `tools/disasm_rdna2.py` did not know VOP2 opcodes 0x20 (`v_madmk_f32`) and 0x21 (`v_madak_f32`). It printed `v_vop2_20/21`, and because it did not consume their mandatory 32-bit literal, the next word was decoded as a separate instruction. That meant the scanner could not recognise the forms that #595 made `pixel_aot` lower. The two opcodes now join the literal set with `v_fmamk_f32`/`v_fmaak_f32` (0x2c/0x2d), using the same operand order: K second for madmk, last for madak. Follow-up to #595 (noted there). AI-assisted (Claude Code). ## Verification - The opcodes come from LLVM 15.0.7 `llvm-mc -mcpu=gfx1013 -show-encoding`. The disassembler tests add the two encodings as golden vectors: - `v_madmk_f32 v5, v1, 0x11213141, v3` encodes as `[0x01,0x07,0x0a,0x40,0x41,0x31,0x21,0x11]` - `v_madak_f32 v5, v1, v2, 0x11213141` encodes as `[0x01,0x05,0x0a,0x42,0x41,0x31,0x21,0x11]` - `python -B tests/rdna2_tools_check.py`: OK (skipped=1). Without the change to `tools/disasm_rdna2.py` the new vectors fail: `AssertionError: 2 != 1 : Failed for 01070a4041312111`, because the literal decoded as a second instruction. - `python -B tests/pixel_aot_check.py` (controls): passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:43:57 +00:00
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!609
No description provided.