Repository navigation
rdna2_decode: decode the 31 GFX10 DS *_src2_* ops, and give ds_condxchg32_rtn_b64 one offset - #7337
hmodymac8-droid wants to merge 4 commits into
Conversation
…hg32_rtn_b64 one offset
All 31 GFX10 DS src2 opcodes (0x80-0x95, 0xc0-0xd3: ds_add_src2_u32 ...
ds_max_src2_f64) were missing from rdna2_isa_tables.DS, which is derived
from AMD's RDNA2 XML, so rdna2_decode reported each one as two invalid
words. llvm-mc 23.1.6 decodes them (`ds_add_src2_u32 v1 offset:16`). They
are added under llvm-mc's names, with the one address operand they take.
The two-offset test was `"2_" in name`, which also matches
ds_condxchg32_rtn_b64 ("32_") and every *_src2_* name, so those printed
`offset0:16` where llvm-mc prints `offset:16`. It now matches only the
ds_read2*/ds_write2*/ds_wrxchg2* (and st64) forms.
Checked every DS opcode with four operand/offset/gds patterns on gfx1013 and
gfx1030: all 319 words llvm-mc decodes match it, the 31 src2 ops included.
Found by decoding random DS words with both and comparing.
tests/test_rdna2_decode.py: test_ds_src2_ops_and_one_offset_forms (fails on
main; ds_read2_b32 keeps offset0/offset1); the file: OK.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows check on
I also traced the offset classification change: only Note: |
…s, apart from the other open rdna2_decode PRs Each of the open rdna2_decode PRs added its test at the same spot, so they conflicted with each other. No change to the test itself. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It sat right above _HWREG_NAMES, which ItsNotRexed#7300 rewrites, so the two PRs conflicted. No behaviour change. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested f4a949e on Windows 11 (NTFS), Python 3.12.10 (CPU only, no GPU, no game files): fail, the 31 src2 ops now also decode on gfx103x, where llvm-mc 23.1.6 rejects them The earlier comment ran the tests and traced the offset rule. This adds a check against the LLVM source, a gfx1030 run, and an all-opcode sweep. What I ran:
The problem. The 31 entries go into the shared
The description says "on gfx1013 and gfx1030: all 319 words llvm-mc decodes now match it". That check counts only the words that llvm-mc decodes, so it cannot see these 31 extra words on gfx1030. Repro: Suggested fix: do what #7421 does for its gfx101x-only SMEM ops ( Nit, not blocking: the module docstrings of Overlap: AI-assisted (Claude Code). |
…codes Review on ItsNotRexed#7337 (AsgerCode): the 31 *_src2_* entries sat in the shared DS table, so gfx1030 decoded them too, where llvm-mc 23.1.6 refuses them (and LLVM's gfx1030_err.s lists them as unsupported). They move to DS_GFX101, which the decoder reads only when mcpu is gfx101x, as ItsNotRexed#7421 does for its SMEM ops; the test checks gfx1030 and gfx1036 refuse ds_add_src2_u32. The condxchg32 and read2 test words had a nonzero unused DATA1 field, which llvm-mc refuses; they now use the words llvm-mc decodes to the expected text, so every row of the test is llvm-mc's output. Every DS word this PR changes against main, over all 256 opcodes, four operand/offset patterns and gfx1013/gfx1030/gfx1036: either it now matches llvm-mc, or llvm-mc refuses that word for a nonzero unused field, which main ignores as well. The tables' docstring names DS_GFX101. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @gut0to and @AsgerCode. You're right about gfx103x, and my check counted only the words llvm-mc decodes, so it could not see it. Pushed 085ee3f:
|
What changed and why
31 missing DS opcodes. All 31 GFX10 DS
*_src2_*opcodes (0x80-0x95,0xc0-0xd3:ds_add_src2_u32...ds_max_src2_f64) were missing fromrdna2_isa_tables.DS, which is derived from AMD's RDNA2 XML. Sordna2_decodereported each one as two invalid words, while llvm-mc 23.1.6 decodes them (ds_add_src2_u32 v1 offset:16). They are added under llvm-mc's names, with the one address operand they take.One offset, not two. The two-offset check was
"2_" in name, which also matchesds_condxchg32_rtn_b64(32_) and every*_src2_*name. Those printedoffset0:16where llvm-mc printsoffset:16. The check now matches only theds_read2*/ds_write2*/ds_wrxchg2*forms (and theirst64variants).0xda000010 0x00000001ds_add_src2_u32 v1 offset:160xdb180010 0x00000001ds_max_src2_i64 v1 offset:160xd9f80010 0x40030201ds_condxchg32_rtn_b64 v[64:65], v1, v[2:3] offset:16... offset0:16Found by decoding random DS words with both
rdna2_decodeand llvm-mc and comparing.Claim: #7231 (new item).
Test
python -I -m unittest tests.test_rdna2_decode: OK. The newtest_ds_src2_ops_and_one_offset_formsfails on main, andds_read2_b32keepsoffset0/offset1.LLVM_MCset, the only failure is thev_permlane16_b32op_sel parity that rdna2_decode: v_permlane16/x16_b32 op_sel is two bits, not four #6036 fixes, and it fails on main too.tests/test_shader_disasm.py: OK.GPU and driver
No GPU needed.
AI-assisted (Claude Code).
🤖 Generated with Claude Code