summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-07 13:01:24 -0400
committerRob Clark <[email protected]>2016-06-03 16:05:03 -0400
commitdfbae7d64f4d563bc65af338cdcb217f10474c1c (patch)
tree2a94671ec13b440c7c993cea08c28511cb205e30 /src/compiler/nir/nir.h
parenta64c7cd2bac33a3a2bf908b5ef538dff03b93b73 (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r--src/compiler/nir/nir.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 20f65201890..3f9309c04dd 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1651,6 +1651,9 @@ typedef struct nir_shader_compiler_options {
/* lower {slt,sge,seq,sne} to {flt,fge,feq,fne} + b2f: */
bool lower_scmp;
+ /** enables rules to lower idiv by power-of-two: */
+ bool lower_idiv;
+
/* Does the native fdot instruction replicate its result for four
* components? If so, then opt_algebraic_late will turn all fdotN
* instructions into fdot_replicatedN instructions.