From 3e7186d4722d009200781c9fb3b6141b064aeabb Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Mon, 12 Nov 2018 12:49:32 -0500 Subject: nir: add fceil lowering lowers ceil(x) as -floor(-x) Signed-off-by: Jonathan Marek Reviewed-by: Jason Ekstrand Reviewed-by: Christian Gmeiner Signed-off-by: Rob Clark --- src/compiler/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compiler/nir/nir_opt_algebraic.py') diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 0d8802582aa..f2a7be0c403 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -125,6 +125,7 @@ optimizations = [ (('flrp@64', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 'options->lower_flrp64'), (('ffloor', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'), (('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'), + (('fceil', a), ('fneg', ('ffloor', ('fneg', a))), 'options->lower_fceil'), (('~fadd', ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', c)))), ('fmul', b, ('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp32'), (('~fadd@32', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', b, c )), ('flrp', a, b, c), '!options->lower_flrp32'), (('~fadd@64', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', b, c )), ('flrp', a, b, c), '!options->lower_flrp64'), -- cgit v1.2.3