nir/algebraic: support for power-of-two optimizations
authorRob Clark <robclark@freedesktop.org>
Sat, 7 May 2016 17:01:24 +0000 (13:01 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 3 Jun 2016 20:05:03 +0000 (16:05 -0400)
commitdfbae7d64f4d563bc65af338cdcb217f10474c1c
tree2a94671ec13b440c7c993cea08c28511cb205e30
parenta64c7cd2bac33a3a2bf908b5ef538dff03b93b73
nir/algebraic: support for power-of-two optimizations

Some optimizations, like converting integer multiply/divide into left/
right shifts, have additional constraints on the search expression.
Like requiring that a variable is a constant power of two.  Support
these cases by allowing a fxn name to be appended to the search var
expression (ie. "a#32(is_power_of_two)").

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir.h
src/compiler/nir/nir_algebraic.py
src/compiler/nir/nir_opt_algebraic.py
src/compiler/nir/nir_search.c
src/compiler/nir/nir_search.h
src/compiler/nir/nir_search_helpers.h [new file with mode: 0644]