[Mesa-dev] [PATCH 3/3] nir/opt_algebraic: lower mod() with doubles operands if lower_fmod64 is enabled

Jordan Justen jordan.l.justen at intel.com
Fri Apr 29 18:26:59 UTC 2016


On 2016-04-28 04:19:18, Samuel Iglesias Gonsálvez wrote:
> Make this distintion as the drivers might need to lower it inside NIR.
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at 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 */

This comment seems out of place compared to the other options here.
Maybe it is not necessary?

Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

> +   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 at 32', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod32'),
> +   (('fmod at 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 at 32', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'),
>     (('usub_borrow at 32', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'),
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list