Repository navigation
Direct RDNA2 decoder: recognize SDWA inline scalar constants - #2811
kacper-serewis wants to merge 21 commits into
Conversation
…negatives as decimal Addresses review feedback on PR ItsNotRexed#2038 (@borislisandro): - Sign-extend SOPP branch simm16 offsets with _s16(simm16) so backward branches decode as negative integers (e.g. -4, -20) matching shader_ir/llvm-mc 21/22 instead of 0xfffc. - Format negative immediates (< 0) as decimal rather than broken '0x-...' hex. - Clarify module docstring (shader_ir-compatible .s text) and update unit tests (normalizing SOPP branch immediates mod 16-bit for LLVM 18 vs 21/22 parity).
|
Independent CPU check of |
|
Independent SDWA scalar-bit differential ( AI-assisted (Codex). |
|
Hardware & Test Verification: PASS on GPU (Dual-GPU Tested) AI-assisted review. Validated branch
GPU Results:
LLVM Parity Confirmation:Confirmed that Zero game data used. |
|
Reviewed at head This is correctly blocked, not wrong: the decoder is absent from |
|
Clarifying the LLVM gate in the latest review: this remains draft pending #2038. The LLVM-enabled checks in the earlier comments did run: Marukooh reports the parity test passing with LLVM 23.1.5; padhossein and dac0129 independently reproduced only the documented ps_sdwa_f16_const encoding-length discrepancy on LLVM 21.1.8, and dac0129 ran both SDWA pixel fixtures on NVIDIA and native RDNA2 Vulkan. Those reports do not resolve cross-version LLVM parity generally, so that limitation stays explicit. We will rebase and rerun after #2038 lands. AI-assisted coordination. |
# Conflicts: # tools/shader_disasm.py
80b46f6 to
9e069b0
Compare
…-mc -disassemble fails to round-trip SDWA float inline constants
BUILD-807. Original claim and continuation.
Depends on: #2038
Depends on: #2786
#2038 at
998128ecsupplies the SDWA implementation. This branch integrates #2786 at2e594cf1, which includes #2038, and main ataa2988cc. The contribution specific to #2811 is a synthetic regression checking all 90 inline constants across five VOP1, VOP2 and VOPC source positions. #2323 adds direct-backend consumers and is a tracker merge-order predecessor, not a prerequisite for this test. Tracker order is #2038 → #2323 → #2786 → #2811.On Windows, 13 synthetic decoder tests and 19 shader-disassembly tests passed. Four independent LLVM 21.1.8 gfx1013 assemblies matched the decoded operands for positive and negative integers, floating-point 1.0, an SGPR, and VGPRs including v242. LLVM rejected a non-inline immediate for v_mov_b32_sdwa as expected.
The optional LLVM fixture parity test still fails on ps_sdwa_f16_const.asm. LLVM renders the 8-byte inline v_cvt_f16_u16_sdwa as a 12-byte literal encoding. Existing parity finding.
AI-assisted. CPU only, with no game archives, GPU or driver used.