diff options
author | Samuel Pitoiset <[email protected]> | 2020-04-15 16:55:31 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-20 06:59:47 +0000 |
commit | 59427b6d1d07a5824272f7d6b562bcfe83d63b2b (patch) | |
tree | 55fae12a8c1007a3018c9ad5fe74c0862b71448f /src/compiler/nir | |
parent | eed0ace466d05e4ab07e638ac94a821788a8deaa (diff) |
nir/opt_algebraic: lower 64-bit fmin3/fmax3/fmed3
This unconditionally lowers 64-bit fmin3/fmax3/fmed3 because
AMD hardware doesn't have native instructions, and no drivers
except RADV uses these instructions.
Fixes dEQP-VK.spirv_assembly.instruction.amd_trinary_minmax.*.f64.*
with ACO.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4570>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 69f804783b2..00d18402bd1 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1076,6 +1076,10 @@ optimizations.extend([ (('bcsel', ('ine', a, -1), ('ifind_msb', a), -1), ('ifind_msb', a)), + (('fmin3@64', a, b, c), ('fmin@64', a, ('fmin@64', b, c))), + (('fmax3@64', a, b, c), ('fmax@64', a, ('fmax@64', b, c))), + (('fmed3@64', a, b, c), ('fmax@64', ('fmin@64', ('fmax@64', a, b), c), ('fmin@64', a, b))), + # Misc. lowering (('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod'), (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod'), |