shader: decode and lower v_dot8_i32_i4 #44
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/uiliannn--VItoriaBr!44
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/44/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?
@lcg007xd-c on GitHub · 2026-11-25 20:24 UTC · original
lcg007xd-c:shader/v-dot8-i32-i4→main· +81 −0 · 4 files · 1 commits · merged 2026-11-25 20:33 UTCWhat this fixes
VOP3P opcode 0x18,
v_dot8_i32_i4, is missing fromgfx10/opcodes.rs. 0x16, 0x17 and 0x19 are there, so any program using it fails at decode. AMD's RDNA2 ISA lists it, and so does LLVM'sllvm-mc --disassemble -mcpu=gfx1030, which I used to cross-check the table.The change (
emit/dot.rs, next tov_dot8_u32_u4)(0x018, "v_dot8_i32_i4").sat_i32_add. The eight products alone stay in [−448, 512], so only that add can overflow.Tests
emit::lower::tests::signed_nibble_dot_product_translates(runs on every host): the encoding decodes tov_dot8_i32_i4, and a program that stores the result translates both unclamped and clamped. The store keeps the instruction from being dropped as dead code. The test fails without the table entry, and fails with "an unhandled dot product" without thedot.rsarm.valu_tests(Windows/GPU): adds two hand-computed cases next to thev_dot8_u32_u4one. All nibbles −1 times all 7, plus 100, gives 44. All nibbles −8 times all −8 gives 512.Run here (Linux, Rust 1.98.1):
cargo test -p victory-shader --lib --locked: 187 passed, 0 failed, 2 ignored.cargo clippy -p victory-shader --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.unused variable: out, which #39 fixes.Not run here: the GPU cases, since I have no Windows machine.
The same fix is open upstream as Marvisak/VIctory#2768 (Windows CI green) and on the Belobug fork as #184.
🤖 Generated with Claude Code