nir: make nir_fisnan helper exact

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: bf9c1699cd ("nir: add nir_fisnan helper function")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22206>
This commit is contained in:
Rhys Perry
2023-03-30 13:38:06 +01:00
committed by Marge Bot
parent a6ab0cff08
commit bb653b0acb

View File

@@ -56,7 +56,11 @@ nir_get_texture_size(nir_builder *b, nir_tex_instr *tex);
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 *