shader: lower gfx1013 scalar halfword pack instructions in pixel_aot #544
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/550"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-22T10:51:10Z.
Change
pixel_aotcan now translates_pack_ll_b32_b16,s_pack_lh_b32_b16, ands_pack_hh_b32_b16. Each instruction selects a halfword from each source and leaves SCC unchanged. The fixture writes the result back to the first source register, then reads SCC before comparing the packed word.I chose two inputs whose four halfwords are all different. That makes a source-order or half-selection mistake visible in the result:
0x1234ABCD,0x5678EF900xEF90ABCD0x5678ABCD0x56781234Verification
Tested commit
caa7fd8against basee55c593. The CPU reference splits each input into two little-endian halfwords and writes the selected pair into the constant buffer. The shader compares all 32 result bits before exporting the equality result. A separate pixel channel reports the incoming SCC. A second input pair exercises zero and all-one halves with SCC set.pixel_mismatchwhen I compiled LL in place of LH and kept the original LH reference.To reproduce the binary check with LLVM 15, then the registered Windows tests containing the draw:
Evidence and follow-up
The fixture uses source-written assembly and synthetic constants under the repository's MIT license. The counts above are local to the binary fixture suite; CI produces the aggregate dashboard separately. Instruction semantics follow the AMD RDNA 2 ISA reference.
AI-assisted with Codex for implementation, local verification, and this write-up.