Repository navigation
fix(shader): quiet signaling NaN halves in v_pack_b32_f16 in IEEE mode - #2042
Conversation
3a3b82c to
77cc1da
Compare
|
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
No title was run. 🤖 Addressed by Claude Code |
With IEEE_MODE=1 the hardware quiets each signaling NaN half that v_pack_b32_f16 packs, after neg and abs; with IEEE=0 it copies the bits. The recompiler always copied them. Same rule as boykopovar#1867, measured on gfx1036 in both modes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Rebased onto current |
77cc1da to
e1f81ab
Compare
…f16-snan fix(shader): quiet signaling NaN halves in v_pack_b32_f16 in IEEE mode
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