From 18a8b0a122292bfa9a984b4035e2898476b8525c Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 10 Nov 2022 21:24:48 +1100 Subject: [PATCH] nir: fix typo in lower_double options handling Seems the intention was to check that both flags were not enabled instead we were checking that the floor flag was both set and not set so the result would always be false. Fixes: 3749a6ecd282 ("nir: honor lower_double options for ffloor and ffract") Reviewed-by: Gert Wollny Part-of: (cherry picked from commit 34c52d8cb98e74a9debcd2605b377170c025582a) --- .pick_status.json | 2 +- src/compiler/nir/nir_opt_algebraic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 25f502df6f7..97840b676d0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2317,7 +2317,7 @@ "description": "nir: fix typo in lower_double options handling", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "3749a6ecd282cf8c801cda948260fd6d521b92ac" }, diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 11deac36ab3..55cb4a2a4a8 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -375,7 +375,7 @@ optimizations.extend([ (('ffloor@16', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'), (('ffloor@32', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'), - (('ffloor@64', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor || ((options->lower_doubles_options & nir_lower_dfloor) && !(options->lower_doubles_options & nir_lower_dfloor))'), + (('ffloor@64', a), ('fsub', a, ('ffract', a)), '(options->lower_ffloor || (options->lower_doubles_options & nir_lower_dfloor)) && !(options->lower_doubles_options & nir_lower_dfract)'), (('fadd@16', a, ('fneg', ('ffract', a))), ('ffloor', a), '!options->lower_ffloor'), (('fadd@32', a, ('fneg', ('ffract', a))), ('ffloor', a), '!options->lower_ffloor'), (('fadd@64', a, ('fneg', ('ffract', a))), ('ffloor', a), '!options->lower_ffloor && !(options->lower_doubles_options & nir_lower_dfloor)'),