Shaders: lower scalar byte and halfword sign extension #182

Open
GeaorgeAyvazov wants to merge 1 commit from upstream-pr/182 into main
GeaorgeAyvazov commented 2026-11-24 22:17:32 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by GeaorgeAyvazov on 2026-11-24T22:17:32Z.


The GFX10 decoder recognizes S_SEXT_I32_I8 and S_SEXT_I32_I16 but lowering rejects them. Reuse the byte/word selection helper to sign-extend the low byte or halfword into the scalar destination. AMD RDNA 2 ISA section 5.4 specifies that both preserve SCC.

The regression translates synthetic GFX10 compute shaders and reads the result back from a UAV. Six input words cover both sign boundaries and discarded high bits. Each runs with both incoming SCC states, consumed by a following scalar select. Before the patch the test stopped at Unsupported s_sext_i32_i8. The focused test passed on the RTX 3070 Ti Laptop and Intel Iris Xe using temporary explicit DXGI adapter selection and the hardware/WARP harness. The full shader library suite reported 204 passed, 7 failed, 2 ignored, with the same seven failures recorded on the base emitter. No game assets or title-level claims.

Implemented and tested with OpenAI Codex.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592519858 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/182). Originally posted by [GeaorgeAyvazov](https://github.com/GeaorgeAyvazov) on 2026-11-24T22:17:32Z. --- The GFX10 decoder recognizes S_SEXT_I32_I8 and S_SEXT_I32_I16 but lowering rejects them. Reuse the byte/word selection helper to sign-extend the low byte or halfword into the scalar destination. AMD RDNA 2 ISA section 5.4 specifies that both preserve SCC. The regression translates synthetic GFX10 compute shaders and reads the result back from a UAV. Six input words cover both sign boundaries and discarded high bits. Each runs with both incoming SCC states, consumed by a following scalar select. Before the patch the test stopped at Unsupported s_sext_i32_i8. The focused test passed on the RTX 3070 Ti Laptop and Intel Iris Xe using temporary explicit DXGI adapter selection and the hardware/WARP harness. The full shader library suite reported 204 passed, 7 failed, 2 ignored, with the same seven failures recorded on the base emitter. No game assets or title-level claims. Implemented and tested with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/182:upstream-pr/182'
git switch 'upstream-pr/182'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/182'
git switch 'upstream-pr/182'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/182'
git switch 'upstream-pr/182'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/182'
git switch 'main'
git merge --squash 'upstream-pr/182'
git switch 'main'
git merge --ff-only 'upstream-pr/182'
git switch 'main'
git merge 'upstream-pr/182'
git push origin 'main'
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
fxceless/victory-fork!182
No description provided.