From d4a87e85b33220eb732c8ac038be6bfb60a2d790 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 17 Dec 2025 12:35:22 -0800 Subject: [PATCH] nir/algebraic: Add missing f on F-strings Without this, nir_algebraic.py was treating "f2i{int_sz}_sat" as the literal opcode name when it should have been "f2i8_sat" or similar. Fixes: c49d6e04808 ("nir/algebraic: Elide range clamping of f2u sources") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 7ffc01a2747..5918682c09b 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -3709,16 +3709,16 @@ for int_sz in (8, 16, 32): late_optimizations.extend([ # This requires is_a_number because f2i_sat(NaN) is zero, but # fmax(intmin, NaN) is intmin. - ((f'f2i{int_sz}', ('fmax', f'a@{float_sz}(is_a_number)', intmin)), ('f2i{int_sz}_sat', a), 'options->has_f2i_sat'), + ((f'f2i{int_sz}', ('fmax', f'a@{float_sz}(is_a_number)', intmin)), (f'f2i{int_sz}_sat', a), 'options->has_f2i_sat'), - ((f'f2i{int_sz}', ('fmin', f'a@{float_sz}(is_a_number)', intmax)), ('f2i{int_sz}_sat', a), 'options->has_f2i_sat'), + ((f'f2i{int_sz}', ('fmin', f'a@{float_sz}(is_a_number)', intmax)), (f'f2i{int_sz}_sat', a), 'options->has_f2i_sat'), ((f'f2u{int_sz}', ('fmin', f'a@{float_sz}(is_a_number)', uintmax)), (f'f2u{int_sz}_sat', a), 'options->has_f2u_sat'), ]) late_optimizations.extend([ # This does not require is_a_number because both f2u_sat(NaN) and # fmax(NaN, 0) are zero. - ((f'f2u{int_sz}', ('fmax', f'a@{float_sz}', 0.0)), ('f2u{int_sz}_sat', a), 'options->has_f2u_sat'), + ((f'f2u{int_sz}', ('fmax', f'a@{float_sz}', 0.0)), (f'f2u{int_sz}_sat', a), 'options->has_f2u_sat'), ((f'f2u{int_sz}', ('ftrunc', f'a@{float_sz}')), (f'f2u{int_sz}_sat', a), 'options->has_f2u_sat'),