mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 18:38:11 +02:00
nir/algebraic: add fdot2 optimizations
Add simple fdot2 optimizations that are missing. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Thomas Helland <thomashelland90@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
1e089d0575
commit
397375d3f3
1 changed files with 3 additions and 0 deletions
|
|
@ -191,6 +191,9 @@ optimizations = [
|
|||
(('fdot3', ('vec3', a, 0.0, 0.0), b), ('fmul', a, b)),
|
||||
(('fdot3', ('vec3', a, b, 0.0), c), ('fdot2', ('vec2', a, b), c)),
|
||||
|
||||
(('fdot2', ('vec2', a, 0.0), b), ('fmul', a, b)),
|
||||
(('fdot2', a, 1.0), ('fadd', 'a.x', 'a.y')),
|
||||
|
||||
# If x >= 0 and x <= 1: fsat(1 - x) == 1 - fsat(x) trivially
|
||||
# If x < 0: 1 - fsat(x) => 1 - 0 => 1 and fsat(1 - x) => fsat(> 1) => 1
|
||||
# If x > 1: 1 - fsat(x) => 1 - 1 => 0 and fsat(1 - x) => fsat(< 0) => 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue