shader: return old values from private LDS word updates #878
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/885"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T15:49:23Z.
Scope
Lower
ds_add_rtn_u32,ds_sub_rtn_u32,ds_and_rtn_b32,ds_or_rtn_b32andds_xor_rtn_b32using the private-word update model introduced in #878. Each instruction captures the original operands, returns the old LDS word in the destination VGPR, and updates the private word. The existing checks require zero offset, initialization, a verified private address, full EXEC, and an immediates_waitcnt lgkmcnt(0).Verification
Tested
daf87eeon Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used an AMD Radeon RX 7900 XTX (driver 32.0.32029.2010). WARP used the Microsoft Basic Render Driver (10.0.26100.9818).7 passed, 0 failed, 0 skipped. The five synthetic kernels each issue two returning updates. The first destination aliases the data VGPR and the second aliases the address VGPR. Both backends matched the CPU reference across the full UAV for one and three groups. Passing LDS dispatches reported zero debug errors and warnings. All five mutants returning the updated value differed at word 0. All five mutants preserving the return value but dropping the second update differed at word 2. For addition, the first mutant produced
40000011instead offffffff0, and the second produced40000011instead ofc0000014.Passed with LLVM 15.0.7 on WSL Ubuntu 24.04. The gfx1030 Wave32 binaries decoded to the expected DS forms and produced the same HLSL as source assembly through both the direct and CLI paths. The coverage records include all five new forms.