shader: lower v_mul_hi_i32_i24 and v_mul_hi_u32_u24 without INT64 #1647
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1647
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1647/head"
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?
@geiyiliyabumo on GitHub · 2026-11-24 20:23 UTC · original
geiyiliyabumo:fix/shader-mul-hi-24→main· +77 −0 · 2 files · 1 commits · closed without mergingSummary
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.
@Marvisak on GitHub · 2026-11-25 01:22 UTC · original
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.
Pull request closed