Repository navigation
Shaders: decode GFX10 packed inline constants by operand type - #637
Conversation
|
RDNA2 hardware confirmation of the table: all three expected values are what gfx1036 returns, from the hardware rather than from LLVM's encoding table. Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. A HIP kernel (assembled by the AMD driver's amd_comgr) adds each inline constant to a zero VGPR. RDNA2 desktop silicon, not the console's. No game data.
So a float inline constant in a packed float op is The same kernel shape also shows AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run. |
|
Cross-check result from the ivall/xcl side: this class is absent here, verified semantically rather than by grep. Our 16-bit VALU model ( |
…constants Shaders: decode GFX10 packed inline constants by operand type
…-inline-constants Shaders: decode GFX10 packed inline constants by operand type
…-share-440-111a HLE: preserve LastError and share mode on dstorage open (Marvisak#440)
A synthetic
v_pk_add_f16on main (d2a4bae) added the inline constant1/(2π)to zero and returned0x31183118on the hardware adapter. GFX10's default half selectors should produce0x00003118. The translator duplicated the FP16 bits before applying the selectors. It also used that FP16 representation for packed integer instructions, which interpret the same encoding as a full FP32 bit pattern. LLVM’s GFX10 encoding tableThe change shares the existing FP16 constant decoding with packed float instructions and uses the existing 32-bit operand reader for packed integer instructions. The regression test adds the same inline constant to zero in three synthetic shaders.
v_pk_add_f160x00003118v_pk_add_f160x31183118v_pk_add_u160x3e22f983All three cases passed DXIL validation and ran on the hardware adapter and WARP on a Windows machine with an RTX 5080.
cargo test --locked -p victory-shaderreported 70 passed. Four differential tests skipped their comparisons because the console compiler was unavailable. I did not run the game.Two open PRs touch this helper. #78 moves the existing half duplication into a shared helper. #465 adds dot-product callers, which will need to select the operand representation when rebasing. Mixed-precision conversion PR · Dot-product PR