cpp-migration: lower v_alignbit_b32, v_alignbyte_b32 and v_bfm_b32 in the direct C++ compute path #2985
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2985
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@legacy-code-archaeologist on GitHub · 2026-11-27 03:14 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 three VOP3 bit operations that
gfx2hlsl.pylowers through its VOP3 table. Each fails in a source-built compute request (v_mov_b32of v1 and v2 from v0, then the VOP3 form on v0, v1 and v2), compiled withcompile_dxil ... gfx1013-direct-cs@0fromcpp-migration05438d65:I found them with a per-opcode probe of every VOP3 name in
gfx1013_isa_tables.inl: 79 are refused, and these three have agfx2hlsl.pylowering and no open issue or PR.Plan: use the
gfx2hlsl.pyexpressions.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], likes_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.
@MasterDomino on GitHub · 2026-11-27 04:35 UTC · original
Completed by #2986, merged into
cpp-migrationas24d92609. Merges into a non-default branch do not close issues automatically.