nir/opcodes: Fix constant-folding of ufind_msb
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 28 Aug 2017 22:05:11 +0000 (15:05 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 13 Oct 2017 05:39:29 +0000 (22:39 -0700)
commita0947921eb01f4c037de28b753fc10f86a25fc65
tree1e9f105754c5fd9d683393942eda458861cece29
parentac3b73ac8dcf501ab704b274d67acd065fbd4348
nir/opcodes: Fix constant-folding of ufind_msb

We didn't fold correctly in the case of 0x1 because we never let the
loop counter hit 0.  Switching it to bit >= 0 solves this problem.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/nir/nir_opcodes.py