shader: set the SCC of s_add_i32, s_sub_i32 and s_addk_i32 to the signed overflow #93
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!93
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-93"
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?
@Olima34 on GitHub · 2026-11-26 14:29 UTC · original
Olima34:fix/shader-signed-add-scc→main· +94 −7 · 3 files · 2 commits · merged 2026-11-26 15:05 UTCWhat this changes
The SCC of
s_add_i32,s_sub_i32ands_addk_i32wasVal::Missing, so a shader that reads it (a select or a branch on it) was refused. It is now the signed overflow, as the RDNA2 ISA reference gives it (SOP2 2 and 3, SOPK 15):S0[31] == S1[31] && S0[31] != D[31]for the adds (tmp[31] == SIMM16[15] && tmp[31] != D[31]fors_addk_i32,tmpthe old D) andS0[31] != S1[31] && S0[31] != D[31]for the subtraction, computed as the sign of(a ^ r) & (b ^ r)and(a ^ b) & (a ^ r).Tests:
a_signed_overflow_reaches_the_selecttranslates a select and a branch on each instruction's SCC (refused onmain), and Windows value probes check the overflow cases (0x7FFFFFFF + 1,0x80000000 + -1,-1 + 1,0x80000000 - 1,0 - 0x80000000,0 - 1, ands_addk_i32with0x7FFF,0xFFFF,0x8000).How it was tested
cargo test -p victory-shaderand arm64cargo test --workspace(value probes run only in the Windows CI)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with--all-featurescargo xtask policyChecklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-26 14:54 UTC · original · approved these changes
The signed-overflow formulas match the ISA and the lowering test fails on main. Thanks.