Repository navigation
Conversation
An LDS / GDS instruction has two offset bytes. Only the instructions with two addresses (ds_read2*, ds_write2*, ds_wrxchg2*) read them as two; for all the others they are one 16-bit offset, and the listing split it: `ds_add_u32 v1, v2 offset0:52 offset1:18` for offset:4660. Printed as LLVM does now. All 1705 such lines of LLVM's gfx10 DS tests in tests/data/llvm-amdgpu read the same (662 did: those without an offset or with two). The pattern of ds_swizzle_b32 stays a number (LLVM: swizzle(...)). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A buffer (MUBUF / MTBUF) instruction was printed with two address registers whatever IDXEN and OFFEN said, so a load at a constant offset read `buffer_load_dword v5, v[0:1], …` though it reads no VGPR; a tbuffer instruction's format was not printed; TFE and LDS were not either, and the flags came in another order than LLVM's. Now: `off`, the index or offset register, or both; `format:[BUF_FMT_…]` (a number past the table; nothing for 8_UNORM, as LLVM); idxen, offen, offset, glc, slc, dlc, lds, tfe; and TFE's extra data register. All 822 lines of LLVM's gfx10 MUBUF / MTBUF tests in tests/data/llvm-amdgpu now read the same (2 did). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A flat, global or scratch instruction was printed with every operand its opcode can have, whatever its addressing mode: the result register of an atomic that returns none (`flat_atomic_add v0, v[1:2], v2` for `flat_atomic_add v[1:2], v2`), `null` or `exec_hi` for the base an address has not, two address registers where a global address beside an SGPR base is one, and a negative offset as a large positive one. Now the operands of the form: no result without GLC (or with LDS), `off` for the missing base, the VGPR or SGPR a scratch address uses, a signed 12-bit offset (global, scratch), and glc / slc / dlc / lds. All 368 flat / global / scratch lines of LLVM's gfx10 tests in tests/data/llvm-amdgpu now read the same (35 did). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#1013 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xcl disasmprints three families of memory instructions differently from what they encode. Each commit compares the printed line with LLVM's for every line of the in-repo LLVM corpus of that family (tests/data/llvm-amdgpu). They're one PR because all three change the samematcharm offormat; they're separate commits, so each can be reviewed or dropped on its own. One more set of the text gaps of xcl-dev#664. No open PR found for any of them (gh pr list --search "disasm"), and this merges cleanly with xcl-dev#687, xcl-dev#706, xcl-dev#716, xcl-dev#790 / xcl-dev#791, xcl-dev#811 and xcl-dev#812.What is in it (all in
crates/xcl/src/gpu/rdna2.rs, text only)b0ec796DS: single-address LDS / GDS instructions print one 16-bitoffset:(they were split intooffset0:52 offset1:18foroffset:4660);ds_read2*/ds_write2*/ds_wrxchg2*keepoffset0:/offset1:. Testllvm_gfx10_ds_text: 1705 lines ofgfx10_ds.txt.cdc4546MUBUF / MTBUF: the address isoff, one register or a pair according to IDXEN / OFFEN (it was always two, so a constant-offset load showed a VGPR it doesn't read);format:[BUF_FMT_…]fortbuffer_*; flags in LLVM's order includingldsandtfe; TFE's extra data register. Testsllvm_gfx10_buffer_text(822 lines ofgfx10_mubuf.txt/gfx10_mtbuf.txt) andbuffer_address_format_and_flags(5 words checked againstllvm-mc21.1.8,-mcpu=gfx1030).6d247e5FLAT / GLOBAL / SCRATCH: only the operands the form has: no result register for an atomic that returns none,offfor a missing base (it printednull/exec_hi), one address register beside an SGPR base, a signed 12-bit offset, thenglc slc dlc lds. Testllvm_gfx10_flat_text: 368 lines ofgfx10_flat.txt/gfx1030_new.txt.Tested
cargo test -p xcl --lib gpu::rdna2::tests::: 13 passed, 0 failed. Before each commit its new tests fail: DS "1043 of 1705 lines differ from LLVM's", buffer "820 of 822", flat "333 of 368".cargo test --workspace --no-fail-fast -- --test-threads=4on6d247e5(all three): 708 passed, 0 failed, 41 ignored (xcl lib: 667 passed, 0 failed, 21 ignored). An earlier run had the Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 cubemap flake (705 passed, 3 failed:placed_title_textures_share_vram_and_preserve_pixelsand the two tests its poisoned lock takes with it), whichmainshows on this machine too.no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
We have no retail title. This changes
crates/xcl/src/gpu/rdna2.rs, so it needs one; could someone with a title runscripts/smoke.ps1onmainand on this head? The change is in the printed text of instructions only (listings, reports and the// pc: …comment lines of the translated HLSL; no HLSL code line changes).main:
PR:
Not tested
XCL_SAMPLE_*data: the game-data tests passed without running.ds_swizzle_b32lines with a pattern: the pattern stays a number (offset:57344) where LLVM writesoffset:swizzle(FFT,0).ldsandtfewere each checked alone againstllvm-mc; their order among other flags is LLVM's by analogy.llvm-mc.AI use
xcl disasmwith the LLVM test lines in the repository, wrote the code, the tests and this description, and ran the tests.🤖 Generated with Claude Code
Mirror of xcl-dev#1013 (auto-synced, do not edit).