shader: align scalar and VOP1 opcode tables with GFX10/RDNA 2 in disasm_rdna2 #260
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/263"
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 LooperSalty on 2026-11-21T19:41:20Z.
Change
tools/disasm_rdna2.pyused pre-GFX10 opcode numbers in five tables, so common GFX10 instructions decoded as unknown or as the wrong instruction. For example,0xbe820300(s_mov_b32 s2, s0) printeds_sop1_03, and0x7e025502(v_rcp_f32_e32 v1, v2) printedv_vop1_2a.s_waitcnt_vscnt/vmcnt/expcnt/lgkmcntmove from SOPP to SOPK (opcodes 0x17-0x1A), where GFX10 encodes them.tests/rdna2_tools_check.py, so whichever lands second needs a trivial rebase.Each opcode number comes from the encodings in LLVM's public gfx10 MC tests (
llvm/test/MC/AMDGPU/gfx10_asm_*.s).Verification
python -B -m unittest tests.rdna2_tools_checkon Windows 11 26300, Python 3.12:Ran 19 tests … OK (skipped=1). The skip istest_llvm_comparison, which needsLLVM_LIB.s_mov_b32(000382be) ands_mov_b64(000482be). The old bytes000082beencoded SOP1 opcode 0, which GFX10 does not assign tos_mov_b32.s_min_i32;s_mul_i32;s_cmpk_eq_i32;s_waitcnt_vscnt;s_inst_prefetch;v_rcp_f32_e32;v_cvt_f32_u32_e32.000382be, so its# s_mov_b32comment matches the bytes. That test only compares extracted bytes.Evidence and follow-up
The table numbers were cross-checked against an independent decoder built from LLVM's gfx10 and gfx1030 MC tests (29,527 encodings, no length mismatch):
PrototypeScarlett/emu/rdna2_ops.pyin LooperSalty/AnyXboxX.Checklist
000082bevector no longer decodes ass_mov_b32.AI-assisted (Claude Code). I reviewed the change and ran the checks above.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T19:59:16Z.
The remaining conflict at
f84407ais intests/rdna2_tools_check.py. Please retain #264's null/ttmp scalar-operand vectors alongside the corrected GFX10 opcode vectors and rerun the golden-vector suite.Imported from R0Y00/Xbox2Windows. Originally posted by LooperSalty on 2026-11-21T20:07:41Z.
Rebased on current
main(now at3996e1e). The conflict intests/rdna2_tools_check.pyis resolved by keeping both blocks: the #264 null/ttmp scalar-operand vectors, followed by the corrected GFX10 opcode vectors.python -B -m unittest tests.rdna2_tools_check→Ran 21 tests … OK (skipped=1). The skip istest_llvm_comparison, which needsLLVM_LIB.Imported from R0Y00/Xbox2Windows. Originally posted by LooperSalty on 2026-11-21T20:11:39Z.
The only failing check is
dxr_facing_warpin Build and test on Windows (run 44944584887):dxr_facing rays=96 hits=72 front_hits=36 culled=24 mismatches=8,debug_errors=0. This PR only changestools/disasm_rdna2.pyandtests/rdna2_tools_check.py, which that C++ WARP test does not use, and the other 100 ctest tests pass. Other recent runs failed in the same way on a different WARP test (gpu_alias_warp, run 44943010678), so it looks intermittent. I can't re-run jobs on this repository: could you re-run the failed job?