shader: lower the binary64 rounding and fraction forms #3865

Closed
github-bot wants to merge 2 commits from gh-pr/3863/head into gh-pr/3863/base
Owner

@⁠lambirou on GitHub · 2026-12-02 15:03 UTC · original
lambirou:shader/f64-rounding → main · +767 −5 · 7 files · 1 commits · closed without merging

Part of the f64 slice (P5).

This adds the ten binary64 rounding/fraction forms: v_ceil_f64, v_floor_f64, v_trunc_f64, v_rndne_f64 and v_fract_f64 in both the VOP1 _e32 and VOP3 _e64 spellings. The lowering works only on the two 32-bit words, with no HLSL double: r64_round covers trunc/floor/ceil/rndne (ties to even), and r64_fract computes x - floor(x) from the significand, with the below-one ceiling for tiny negative fractions. NaN inputs are quieted and infinities become the canonical qNaN, following the existing binary16/binary32 helpers.

Guards: entry EXEC, destination pair v[d:d+1] with d <= 254, no outstanding sample, preserved entry denormal profile; modifiers, clamp/omod, op_sel, DPP, SDWA, inline constants, literals and unproven pairs are refused.

Tests

  • pixel_aot_f64_round_warp and _hardware pass on WARP and the AMD Radeon RX 9060 XT (driver 32.0.32029.2010).
  • The draw covers integral values, exact rndne ties, positive/negative fractions, signed zeros, values above 2^52, subnormals, infinities and NaNs; five mutations each report pixel_mismatch.
  • form_coverage_check.py pins exactly the ten forms; rdna2_tools_check.py passes 162 tests (19 LLVM-dependent skips); the neighbouring draw-cmp-f64, draw-cvt-f64-* and draw-cvt-*-f64 tests still pass on both adapters.
  • Expected delta: +10 forms on gfx1013 and +10 on gfx1030. After the other open PRs and this one: 1,756/1,968 and 1,652/1,863.

Limits

The draws prove the translated shader on desktop adapters, not gfx1013 or the console. NaN quieting and the fract below-one ceiling are chosen from the existing helpers without a console measurement. No LLVM 15 round-trip of the ten forms was run; the spellings are covered by the controls and draws.

AI-assisted.

Merge with origin/main (2026-12-01)

Merged origin/main at a3bfd019 into this branch; head is 9601449e. The shared CMake, docs and test files keep both the #3609/#3623 additions and the PR additions. Local post-merge: pixel_aot_check.py, form_coverage_check.py and rdna2_tools_check.py pass (163 tests, 19 skips); CTest pixel_aot_f64_round_warp and pixel_aot_f64_minmax_ldexp_warp pass.

Replacement for #3645 after an accidental empty-branch push during a rebase; the original branch is restored and the code is unchanged.

**@⁠lambirou** on GitHub · 2026-12-02 15:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3863) `lambirou:shader/f64-rounding` → `main` · +767 −5 · 7 files · 1 commits · closed without merging Part of the f64 slice (P5). This adds the ten binary64 rounding/fraction forms: `v_ceil_f64`, `v_floor_f64`, `v_trunc_f64`, `v_rndne_f64` and `v_fract_f64` in both the VOP1 `_e32` and VOP3 `_e64` spellings. The lowering works only on the two 32-bit words, with no HLSL double: `r64_round` covers trunc/floor/ceil/rndne (ties to even), and `r64_fract` computes x - floor(x) from the significand, with the below-one ceiling for tiny negative fractions. NaN inputs are quieted and infinities become the canonical qNaN, following the existing binary16/binary32 helpers. Guards: entry EXEC, destination pair `v[d:d+1]` with `d <= 254`, no outstanding sample, preserved entry denormal profile; modifiers, clamp/omod, `op_sel`, DPP, SDWA, inline constants, literals and unproven pairs are refused. ## Tests - `pixel_aot_f64_round_warp` and `_hardware` pass on WARP and the AMD Radeon RX 9060 XT (driver 32.0.32029.2010). - The draw covers integral values, exact rndne ties, positive/negative fractions, signed zeros, values above 2^52, subnormals, infinities and NaNs; five mutations each report `pixel_mismatch`. - `form_coverage_check.py` pins exactly the ten forms; `rdna2_tools_check.py` passes 162 tests (19 LLVM-dependent skips); the neighbouring `draw-cmp-f64`, `draw-cvt-f64-*` and `draw-cvt-*-f64` tests still pass on both adapters. - Expected delta: **+10 forms on gfx1013 and +10 on gfx1030**. After the other open PRs and this one: **1,756/1,968** and **1,652/1,863**. ## Limits The draws prove the translated shader on desktop adapters, not gfx1013 or the console. NaN quieting and the fract below-one ceiling are chosen from the existing helpers without a console measurement. No LLVM 15 round-trip of the ten forms was run; the spellings are covered by the controls and draws. AI-assisted. ## Merge with origin/main (2026-12-01) Merged `origin/main` at `a3bfd019` into this branch; head is `9601449e`. The shared CMake, docs and test files keep both the #3609/#3623 additions and the PR additions. Local post-merge: `pixel_aot_check.py`, `form_coverage_check.py` and `rdna2_tools_check.py` pass (163 tests, 19 skips); CTest `pixel_aot_f64_round_warp` and `pixel_aot_f64_minmax_ldexp_warp` pass. Replacement for #3645 after an accidental empty-branch push during a rebase; the original branch is restored and the code is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:04:32 +00:00
github-bot closed this pull request 2026-12-02 15:04:32 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.