shader: lower scalar quadmask and bit replication #710
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/716"
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 lambirou on 2026-11-22T22:19:42Z.
Change
Add s_quadmask_b32, s_quadmask_b64 and s_bitreplicate_b64_b32 to pixel_aot
for numeric SGPR values.
The quad masks take the OR of each four-bit group and set SCC from the complete
result. The b64 result keeps all sixteen quad bits in bits 15:0 and writes zero
to the high word, matching the measured RDNA2 words. Bit replication expands
each source bit into two adjacent bits and preserves SCC. Reads occur before
destination writes, so a destination may overlap the source.
The fixture covers sparse and alternating patterns, zero, the all-set word,
bits 0 and 31, both result words and both incoming SCC values. Negative
references cover AND-within-group, the missing second copy, the wrong source
word, a quad placed in the high destination word and recomputed SCC.
GitHub searches for the three exact mnemonics found no open issue or pull
request.
Verification
The final local commit is
b93399de22.The 37-case fixture passed in development and Release on WARP
10.0.26100.10068 and AMD Radeon RX 9060 XT driver 32.0.32029.2010.
Every positive draw matched all 4,096 pixels and 16,384 channels bit for bit,
and every negative control reported pixel_mismatch. Windows build
26300.10075, D3D12 debug layer unavailable, no skipped tests.
Release used MSVC 19.52.37029.0, CMAKE_CXX_FLAGS_RELEASE=/O2 /Ob2 /DNDEBUG
and a separate build directory.
Form coverage moved gfx1013 from 142 to 145 of 1,968 forms. gfx1030 moved
from 138 to 141 of 1,863.
The local pixel_aot_check.py binary check could not run because the
downloaded out/llvm-check/ucrt64/bin/llvm-mc.exe exits with
Permission denied before processing its options. An LLVM 23 disassembler
check accepted all three instruction encodings, but the full LLVM
assembler/object-copy round trip remains for CI or a host where llvm-mc is
executable.
Evidence and follow-up
The source-built fixture uses synthetic constants under the repository's MIT
license. The independent semantic reference is Leonida at 4eb6155d, checked
against the RDNA2 scan of the AMD instruction-set reference. TomBox at 2be7211
was also inspected and contained explicit bitset cases, but no direct quadmask
or bitreplicate case at that revision.
AI-assisted: yes.
Checklist