Shaders: the RDNA decoder accepts the inline 0 in an unread VOP3 source #25

Manually merged
github merged 1 commit from gh-pr/25/head into gh-pr/25/base 2026-11-27 03:14:17 +00:00
Owner

@⁠Sr-0w on GitHub · 2026-11-25 10:25 UTC · original
Sr-0w:shaders/vop3-unused-inline-zero → main · +19 −2 · 3 files · 1 commits · merged 2026-11-25 11:02 UTC

llvm-mc 23 writes source code 0x80 (the inline constant 0) into the VOP3 sources an instruction does not read, where the release that assembled the committed test binaries wrote 0. v_cmp_gt_u32_e64 s40, 4, v0 now assembles to d4c40028 02020084 instead of d4c40028 00020084. llvm-objdump lists both as the same compare, but Vop3Decoder required unread sources to be 0 and made the dword .long, so a new compute case with a VOP3 compare, assembled with a current LLVM, fails to translate (UnsupportedProgramException: .long).

The decoder now accepts 0 or the inline 0 there; any other value is still .long.

  • Test: RdnaDecoderTests.An_unread_vop3_source_may_be_the_inline_zero decodes the llvm-mc 23 words.
  • Docs: the Disassembly paragraph of shader-translation.md.
  • Shaders and Architecture tests green.

Found while adding a test case for another change (the AMDGPU-enabled llvm-mc I used is MSYS2's ucrt64 build, since the official Windows release only has the x86 target).

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-25 10:25 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/25) `Sr-0w:shaders/vop3-unused-inline-zero` → `main` · +19 −2 · 3 files · 1 commits · merged 2026-11-25 11:02 UTC llvm-mc 23 writes source code 0x80 (the inline constant 0) into the VOP3 sources an instruction does not read, where the release that assembled the committed test binaries wrote 0. `v_cmp_gt_u32_e64 s40, 4, v0` now assembles to `d4c40028 02020084` instead of `d4c40028 00020084`. llvm-objdump lists both as the same compare, but `Vop3Decoder` required unread sources to be 0 and made the dword `.long`, so a new compute case with a VOP3 compare, assembled with a current LLVM, fails to translate (`UnsupportedProgramException: .long`). The decoder now accepts 0 or the inline 0 there; any other value is still `.long`. - Test: `RdnaDecoderTests.An_unread_vop3_source_may_be_the_inline_zero` decodes the llvm-mc 23 words. - Docs: the Disassembly paragraph of shader-translation.md. - Shaders and Architecture tests green. Found while adding a test case for another change (the AMDGPU-enabled llvm-mc I used is MSYS2's ucrt64 build, since the official Windows release only has the x86 target). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
llvm-mc 23 writes source code 0x80 (inline constant 0) into the VOP3 sources
an instruction does not read, where older releases wrote 0: a compare such as
v_cmp_gt_u32_e64 s40, 4, v0 assembles to d4c40028 02020084. llvm-objdump
lists it as the same compare, but the decoder made it .long, so any new test
case with a VOP3 compare failed to translate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:14:17 +00:00
github manually merged commit 30c8d2e257 into gh-pr/25/base 2026-11-27 03:14:17 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.