Skip to content

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

Merged
ThatRecompDev merged 1 commit into
ThatRecompDev:mainfrom
Sr-0w:shaders/vop3-unused-inline-zero
Nov 25, 2026
Merged

ThatRecompDev merged 1 commit into
ThatRecompDev:mainfrom
Sr-0w:shaders/vop3-unused-inline-zero

Conversation

@Sr-0w

@Sr-0w Sr-0w commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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.ai/code/session_01SKtJsfjasPuTLtS3mEXFru

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
@ThatRecompDev
ThatRecompDev merged commit 8687725 into ThatRecompDev:main Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants