Shaders: decode and lower v_dot8_i32_i4 #184
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/184"
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 Belobug/VIctory-Belobug-AMD. Originally posted by lcg007xd-c on 2026-11-25T20:16:29Z.
What this fixes
VOP3P opcode 0x18,
v_dot8_i32_i4, is missing fromgfx10/opcodes.rs. 0x16, 0x17 and 0x19 are all 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
(0x018, "v_dot8_i32_i4").integer_dot: already takes the field width (v_dot8→ 4) and signedness (_i32) from the name, so it only needed the name added to its dispatch. Clamp saturates in 64 bits, as it does for the other signed forms.v_dot8_i32_i4to(4, true)explicitly. Otherwise it would fall into_ => (4, false)and be treated as unsigned.Tests
packing_dot_and_ldexp_instructions_translate(runs on every host) now covers the new opcode. It passes with the change and fails with the table entry removed.opcode_tests::packed_integer_dot_productsandvalu_tests::v_dot_products_of_packed_fields(Windows/GPU) get the new opcode as a row in their tables, with the same signed model the other signed rows use.Run here (Linux, Rust 1.98.1):
cargo test -p victory-shader --lib: 185 passed, 0 failed, 6 ignored. That includesrefused_opcodes, which now audits this opcode as well.cargo clippy --target x86_64-pc-windows-msvc: reports the same 12 findings asmain, and nothing new from this change.Not run here: the GPU tests, since I have no Windows machine.
The same fix is open upstream as Marvisak/VIctory#2768, where Windows CI passed.
🤖 Generated with Claude Code
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-26T05:00:26Z.
RDNA2 data point. This PR (
01f7c0f) merged onmain4f62c2a,cargo test --release -p victory-shader --libon an RX 6950 XT (Windows 11 build 26300, Rust 1.98.1):main: 275 passed, 2 failed.main, so no new lib test ofvictory-shaderran here.The 2 failures are the same as on
main: the RDNA2 wave-size testsscalar_counted_in_a_divergent_loop_read_after_itandscalar_counted_in_nested_divergent_loops, fixed by #110 and #204. No regression here. One run ended without a result line, which this test binary does now and then on this machine, onmaintoo. Not run in the game.harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300
AI-assisted (Claude Code); no game data.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by adrianmjim on 2026-11-26T19:42:12Z.
Tested on Windows 11 with an RX 7900 XT (RDNA3, driver 32.0.32029.2010), Rust 1.98.1. The PR is based on
000ffdd. I tested the head (01f7c0f) and also the diff applied on current main (4f62c2a). It applies cleanly there.GPU tests (they run natively here):
cargo test -p victory-shader --lib -- --test-threads=1on4f62c2a+ this PR: 277 passed, 0 failed, 6 ignored. That is the same count as4f62c2aalone. The head itself gives 266 / 0 / 6.valu_tests::v_dot_products_of_packed_fieldspasses on both the hardware adapter and WARP.opcode_tests::packed_integer_dot_productspasses on the hardware adapter, including the clamp rows for the new opcode.4f62c2a, all three touched tests fail.packing_dot_and_ldexp_instructions_translateandv_dot_products_of_packed_fieldsfail with "unknown opcode".packed_integer_dot_productsfails at the opcode-name lookup.Game corpus (whole shaders.rpf,
translate --validate --host-lanes 32-64):000ffddand for4f62c2a+ PR against4f62c2a.shader-info --disasmwith this build finds nov_dot*instruction of any kind in this title (0 of about 44.4M decoded instructions) and no unnamed opcodes. So the change has no effect on this corpus, and this corpus does not exercise the new path.Not tested: native execution of
v_dot8_i32_i4on RDNA2 hardware to compare against the test model, other host lane configurations, and clippy.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.