Commit Graph

3 Commits

Author SHA1 Message Date
c932457840 rdna2spirv: recover native SDWA inline float from LLVM 19 listings
LLVM 19 prints an 8-byte integer-to-half SDWA conversion as a 12-byte instruction with an extra literal dword. Recover the native source and byte length when the opcode, selector, other bytes and printed literal agree, and keep following instruction offsets correct.

Carried from the source-only patch by Sigtryggur-Mani-Gudmundsson:
b17a81c3d9/tests/sdwa-inline

AI-assisted.
2026-11-23 23:45:05 -06:00
78c41f3135 rdna2spirv: reject mismatches in used VOP3 sources 2026-11-22 20:43:36 +02:00
cc283495e6 rdna2spirv: check every printed encoding against its blob, not only re-anchored listings
A listing is LLVM's text for the instruction it decoded, not the bytes it
read. translate() compared the two only for listings with undecodable words
(the re-anchoring path); a clean listing was translated from the text alone,
so a field the disassembler drops would be translated as 0 without a word.
llvm-mc's gfx1013 decoder does drop the VOP3 op_sel bits (14:11) of 16-bit
VOPC compares and re-encodes them as 0.

check_printed_encodings() runs for every other listing whose header names
its code range and whose fssm/ or fspx/ blob holds that range: each
instruction's printed encoding must be the bytes at its offset, with
same_encoding's exceptions, or the shader is Unsupported. Hand-written
listings, run_gpu_tests.py's synthetic listings and the tests' header-only
blobs are not checked.

On the 1.0.2.1 corpus the 25,030 clean listings hold 30,335,381
instructions and none differs (754 fall under same_encoding's exceptions);
the 166 16-bit VOPC compares have op_sel clear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:28:18 +01:00