nir: add lower_bitshift option

Add a "lower_bitshift" option, which disables optimizations introducing
bitshifts and lowers ishl by constant to a multiply, so that we don't have
to deal with bitshifts in int_to_float lowering.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Jonathan Marek
2019-05-31 13:54:12 -04:00
parent 887c2a6092
commit f889180ee1
4 changed files with 10 additions and 3 deletions

View File

@@ -2272,6 +2272,9 @@ typedef struct nir_shader_compiler_options {
/** enables rules to lower idiv by power-of-two: */
bool lower_idiv;
/** enable rules to avoid bit shifts */
bool lower_bitshift;
/** enables rules to lower isign to imin+imax */
bool lower_isign;