feat: implement v_div_fixup_f16 in Python, Rust rdna2-ref, and HLSL #605
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/605"
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 LooperSalty/AnyXboxX. Originally posted by mahmudintaginting2024 on 2026-12-01T17:38:39Z.
Change
Implements
v_div_fixup_f16(VOP3 opcode0x35F) across the Python reference interpreter, the Rust reference interpreter (anyxboxx-rdna2-ref), and the integer-only HLSL/DXIL recompiler.Per AMD's "RDNA 2" Instruction Set Architecture Reference Guide (30 Nov 2020, SHA-256
22aec03f..., section 12.12, VOP3 863, printed p. 183;OPSELsupport per section 6.2.5 Table 21, printed p. 44):S2NaN (quieted),S1NaN (quieted),0/0andinf/inf(0xFE00),x/0andinf/y(sign_out ? -INF : +INF),x/infand0/y(sign_out ? -0 : +0), and normalsign_out ? -abs(S0) : abs(S0).op_sel[0..2]source half selection,op_sel[3]destination half write (preserving the other 16 bits),abs/neg, andclamp([0, 1]); refusesomodand high-half constants by name like the otherf16convops.Files changed:
PrototypeScarlett/emu/rdna2_exec_f16conv.py: adddiv_fixup_f16and registerv_div_fixup_f16inOPERATIONS,CLAMP_SATURATES, andDESTINATION_HIGH.PrototypeScarlett/emu/rdna2_hlsl_f16conv.py: add integer-onlyF16DivFixup(uint s0, uint s1, uint s2)helper and template.crates/anyxboxx-rdna2-ref/src/f16conv.rs: adddiv_fixup_f16, register inspec(), and add Rust unit testdiv_fixup_f16_handles_specials_and_quotient_sign.crates/anyxboxx-report/data/rdna2-coverage.txt: regenerated viapython tests/test_rust_traduction_parity.py.tests/test_rdna2_exec_f16conv.py,tests/test_rdna2_hlsl_f16conv.py,tests/test_rdna2_ref_f16conv_parity.py: unit tests for all branches/modifiers, wave32/wave64 GPU & WARP parity, and Python vs Rust parity (including seeded random programs).Verification
Oracle and test data
ANYXBOXX_GPU=warp), plus vertex and pixel shader compilation.test_rdna2_ref_f16conv_parity.py).test_div_fixup_f16_special_cases_and_modifiersfails withUntranslatedonmainand passes with this change.Checklist
E_NOTIMPL), never a fake success.1900+band (1,984 tests;test_readme_sync.pypasses).Note: Co-authored with Gemini Neon (AI assistant).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.