mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
nir: add lowering for ffloor
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
41c8f99137
commit
c6aaafa3a1
2 changed files with 4 additions and 0 deletions
|
|
@ -2083,6 +2083,9 @@ typedef struct nir_shader_compiler_options {
|
|||
*/
|
||||
bool fdot_replicates;
|
||||
|
||||
/** lowers ffloor to fsub+ffract: */
|
||||
bool lower_ffloor;
|
||||
|
||||
/** lowers ffract to fsub+ffloor: */
|
||||
bool lower_ffract;
|
||||
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ optimizations = [
|
|||
(('~flrp', a, 0.0, c), ('fadd', ('fmul', ('fneg', a), c), a)),
|
||||
(('flrp@32', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 'options->lower_flrp32'),
|
||||
(('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'),
|
||||
(('~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'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue