feat(shader): implement v_div_fixup_f16 #438
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/438"
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 boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-03T07:21:18Z.
What
v_div_fixup_f16(VOP3 0x35f) threw "VOP3 opcode is not implemented". Found by the ISA coverage sweep.It is translated on the raw half bits (no f32 round trip), with this behaviour measured on RDNA2 hardware:
sign = sign(src1) ^ sign(src2).src2, else NaNsrc1: returned quieted (bit 9 set, sign and payload kept).0xfe00(the default NaN has the sign bit set).src1 == 0or|src2| == inf: signed infinity.|src1| == inforsrc2 == 0: signed zero.sign | |src0|, except a NaNsrc0, which gives a signed infinity.op_sel(sources and destination half),absandnegwork as for the other f16 ternaryops; the other half of the destination is kept.
Tested
DivFixupF16(32 lanes, expected values captured on an RDNA2 GPU, Radeon 660M): eight formscovering low/high source halves, high destination half, abs/neg, swapped operands and literal operands, with
inputs drawn from zeros, infinities, quiet and signalling NaNs, denormals and random halves. A Python model matched
the 256 test values and a further 16384 random values on hardware before the C++ was written.
src0passed through ("mixed halves"), default NaN0x7e00("mixed halves"), NaN not quieted ("neg denominator").
ctest: 129/130. The failure isagc_driver_pixel_helper_lanes(wave64 case) on thismachine's RADV, and it fails the same way on
mainwithout this change.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-03T07:21:41Z.
Progress report (
926906e→c23ead6)📈 GPU shader instructions: 65.78% (+0.09%, +1 implemented instructions)
✅ 1 implemented
V_DIV_FIXUP_F16