shader: lower gfx1013 v_frexp_mant_f32 and v_ldexp_f32 in pixel_aot #310
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!310
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/310/head"
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?
@alexander-src on GitHub · 2026-11-21 21:44 UTC · original
alexander-src:shader/frexp-ldexp-pixel-aot→main· +166 −2 · 3 files · 2 commits · merged 2026-11-22 04:28 UTCChange
Lower
v_frexp_mant_f32(in both_e32and_e64encodings) andv_ldexp_f32intools/pixel_aot.py(3 gfx1013 forms).Both lower through explicit IEEE-754 binary32 bit helpers (
frexp_mant32andldexp32) inPREAMBLEso subnormals, signed zero, infinity, NaN, round-to-nearest-even underflow, and extreme exponent deltas do not depend on desktop driver flush-to-zero behavior.v_frexp_mant_f32joins the existingALUpath with source modifiers andclamp;v_ldexp_f32decodessrc0as float (accepting-,|x|,abs(...)), decodessrc1as a signed 32-bit integer (rejecting float modifiers), and supportsclamp.Add control, binary assembly/disassembly, and D3D12 draw fixtures in
tests/pixel_aot_check.py, plus documentation indocs/experiments.md.Verification
Commit
cd1055fon Linux x86_64 (Python 3.14, LLVM 23.1, g++):python3 -B tests/pixel_aot_check.py binary llvm-mc llvm-objcopy libLLVM.so: passed (assembles both new fixtures forgfx1013, extracts, disassembles, lowers, and matches source lowering).g++ -std=c++17 -O2 -Wall -Wextra -Werror) offrexp_mant32andldexp32extracted directly frompixel_aot.PREAMBLEagainststd::frexpandstd::ldexp: 21/21frexp_mant32cases and 588/588ldexp32pairs (including+0,-0, subnormals, normal/subnormal tie boundaries,INT32_MIN/INT32_MAXdeltas,+/-Inf, andNaN) matched bit-for-bit (asuint).main:tools/pixel_aot.py: rejectedv_frexp_mant_f32_e32(Unsupported instruction 20) andv_ldexp_f32(Unsupported instruction 21).python3 -B tests/docs_links_check.py,tests/bidi_controls_check.py,tests/rdna2_tools_check.py(26 ran, 1 skipped withoutLLVM_LIB), and the 5 non-iced_x86checks intests/form_coverage_check.py: all passed.offscreen_check.exeD3D12 draws locally because this environment is Linux without MSVC/DXC/Windows;check_frexp_ldexp_draws()will execute under the Windows CI job.Evidence and follow-up
All fixtures are synthetic AMDGPU assembly programs authored inline in
tests/pixel_aot_check.pyunder the repository's MIT license. Semantics follow the AMD RDNA Shader ISA reference.This shares the
int_operand()helper with #306 and #308; whichever lands later will need a small rebase.Checklist
AI-assisted: yes.
@R0Y00 on GitHub · 2026-11-21 21:58 UTC · original
At
cd1055fthe merge conflicts are intests/pixel_aot_check.py. Keep both exponent boundary controls and the landed arithmetic cases.@alexander-src on GitHub · 2026-11-21 22:20 UTC · original
Rebased onto
main(6ee2406) ina51742b, preserving both exponent boundary fixtures alongside all landed scalar64,v_cvt_f32_f16, andfmaak/fmamkcontrols. Updatedint_operand()to reusescalar_u32()identically to #306 and #308.@R0Y00 on GitHub · 2026-11-22 02:56 UTC · original
A test merge of
a51742bagainst main conflicts indocs/experiments.md,tests/pixel_aot_check.pyandtools/pixel_aot.py. Reconcile with #306’sint_operandand retain its comparison draws along with your exponent-boundary controls. Please refresh the branch and rerun the relevant fixture and Windows CI.@R0Y00 on GitHub · 2026-11-22 04:24 UTC · original
I resolved the conflicts with #306 and #308 on your branch at
04790b3. The combined pixel_aot_hardware test passed in 58.50 s and pixel_aot_warp in 11.58 s locally. Hardware is close to its 60 s limit, consistent with the measurements in #448. Auto-merge is enabled while CI tests this head.