16
Axe / Axe Optimization Tricks
« on: June 30, 2010, 12:24:05 am »
NOTE: THIS IS NOT FOR SOURCE CODE OPTIMIZATIONS, JUST THE FINAL EXECUTABLE!
This is a topic to share and comment on Axe optimizations. I'll start out with a very useful one that can decrease code size quite a bit:
Instead of
If A=B
do
!If A-B
And instead of
If A!=B
do
If A-B
This optimization takes advantage of the fact that the If statement checks for non-zero and !If checks for zero. No speed/space is wasted on the boolean expressions returning just a 0 or 1.
This is a topic to share and comment on Axe optimizations. I'll start out with a very useful one that can decrease code size quite a bit:
Instead of
If A=B
do
!If A-B
And instead of
If A!=B
do
If A-B
This optimization takes advantage of the fact that the If statement checks for non-zero and !If checks for zero. No speed/space is wasted on the boolean expressions returning just a 0 or 1.