remove assigment splitter, it now caused code bloat instead of more efficient code

This commit is contained in:
Irmen de Jong 2023-10-16 01:28:47 +02:00
parent 97c5c90eff
commit dd7c9d62e6
3 changed files with 8 additions and 38 deletions

View File

@ -39,6 +39,7 @@ internal class BeforeAsmAstChanger(val program: Program, private val options: Co
return noModifications return noModifications
} }
/* TODO remove permanently:
override fun after(assignment: Assignment, parent: Node): Iterable<IAstModification> { override fun after(assignment: Assignment, parent: Node): Iterable<IAstModification> {
// Try to replace A = B <operator> Something by A= B, A = A <operator> Something // Try to replace A = B <operator> Something by A= B, A = A <operator> Something
// this triggers the more efficent augmented assignment code generation more often. // this triggers the more efficent augmented assignment code generation more often.
@ -104,6 +105,7 @@ internal class BeforeAsmAstChanger(val program: Program, private val options: Co
} }
return noModifications return noModifications
} }
*/
override fun after(scope: AnonymousScope, parent: Node): Iterable<IAstModification> { override fun after(scope: AnonymousScope, parent: Node): Iterable<IAstModification> {
if(scope.statements.any { it is VarDecl || it is IStatementContainer }) if(scope.statements.any { it is VarDecl || it is IStatementContainer })

View File

@ -1,8 +1,10 @@
TODO TODO
==== ====
- why does cx16.r1L = lsb(xx) & 3 generate 5 asm instructions? (noopt) - monogfx/gfx2 flood fill is broken after removing the after(assignment: Assignment) from BeforeAsmAstChanger that splits assignments
- optimize asm: sta VAR / <something with A> / sta VAR also other things broken? rectangle? not sure
- remove after(assignment from BeforeAsmAstChanger permanently once issues above fixed
- gfx2/monogfx: use vera auto in/decrement in the flood fill routine (getpixels) - gfx2/monogfx: use vera auto in/decrement in the flood fill routine (getpixels)
- gfx2: use vera fx fill for horizontal_line of sufficient length? - gfx2: use vera fx fill for horizontal_line of sufficient length?

View File

@ -1,44 +1,10 @@
%import gfx2
%import textio
%import math
%option no_sysinit %option no_sysinit
%zeropage basicsafe %zeropage basicsafe
main { main {
sub start() { sub start() {
ubyte[] shifts = [0,2,4,6] uword xx
ubyte value = 100 cx16.r1L = lsb(xx) & 3
ubyte index = 2
value >>= shifts[index]
txt.print_ub(value)
txt.nl()
value = 100
index = 1
value >>= shifts[index]
txt.print_ub(value)
txt.nl()
value = 100
index = 0
value >>= shifts[index]
txt.print_ub(value)
txt.nl()
gfx2.screen_mode(2)
demofill()
repeat {
}
}
sub demofill() {
gfx2.circle(160, 120, 110, 1)
gfx2.rect(180, 5, 25, 190, 1)
gfx2.line(100, 150, 240, 10, 1)
gfx2.line(101, 150, 241, 10, 1)
gfx2.fill(100,100,2)
gfx2.fill(182,140,3)
gfx2.fill(182,40,1)
} }
} }