nir/algebraic: Optimize fabs(u2f(x))
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 27 Jun 2016 18:38:15 +0000 (11:38 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 19 Jul 2016 19:19:30 +0000 (12:19 -0700)
commit0b626d75241213f2c5535b38aee233d6cdbed781
tree554f7a39c9e44232b357302404c6c5449c1bd867
parent94296be276bf9c0a574df262b5d45f1bf38918ff
nir/algebraic: Optimize fabs(u2f(x))

I noticed this when I tried to do frexp(float(some_unsigned)) in the
ir_unop_find_lsb lowering pass.  The code generated for frexp() uses
fabs, and this resulted in an extra instruction.  Ultimately I ended up
not using frexp.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/nir/nir_opt_algebraic.py