Repository navigation
Translator: v_dot4_i32_i8 refuses neg_lo/neg_hi, which RDNA2 hardware does not ignore (follow-up to SHADER-303) - #1913
Conversation
…re does not ignore The rule took v_dot4_i32_i8 with a neg_lo or neg_hi field as the plain instruction. llvm-mc accepts those fields on it for gfx1036 (not on v_dot4c_i32_i8), and on RDNA2 hardware they change the result: neg_lo flips bit 15 and neg_hi bit 31 of S0 or S1, and on S2 neg_hi clears bit 31 before neg_lo flips it, as the fields do to float operands. Measured on gfx1036 through tools/hw_oracle: 5 operand sets under 8 forms plus the plain one, 45 words, all as that model predicts. Nine of them are the table MEASURED_NEG of tests/semantic/test_alu_dot4_i8.py. A set bit is now Unsupported, like clamp and op_sel; an all-zero field stays the plain instruction. No listing of the 29 FSPX programs carries either field on these two instructions (0 lines), so what translates there does not change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested
|
|
Tested 186d793 on NVIDIA GeForce GTX 1660 (Turing, TU116, subgroup 32..32), driver 620.73.04 (proprietary, Vulkan 1.4.357), Arch Linux (kernel 6.18): pass, no regression. Native build of runtime/ from this head (Ninja, RelWithDebInfo, clang 23.1.5), llvm-mc 23.1.5, SPIRV-Tools v2026.4.
The PR adds no GPU fixture, so the refusal itself is covered only by the semantic tests here. AI-assisted run (Claude). Synthetic programs only, no game files involved. |
|
Corpus check on my own 1.0.2.1 package (26,503 shaders disassembled with llvm-mc 21, gfx1013), comparing this PR's head with its own base, not with today's
AI-assisted (Claude Code). |
|
Tested
No game data. AI-assisted. |
|
Tested 186d793 on NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), NVIDIA 621.01 (Vulkan 1.4.357), Windows 11 Pro 26300: pass, no regression. VS 2022 Build Tools 17.14, Vulkan SDK 1.4.363.0 / SPIRV-Tools v2026.4, llvm-mc 21.1.8 (native,
No GPU test exercises the new refusal itself; this run only checks that the translator change doesn't disturb anything else on NVIDIA. AI-assisted run (Claude Code). |
Claimed in the coordination issue as: finding + claim (follow-up to SHADER-303, #1754)
What and why
#1754 translated
v_dot4_i32_i8with aneg_loorneg_hifield as the plain instruction.llvm-mcaccepts those fields on it for gfx1036 (not onv_dot4c_i32_i8), and the hardware does not ignore them:neg_loflips bit 15 andneg_hiflips bit 31 of the dword.neg_hiclears bit 31 andneg_lothen flips it.The change:
Unsupported, likeclampandop_sel. An all-zero field stays the plain instruction.tests/semantic/test_alu_dot4_i8.pygets the measured tableMEASURED_NEGand three tests.docs/design.mdsays what was measured.The other five integer dot products behave the same way on this hardware (words posted on #1808, whose rules already refuse these fields).
Tested
tools/hw_oracle. 5 operand sets under 8 forms plus the plain one: 45 words, all as the model above predicts. Nine of them areMEASURED_NEG.tests/semantic/test_alu_dot4_i8.py: 10 tests pass. The three new ones: the reference reproduces the measured words (7 of the 8 forms differ from the plain word), a set bit is refused, an all-zero field gives the plain result.python -m unittest discover -s tests/semantic: 1,647 tests OK.python -I -m compileall -q make_game.py tools tests: OK.Checklist
docs/design.md, with how it was confirmed (the row "Signed-byte dot products" is extended).AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).