Skip to content

cpp-migration: lower v_alignbit_b32, v_alignbyte_b32 and v_bfm_b32 in the direct C++ compute path #2985

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 three VOP3 bit operations that gfx2hlsl.py lowers through its VOP3 table. Each fails in a source-built compute request (v_mov_b32 of v1 and v2 from v0, then the VOP3 form on v0, v1 and v2), compiled with compile_dxil ... gfx1013-direct-cs@0 from cpp-migration 05438d65:

direct DXIL lowering for v_alignbit_b32
direct DXIL lowering for v_alignbyte_b32
direct DXIL lowering for v_bfm_b32

I found them with a per-opcode probe of every VOP3 name in gfx1013_isa_tables.inl: 79 are refused, and these three have a gfx2hlsl.py lowering and no open issue or PR.

Plan: use the gfx2hlsl.py expressions.

  • v_alignbit_b32: bits [S2[4:0]+31 : S2[4:0]] of {S0, S1}; a zero shift returns S1.
  • v_alignbyte_b32: the same with S2[1:0] * 8.
  • v_bfm_b32: ((1 << S0[4:0]) - 1) << S1[4:0], like s_bfm_b32.

Shift amounts stay masked to five bits, so no shift reaches 32. The fixture is a source-built dispatch with per-lane operands that cover shifts 0, 1, 31, values above 31 and every byte count, against a CPU reference, with mutated references as controls (zero shift not special-cased, high and low words swapped).

AI-assisted.

Activity

  1. MasterDomino commented on Nov 27, 2026

    @MasterDomino
    Collaborator

    Completed by #2986, merged into cpp-migration as 24d9260. 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