tooling: decode VOP3_INTERP f16 instructions in disasm_rdna2 as LLVM 15 does #972
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!972
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/972/head"
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?
@Batushn on GitHub · 2026-11-23 19:21 UTC · original
Batushn:disasm/vop3-interp-f16→main· +147 −0 · 2 files · 1 commits · closed without mergingSummary
Implements step 2 of #938: decode the GFX10
VOP3_INTERP16-bit interpolation instructions (v_interp_p1ll_f16,v_interp_p1lv_f16, andv_interp_p2_f16) intools/disasm_rdna2.pywith LLVM 15's exact operand syntax instead of falling through tov_vop3_342/v_vop3_343/v_vop3_35a.tools/disasm_rdna2.py:VOP3_INTERP16_OPS(0x342v_interp_p1ll_f16,0x343v_interp_p1lv_f16,0x35av_interp_p2_f16).VOP3Interp_gfx10fields matching LLVM 15.0.7 (VOPInstructions.td/VOP3Instructions.td):attr(w1[5:0]),attrchan(w1[7:6]),high(w1[8]),src0(w1[17:9],abs=w0[9],neg=w1[30]), optionalsrc2(w1[26:18],abs=w0[10],neg=w1[31]),clamp(w0[15]), andomod(w1[28:27]forf32-destinationp1ll/p1lvonly; omitted onp2_f16).tests/rdna2_tools_check.py:test_vop3_interp_f16_encodings: 26 golden GFX10 encodings verified against LLVM 15.0.7test/MC/AMDGPU/gfx10_asm_vop3.s, covering all 3 opcodes,attr/attrchan,-/|...|/-|...|,high,clamp,mul:2/mul:4/div:2, 8-byte stream alignment withs_endpgm, and 4-bytevop3_truncatedhandling.test_vop3_interp_f16_llvm_round_trip: assembles 11 single-field and combinedv_interp_*_f16cases withllvm-mc, checks exact equality againstllvm_disassemble, and re-assemblesdisasm_rdna2's output back to identical bytes (runs in Ubuntu LLVM 15 CI).test_binary_scan_recognizes_vop3_interp_f16: verifiesscan_unsupported_shaders.pynow recognizes the decoded opcodes (opcodes_recognized=True,unsupported_opcodes={}) while keeping them unlowered (translator_accepted=False,compatibility_category="opcode_recognized_translator_rejected"), with negative control on the oldv_vop3_342/343/35anames.Refs #938
Verification
python -B tests/rdna2_tools_check.pyon Windows 11 (Python 3.12.10, synthetic inputs, no game files):Ran 81 tests ... OK (skipped=3)(the 3 skipped tests requirellvm-mc/llvm-objcopyand will run in Ubuntu CI).AI-assisted: yes
@R0Y00 on GitHub · 2026-11-23 19:34 UTC · original
Thanks for the independent LLVM 15 comparison and the single-field controls. #970 has now landed the same three opcodes and scan classification. It also distinguishes encodings LLVM 15 refuses, such as an output modifier on P2 or an attribute modifier, so both implementations would compete for the same decode path. Closing this duplicate; any golden vector that exposes a difference against current main is welcome as a separate test or fix under #938. #977 continues as its own review for carry and image atomic names.
Pull request closed