From 47d3f7c69f52432566653834cde0f4fcbef408dd Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 24 Apr 2022 14:25:01 +0200 Subject: [PATCH] nir: Don't optimize to 64 bit fsub if the driver doesn't support it Fixes: a4840e15ab77b44a72cabd7d503172e8357477eb r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled. Signed-off-by: Gert Wollny Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 3eba54f..eec1040 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -2556,7 +2556,11 @@ late_optimizations = [ (('~fadd@32', ('fmulz', a, b), c), ('ffmaz', a, b, c), 'options->fuse_ffma32'), # Subtractions get lowered during optimization, so we need to recombine them - (('fadd', a, ('fneg', 'b')), ('fsub', 'a', 'b'), 'options->has_fsub'), + (('fadd@8', a, ('fneg', 'b')), ('fsub', 'a', 'b'), 'options->has_fsub'), + (('fadd@16', a, ('fneg', 'b')), ('fsub', 'a', 'b'), 'options->has_fsub'), + (('fadd@32', a, ('fneg', 'b')), ('fsub', 'a', 'b'), 'options->has_fsub'), + (('fadd@64', a, ('fneg', 'b')), ('fsub', 'a', 'b'), 'options->has_fsub && !(options->lower_doubles_options & nir_lower_dsub)'), + (('fneg', a), ('fmul', a, -1.0), 'options->lower_fneg'), (('iadd', a, ('ineg', 'b')), ('isub', 'a', 'b'), 'options->has_isub || options->lower_ineg'), (('ineg', a), ('isub', 0, a), 'options->lower_ineg'), -- 2.7.4