compute: lower sub-dword LDS stores and loads #3330
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3330"
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 Leyukaka on 2026-11-28T10:04:04Z.
Part of #3224. Target branch
main.Lowers the sub-dword LDS stores and loads in the direct compute path (
src/gfx1013_compute_ir.cpp,src/gfx1013_direct_compute.inl; the HLSLlower_ldsgets the same forms).ds_write_b8(0x1e) andds_write_b16(0x1f) insert the low byte or halfword into the containing dword with acmpxchgloop. Lanes that write different bytes of one word keep each other's bytes. Lanes that write the same byte leave one lane's value, never a mix.ds_read_i8,ds_read_u8,ds_read_i16andds_read_u16(0x39-0x3c) load the field with sign or zero extension.ds_read_u16_d16(0xa6) andds_read_u16_d16_hi(0xa7) write the field into the low or high half of the destination and keep the other half.Tests (Windows 11, RTX 5080, SDK 10.0.26100 DXC, Release,
main3f780716plus this commit):native_lds_subword_store_controlschecks thecmpxchgloop shape, including a check that fails if it is replaced by anand/orpair.native_lds_subword_read_controlschecks the extraction and kept-half shape of the six load forms (seven cases, one at an odd address), and four refusals.mainthe store control is refused withunsupported local DS opcode 30and the read control withunsupported local DS opcode 166.native_lds_subword_store_hardwarepasses: b8 and b16 stores, an odd b16 offset, and two lanes storing to the same byte.native_lds_subword_read_hardwarepasses: a b16 store read back withd16andd16_hiinto a register whose other half holds a known value, and an odd address. The_warpvariants report a capability skip (77).ctest -R "native_|startup_compute|compile_dxil|salu": 531 of 532.native_scalar_lds_hardwarefails as onmain.compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests: 250 to 251. The added program weighs 4,280 dispatches in that run. None is lost, and the existing output is byte-identical.Not covered: 0xa0-0xa5 (
ds_write_b8/b16_d16_hi, 8-bitd16loads) stay refused; the HLSLlower_ldsforms have no test; no source mutations were run.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T16:19:48Z.
Measurement on a 600 s run of
mainf5a6f6bawith thread holding off (--suspend-others 0, see #3331). Of the 887 compute shaders with no translation in that run,compile_dxil gfx1013-direct-cs@0 --requestsonf5a6f6baand on this branch (f7a1d168):mainSRV kind typed_buffer_srv)main, refused hereImported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T05:03:41Z.
Open for review at
f7a1d168(CI green, no conflict withmain212d4b5f). A reviewer can checknative_lds_subword_store_controlsandnative_lds_subword_read_controlsfor the DXIL shape, andnative_lds_subword_store_hardwareandnative_lds_subword_read_hardwareon a hardware adapter.