Repository navigation
Conversation
…16, v_sub_nc_i16 These were decoded but refused. The low bits of a sum, difference or product do not depend on the sign, so they lower as their unsigned twins; the 16-bit forms use the existing 16-bit path, which already sign-extends _i16 operands. Clamp, abs and neg are still refused.
|
Tested
AI-assisted (DeepSeek V4.1 Flash coding agent). |
|
Verified
AI-assisted. |
|
RDNA2 hardware check: the add/sub forms match, with one note on Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. Hand-written instructions in a HIP kernel (assembled by the AMD driver's amd_comgr). RDNA2 desktop silicon, not the console's. No game data. 400 operand pairs (edge values
AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run. |
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
What
Lowers
v_add_nc_i32,v_sub_nc_i32,v_mul_lo_i32,v_add_nc_i16andv_sub_nc_i16. They were decoded but refused inemit/lower.rs("unsupported"), so any shader using one fell back instead of translating.Why
The low 32 bits of a sum, difference or product do not depend on the sign, so the 32-bit forms lower exactly as
v_add_nc_u32,v_sub_nc_u32andv_mul_lo_u32. The 16-bit forms go through the existing 16-bit integer path, which already sign-extends_i16operands and keeps the low half (including op_sel and the high-half destination). Clamp (which saturates), abs, neg and omod stay refused rather than miscompiled.The diff is local: names added to four existing match arms and the 16-bit name list, plus tests.
Tested
Linux x86_64 only:
cargo test -j4 -p victory-shader: 54 passed, 0 failed (3 of them new).Unsupported { what: "v_add_nc_i32" },"v_add_nc_i16"); after it they pass.cargo clippy -j4 -p victory-shader --tests: no new warnings (the existingconstant_colordead-code warning on non-Windows is untouched).rustfmt --check --edition 2024onlower.rs: clean.The new tests build a synthetic pixel program in memory (no game data), lower it, and check that the signed 32-bit forms produce the same DXIL as their unsigned twins, that the 16-bit forms lower with op_sel variants, and that clamp is still refused.
Not run: the Windows runtime, a GPU, DXC validation of the emitted DXIL.