compute: lower the DS _src2 family #3592

Merged
lambirou merged 1 commit from upstream-pr/3592 into main 2026-11-30 12:11:13 +00:00
lambirou commented 2026-11-30 12:02:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T12:02:10Z.


Part of the DS slice (P7).

This adds the DS _src2 family in the private-LDS profile (gfx1030 16-byte records): ds_add_src2_f32/u32/u64, ds_sub_src2_u32/u64, ds_rsub_src2_u32/u64, ds_and_src2_b32/b64, ds_or_src2_b32/b64, ds_xor_src2_b32/b64, ds_inc_src2_u32/u64, ds_dec_src2_u32/u64, ds_min_src2_f32/f64/i32/i64/u32/u64, ds_max_src2_f32/f64/i32/i64/u32/u64 and ds_write_src2_b32/b64 — the 31 _src2 lines of docs/coverage/gfx1013.tsv (the table has 31, not 32). The second source is the same lane's dword or qword at A + 4 * offset, and the update stays inside the proven record. ds_write_src2 only needs the source.

Refusals: an offset mode carried in the VGPR address, an offset outside the record, an unaligned 64-bit pair, an uninitialized source, a missing destination for a read-modify-write form, the group-shared gfx1013 profile (its second address can cross lanes and its atomic order is not modelled), a 4-byte stride, a lane-guarded form, GWS and ds_ordered_count. f32/f64 min/max keep the old value on NaN, equality and opposite signed zeros; add/sub/rsub, inc/dec and the integer comparisons follow the 32/64-bit carry/borrow rules.

Tests

  • compute_store_aot_lds_src2_warp and _hardware pass: 64 source-built programmes and 37 mutants, 320 words compared per dispatch, 0 mismatch (WARP and AMD Radeon RX 9060 XT, driver 32.0.32029.2010).
  • The existing DS/LDS family still passes (22/22 in the agent run; compute_store_aot_ds_route_warp re-run after the rebase).
  • form_coverage_check.py pins exactly the 31 _src2 forms and keeps GWS and ds_ordered_count uncovered; docs_links_check.py passes.
  • Expected full table after the merge: 1,620/1,968 gfx1013 and 1,574/1,863 gfx1030 (the _src2 forms are absent from the RDNA 2 reference).

Limits

Only the private-LDS profile is covered; the group-shared gfx1013 profile still refuses _src2. Only direct immediate offsets 0..3 (0 or 2 for a 64-bit pair) are accepted; the VGPR offset mode, dynamic offsets and sources outside the record stay refused. GWS (6 forms) and ds_ordered_count need a separate barrier/order model. The binary/LLVM round-trip was not run locally (llvm-mc absent); the static _src2 controls are wired into that mode. The D3D12 debug layer is unavailable on this host.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5564863272 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3592). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-30T12:02:10Z. --- Part of the DS slice (P7). This adds the DS `_src2` family in the private-LDS profile (gfx1030 16-byte records): `ds_add_src2_f32/u32/u64`, `ds_sub_src2_u32/u64`, `ds_rsub_src2_u32/u64`, `ds_and_src2_b32/b64`, `ds_or_src2_b32/b64`, `ds_xor_src2_b32/b64`, `ds_inc_src2_u32/u64`, `ds_dec_src2_u32/u64`, `ds_min_src2_f32/f64/i32/i64/u32/u64`, `ds_max_src2_f32/f64/i32/i64/u32/u64` and `ds_write_src2_b32/b64` — the 31 `_src2` lines of `docs/coverage/gfx1013.tsv` (the table has 31, not 32). The second source is the same lane's dword or qword at `A + 4 * offset`, and the update stays inside the proven record. `ds_write_src2` only needs the source. Refusals: an offset mode carried in the VGPR address, an offset outside the record, an unaligned 64-bit pair, an uninitialized source, a missing destination for a read-modify-write form, the group-shared gfx1013 profile (its second address can cross lanes and its atomic order is not modelled), a 4-byte stride, a lane-guarded form, GWS and `ds_ordered_count`. f32/f64 min/max keep the old value on NaN, equality and opposite signed zeros; add/sub/rsub, inc/dec and the integer comparisons follow the 32/64-bit carry/borrow rules. ## Tests - `compute_store_aot_lds_src2_warp` and `_hardware` pass: 64 source-built programmes and 37 mutants, 320 words compared per dispatch, 0 mismatch (WARP and AMD Radeon RX 9060 XT, driver 32.0.32029.2010). - The existing DS/LDS family still passes (22/22 in the agent run; `compute_store_aot_ds_route_warp` re-run after the rebase). - `form_coverage_check.py` pins exactly the 31 `_src2` forms and keeps GWS and `ds_ordered_count` uncovered; `docs_links_check.py` passes. - Expected full table after the merge: **1,620/1,968** gfx1013 and **1,574/1,863** gfx1030 (the `_src2` forms are absent from the RDNA 2 reference). ## Limits Only the private-LDS profile is covered; the group-shared gfx1013 profile still refuses `_src2`. Only direct immediate offsets 0..3 (0 or 2 for a 64-bit pair) are accepted; the VGPR offset mode, dynamic offsets and sources outside the record stay refused. GWS (6 forms) and `ds_ordered_count` need a separate barrier/order model. The binary/LLVM round-trip was not run locally (`llvm-mc` absent); the static `_src2` controls are wired into that mode. The D3D12 debug layer is unavailable on this host. AI-assisted.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3592
No description provided.