disasm_rdna2: decode 64-bit FLAT, GLOBAL and SCRATCH memory instructions #574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/580"
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 Neoplayer on 2026-11-22T13:59:38Z.
Change
Add decoding for 64-bit RDNA 2 (
gfx1013) FLAT, GLOBAL, and SCRATCH memory instructions ((w0 & 0xfc000000) == 0xdc000000, 130 forms total) intools/disasm_rdna2.py, and synchronizetools/scan_unsupported_shaders.py:tools/disasm_rdna2.py:FLAT_BASE_OPSplus segment tablesFLAT_OPS(54 ops),GLOBAL_OPS(54 ops), andSCRATCH_OPS(22 load/store ops) covering loads, stores, d16 byte/short ops, and 32-bit/_x2atomics._format_vgpr_range()and_decode_flat_family()handling segment dispatch (segin0..2, plus 8-byte aligned fallbacks for reservedseg=3and unsupported segment/opcode combinations such as scratch atomics), GFX10saddr == 0x7d(off) vs 64-bitsaddr(s[n:n+1],vcc,ttmp[0:1]) onglobal_*and 32-bitsaddr(s[n],m0,vcc_lo) onscratch_*, 12-bit unsignedflatoffsets vs 12-bit signedglobal/scratchoffsets, atomicvdstemission only whenglc == 1,ldsomittingvdstonglobal/scratchloads,glc/slc/dlc, andflat_truncatedon short buffers.tools/scan_unsupported_shaders.py:flat_*,global_*, andscratch_*mnemonics inKNOWN_RDNA2_BASE_OPCODESand includescratch_inVMEM (Vector Memory / Buffer)inclassify_isa_category().tests/rdna2_tools_check.py:gfx1013golden vectors (test_golden_vectors), synthetic sweeps over all 130 forms (test_flat_global_scratch_opcode_tables_synthetic_forms), addressing/modifier distinction checks (test_flat_global_scratch_distinguishes_modifiers_and_addressing), truncation and reserved-segment alignment checks, and exact-assembly LLVM 15 comparison (test_llvm_comparison).Verification
Commit under test:
7b13d9eon macOS arm64 (verified against official upstreamllvm/llvm-projectllvmorg-15.0.7FLATInstructions.tddefinitions and local Homebrew LLVM 15.0.7-mcpu=gfx1013):LLVM_LIB=libLLVM-15.dylib LLVM_MC=llvm-mc LLVM_OBJCOPY=llvm-objcopy python3 -B tests/rdna2_tools_check.py:Ran 44 tests in 0.393s - OK(0 skips).pixel_aot.disassemble(..., libLLVM-15.dylib)across all 54 FLAT ops (bothglc=0&glc=1for atomics), all 54 GLOBAL ops (saddr=off&s[2:3],glc=0&glc=1), all 22 SCRATCH ops (saddr=off&s2), high/negative offsets,lds,vcc/ttmp[0:1]/m0:Checked 312 FLAT/GLOBAL/SCRATCH encodings against LLVM 15: mismatches=0..github/workflows/windows.ymlpassed (tests/rdna2_tools_check.py,tests/form_coverage_check.py,tests/shader_probe_check.py,tests/pso_readiness_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py, etc.).python3 -B tests/pixel_aot_check.py binaryandpython3 -B tests/ffx_dispatch_aot_check.py(LLVM 15): exit 0.git diff --check: exit 0.MSVC, D3D12, and WARP builds (
cmake --preset dev) were not run on this macOS host and remain covered by Windows CI.Evidence and follow-up
All fixtures are source-built synthetic sequences assembled and checked against LLVM 15.0.7
-mcpu=gfx1013. Remaining unimplemented 64-bit encodings intools/disasm_rdna2.pyincludeDS(0xd8000000) andSDWA/DPP.Checklist
AI-assisted.