cpp-migration: lower v_cvt_pk_u16_u32 and v_cvt_pk_i16_i32 in the direct C++ compute path #2995

Closed
opened 2026-11-27 03:39:28 +00:00 by github-bot · 1 comment
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-27 03:37 UTC · original

Target branch cpp-migration. Part of #2935 (instruction coverage: integer ALU). I am taking this; please say if you already have it locally and I will drop it.

Gap: the direct compute path refuses v_cvt_pk_u16_u32 and v_cvt_pk_i16_i32 with direct DXIL lowering for <name>. I found this with the same per-opcode VOP3 probe as #2985, on cpp-migration 05438d65. gfx2hlsl.py lowers both in its VOP3 table:

  • v_cvt_pk_u16_u32: min(S0, 0xffff) | min(S1, 0xffff) << 16.
  • v_cvt_pk_i16_i32: each source clamped to [-32768, 32767] as a signed value, then packed as 16 bits.

It refuses a nonzero unused SRC2 field.

Plan:

  • The same expressions, with unsigned and signed compares.
  • Modifiers stay refused, as for the other integer VOP3 forms.
  • A nonzero SRC2 field is refused, as in gfx2hlsl.py.
  • Fixture: a source-built dispatch whose per-lane operands cross both bounds (0, 0xffff, 0x10000, 0xffffffff, -32768, -32769, 32767, 32768) against a CPU reference. References that truncate instead of saturating, or that use the unsigned bound for the signed form, must differ. A SRC2-field control is refused.

AI-assisted.

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-27 03:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2995) Target branch `cpp-migration`. Part of #2935 (instruction coverage: integer ALU). I am taking this; please say if you already have it locally and I will drop it. **Gap:** the direct compute path refuses `v_cvt_pk_u16_u32` and `v_cvt_pk_i16_i32` with `direct DXIL lowering for <name>`. I found this with the same per-opcode VOP3 probe as #2985, on `cpp-migration` `05438d65`. `gfx2hlsl.py` lowers both in its VOP3 table: - `v_cvt_pk_u16_u32`: `min(S0, 0xffff) | min(S1, 0xffff) << 16`. - `v_cvt_pk_i16_i32`: each source clamped to [-32768, 32767] as a signed value, then packed as 16 bits. It refuses a nonzero unused SRC2 field. **Plan:** - The same expressions, with unsigned and signed compares. - Modifiers stay refused, as for the other integer VOP3 forms. - A nonzero SRC2 field is refused, as in `gfx2hlsl.py`. - Fixture: a source-built dispatch whose per-lane operands cross both bounds (0, 0xffff, 0x10000, 0xffffffff, -32768, -32769, 32767, 32768) against a CPU reference. References that truncate instead of saturating, or that use the unsigned bound for the signed form, must differ. A SRC2-field control is refused. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:39:28 +00:00
Author
Owner

@⁠MasterDomino on GitHub · 2026-11-27 04:35 UTC · original

Completed by #2996, merged into cpp-migration as 4701650d. Merges into a non-default branch do not close issues automatically.

**@⁠MasterDomino** on GitHub · 2026-11-27 04:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2995#issuecomment-7209929468) Completed by #2996, merged into `cpp-migration` as 4701650d. Merges into a non-default branch do not close issues automatically.
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#2995
No description provided.