optimised INCR & DECR variable - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14) +---- Thread: optimised INCR & DECR variable (/showthread.php?tid=108) |
optimised INCR & DECR variable - LCD - 05-11-2009 Because I also coded some stuff in AMOS on Amiga: How about optimised INCR and DECR commands for variables? This can be easyly optimised because Z80 knows INC and DEC commands, and variable=variable+1 is maybe much slower. INCR variable incrases the value by one. This will be very handy, I think . Re: optimised INCR & DECR variable - boriel - 05-12-2009 LCD Wrote:Because I also coded some stuff in AMOS on Amiga: How about optimised INCR and DECR commands for variables? This can be easyly optimised because Z80 knows INC and DEC commands, and variable=variable+1 is maybe much slower.Well, using -O3 should convert variable=variable+1 to inc(variable). If not, its something to be done. Re: optimised INCR & DECR variable - LCD - 05-12-2009 boriel Wrote:LCD Wrote:Because I also coded some stuff in AMOS on Amiga: How about optimised INCR and DECR commands for variables? This can be easyly optimised because Z80 knows INC and DEC commands, and variable=variable+1 is maybe much slower.Well, using -O3 should convert variable=variable+1 to inc(variable). If not, its something to be done. Aha, thank you, I was compiling with -O2 (forgot to change again after changing for a little test)... |