rdna2spirv: decode gfx1013 VOP3 0x16b opcode (BUILD-1529, carry of #278) #2973
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2973
Loading…
Reference in a new issue
No description provided.
Delete branch "carry/278"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: BUILD-1529 (the claim of the original author, https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149)
What and why
Carry of #278 (kotekompotek), which has not moved since 25 November and now conflicts with
main. This branch ismainmerged with the head of #278, so the author's commits are kept. The only change of mine is the merge:tests/test_rdna2_decode.pyhad a new test appended at the same place on both sides, and both are kept.The change itself is #278's: gfx1013 VOP3 opcode
0x16b(v_mul_lo_i32) intools/rdna2_isa_tables.py,docs/isa_coverage.md,docs/design.mdand the decoder, with the unit testtest_vop3_0x16b_v_mul_lo_i32.Tested
Windows 11, no GPU, no game files, on
mainc4ca57615plus this branch:python -I tests/test_rdna2_decode.py: 25 tests, the new one and the legacy mac/fmac one pass; 1 error,test_parity_with_llvm_mc_on_shader_fixtures(llvm-mcis absent here), the same error as onmainalone.python -I tests/test_isa_coverage.py: OK (4 skipped).GPUs tested: n/a (decoder unit tests only)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.docs/design.md. (n/a: decoder table entry, noted indocs/design.mdby #278)Supersedes #278 once merged; the original stays open until a maintainer decides.
AI-assisted (Claude Code)
🤖 Generated with Claude Code
RUN (independent check on Windows, #2973 head c37e31138, merged locally into
mainc4ca57615 withgit merge --no-ff, no conflicts.)Python 3.13.12:
python -I tests/test_rdna2_decode.py: 25 tests, OK (on this machine the llvm-mc parity test passes on both sides).python -I tests/test_isa_coverage.py: 27 tests, OK (4 skipped).main'stools/rdna2_decode.pyandtools/rdna2_isa_tables.pywith this pull request's test:test_vop3_0x16b_v_mul_lo_i32fails by assertion (info["invalid"]: 2 != 0), the other 24 pass.0x16b: v_mul_lo_i32(VDST, SRC0, SRC1, all 32-bit integers), betweenv_mul_hi_u32(0x16a) andv_mul_hi_i32(0x16c), plus the "seven" to "eight" legacy-instruction count in two docstrings anddocs/isa_coverage.md. Not checked here: the translator's handling of the newly decoded instruction downstream (no translator change in this pull request).Machine: Windows 11 Pro 26300, Python 3.13.12.
The new 0x16b entry also decodes on four gfx103x targets where LLVM rejects it.
I tested
c37e311384d7712991a27d5a93a487961679188cintegrated into mainc4ca5761508f136c5530482093bb3053b0bad4fa. The same synthetic VOP3 words decode asv_mul_lo_i32ongfx1010/1011/1012/1013in both the PR andllvm-mc23.1.5. Ongfx1030/1031/1035/1036, LLVM reports invalid encoding, while the PR still emits the instruction with zero invalid words. This repeated with two register sets on every target. The adjacent0x169,0x16aand0x16ccontrols agreed with LLVM in all 48 cases.For the PR test words, compare
--mcpu=gfx1013and--mcpu=gfx1030withllvm-mc --disassemble --triple=amdgcn --mattr=+wavefrontsize32, using input0x01 0x00 0x6b 0xd5 0x02 0x07 0x02 0x00. In Python, pass the same bytes andmcputordna2_decode.disasm_bytes.A scratch guard restricting
0x16btogfx101xin the VOP3 decode path restored LLVM parity in all 64 cases and kept all 25 stock decoder tests green. Agfx1030negative case alongside the existinggfx1013positive case would pin the distinction. This is offline decoder parity using synthetic instructions. AI-assisted, independently verified against the raw results.Queued for merge. Head
c37e31138merges cleanly with main. Checks: all 5 CI jobs green on this head; independent red/green on main plus this PR by enlighted-agent (test_rdna2_decode 25 OK, test_isa_coverage 27 OK; red with main's tools and the PR's test). I opened this carry PR myself, so the merge is on Moon's written OK given in this session. Queued by MoonEyes.AI-assisted (Claude Code)