fix(shader): quiet signaling NaN halves in v_pack_b32_f16 in IEEE mode #2042
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2042"
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 CouchRiv on 2026-10-09T05:44:41Z.
What
Part of #981, a follow-up to #1867. In a shader with
IEEE_MODE=1,v_pack_b32_f16returns a signaling NaN half unchanged:The hardware quiets each signaling NaN half it packs (after
negandabs) when IEEE=1, and copies the bits when IEEE=0. This is the rule #1867 measured for the unary instructions. The recompiler always copied the bits.vPackB32F16now passes each NaN half throughquietNan16. IEEE=0, and shaders without a known float mode, behave as before.0x7c01,0x7dff7dff7c017fff7e010x0000,0xfd23fd230000ff2300000x7c01,0x7fff(op_sel, high halves)7fff7c017fff7e01-0x7c01,|0x7dff|7dfffc017ffffe01Which title needs it
No known title needs it yet. It extends the rule #1867 measured to one more instruction, and it only changes shaders running with IEEE=1, which titles we know do not use (they use 0xc0, IEEE=0).
Tested
CachyOS Linux, GCC 16.2, RTX 4070 Ti (NVIDIA 615.71) and Radeon 610M (RADV, Mesa 26.2.4). Measured on RDNA2 (gfx1036) with the HW oracle.
agc_driver_vop3_pack_ldexpgets a second shader: 4 forms ofv_pack_b32_f16(plain, op_sel, neg/abs) × 32 rows of signaling, quiet and ordinary halves. It runs with no mode, IEEE=0 and IEEE=1 and checks the hardware tables bit for bit. The hardware gave the same results with DX10 clamp on or off and f32 denormals kept or flushed.lane 0 IEEE=1 v_pack_b32_f16 v10, v4, v5 is 0x7dff7c01, expected 0x7fff7e01.check_conventions.pyandgit diff --checkpass.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:24:11Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
77cc1da2, merged ontomaind70b8998in one build with 33 other AGC/shader PRs that had no Windows run.agc_driver_vop3_pack_ldexp. None of them reported skipping a case.PATHsetup.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:56:41Z.
Rebased onto current
main(mechanical conflict indocs/dev/TechnicalDebt.mdafter #2000; your sentence aboutv_pack_b32_f16is kept in the "Signaling NaN inputs" entry). The code and test are unchanged. The earlier red linux/windows jobs wereagc_shader_fusion_testsfailing to findspirv/unified1/spirv.hpp, whichmainfixed in37bc6f2e7; unrelated to this PR. Full build and ctest on the rebased head: 630/630 pass, includingagc_driver_vop3_pack_ldexp. Merging once CI is green.