added array out of bounds and division by zero runtime errors
wizoptimizer.c is now on steroids (does full on algebraic reductions
and stuff)...
TODO: actually test and debug this
fixed various errors in new wizoptimiser (seems to work well now),
and included a sample wiz input file "reduce_example.wiz" that
can be optimized (run ./wiz with -c flag) to showcase some of the
reductions possible by this module
realized I forgot to remove some debugging print statements on last
commit
implemented streamlined array access and bounds checking
optimized loads/stores from/to arrays, where
access is statically determined, to do direct
load/store instead of indirect
prevented folding division by zero
fixed error in how array access was calculated (now actually
works correctly lol)
fixed bug in wiz optimizer for expressions made up of commutative
operators whose operands were ALL foldable
fixed bug in oztree.c where reference variables were not accessed
properly (need to load address to register before load_indirect)
slight hack to account for lack of semantic analysis on expressions
generated for array access (changed order of type checks for binop
expressions in code generation, so integer binop is assumed as the
"default" choice instead of boolean)
- order of operations for array access slightly optimized
- fixed error in how float constants were compiled in oztree.c
(there was an error with casting, I think code had been copy-pasted
from the int const function... forgot to change int* to float*)
Merge remote-tracking branch 'remotes/origin/awbennett_optimizing_master' into mboptimisation