Make this distintion as the drivers might need to lower it inside NIR. Signed-off-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com> --- src/compiler/nir/nir.h | 2 ++ src/compiler/nir/nir_opt_algebraic.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index a478124..83a8cae 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1631,6 +1631,8 @@ typedef struct nir_shader_compiler_options { bool lower_fsat; bool lower_fsqrt; bool lower_fmod32; + /** Lowers fmod when it does not support doubles */ + bool lower_fmod64; bool lower_bitfield_extract; bool lower_bitfield_insert; bool lower_uadd_carry; diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index afe653e..f81416b 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -296,7 +296,8 @@ optimizations = [ (('iadd', '#a', ('iadd', b, '#c')), ('iadd', ('iadd', a, c), b)), # Misc. lowering - (('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod32'), + (('fmod@32', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod32'), + (('fmod@64', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod64'), (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod32'), (('uadd_carry@32', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'), (('usub_borrow@32', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'), -- 2.5.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev