mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 18:30:09 +01:00
nir: add lowering for ffract
Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
47e18a5957
commit
d9efe40dc9
2 changed files with 4 additions and 0 deletions
|
|
@ -1440,6 +1440,9 @@ typedef struct nir_shader_compiler_options {
|
|||
*/
|
||||
bool fdot_replicates;
|
||||
|
||||
/** lowers ffract to fsub+ffloor: */
|
||||
bool lower_ffract;
|
||||
|
||||
/**
|
||||
* Does the driver support real 32-bit integers? (Otherwise, integers
|
||||
* are simulated by floats.)
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ optimizations = [
|
|||
(('flrp', a, a, b), a),
|
||||
(('flrp', 0.0, a, b), ('fmul', a, b)),
|
||||
(('flrp', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 'options->lower_flrp'),
|
||||
(('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'),
|
||||
(('fadd', ('fmul', a, ('fadd', 1.0, ('fneg', c))), ('fmul', b, c)), ('flrp', a, b, c), '!options->lower_flrp'),
|
||||
(('fadd', a, ('fmul', c, ('fadd', b, ('fneg', a)))), ('flrp', a, b, c), '!options->lower_flrp'),
|
||||
(('ffma', a, b, c), ('fadd', ('fmul', a, b), c), 'options->lower_ffma'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue