shader: admit s_max_u32 and v_mul_hi_u32 in the mesh frontend #3445
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3445"
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-29T09:16:22Z.
Part of #3416
Branch
shader-mesh-udiv-ops, head0f84c3ac, based on main1a0120ba. One commit:0f84c3acmesh: admit s_max_u32 and v_mul_hi_u32 in the native frontendFiles:
src/gfx1013_direct_mesh.inl,tests/native_direct_mesh_check.py.What changes
The shared compute translator already lowers both ops, and the native mesh frontend refused them as unsupported (line numbers at the branch head):
s_max_u32: select on unsigned strictS0 > S1, with SCC set to that compare (src/gfx1013_direct_compute.inl:4134-4146).v_mul_hi_u32: 16-bit partial products, without the signed correction (:4160-4171).In
src/gfx1013_direct_mesh.inl:s_max_u32to the scalar ALU list.v_mul_hi_u32to the VALU list, with that list's existing condition and partial-write handling.Evidence
On this head (base
1a0120ba): configure, buildcompile_dxil, thenResult:
native_direct_meshPassed.Tests:
v-mul-hi-u32ands-max-u32are accepted fixtures whose result reaches POS0.x.assert_position_xfollows the exported value back throughuitofpto the op that produced it.Mutation on this head, reverted afterwards:
v_mul_hi_u32from the mesh VALU list (:1104)native compute +0x18: unsupported mesh instruction or EXEC state: v_mul_hi_u32Mutations on previous revisions (same source change, same two fixtures), not repeated on this head:
s_max_u32from the mesh scalar listd58a9f63native compute +0x24: unsupported mesh instruction or EXEC state: s_max_u32s_max_u32ingfx1013_direct_compute.inl212d4b5fassert 'icmp ugt i32' in textv_mul_hi_u32takes the signed correction ingfx1013_direct_compute.inl212d4b5fassert_position_x(text, r'add i32')Not covered
v_mul_hi_u32check sees only the last op before POS0.x:add i32for the unsigned path,sub i32for the signed correction. The partial-product sequence and the numeric result are not checked. A signed lowering that still ended inadd i32would pass.s_max_u32position regex accepts both signed and unsigned selects. Theicmp ugt i32substring is what separates them, and nothing ties that compare to the select.s_max_u32is not read by any case. A tie, where>and>=give different SCC values, is not tested.CI
On main
1a0120batheprtest preset filter inCMakePresets.jsondoes not matchnative_direct_mesh, and theprbuild preset does not listcompile_dxil.Build and test on Windowsdoes not exercise this change.Interactions with our other open mesh branches
This branch touches the same two files as #3439 (
f74eacc8) and the same test file as #3438 (0feac9c2). Bygit merge-tree --write-treeat these heads:src/gfx1013_direct_mesh.inl, on the scalar ALU name list. This branch addss_max_u32on the line where #3439 addss_sub_i32 || s_mul_hi_u32. The resolution is the union.tests/native_direct_mesh_check.pymerges automatically.shader-mesh-exec-widen(958d341e): cleanshader-mesh-exchange-nosave(08cf44c8): cleanThe combinations were not built. Whichever of this branch and #3439 merges second needs a rebase.