i965/vec4: Properly handle sign(-abs(x))
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 27 Jun 2018 01:30:09 +0000 (18:30 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 6 Jul 2018 23:20:07 +0000 (16:20 -0700)
commit9626ea497de8af5580ee3af76df79ad8083c5922
treec6423437b0e8cb11634ceec8f0809a9b414fd85f
parent88bd37c01060169b451ca2c3900830342d34a9a2
i965/vec4: Properly handle sign(-abs(x))

This is achived by copying the sign(abs(x)) optimization from the FS
backend.

On Gen7 an earlier platforms, this fixes new piglit tests:

 - glsl-1.10/execution/vs-sign-neg-abs.shader_test
 - glsl-1.10/execution/vs-sign-sat-neg-abs.shader_test

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/intel/compiler/brw_vec4_nir.cpp