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 <alyssa@rosenzweig.io>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36257>
This commit is contained in:
Alyssa Rosenzweig 2025-07-15 18:46:43 -04:00 committed by Marge Bot
parent ecfca8ec6f
commit 421d0e0953

View file

@ -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'),