Add ceil, exp2 and log2 to the depth-mask translator #1370
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1377"
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-24T09:47:41Z.
Change
The shader depth-mask translator accepts three more one-source binary32 forms:
v_ceil_f32,v_exp_f32andv_log_f32(also in the plain_e64spelling), lowering toceil,exp2andlog2. They join the table added in #1302. This work is AI-assisted.Verification
python3 -B tests/depth_mask_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM.so.19.1: passes (exit 0). It assembles each form (e32 and e64 spelling), pins the lowered HLSL line, swaps that one instruction word for every other form, and rejects source modifiers, clamp, output modifiers, a second source, an unwritten source and a missing operand.tools/depth_mask_aot.pyfrom origin/main the same test fails withValueError: Unsupported depth instruction: v_exp_f32_e32.python3 -B tests/rdna2_tools_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py: pass.depth_mask_unary_draw_warp), no Windows host here. LLVM 15 was not run.Evidence and follow-up
math.ceilon4 * (v7 - 0.5). Exp2 and log2 are not claimed to be bit-exact: they get inputs with an exact integer result (exp2(5) = 32, log2(32) = 5) through a zero the compiler cannot prove, the result is rounded to the nearest integer, then scaled by v7.--preset pr:depth_mask_unary_draw_warp.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:50:59Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
6518a75adc7f9f91bf26ada1c29d91bf79131ac0:--preset dev):offscreen_checkbuild3.60s;ctest --preset dev -R '^depth_mask_.*_warp$' --parallel 4 --no-tests=error --output-on-failure: 4/4 passed (depth_mask_draw_warp1.39s,depth_mask_cmpx_draw_warp1.99s,depth_mask_ops_draw_warp3.16s,depth_mask_unary_draw_warp5.73s)/O2(--preset release):offscreen_checkbuild0.97s;ctest --preset release -R '^depth_mask_.*_warp$' --parallel 4 --no-tests=error --output-on-failure: 4/4 passed (depth_mask_draw_warp1.33s,depth_mask_cmpx_draw_warp1.83s,depth_mask_ops_draw_warp2.85s,depth_mask_unary_draw_warp5.23s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:51:11Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
6518a75ℹ️ 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.