shader: lower v_frexp_{exp,mant}_{f32,f16} in pure 32-bit DXIL #1658
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1659"
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?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T20:33:31Z.
Summary
v_frexp_exp_i32_f32(VOP1 0x03f/VOP3 0x1bf),v_frexp_mant_f32(VOP1 0x040/VOP3 0x1c0),v_frexp_mant_f16(VOP1 0x059/VOP3 0x1d9), andv_frexp_exp_i16_f16(VOP1 0x05a/VOP3 0x1da) incrates/victory-shader/src/emit/lower.rs(Lower::frexp).DoublenorInt64feature bits are set inSFI0):FirstbitHi(unaryBits.i32op 33) so DXIL f32 denormal flushing cannot corrupt subnormal inputs.±0.0),±inf, andNaNin the mantissa (and flushes-0.0to+0.0underomodper RDNA2 ISA §6.2.2); returns0for their exponents.abs/negsource modifiers,clamp/omodfloat output modifiers, and SDWA / VOP3op_selhalf selection while preserving the untouched VGPR half on 16-bit writes.Verification
cargo test -p victory-shader --lib: 123 passed, 0 failed, 1 ignored on both AMD Radeon RX 9060 XT (D3D12 hardware) and Microsoft Basic Render Driver (WARP), including 3 new regression tests (v_frexp_f32_decomposes_normals_and_subnormals_and_handles_special_values,v_frexp_f16_decomposes_and_preserves_the_other_destination_half,v_frexp_vop3_applies_float_modifiers— 108 synthetic GPU dispatches per backend, assertingDoubleandInt64SFI0flags are clear).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: pass (154 files).AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:42:44Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows.v_frexp_{exp,mant}_{f32,f16} lowered in pure 32-bit DXIL: frexp() with src_bits + float_output_modifiers (omod/clamp), build_frexp_cs test builder.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:33:38Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/valu_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:36:46Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
79107fdapplied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 96 passed, 0 failed, 1 ignored. All tests pass.cargo clippy -p victory-shader --all-targets -- -D warnings: 2 pre-existing unused-import errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T02:25:30Z.
Rebased cleanly onto \main\ (\
ccfb029), preserving \main's \tz/denormal-flush \omod\ handling inside \loat_output_modifiers. \cargo test -p victory-shader --locked frexp\ (verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll), \cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings, and \cargo xtask policy\ all pass.Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T03:49:53Z.
Updated per triage feedback: applied \Lower::ftz\ to f32 \_frexp_exp_i32_f32\ / \_frexp_mant_f32\ inputs (preserving signed-zero mantissa and zero exponent for flushed f32 subnormals while keeping f16 subnormal decomposition unchanged) and updated the f32 subnormal tests. Rebased onto \main\ (\
940d32f); verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll: \rexp\ (3 passed, 0 failed), \semantics_tests\ (32 passed, 0 failed), \clippy -D warnings, and \xtask policy\ all pass.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.