Skip to content

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

Done

Description

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.

Activity

  1. MasterDomino commented on Nov 27, 2026

    @MasterDomino
    Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions