Repository navigation
Conversation
The immediates of s_waitcnt, s_waitcnt_depctr, s_getreg_b32 / s_setreg_* and s_sendmsg / s_sendmsghalt were printed as one hexadecimal number, which the reader had to take apart by hand. Now, as LLVM writes them: vmcnt() / expcnt() / lgkmcnt(), the depctr_*() counters of RDNA2 (with depctr_hold_cnt, which RDNA1 has not), hwreg(register, first bit, bits) with the registers' names, and sendmsg(message, operation, stream) with the names where the message has that operation. The 48 such lines of LLVM's gfx10 tests in tests/data/llvm-amdgpu now read the same (8 did: the immediates LLVM leaves as numbers too). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#1014 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 the immediates ofs_waitcnt,s_waitcnt_depctr,s_getreg_b32/s_setreg_b32/s_setreg_imm32_b32ands_sendmsg/s_sendmsghaltas one hexadecimal number (s_waitcnt 0xf7f,s_setreg_b32 0xf851, m0,s_sendmsg 0x122), which the reader has to take apart by hand. Now as LLVM writes them:s_waitcnt vmcnt(15) lgkmcnt(15),s_setreg_b32 hwreg(HW_REG_TBA_HI, 1, 32), m0,s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1). One more of the text gaps of xcl-dev#664, in operands that issue and xcl-dev#687 / xcl-dev#706 / xcl-dev#716 / xcl-dev#790 / xcl-dev#791 / xcl-dev#812 do not cover; no open PR found for it (gh pr list --search"disasm", "hwreg OR sendmsg OR waitcnt").Independent: 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
crates/xcl/src/gpu/rdna2.rs:waitcnt_text(a counter at its maximum is left out, unless all are),depctr_text(RDNA2's counters, withdepctr_hold_cnt; the number when bit 5 or 6 is set, as LLVM),hwreg_text(hwreg(register)for a whole register, elsehwreg(register, first bit, bits); LLVM's names for gfx10.3),sendmsg_text(names where the message has that operation, a stream only with a GS cut / emit, else the three numbers), called fromoperand_textbefore its match on the operand type.llvm_gfx10_waitcnt_hwreg_sendmsg_textcompares the whole line with LLVM's for the 48 such lines oftests/data/llvm-amdgpu;waitcnt_hwreg_and_sendmsg_operandshas 25 words checked againstllvm-mc21.1.8 (-mcpu=gfx1030): the corpus has twohwregforms and onesendmsg.sendmsgimmediate with bits above bit 9 stays a number (LLVM 21 ignores them). Branch targets stay addresses.Tested
cargo test -p xcl --lib gpu::rdna2::tests::: 11 passed, 0 failed. With the tests onmain'srdna2.rs(e50836b): 2 failed –llvm_gfx10_waitcnt_hwreg_sendmsg_text"40 of … lines differ from LLVM's" (48 lines),waitcnt_hwreg_and_sendmsg_operands.cargo test --workspace --no-fail-fast -- --test-threads=4on 7cd41d9: three runs. Run 3: 706 passed, 0 failed, 41 ignored (xcl lib: 665 passed, 0 failed, 21 ignored). Runs 1 and 2: 703 passed, 3 failed, 41 ignored – the failure of Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 (placed_title_textures_share_vram_and_preserve_pixels, "cubemap extra_pages must be reused at same va", and 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
main:
PR:
Not run: I have no game files. 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).Not tested
XCL_SAMPLE_*data: the game-data tests passed without running.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_statereturn early.s_waitcnt_depctrlines ofgfx10_sopp.txtare not compared: they are RDNA1's reading (nodepctr_hold_cnt); the 19 ofgfx1030_new.txtare.llvm-mc21.1.8, not from hardware.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#1014 (auto-synced, do not edit).