Commit e4d346c8 authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

nir: Add a couple trivial abs optimizations

Spotted in a shader in Batman: Arkham City.
Reviewed-by: Matt Turner's avatarMatt Turner <>
Reviewed-by: default avatarIan Romanick <>
parent 52d831ff
......@@ -229,6 +229,8 @@ optimizations = [
(('imax', a, a), a),
(('umin', a, a), a),
(('umax', a, a), a),
(('fmax', a, ('fneg', a)), ('fabs', a)),
(('imax', a, ('ineg', a)), ('iabs', a)),
(('fmin', a, ('fneg', a)), ('fneg', ('fabs', a))),
(('imin', a, ('ineg', a)), ('ineg', ('iabs', a))),
(('fmin', a, ('fneg', ('fabs', a))), ('fneg', ('fabs', a))),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment