mirror of
https://github.com/irmen/prog8.git
synced 2024-08-13 04:29:09 +00:00
tiny fill() optimization
This commit is contained in:
parent
d88c09b098
commit
e15c5cde53
@ -583,13 +583,12 @@ gfx2 {
|
|||||||
while cx16.r12L {
|
while cx16.r12L {
|
||||||
pop_stack()
|
pop_stack()
|
||||||
xx = x1
|
xx = x1
|
||||||
cx16.r9 = xx
|
; TODO: if mode==1 (256c) use vera autodecrement instead of pget(), but code bloat not worth it?
|
||||||
while xx >= 0 and pget(xx as uword, yy as uword) == cx16.r11L
|
while xx >= 0 and pget(xx as uword, yy as uword) == cx16.r11L
|
||||||
xx--
|
xx--
|
||||||
if cx16.r9!=xx
|
if x1!=xx
|
||||||
horizontal_line(xx as uword+1, yy as uword, cx16.r9-(xx as uword), cx16.r10L)
|
horizontal_line(xx as uword+1, yy as uword, x1-xx as uword, cx16.r10L)
|
||||||
|
else
|
||||||
if xx >= x1
|
|
||||||
goto skip
|
goto skip
|
||||||
|
|
||||||
left = xx + 1
|
left = xx + 1
|
||||||
@ -599,6 +598,7 @@ gfx2 {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
cx16.r9 = xx
|
cx16.r9 = xx
|
||||||
|
; TODO: if mode==1 (256c) use vera autoincrement instead of pget(), but code bloat not worth it?
|
||||||
while xx <= width-1 and pget(xx as uword, yy as uword) == cx16.r11L
|
while xx <= width-1 and pget(xx as uword, yy as uword) == cx16.r11L
|
||||||
xx++
|
xx++
|
||||||
if cx16.r9!=xx
|
if cx16.r9!=xx
|
||||||
|
@ -608,14 +608,11 @@ _done
|
|||||||
while cx16.r12L {
|
while cx16.r12L {
|
||||||
pop_stack()
|
pop_stack()
|
||||||
xx = x1
|
xx = x1
|
||||||
|
|
||||||
cx16.r9 = xx
|
|
||||||
while xx >= 0 and pget(xx as uword, yy as uword) == cx16.r11L
|
while xx >= 0 and pget(xx as uword, yy as uword) == cx16.r11L
|
||||||
xx--
|
xx--
|
||||||
if cx16.r9!=xx
|
if x1!=xx
|
||||||
horizontal_line(xx as uword+1, yy as uword, cx16.r9-(xx as uword), cx16.r10L)
|
horizontal_line(xx as uword+1, yy as uword, x1-xx as uword, cx16.r10L)
|
||||||
|
else
|
||||||
if xx >= x1
|
|
||||||
goto skip
|
goto skip
|
||||||
|
|
||||||
left = xx + 1
|
left = xx + 1
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
TODO
|
TODO
|
||||||
====
|
====
|
||||||
|
|
||||||
- gfx2/monogfx: use vera auto in/decrement in the flood fill routine (getpixels)
|
|
||||||
- gfx2: use vera fx fill for horizontal_line of sufficient length?
|
|
||||||
|
|
||||||
- [on branch: shortcircuit] investigate McCarthy evaluation again? this may also reduce code size perhaps for things like if a>4 or a<2 ....
|
- [on branch: shortcircuit] investigate McCarthy evaluation again? this may also reduce code size perhaps for things like if a>4 or a<2 ....
|
||||||
- [on branch: ir-less-branch-opcodes] IR: reduce the number of branch instructions such as BEQ, BEQR, etc (gradually), replace with CMP(I) + status branch instruction
|
- [on branch: ir-less-branch-opcodes] IR: reduce the number of branch instructions such as BEQ, BEQR, etc (gradually), replace with CMP(I) + status branch instruction
|
||||||
- IR: reduce amount of CMP/CMPI after instructions that set the status bits correctly (LOADs? INC? etc), but only after setting the status bits is verified!
|
- IR: reduce amount of CMP/CMPI after instructions that set the status bits correctly (LOADs? INC? etc), but only after setting the status bits is verified!
|
||||||
|
Loading…
Reference in New Issue
Block a user