tiny fill() optimization

This commit is contained in:
Irmen de Jong 2023-10-18 23:04:11 +02:00
parent d88c09b098
commit e15c5cde53
3 changed files with 8 additions and 14 deletions

View File

@ -583,13 +583,12 @@ gfx2 {
while cx16.r12L {
pop_stack()
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
xx--
if cx16.r9!=xx
horizontal_line(xx as uword+1, yy as uword, cx16.r9-(xx as uword), cx16.r10L)
if xx >= x1
if x1!=xx
horizontal_line(xx as uword+1, yy as uword, x1-xx as uword, cx16.r10L)
else
goto skip
left = xx + 1
@ -599,6 +598,7 @@ gfx2 {
do {
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
xx++
if cx16.r9!=xx

View File

@ -608,14 +608,11 @@ _done
while cx16.r12L {
pop_stack()
xx = x1
cx16.r9 = xx
while xx >= 0 and pget(xx as uword, yy as uword) == cx16.r11L
xx--
if cx16.r9!=xx
horizontal_line(xx as uword+1, yy as uword, cx16.r9-(xx as uword), cx16.r10L)
if xx >= x1
if x1!=xx
horizontal_line(xx as uword+1, yy as uword, x1-xx as uword, cx16.r10L)
else
goto skip
left = xx + 1

View File

@ -1,9 +1,6 @@
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: 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!