shader: lower v_ldexp_f64 in the direct compute path #3529
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3529"
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 legacy-code-archaeologist on 2026-11-29T23:23:43Z.
Summary
Lowers
v_ldexp_f64in the direct C++ compute path. It was refused withdirect DXIL lowering for v_ldexp_f64(VOP3 probe, see #3518). The lowering followstools/pixel_aot.py'sldexp32rules, carried over to binary64, and uses 32-bit integer operations only. The module needs no double-precision and no 64-bit integer shader operations, so this does not depend on the approach #3518 settles for binary64 arithmetic.Refs #3518, refs #2935
Tests
tests/native_ldexp_f64_check.py(ir,controls,hardware),tests/cmake/native_ldexp_f64.cmake,docs/experiments/native-direct-ldexp-f64.md. The VOP3 words were assembled with LLVM 15.0.7. The references do not transcribe the algorithm: each is the exactS0 * 2^S1, rounded once by Python's correctly rounded integer division.On
main2ff74a6aplus this change, Windows 10.0.26100:ctest --preset dev --no-tests=error -R '^native_ldexp_f64_' -V:irpassed: 243 cases, 972 words bit for bit through the IR interpreter ofnative_f16_alu_check.py. The cases are 8 readback cases, 3 carry cases (one rounds a subnormal up to 2^-1022) and a seeded sweep of 232.controlspassed: no double, no i64 and no float op in the module; 5 refusals; flushing, truncating, half-away and wrapping-exponent references each differ.hardwareskipped (77). This machine's only D3D12 FL 12_0 adapter does not report SM 6.6 with wave32, so the readback is unmeasured.native_compute_ir_dump, each rebuilt and then restored: dropping the sticky bits, the carry into the high word, or the subnormal normalization each failsir.ctest --preset dev --no-tests=error -R '^native_.*_(controls|ir)$' -j 2: 139/139 passed.EXTRA.AI-assisted: written with Claude Code. I reviewed it and ran the commands above.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by Alexofbulgaria on 2026-11-30T04:13:24Z.
Intel Arc A770 readback passed for
v_ldexp_f64Tested on my Intel Arc A770 (
8086:56a0), driver32.0.101.9175, Windows build26300.10075. Release build with MSVC14.44.35207and DXC1.9.2602.17. I used the repository's synthetic fixtures. Source commit1601d5cc663f7fb4da9ed20789b9590b784ef154.I ran
ctest --test-dir <release-build> --no-tests=error -R '^native_ldexp_f64_(ir|controls|hardware)$' -V. All three tests passed with zero skips.WARP: The same fixture and reference, run with
--direct-warp, skipped with exit 77 at the Shader Model 6.6 and wave32 capability check. WARP arithmetic remains unverified.AI assisted with setup and reporting. The test runs executed locally.