tooling: decode VOP2 carry ops and GFX10 MIMG image_atomic_* in disasm_rdna2 #970
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/977"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Batushn on 2026-11-23T19:25:47Z.
Summary
Implements the VOP2 carry and MIMG
image_atomic_*part of step 3 in #938 (leaving SDWA VOPC separate so each change stays small and easy to review):tools/disasm_rdna2.py:0x28(v_add_co_ci_u32_e32),0x29(v_sub_co_ci_u32_e32), and0x2a(v_subrev_co_ci_u32_e32) toVOP2_OPSand formatted them with LLVM 15's wave32 implicit carry operands (v{vdst}, vcc_lo, {src0}, v{vsrc1}, vcc_lo), matchingv_cndmask_b32_e32. Previously these fell through tov_vop2_28/29/2aand were falsely reported as unsupported even thoughpixel_aotalready accepts them.image_atomic_*opcodes (0x0f..0x12,0x14..0x1f:swap,cmpswap,add,sub,smin,umin,smax,umax,and,or,xor,inc,dec,fcmpswap,fmin,fmax) toMIMG_OPS, matching LLVM 15.0.7MIMGInstructions.td.tests/rdna2_tools_check.py:test_vop2_carry_and_mimg_atomic_encodings: 22 golden LLVM 15.0.7 encodings (gfx10_asm_vop2.s&gfx10_asm_mimg.s) covering all 3 VOP2 carry ops (VGPR, inline constants, 32-bit literal) and all 16 GFX10image_atomic_*opcodes (includingcmpswap/fcmpswap2-dwordvdataand NSA address tuples), plusvop2_truncatedandmimg_truncatedcontrols.test_vop2_carry_and_mimg_atomic_llvm_round_trip: assembles all 3 VOP2 carry ops and all 16image_atomic_*ops withllvm-mc, checks exact equality withllvm_disassembleanddisasm_rdna2, and re-assemblesdisasm_rdna2's output back to identical bytes (runs in Ubuntu LLVM 15 CI).test_binary_scan_recognizes_vop2_carry_and_image_atomics: proves binary scanning now marks decoded VOP2 carry ops as both recognized and supported (4/4supported,0unsupported) while keepingimage_atomic_umaxrecognized (opcodes_recognized=True) yet unlowered (opcode_recognized_translator_rejected), with negative controls on the oldv_vop2_28/29/2anames.Refs #938
Verification
python -B tests/rdna2_tools_check.pyon Windows 11 (Python 3.12.10, synthetic inputs, no game files):Ran 83 tests ... OK (skipped=3)(the 3 skipped tests requirellvm-mc/llvm-objcopyand will run in Ubuntu CI).AI-assisted: yes