Skip to content

shader: accept inline constants in packed binary16 arithmetic and min/max in direct DXIL #3226

Done

Description

Refs #2935 and #3224.

In src/gfx1013_direct_compute.inl, DirectCompute::packed_f16_alu() (v_pk_add_f16, v_pk_mul_f16, v_pk_fma_f16) currently refuses every inline constant except 128 (0) and 255 (literal) with "unsupported packed binary16 arithmetic source", and DirectCompute::packed_minmax() (v_pk_min_f16, v_pk_max_f16) likewise refuses inline binary16 float constants 240..248 and non-zero inline integers 129..208 with "unsupported packed 16-bit min/max source".

As noted on #3224 (Rank 3 follow-on after #3220), shaders using v_pk_*_f16 with inline binary16 float constants (0.5, -0.5, 1.0, -1.0, 2.0, -2.0, 4.0, -4.0, 1/(2*pi)) or inline integers (0..64, -1..-16) hit this refusal.

Scope

  • Accept inline binary16 float constants (240..248, with [31:16] = 0 per gfx1013 hardware) and inline integer constants (128..208, 32-bit sign-extended) in packed_f16_alu() and packed_minmax() (keeping float 240..248 refused on integer v_pk_min_{i,u}16 / v_pk_max_{i,u}16).
  • Keep existing refusals for vcc_lo/vcc_hi, m0, exec_lo/exec_hi, scc, clamp, reserved bits, and non-default FP16 MODE.
  • Add source-built IR, controls, compute, and pixel tests pinning all 9 inline float constants, high-half zeroing (op_sel_hi=1), neg_lo/neg_hi, single-rounding FMA tie witnesses with 0.5, inline integer constants, and kept refusals.

AI-assisted.

Activity

  1. added a commit that references this issue on Nov 28, 2026
    37e76fb
  2. added a commit that references this issue on Nov 28, 2026
    86beae9
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