From 8dc4e8094ee79ad3c38e2cd970f91d2b0e1150f1 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 21 May 2026 12:30:59 +0200 Subject: [PATCH] nir/opt_algebraic: add missing fmadz lowering for lower_fmulz_with_abs_min Fixes: 32e91a74675 ("nir: add new float multiply-add opcodes") Suggested-by: Georg Lehmann Acked-by: Job Noorman Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index a8f71b8bc90..2a18ed2691a 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -4091,7 +4091,9 @@ late_optimizations += [ (('fmulz@32', a, b), ('bcsel', ('feq', ('fmin', ('fabs', a), ('fabs', b)), 0.0), 0.0, ('fmul', a, b)), 'options->lower_fmulz_with_abs_min'), (('ffmaz@32', a, b, c), - ('bcsel', ('feq', ('fmin', ('fabs', a), ('fabs', b)), 0.0), c, ('ffma@32', a, b, c)), 'options->lower_fmulz_with_abs_min') + ('bcsel', ('feq', ('fmin', ('fabs', a), ('fabs', b)), 0.0), c, ('ffma@32', a, b, c)), 'options->lower_fmulz_with_abs_min'), + (('fmadz@32', a, b, c), + ('bcsel', ('feq', ('fmin', ('fabs', a), ('fabs', b)), 0.0), c, ('fmad@32', a, b, c)), 'options->lower_fmulz_with_abs_min'), ] # mediump: If an opcode is surrounded by conversions, remove the conversions.