Repository navigation
Conversation
…4 special-case semantics
|
Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head
Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too); whether the new test fails without the fix on this host. AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #200. Lowers v_div_fixup_f32 and v_div_fixup_f16, which the title does not use. Both are covered by PRs that merge clean: #200 (f32, with v_div_scale/v_div_fmas) and #379 (f16). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Summary
Lowers RDNA2's IEEE-754 division-finalization instructions
v_div_fixup_f32(VOP30x15F) andv_div_fixup_f16(VOP30x35F) incrates/victory-shader/src/emit/lower.rs:Lower::div_fixup(quot, denom, num)implementing the full RDNA2 GFX10.3 special-case priority table in pure integer bit operations (immune to host-driver float NaN-folding differences):denomis NaN →quiet(denom)(highest priority, preserving payload)numis NaN →quiet(num)(denom == ±0 && num == ±0)or(denom == ±inf && num == ±inf)→ canonical qNaN (0x7FC0_0000)num == ±infordenom == ±0→±infwithsign(denom) ^ sign(num)denom == ±infornum == ±0→±0.0withsign(denom) ^ sign(num)quotis NaN (overflow in division sequence) →±infwithsign(denom) ^ sign(num), elsecopysign(quot, sign(denom) ^ sign(num)).v_div_fixup_f32throughf(self, 0..=2)andfloat(self, r)(preserving VOP3abs/neg/omod/clamp) andv_div_fixup_f16throughvalu16_op'sFLOAT3path (half_fsrc+float_result).Tests
Added two end-to-end synthetic GFX10 compute shader tests in
crates/victory-shader/src/emit/valu_tests.rs(validated viadxil.dlland executed on both host GPU and WARP):v_div_fixup_f32_matches_rdna2: 19 cases covering normalcopysign,NaNquotient overflow,±x / ±0,±inf / finite,finite / ±inf,±0 / finite,0/0,inf/inf, andsNaNpriority/quieting.v_div_fixup_f16_matches_rdna2: 9 cases covering f16copysign,NaNquotient overflow,±0/±infsign rules,0/0,inf/inf, andNaNpropagation.Verification
cargo test -p victory-shader v_div_fixup: 2 passed, 0 failed on Windows 11 x64 / NVIDIA GeForce RTX 5090 (Blackwell) + WARPcargo clippy -p victory-shader --all-targets: 0 warningscargo xtask policy:asset policy: 155 files okAI-assisted (Gemini 4 Neon).