Repository navigation
shader: refuse reads of the carry s_lshlN_add_u32 leaves in SCC - #2813
spy0eye-beep wants to merge 1 commit into
Conversation
The default set SCC to result != 0; the hardware sets the add's carry. Mark it unknown like s_add/s_sub, so a shader reading it is refused instead of silently mistranslated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kotekompotek
left a comment
There was a problem hiding this comment.
Correct per ISA: s_lshl1-4_add_u32 set SCC to the add's carry-out, not result != 0 — reading it through the generic SCC path silently produced the wrong predicate. Refusing it alongside the add/sub carries is the honest behavior until carry tracking lands. The pattern is precise (s_lshl prefix AND _add_u32 suffix, so plain s_lshl_b32 shifts still fall through), and the test covers all four ops 0x2e-0x31 reading SCC via s_cselect. LGTM.
|
Verified
One clippy failure causing CI to fail:
|
Shaders: port four translator fixes from upstream (Marvisak#2813, Marvisak#2812, Marvisak#2816, Marvisak#2817)
|
Automated triage for the maintainers. This PR no longer merges cleanly into Generated by Claude Code |
The default set SCC to result != 0; the hardware sets the add's carry. Mark it unknown like s_add/s_sub, so a shader reading it is refused instead of silently mistranslated. Ported from Marvisak#2813 (0e193db). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split out of #1483 as requested in review. The s_min/s_max part of that PR is already fixed on main; this is the remaining piece.
s_lshl{1..4}_add_u32fell through to the default SCC = (result != 0), but the hardware sets the add's carry. Like s_add/s_sub, SCC is now marked unknown, so a shader that reads it is refused instead of silently mistranslated.Test:
lshl_add_carry_read_is_refusedbuilds each of the four ops followed bys_cselect_b32on SCC and expects the refusal (it fails without the change).cargo test -p victory-shader: the same 9 tests fail on main and on this branch.🤖 Generated with Claude Code