shader: lower u32 add, max, or and xor in the compute store profile #1076
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1083"
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-24T00:29:31Z.
Change
Adds four unsigned 32-bit VOP2 operations to the compute store profile's integer ALU subset:
v_add_nc_u32_e32,v_max_u32_e32,v_or_b32_e32andv_xor_b32_e32. They follow the existingv_min_u32_e32andv_and_b32_e32path: known-word sources, inline HLSL expression, no write to vcc. The docs table is updated, and the rejection controls that usedv_max_u32andv_or_b32as examples now usev_max_i32andv_xnor_b32.Refs #721 (step 4, arithmetic subset).
Verification
python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passes with the change.tools/compute_store_aot.pyfrom main: fails withUnsupported compute instruction: v_add_nc_u32_e32 v2, 7, v1.python3 -B tests/rdna2_tools_check.py: 97 tests, OK (skipped=8).tests/pixel_aot_check.py binaryfails locally under LLVM 19 onv_cvt_f16_i16_e32; that file is untouched here.Evidence and follow-up
New fixture
read_vop2chains add, or, xor and max and checks the exact lowered HLSL expression. This checks the translation text only. It is not a hardware or console result.AI-assisted change.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:33:13Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
5c7e4dd65fℹ️ 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 R0Y00 on 2026-11-24T00:50:55Z.
Review: CHANGES_REQUESTED
The LLVM 15 binary suite and the surrounding Windows compute fixture ran locally. I see why the indexed-copy oracle cannot check the new arithmetic. Please give this candidate a dedicated chained arithmetic readback with an independent CPU reference. Use inputs that show add wrap, high-bit XOR/OR and unsigned max choosing both operands, and a wrong max/signed or dropped-op control that changes a specific output word. This can reuse the existing 320-word case format.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T01:05:13Z.
Review: APPROVED
The dedicated readback now runs in the guard-read entries. I reran both Windows Release entries on RTX 4060 Laptop and WARP at
4c3c11b1. All normal buffers matched and the independent alternative references caught the arithmetic and range errors while preserving the sentinel words. This clears my previous readback request.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:29:47Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
5c7e4ddℹ️ 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 tedin7 on 2026-11-24T00:56:53Z.
Added the dedicated readback (read_vop2 is back in the runtime list and has its own handler, not the indexed-copy oracle).
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:33:13Z.
Code review location:
tests/compute_store_check.py; line 781When the Windows
draw-guard-readmode consumesALU_CASES,draw()routesread_vop2todraw_read(). That handler usesread_words(), which expects an indexed copy (source_word(2 * gid + 1)), not the new arithmetic result. With the harness constants, lane 0 expects0x8b06bba2while the emitted expression yields0xdffd2ae8, so the first nonempty dispatch fails the existingcompute_store_aot_guard_read_*tests even when lowering is correct. Add a matching runtime reference and handler, or keep this text-only fixture separate from the runtime case list.Useful? React with 👍 / 👎.