Repository navigation
Conversation
Direct compute accepted DPP16 quad_perm and the two mirrors only. It now also lowers row_shl:N, row_shr:N and row_ror:N (N = 1..15) with full row and bank masks. The source lane stays inside the lane's 16-lane row, so a split guest wave64 needs no exchange. A shift whose source falls outside the row has an unusable source, as does an EXEC-inactive source without FI: BOUND_CTRL then supplies 0, otherwise the destination keeps its old value. Row operations need a thread count divisible by 16. row_share, row_xmask, the pre-GFX10 controls and partial masks stay refused. A new check runs 16 programs on hardware with sparse EXEC against a CPU reference, and checks four refusals. AI-assisted.
Lane i of a 16-lane row reads S0 from lane ({S2,S1} >> 4*(i & 15)) & 15
of its row (permlane16) or of the other row of its 32-lane half
(permlanex16). S1 and S2 are uniform: SGPRs, inline constants or one
32-bit literal (the decoder now refuses a literal in S0 or two
literals). op_sel[0] is FI and op_sel[1] is BOUND_CTRL, with the DPP
rule for an inactive source (assumed). Rows stay inside one physical
wave32, also on the wave64 path. Other op_sel bits, modifiers,
non-uniform or special selectors and thread counts that leave a
partial row or pair are refused.
A new check runs six programs on hardware against a CPU reference and
checks the refusals; wave64 is covered by a compile case.
AI-assisted.
R0Y00
left a comment
There was a problem hiding this comment.
Independent retest at 125f5313 stacked on #3010 (7325dd17). I rebuilt compile_dxil and native_store_replay and ran native_permlane_controls and native_permlane_hardware separately with ctest --preset <dev|release> --no-tests=error -V -R '^native_permlane_(controls|hardware)$'. Both passed in Debug and Release /O2 without skips. The hardware replay matched 128 result words plus all guards in each of six cases with the inbox D3D12 runtime (Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, replay debug layer off). No WARP test is registered.
The AMD RDNA 2 ISA guide, §12.12 confirms the selector packing, row pairing and FI/BOUND_CTRL bit positions. The desktop readback exercises the proposed inactive-source model. The exact preserve-versus-zero behavior still needs a native RDNA 2 result. All 47 measured requests are flagged wave64, while the current wave64 control only compiles. Please coordinate with #3006 on a split-wave64 bit-exact readback with different lower/upper EXEC masks, so selecting the wrong half fails at a known lane.
Fixes #3021 (it needs closing by hand, since the base is not the default branch). Part of #2935. Target branch
cpp-migration. Builds on #3010: the measured requests reach these ops only once DPP16 row operations are lowered. Please merge #3010 first.Change (
src/gfx1013_compute_native.cpp,src/gfx1013_direct_compute.inl): direct compute now lowersv_permlane16_b32andv_permlanex16_b32.iof a 16-lane row readsS0from lanesel = ({S2, S1} >> (4 * (i & 15))) & 15.permlane16reads from the same row.permlanex16reads from the other row of the same 32-lane half.op_sel[0]is FI andop_sel[1]is BOUND_CTRL.op_selbits, abs, neg, clamp and omod;permlane16) or 32 (permlanex16).Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, on #3010 (
7325dd17) plus this commit.native_permlane_hardwarepassed. Six wave32 programs ran in two 64-thread groups with sparse guest EXEC. All 2,064 output words matched a CPU reference, sentinels included. The programs are:x16with BOUND_CTRL and a literal-plus-SGPR selector;x16with FI and two SGPRs;x16with inline 0 selectors;permlane16with BOUND_CTRL and a literal-plus-SGPR selector;permlane16with two SGPRs;x16with an SGPR in S1 and a literal in S2.The selectors differ per row lane, and S1 differs from S2.
native_permlane_controlspassed. A wave32 request and a split-wave64 container compile. These are refused:op_selbit 2;x16with 16 threads, andpermlane16with 8;Wave64 is covered by that compile case only, not by a readback.
The 9
native_dpp*,native_lane*,native_wave*,native_readlane*andnative_permlane*tests pass.Mutation checks, run by hand; each fails the hardware check:
x16;Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests.AI-assisted.