From 421d0e0953ea66c13733c6fe09facacb2ab08bec Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 15 Jul 2025 18:46:43 -0400 Subject: [PATCH] nir: mark exact fmul in ldexp lowering this chain of fmul is deliberately chosen for floating point precision reasons, it needs to be exact, or else we might try to reassociate it and break subnormal handling. avoids regressing dEQP-VK.glsl.builtin.precision.ldexp_subnormals.* Signed-off-by: Alyssa Rosenzweig Reviewed-by: Mel Henning Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 0d8d9a9f058..5f75941e575 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -3091,7 +3091,7 @@ def ldexp(f, exp, bits): # of our exponent is doubled. pow2_1 = fexp2i(('ishr', exp, 1), bits) pow2_2 = fexp2i(('isub', exp, ('ishr', exp, 1)), bits) - return ('fmul', ('fmul', f, pow2_1), pow2_2) + return ('!fmul', ('!fmul', f, pow2_1), pow2_2) optimizations += [ (('ldexp@16', 'x', 'exp'), ldexp('x', 'exp', 16), 'options->lower_ldexp'),