Repository navigation
feat(shader): accept every SDWA selector on v_mov_b32 - #751
oneandonlydean merged 1 commit into
Conversation
6123ea3 to
d82709a
Compare
|
The Linux CI re-run now gets through ctest and fails in this PR's own test (run 37383475649, attempt 2, llvmpipe with 8-wide subgroups): What the log narrows down:
Here, on NVIDIA, the test passes 20 times in a row and Windows CI is green. Because of that, this may be how a partial |
v_mov_b32_sdwa threw 'VOP1 SDWA destination selector ... is not supported' when a byte source (src0_sel BYTE_0..3) met a partial destination (dst_sel BYTE_0..3 or WORD_0/1): the VMovB32 rule allowed only WORD and DWORD sources there. Every src0_sel, src0_sext, dst_sel and dst_unused combination is now accepted. Translation already follows RDNA2 for all of them (applyBitSourceModifiers, writeRawU32): the selected field is zero- or sign-extended, and the result's low bits go to the dst_sel field with the other bits zeroed, sign-extended above and zeroed below, or preserved. Reserved selectors, dst_unused 3, and neg/abs on sub-dword sources still throw. agc_driver_sdwa_move_selectors runs all 294 combinations as wave32 and wave64 on the GPU, plus the in-place byte broadcast under a partial exec mask, which is not checked on subgroups narrower than 32 lanes, as in the other EXEC-masked execution tests. agc_vop1_sdwa_move_decode checks the decoded operands and the reserved encodings.
d82709a to
e5b7427
Compare
|
Thanks. As you suspected, it is on
One side note: in that run Windows CI reports this test as Skipped, like the other GPU tests, so llvmpipe is the only CI job that actually executes it. |
|
Thanks for tracking that down. The skip follows the existing DPP/swizzle precedent ( The literal-EXEC behaviour you found on narrow subgroups is a |
|
Thanks. The TechnicalDebt line is up as #800 (documentation only). |
On a host subgroup narrower than 32 lanes, threadBit reads an EXEC written with s_mov_b32 or s_mov_b64 at bit LaneId & 31 of EXEC_LO, and LaneId is the subgroup invocation id. Every lane at or above the host subgroup size therefore reads the bit of a lower lane, in wave32 and wave64 alike. An EXEC produced by a compare stays consistent because its ballot is subgroup-local as well. Found while investigating the llvmpipe failure of boykopovar#751.
What
v_mov_b32_sdwathrewVOP1 SDWA destination selector 1 (unused 2, source selector 0) ... is not supportedwhen a byte source (src0_selBYTE_0..3) met a partial destination (dst_selBYTE_0..3, WORD_0/1): the VMovB32 rule allowed only WORD and DWORD sources there.src0_sel,sext,dst_selanddst_unusedcombination is now accepted. Translation already implements them (applyBitSourceModifiers,writeRawU32): the selected field is zero- or sign-extended, and the result's low bits go to thedst_selfield with the other bits zeroed (UNUSED_PAD), sign-extended above and zeroed below (UNUSED_SEXT) or kept (UNUSED_PRESERVE).dst_unused3, and neg/abs on sub-dword sources.v_mov_b32_sdwa v3, v3 dst_sel:BYTE_1/2/3 dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0(0x7e0602f9 + 0x00001103/0x00001203/0x00001303 at 0x4b64/0x4b6c/0x4b7c). These three are the only byte-source partial-destination moves among the game's 5,859 shaders that usev_mov_b32_sdwa.RdnaVectorOpDecoder.cpp; they merge cleanly with this branch.Tested
main9cafa33: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)agc_driver_sdwa_move_selectorsruns all 294 combinations as wave32, wave64 and wave64 on 32-lane subgroups, plus the game's three in-place words under a partial exec mask, on the GPU (RTX 3080 Laptop and Intel UHD); expected values come from an ISA model. Newagc_vop1_sdwa_move_decodechecks the decoded operands for all 294 and that the reserved encodings throw. Onmainthe GPU test fails at its first byte-source move with the message above, and the decode test reports the 144 byte-source partial-destination combinations.agc_driver_image_sample_derivatives: therethreadBitreads an EXEC written withs_mov_b32from EXEC_LO at the subgroup invocation id, onmaintoo.mainit fails at decode; with this change it decodes and translates (3,340 instructions) and stops at an unrelated gap, a loop-indexed image descriptor (s_load_dwordx8at 0x131c). 352 other game shaders that usev_mov_b32_sdwagive identical results with and without this change.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)