Repository navigation
Shaders: lower v_mov_b32 abs/neg modifiers bitwise - #2548
fuzeofficlal wants to merge 1 commit into
Conversation
a363be3 to
cc7e263
Compare
fyernald
left a comment
There was a problem hiding this comment.
Verified on RTX 3080 (617.42), Windows 10 (19045) plus WARP, main 67e8ae1 + #486 + #2596 (the suite crashes on NVIDIA without #2596, #2571). cargo test -p victory-shader --lib --locked -- --test-threads=1: 268 passed, 3 failed (the #1835 ones, also on the base). v_mov_b32_modifiers_are_bitwise passes on both adapters.
Making abs/neg sign-bit operations (AND 0x7FFFFFFF, XOR 0x80000000) in one src_bits is cleaner than the select-only special case it replaces, and it keeps denormals and NaN payloads, which a host fabs/fneg may not. src still refuses modifiers for its integer users, so nothing else changes.
|
Automated triage for the maintainers. Verdict: merge candidate (unchanged). The new head is a rebase onto current As noted before, #1275 makes the same change on an old base, and only one of the two should land. CI: passing ( Generated by Claude Code |
|
Note 🤖 Gemini 4 Neon (with GPT-6.2 Astra, Mistral Large 4, and DeepSeek V4.1 Flash) responding on behalf of brainbudt APPROVE — independently verified
|
On RDNA2, source abs/neg on v_mov_b32 clears or flips bit 31 bitwise without quieting sNaN or flushing denormals unless a float output modifier (clamp/omod) is active. Extract Lower::src_bits to apply SDWA selection and bitwise abs/neg consistently for both v_mov_b32 and v_cndmask_b32, and only convert to float for write_f when clamp or omod is set. Co-authored-by: AscilCH <178020422+AscilCH@users.noreply.github.com>
cc7e263 to
f3809a8
Compare
Refs #883
Summary
Ports the remaining
v_mov_b32half of #883 (AscilCH'scacf6ad, withCo-authored-bypreserved) onto currentmain(v_cndmask_b32already landed there):absandnegmodifiers onv_mov_b32clear or flip bit 31 bitwise without flushing subnormal values or quietingsNaNpayloads unless a floating-point output modifier (clamporomod) is active.Lower::src_bitsincrates/victory-shader/src/emit/lower.rs(preserving DPPsrc0,low16_src, and SDWA byte/word selection before applyingAnd 0x7FFF_FFFF/Xor 0x8000_0000), sharing it acrossLower::src,v_mov_b32, andv_cndmask_b32.v_mov_b32throughas_float+write_fonly whenv.clamp || v.omod != 0.Verification
emit::valu_tests::v_mov_b32_modifiers_are_bitwise(crates/victory-shader/src/emit/valu_tests.rs) coveringv_mov_b32_e64(-v1,|v1|,-|v1|),v_mov_b32_sdwa(-v1,-v1.w0,|sext(v1.b0)|) across normals,±0.0,±inf, min/max±denormal,±sNaN, and payload±qNaN, plusv_mov_b32_e64withclampandomod = mul:2.lower.rsreproduces subnormal flushing (0x0000_0001 -> 0x8000_0000instead of0x8000_0001).cargo test -p victory-shader --lib emit::valu_tests(passed on both RTX 5090 hardware and D3D12 WARP, validated withdxil.dll)cargo clippy -p victory-shader --all-targets -- -D warnings(default and--no-default-features)cargo xtask policy