Mesh: lower s_cmp_le_u32, v_cmpx_ne_u32 and v_cmpx_lt_u32 (Part of #3703) #3715

Manually merged
github merged 3 commits from github-bot/gh-3713 into main 2026-12-01 11:23:12 +00:00 AGit
Owner

@⁠SimSalabimse on GitHub · 2026-12-01 08:57 UTC · original
SimSalabimse:local/mesh-scmp-cmpx → main · +153 −1 · 2 files · 3 commits · merged 2026-12-01 11:20 UTC

Part of #3705 (the s_cmp_le_u32 and v_cmpx_ne_u32 items, plus v_cmpx_lt_u32).

The native mesh frontend now lowers s_cmp_le_u32 (SOPC, SCC = icmp ule), v_cmpx_ne_u32, and v_cmpx_lt_u32 (both EXEC-only writes, no VCC), next to the existing v_cmpx_eq_u32 path. v_cmpx_lt_u32 uses icmp ult. It was seen as the next wall in a game run.

Source-built fixtures in tests/native_direct_mesh_check.py cover equal, less, and greater pairs, the unsigned wrap cases (0 vs all-ones, and the reverse), and a self-compare that gives an empty EXEC, for both s_cmp_le_u32 and v_cmpx_lt_u32. s_cmp_le_i32 and v_cmpx_lt_i32 stay refused.

Linux g++ 13.3 and clang++ 18.1 pass with -Werror=narrowing. native_direct_mesh is a Windows-only dxc test and has not been run on Windows yet, so this is a draft until the Windows test PC run passes.

This sits beside #3668, which adds v_cmpx_eq_i32 and v_cmpx_lt_f32 only. If that one merges first, this may need a trivial rebase.

AI-assisted (Cursor)

**@⁠SimSalabimse** on GitHub · 2026-12-01 08:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3713) `SimSalabimse:local/mesh-scmp-cmpx` → `main` · +153 −1 · 2 files · 3 commits · merged 2026-12-01 11:20 UTC Part of #3705 (the s_cmp_le_u32 and v_cmpx_ne_u32 items, plus v_cmpx_lt_u32). The native mesh frontend now lowers s_cmp_le_u32 (SOPC, SCC = icmp ule), v_cmpx_ne_u32, and v_cmpx_lt_u32 (both EXEC-only writes, no VCC), next to the existing v_cmpx_eq_u32 path. v_cmpx_lt_u32 uses icmp ult. It was seen as the next wall in a game run. Source-built fixtures in tests/native_direct_mesh_check.py cover equal, less, and greater pairs, the unsigned wrap cases (0 vs all-ones, and the reverse), and a self-compare that gives an empty EXEC, for both s_cmp_le_u32 and v_cmpx_lt_u32. s_cmp_le_i32 and v_cmpx_lt_i32 stay refused. Linux g++ 13.3 and clang++ 18.1 pass with -Werror=narrowing. native_direct_mesh is a Windows-only dxc test and has not been run on Windows yet, so this is a draft until the Windows test PC run passes. This sits beside #3668, which adds v_cmpx_eq_i32 and v_cmpx_lt_f32 only. If that one merges first, this may need a trivial rebase. AI-assisted (Cursor)
Accept s_cmp_le_u32 in the mesh scalar ALU so SCC is the unsigned
<= result, and narrow EXEC for v_cmpx_ne_u32 the same way as
v_cmpx_eq_u32. On this target CMPX writes EXEC only.

AI-assisted (Cursor)

Co-authored-by: SimSalabimse <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:59:11 +00:00
github-bot changed title from Mesh: lower s_cmp_le_u32 and v_cmpx_ne_u32 (Part of #3703) to Mesh: lower s_cmp_le_u32, v_cmpx_ne_u32 and v_cmpx_lt_u32 (Part of #3703) 2026-12-01 09:05:15 +00:00
Replace EXEC with the unsigned less-than predicate. The compare does
not write VCC or an SGPR destination. v_cmpx_lt_i32 stays refused.

AI-assisted (Cursor)

Co-authored-by: SimSalabimse <[email protected]>
Allow DXC's -1 rendering for 0xFFFFFFFF while keeping the fixture IR's
4294967295 spelling and preserving operand order in compare checks.

AI-assisted (Cursor)

Co-authored-by: SimSalabimse <[email protected]>
Author
Owner

@⁠SimSalabimse on GitHub · 2026-12-01 09:53 UTC · original

Tested on the Windows test PC at head d60a1f7a, dev preset.

native_direct_mesh passed, including the new s_cmp_le_u32, v_cmpx_ne_u32 and v_cmpx_lt_u32 cases (wrap-case asserts now accept DXC's -1 spelling).

WARP/CPU ctest -R mesh (excluding _hardware and the real-device audio tests), -j 6: 122/122 passed.

Hardware mesh was 78/78 at 7ed70cc5 (same lowerer; this commit is test-only).

AI-Assisted

**@⁠SimSalabimse** on GitHub · 2026-12-01 09:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3713#issuecomment-7307345887) Tested on the Windows test PC at head d60a1f7a, dev preset. `native_direct_mesh` passed, including the new `s_cmp_le_u32`, `v_cmpx_ne_u32` and `v_cmpx_lt_u32` cases (wrap-case asserts now accept DXC's `-1` spelling). WARP/CPU `ctest -R mesh` (excluding `_hardware` and the real-device audio tests), `-j 6`: 122/122 passed. Hardware mesh was 78/78 at `7ed70cc5` (same lowerer; this commit is test-only). AI-Assisted
github manually merged commit 0d6fb31743 into main 2026-12-01 11:23:12 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-01 11:20 UTC · original · approved these changes

Reviewed the CMPX EXEC intersection and unsigned scalar comparison. Integrated native_direct_mesh passed locally, including the comparison and destination controls.

**@⁠R0Y00** on GitHub · 2026-12-01 11:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3713#pullrequestreview-6130201191) · **approved these changes** Reviewed the CMPX EXEC intersection and unsigned scalar comparison. Integrated native_direct_mesh passed locally, including the comparison and destination controls.
This discussion has been locked. Commenting is limited to contributors.
No description provided.