diff options
| author | whoalin1 <207920491+whoalin1@users.noreply.github.com> | 2026-11-24 23:42:02 +0200 |
|---|---|---|
| committer | Man Alin <whoalin414@gmail.com> | 2026-11-30 22:21:36 +0000 |
| commit | 51b0b9d34095cb2441fc50204612313a3d592370 (patch) | |
| tree | a2aaa6beabbde4da510bb34c126c7c071d72fb63 /runtime/src/xma2_decoder.cpp | |
| parent | b1f91c2f938fa9f4e082d612f412a0c57a8e3b87 (diff) | |
translator: a VALU data read of a lane-mask operand yields the wave's mask word
A lane mask (EXEC/VCC or a mask-tracked SGPR) that a VALU op reads as a
32-bit value — v_mov_b32 of it into a plain VGPR, or any VALU source
where the mask is data rather than a mask operand — materialized each
lane's own 0 / ~0 bit. Hardware holds the whole wave's mask word there
(tools/crosslane_fuzz.py's op_maskdata model: the uniform word written
to the active lanes), so every lane gets the word, the same in each.
- src_u materializes the wave mask word (lane_mask_word) for SGPR and
EXEC/VCC operands when the instruction's VGPR destination makes the
read a data read (mask_read_is_data); SGPR/EXEC/VCC destinations keep
this lane's bit, which mask_src readers rely on. Mask-holding VGPRs
already store the word, so their reads are plain loads.
- mask_src extracts this lane's bit back out of a mask-holding VGPR
(_vgpr_mask_lane_bit), half-aware in wave64 via mask_half.
- mask_data_src keeps instructions that materialize the word out of
EXEC-gated active runs (a subgroup op can't sit inside if (active)).
- v_readfirstlane_b32 of a mask VGPR broadcasts the first active lane's
copy — the only lane guaranteed fresh after an EXEC-gated v_mov_b32 —
as the word itself into a VGPR destination (VGPR writes are never
mask-tracked), or this lane's bit for a mask-tracked SGPR/special
one; fixes cs_wavemask lanes 48-63.
Found by tools/crosslane_fuzz.py (#293). docs/design.md's whole-wave
mask contract updated.
Co-Authored-By: Devin <noreply@cognition.ai>
Diffstat (limited to 'runtime/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions