gallium: u_bitmask: Make the util_bitmask_get_next_index() a bit smarter

This patch makes the util_bitmask_get_next_index() function use ffs() to
find first set bit in a word instead of testing every bit manually in a
loop. This has also a side-effect of reducing lines of code of this
function.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: Implement simple private heap helpers

It is basically generalized version of simply preallocated heap copied
from freedreno modified to use dynamic allocation and be able to grow on
demand.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Unify depart and repeat node data

This allows uniform handling of both node types in certain parts of the
code.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: Add bitmap helper functions

There are no usable bitmap helpers in Gallium, so for now let's
roll our own.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Extend AST dumper to handle custom data

This will allow to print different set of data for each step of
processing.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
openfimg: compiler: Add basic stat collection

Currently only single statistic is collected - numer of used variables
(aka temporary registers).

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>