feat(shader): follow IEEE_MODE in f32 min, max, min3, max3 and med3 #1826
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1826"
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-08T20:39:39Z.
What
Step 3 of #981, IEEE_MODE family:
v_min_f32,v_max_f32,v_min3_f32,v_max3_f32andv_med3_f32follow the shader'sIEEE_MODE(carried by #1816).Measured on RDNA2 (gfx1035) with the hardware oracle over every (a, b, c) combination of ±0, ±1, ±inf, positive/negative denormals, quiet NaNs with and without payload, and signaling NaNs with and without payload (14³ = 2,744 rows × 5 ops), in four modes: IEEE 0/1 × f32 denormals flushed/kept.
mainmainThe existing
agc_driver_f32_min_max_nantable matches the hardware at IEEE=0 (128/128). With IEEE=1, 53 of its 128 rows differ. The test now also runs every row withIEEE_MODE=1against a table captured on the oracle (the same with f32 denormals flushed and kept).TranslateOptions::ieeeMode, fromrequest.context.floatMode, set on eachTranslationContext.ieeeMinMaxF32for the five ops whenieeeMode: per pair, it selects the quieted signaling NaN (bits | 0x400000) before the existingFPMin32/FPMax32, so the emitter and the f16/packed variants that share those IR ops are unchanged. IEEE=0 and unknown modes keep the previous lowering. IEEE=1 with an output modifier throws (the hardware ignores omod at IEEE=1, not measured here).FLOAT_MODE0xc0, which these measurements also show but which belongs to the FLOAT_MODE family.Tested
Linux (CachyOS).
agc_driver_f32_min_max_nanpasses on RADV (gfx1035) and CI's lavapipe with IEEE 0 and 1. Negative check: dropping the first-operand signaling-NaN select fails atIEEE mode: row 80 v_min_f32 ... is 0x00000000, expected 0x7fc00001. Full ctest: 488/488.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)