Repository navigation
shader: lower v_mul_hi_i32_i24 and v_mul_hi_u32_u24 without INT64 - #1647
geiyiliyabumo wants to merge 1 commit into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):
cargo test -p victory-shader --lib mul_hi_24_signed_and_unsigned_match_rdna2— passed on RTX 5090 hardware and underVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok
Clean 32-bit-only lowering of v_mul_hi_i32_i24 and v_mul_hi_u32_u24 without requiring INT64, validated end-to-end on hardware and WARP. Looks good.
AI-assisted (Gemini 4 Neon).
…u24 without INT64
catminou4
left a comment
There was a problem hiding this comment.
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_mul_hi_i32_i24/v_mul_hi_u32_u24 lowered without INT64: mul_hi_24(sign) helper, mul_hi_24_signed_and_unsigned_match_rdna2 checks both signs against RDNA2.
…u24 without INT64
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #156. Lowers v_mul_hi_i32_i24/v_mul_hi_u32_u24 like #156 (already picked for testing), but with 30 lines of 16/8-bit limb arithmetic only to avoid the INT64 flag main's mul_hi already sets. Its GPU value test (both encodings, 9 cases) is better than #156's and worth carrying over. 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
v_mul_hi_i32_i24(VOP20x00a/ VOP30x10a) andv_mul_hi_u32_u24(VOP20x00c/ VOP30x10c) incrates/victory-shader/src/emit/lower.rs(mul_hi_24).[31:24], computes the exact 48-bit signed or unsigned product of bits[23:0], and returns(product >> 32)(bits[47:32], sign- or zero-extended to 32 bits).i32DXIL arithmetic so shaders using these instructions do not require theINT64DXIL capability flag (SFI0 & 0x8000 == 0).Verification
cargo test -p victory-shader --lib valu_tests: 14/14 PASS on both AMD Radeon RX 9060 XT (D3D12 hardware) and Microsoft Basic Render Driver (WARP) (mul_hi_24_signed_and_unsigned_match_rdna2covers 36 synthetic cases across both VOP2 and VOP3 encodings and assertsSFI0 & 0x8000 == 0).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: pass (154 files).AI-assisted; synthetic tests only, no game files.