glsl: Use find_msb_uint to implement ir_unop_find_lsb
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 13 Jul 2016 00:40:48 +0000 (17:40 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Aug 2016 23:28:01 +0000 (16:28 -0700)
commit6d5fe1815c96b849aaf08f31c11d9ad4fe2b4769
tree69ec322fda71fccbac55c4d79782874be33a215a
parent5c24750a49b7c39f35600b25ece05f908d59f170
glsl: Use find_msb_uint to implement ir_unop_find_lsb

(X & -X) calculates a value with only the least significant bit of X
set.  Since there is only one bit set, the LSB is the MSB.

v2: Remove extra int() cast.  Suggested by Matt.

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