shader: lower s_lshl1_add_u32 and s_lshl4_add_u32 in gfx2hlsl (Part of #1723) #2020
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2027"
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 tedin7 on 2026-11-24T23:27:02Z.
Part of #1723
What this unblocks: Run 20 census #16 (40/32 pairs).
Lowers
s_lshl1_add_u32..s_lshl4_add_u32intools/startup/gfx2hlsl.py:D = (S0 << N) + S1, with SCC set to the carry out of the wide sum (bits shifted out of S0 count too). SCC is emitted before the destination write, so an in-place destination keeps the right sources. Lane-mask and descriptor-data operands are refused, as for the other SCC-from-word scalar ops.Verification (commands executed locally):
python3 -B tests/startup_gfx2hlsl_s_lshl_add_check.py: all ok (4 ops x 10 operand forms x 1824 value pairs, plus mask refusals). Copied onto a detachedorigin/maintree it fails (rc=1) for all four ops.startup_gfx2hlsl_b64_shift_check.py,startup_gfx2hlsl_bit_alu_check.py,startup_gfx2hlsl_lane_alu.py,startup_gfx2hlsl_scalar_m0_check.py,startup_gfx2hlsl_sop2_complement_check.py.startup_gfx2hlsl_s_lshl_add.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:31:30Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
d2f0e1df19ℹ️ 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".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:27:16Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
d2f0e1dℹ️ 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.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:53:55Z.
The maintainer update resolves the conflict with #2024 and rejects the discard destination for all four shift-add opcodes. Both new SCC producers now use the current uniformity-aware setter. Tests cover a varying source and the discard encoding, and the existing readfirstlane, complement/pack and bit-test cases passed after combining with main. The shift-and-add result and carry agree with the RDNA 2 SOP2 reference.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:31:30Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1748For a shader containing
s_lshl1_add_u32 null, 1, 1(SDST 125), these entries now enterscalar(), whose destination write indexesreg_range('null')even though it returnsNone. Using the source-built pipeline fixture,translate_to(..., check=False)returns an unsupported result and writes.failon the parent, but raises an uncaughtTypeErrorhere for all four opcodes. The request loop inmain()does not catch that exception, so one such shader aborts the remaining cache translations. Handle the discard destination, or reject unsupported destination kinds withUnsupportedbefore reaching the generic scalar writer.Useful? React with 👍 / 👎.