shader: lower s_bitcmp0_b32 and s_bitcmp1_b32 in gfx2hlsl (Part of #1723) #2024
No reviewers
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!2024
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2024/head"
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?
@tedin7 on GitHub · 2026-11-24 23:26 UTC · original
tedin7:x2w-r20-s-bitcmp→main· +101 −5 · 4 files · 2 commits · merged 2026-11-24 23:50 UTCPart of #1723
What this unblocks: Run 20 census #1 (128/114 pairs).
Lowers
s_bitcmp1_b32ands_bitcmp0_b32(SOPC) intools/startup/gfx2hlsl.py: SCC is set to the tested bit of S0, selected by S1[4:0], being 1 or 0. Nothing else is written.Verification:
python3 -B tests/startup_gfx2hlsl_s_bitcmp_check.pyon the branch:s_bitcmp: ok(216 cases: 6 words x 9 bit indexes x immediate and register forms x both ops, including indexes above 31).origin/mainsources:216 mismatches(every case refused asUnsupported).startup_gfx2hlsl_swap_check.py,startup_gfx2hlsl_sdwa_check.py,startup_gfx2hlsl_operand_count_check.py,startup_gfx2hlsl_op_refusals_check.py.startup_gfx2hlsl_s_bitcmp.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:27 UTC · original · edited 2026-11-24 23:30 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7ea4990ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@ -1751,0 +1757,4 @@raise Unsupported('scalar bit test requires two unmodified operands')if any(self.is_lane_mask(tok) for tok in ops):raise Unsupported('scalar bit test on a lane mask')self.emit('scc = ((%s >> (%s & 31)) & 1u) == %du;' % (self.u(ops[0]), self.u(ops[1]), bit))@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:30 UTC · original
When a source is
exec_lo,vcc_lo, or an SGPR tracked inself.masks,self.u()returns the current lane's projected 0/1 bit rather than the full 32-bit mask. For a fully active wave,s_bitcmp1_b32 exec_lo, 1should set SCC, but the emitted expression evaluates to false because the generatedexecstarts at 1; copying EXEC to an SGPR has the same problem. A subsequent SCC branch or scalar select therefore takes the wrong path, whereas this program was previously refused. Reject lane-mask sources, as the existing word-level scalar handlers do, unless their full mask value can be modeled.Useful? React with 👍 / 👎.
@R0Y00 on GitHub · 2026-11-24 23:43 UTC · original
I pushed a maintainer follow-up for the existing lane-mask finding. It reuses the integer word mask guard, checks direct EXEC/VCC and mask-tagged SGPRs in both operand positions, and documents the CPU-only test. On Windows the 216 scalar cases and 10 refusal controls passed, along with five existing translator checks and docs links. Full-mask SCC remains outside this patch.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:30 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
7ea4990831ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".