shader: lower binary32 integer conversions, min and max in the mesh-entry translator #1145
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1152"
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-24T01:48:46Z.
Change
Lowers the binary32 integer-to-float conversions
v_cvt_f32_u32andv_cvt_f32_i32and the binary32v_min_f32andv_max_f32(_e32and_e64) in the mesh-entry translator (tools/mesh_entry_aot.py). A conversion needs a concrete integer word; a float expression as its source is refused. Source modifiers,clampand output modifiers are refused. No related issue.Overlap: #1117 edits the same file and test for add, sub, subrev and mul. This change is separate (different opcodes, separate test mode
draw-cvt-minmaxand ctestmesh_entry_cvt_minmax_draw_*). Whichever lands second needs a mechanical rebase of the adjacent test and CMake lines.Verification
Local, Linux, LLVM 19 (CI uses LLVM 15, not available locally):
python3 -B tests/mesh_entry_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: exit 0 with this change; exit 1 onorigin/mainc205cffdwith the same test file (the translator rejects the new opcodes).tests/mesh_indexed_check.py binaryandtests/mesh_descriptor_swap_check.py binary: exit 0.draw-cvt-minmaxis written for Windows and was not run here (no D3D12 adapter, no dxc). Missing prerequisite: Windows runner.Evidence and follow-up
Test program: four exact words (0xc0000000 and 0x80000000, each read as unsigned and signed) are converted, then clamped by min or max; depth 0.8125. The reference is independent hand arithmetic on exact values, not the lowering. Negative controls: each of the eight opcodes swapped for its sibling gives a different evaluated depth (binary mode) and must report
Mesh export trace mismatch(draw mode); the draw also expects one unit in the last place off in the depth word of the last vertex to be reported. Refusals of modifiers, clamp, omod and a float source are asserted.Not exercised: NaN operands, signed zeros, conversions that need rounding. Fixtures are synthetic, MIT, written from the ISA description.
This work is AI-assisted.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T02:31:33Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
a430e97ℹ️ 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.