shader: lower v_pk_mul_lo_u16, v_pk_mad_u16 and v_pk_mad_i16 in the direct compute path #3090

Closed
opened 2026-11-27 14:57:17 +00:00 by github-bot · 0 comments
Owner

@⁠R0D4X on GitHub · 2026-11-27 14:52 UTC · original

Refs #2935.

The ISA table (src/gfx1013_isa_tables.inl) already decodes VOP3P v_pk_mul_lo_u16 (0x01), v_pk_mad_u16 (0x09), and v_pk_mad_i16 (0x00), and the startup HLSL translator already lowers them, but the direct C++ compute frontend (src/gfx1013_direct_compute.inl) does not lower them yet.

I am taking this slice.

Planned scope

  • Lower VOP3P v_pk_mul_lo_u16, v_pk_mad_u16, and v_pk_mad_i16 in src/gfx1013_direct_compute.inl with full op_sel / op_sel_hi lane selection (op_sel[1:0] / op_sel_hi[1:0] for 2-source mul_lo, op_sel[2:0] / op_sel_hi[2:0] for 3-source mad), wrapping modulo 2^16 when unclamped, and per-lane saturation ([0, 65535] for mad_u16, [-32768, 32767] for mad_i16) when clamp is set.
  • Refuse clamp on v_pk_mul_lo_u16, refuse neg_lo / neg_hi on all three, and refuse op_sel[2] / nonzero src2 on 2-source v_pk_mul_lo_u16.
  • Add tests/native_pk_mul_mad_16_check.py, tests/cmake/native_pk_mul_mad_16.cmake, and docs/experiments/native-pk-mul-mad-16.md covering DXIL compile controls, modifier refusals, EXEC masking, 3-source op_sel/op_sel_hi swizzles, no-clamp negative controls, and native_store_replay hardware readback.
**@⁠R0D4X** on GitHub · 2026-11-27 14:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3090) Refs #2935. The ISA table (`src/gfx1013_isa_tables.inl`) already decodes VOP3P `v_pk_mul_lo_u16` (`0x01`), `v_pk_mad_u16` (`0x09`), and `v_pk_mad_i16` (`0x00`), and the startup HLSL translator already lowers them, but the direct C++ compute frontend (`src/gfx1013_direct_compute.inl`) does not lower them yet. I am taking this slice. ### Planned scope - Lower VOP3P `v_pk_mul_lo_u16`, `v_pk_mad_u16`, and `v_pk_mad_i16` in `src/gfx1013_direct_compute.inl` with full `op_sel` / `op_sel_hi` lane selection (`op_sel[1:0]` / `op_sel_hi[1:0]` for 2-source `mul_lo`, `op_sel[2:0]` / `op_sel_hi[2:0]` for 3-source `mad`), wrapping modulo 2^16 when unclamped, and per-lane saturation (`[0, 65535]` for `mad_u16`, `[-32768, 32767]` for `mad_i16`) when `clamp` is set. - Refuse `clamp` on `v_pk_mul_lo_u16`, refuse `neg_lo` / `neg_hi` on all three, and refuse `op_sel[2]` / nonzero `src2` on 2-source `v_pk_mul_lo_u16`. - Add `tests/native_pk_mul_mad_16_check.py`, `tests/cmake/native_pk_mul_mad_16.cmake`, and `docs/experiments/native-pk-mul-mad-16.md` covering DXIL compile controls, modifier refusals, `EXEC` masking, 3-source `op_sel`/`op_sel_hi` swizzles, no-clamp negative controls, and `native_store_replay` hardware readback.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:57:17 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3090
No description provided.