shader: return old LDS words from min, max and reverse subtract #908

Merged
stan495 merged 1 commit from upstream-pr/915 into main 2026-11-23 17:16:08 +00:00
stan495 commented 2026-11-23 17:01:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T17:01:02Z.


Scope

Add the returning forms of the five private LDS word updates from #898. ds_rsub_rtn_u32, ds_min_rtn_i32, ds_max_rtn_i32, ds_min_rtn_u32 and ds_max_rtn_u32 write the pre-update word to the destination VGPR. The same zero-offset private address, initialization, EXEC and wait checks apply.

Verification

Tested a329153 on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used the AMD Radeon RX 7900 XTX (driver 32.0.32029.2010). WARP used Microsoft Basic Render Driver (10.0.26100.9818).

cmake --build --preset dev --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = '7900 XTX'
ctest --preset dev --no-tests=error -R '^compute_store_aot_(lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V

7 passed, 0 failed, 0 skipped. For each opcode, both backends compared two returned words and the final LDS word across the whole 320-word UAV for one and three groups. Each program aliases the destination with the data VGPR once and the address VGPR once. All 15 mutants produced the expected first mismatch on both backends. For reverse subtract, changing the order produced 7ffffff8 at word 1 instead of 80000008. Returning the new word and dropping the second write also produced mismatches.

python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

Passed with LLVM 15.0.7 in WSL Ubuntu 24.04. The decoded forms match the source fixture, the direct and CLI paths generate the same HLSL, and the coverage records include all five forms.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6564468399 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/915). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T17:01:02Z. --- ## Scope Add the returning forms of the five private LDS word updates from #898. `ds_rsub_rtn_u32`, `ds_min_rtn_i32`, `ds_max_rtn_i32`, `ds_min_rtn_u32` and `ds_max_rtn_u32` write the pre-update word to the destination VGPR. The same zero-offset private address, initialization, EXEC and wait checks apply. ## Verification Tested `a329153` on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used the AMD Radeon RX 7900 XTX (driver 32.0.32029.2010). WARP used Microsoft Basic Render Driver (10.0.26100.9818). ```powershell cmake --build --preset dev --target offscreen_check $env:XBOX2WINDOWS_ADAPTER = '7900 XTX' ctest --preset dev --no-tests=error -R '^compute_store_aot_(lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V ``` 7 passed, 0 failed, 0 skipped. For each opcode, both backends compared two returned words and the final LDS word across the whole 320-word UAV for one and three groups. Each program aliases the destination with the data VGPR once and the address VGPR once. All 15 mutants produced the expected first mismatch on both backends. For reverse subtract, changing the order produced `7ffffff8` at word 1 instead of `80000008`. Returning the new word and dropping the second write also produced mismatches. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` Passed with LLVM 15.0.7 in WSL Ubuntu 24.04. The decoded forms match the source fixture, the direct and CLI paths generate the same HLSL, and the coverage records include all five forms.
upstream-sync closed this pull request 2026-11-24 06:45:23 +00:00
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!908
No description provided.