compute: lower s_bcnt1_i32_b64 on a known or runtime SGPR pair #2102
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2109"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T00:34:41Z.
Part of #2022 (item G,
s_bcnt1).tools/compute_store_aot.pylowered onlys_bcnt1_i32_b32 sD, exec_lo.s_bcnt1_i32_b64reached the unsupported-instruction diagnostic. This adds the SGPR-pair form.s_bcnt1_i32_b64 sD, s[lo:hi]writes the number of set bits in both words tosD. The pair must be even-aligned and consecutive, withins0..s105.(countbits(lo) + countbits(hi))and keeps the existing ALU expression size limit.sDis written, sosDmay alias either half of the pair.SCCtosD != 0(AMD RDNA 2 ISA, SOP1). This compute profile has noSCCreader, and a followings_cbranch_scc1stays refused. The test asserts that.sDbeyonds105or pending, and source words that are not verified.exec,vccand immediate 64-bit sources stay unsupported.Tests
The check covers:
sDaliasing the low word;exec,vccand an immediate source;Registered as
compute_alu_bcnt64_controlsand added to the pure-Python lists inAGENTS.mdandwindows.yml. The existing controls incompute_store_check.pyandcompute_lane_mask_check.pystill pass.Negative control: against the previous
tools/compute_store_aot.py, the check fails withUnsupported compute instruction: s_bcnt1_i32_b64 s4, s[4:5].AI-assisted.