shader: lower v_frexp_exp_i32_f32 and v_frexp_mant_f32 in the direct compute path #3117
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3117
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3117"
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?
@R0D4X on GitHub · 2026-11-27 15:59 UTC · original
R0D4X:feat/native-frexp-f32→main· +220 −0 · 4 files · 2 commits · merged 2026-11-27 17:48 UTCFixes #3116. Refs #2935.
What this changes
v_frexp_exp_i32_f32(VOP10x3f/ VOP3A0x1bf) andv_frexp_mant_f32(VOP10x40/ VOP3A0x1c0) insrc/gfx1013_direct_compute.inlusing exact 32-bit integer IEEE-754 binary32 manipulation.±0.0,±Inf, andNaN, supports VOP3Aabs/negonsrc0andclamponv_frexp_mant_f32, and refuses unsupported modifier combinations (clamponv_frexp_exp_i32_f32,omod,op_sel, unused VOP3 sources).Tests & docs added
tests/native_frexp_f32_check.py&tests/cmake/native_frexp_f32.cmake:native_frexp_f32_controls: validates emitted integer DXIL (shl i32/lshr i32), refuses invalid modifiers, and verifies that theflush_denormalsandno_clampnegative controls differ.native_frexp_f32_hardware: dispatches 8 binary32 edge cases (±0.0, normals, smallest normal, largest/smallest subnormals,+Inf) across VOP1 and VOP3A (neg,abs+clamp), matching 2048 result words and 16 sentinel guards.docs/experiments/native-frexp-f32.md: experiment note and reproduction commands.Verification
2b5610a910.0.26300.9974), MSVC19.44.35230, Windows SDK / DXC10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver32.0.16.2124).ctest --preset dev --no-tests=error -R '^native_frexp_f32_|^native_ldexp_' -V: 4/4 passed (0 skipped).ctest --preset release --no-tests=error -R '^native_frexp_f32_|^native_ldexp_': 4/4 passed (0 skipped).tests/docs_links_check.py&tests/bidi_controls_check.py: passed.Scope: covers synthetic direct-DXIL compute fixtures for
v_frexp_exp_i32_f32andv_frexp_mant_f32only; does not establish full-game execution.@tedin7 on GitHub · 2026-11-27 17:47 UTC · original · reviewed
Review of
03f6210882(the change from2b5610a9, updated with main; the PR's own diff is unchanged).Code: zero, Inf and NaN keep the input (mantissa op) or give 0 (exponent op). Normal inputs give sign | 0.5 | fraction and exponent - 126. Denormals are normalized with a five-step shift count, so the exponent becomes 1 - steps - 126 and the fraction is the normalized mantissa; I checked both formulas against frexp for a denormal with its top bit at position p (result exponent p - 148). abs/neg on src0 are applied before the split, clamp is refused on the exponent op and clamps the mantissa to [0, 1] (NaN and negative to 0), and omod, op_sel, DPP/SDWA and unused sources are refused. The test reference is computed independently, and the flushed-denormal and no-clamp controls change the expected words. No other open PR covers these two opcodes in the direct compute path.
Windows results are in the comment below.
Commands:
git diff origin/main...pull/3117/head -- src/ tests/(read), plus the Windows commands listed in the comment.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-27 17:47 UTC · original
Windows Server 2025 verification of
03f621088220578ca36846b1e33fec433cc92192(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target compile_dxil native_store_replay;ctest --preset dev -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped)cmake --build --preset release --target compile_dxil native_store_replay;ctest --preset release -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 skipped)<native sweep>= everynative_*test exceptnative_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR (wave lane count 32 requested, WARP offers 4; the test comes from #2955).native_frexp_f32_controlspassed in both presets; the_hardwareleg skips on WARP because it needs a physical wave32 adapter.AI-assisted; commands listed were executed locally.