Floating point ALU assume no NaNs unless
FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FPn or (for some opcodes)
exact=true.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes:
bf9c1699cd7 ("nir: add nir_fisnan helper function")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22206>
static inline nir_ssa_def *
nir_fisnan(nir_builder *b, nir_ssa_def *x)
{
- return nir_fneu(b, x, x);
+ bool old_exact = b->exact;
+ b->exact = true;
+ nir_ssa_def *res = nir_fneu(b, x, x);
+ b->exact = old_exact;
+ return res;
}
static inline nir_ssa_def *