nir: Differentiate between signed and unsigned versions of find_msb
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 7 Nov 2014 18:59:16 +0000 (10:59 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:19:01 +0000 (07:19 -0800)
commit10adf8fc858c21cd95b3e02a8d6abee563ca1046
treed7b29be9ae747f9e991ab9d84132c592f5f6fde4
parenta76ccbfacf3d8e4ea4ab9c25d279eab480f8702e
nir: Differentiate between signed and unsigned versions of find_msb

We also make the return types match GLSL.  The GLSL spec specifies that
findMSB and findLSB return a signed integer.  Previously, nir had them
return unsigned.  This updates nir's behavior to match what GLSL expects.

We also update the nir-to-fs generator to take the new instructions.  While
we're at it, we fix the case where the input to findMSB is zero.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/glsl_to_nir.cpp
src/glsl/nir/nir_opcodes.h
src/mesa/drivers/dri/i965/brw_fs_nir.cpp