Native compiler: lower 32-bit bit counts and scans in the direct compute path #3050
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#3050
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?
@pigalot on GitHub · 2026-11-27 11:35 UTC · original
Part of the instruction-coverage item of #2935. Target branch
main(cpp-migration merged in #3039).Gap. The direct C++ compute path refuses the 32-bit bit counts and bit scans with
direct DXIL lowering for <name>:s_bcnt0_i32_b32ands_bcnt1_i32_b32s_ff0_i32_b32ands_ff1_i32_b32s_flbit_i32_b32ands_flbit_i32v_ffbl_b32,v_ffbh_u32andv_ffbh_i32gfx2hlsl.pyandtools/pixel_aot.pyalready lower them. They agree on these rules:ffbh/flbitcount from bit 31.Measured. I ran
compile_dxil --refusals(counts only) atmain98007de5on a local start-up capture of 2,689 compute requests. 12 of them stop first at one of these names:s_bcnt1_i32_b325,s_ff1_i32_b323,v_ffbl_b323 andv_ffbh_i321.Proposed.
Countbits,FirstbitLo,FirstbitHiandFirstbitSHi.FirstbitHiandFirstbitSHialready count from bit 31, asdxcshows: HLSLfirstbithighcompiles to31 - FirstbitHi.I am taking it, and the PR follows. This issue was AI-assisted.