From a223abdf6e3d7f2ce57ee18e527a4a9c1577906e Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Wed, 22 Aug 2018 12:40:19 +0200 Subject: [PATCH] Now also simplifying +0 and *0 in constant values. --- .../java/dk/camelot64/kickc/Compiler.java | 2 +- .../asm/{unused => }/vbuaa=vbuaa_plus_0.asm | 0 ...ass2ConstantIntIncrementConsolidation.java | 39 - .../passes/Pass2ConstantSimplification.java | 64 ++ .../camelot64/kickc/test/ref/arrays-init.asm | 2 +- .../camelot64/kickc/test/ref/arrays-init.cfg | 4 +- .../camelot64/kickc/test/ref/arrays-init.log | 34 +- .../kickc/test/ref/bitmap-bresenham.asm | 4 +- .../kickc/test/ref/bitmap-bresenham.cfg | 2 +- .../kickc/test/ref/bitmap-bresenham.log | 26 +- .../camelot64/kickc/test/ref/bool-const.asm | 2 +- .../camelot64/kickc/test/ref/bool-const.cfg | 2 +- .../camelot64/kickc/test/ref/bool-const.log | 17 +- .../camelot64/kickc/test/ref/bool-pointer.asm | 2 +- .../camelot64/kickc/test/ref/bool-pointer.cfg | 2 +- .../camelot64/kickc/test/ref/bool-pointer.log | 17 +- .../camelot64/kickc/test/ref/bresenhamarr.asm | 2 - .../camelot64/kickc/test/ref/bresenhamarr.cfg | 2 +- .../camelot64/kickc/test/ref/bresenhamarr.log | 25 +- .../kickc/test/ref/c64dtv-gfxexplorer.asm | 15 +- .../kickc/test/ref/c64dtv-gfxexplorer.cfg | 14 +- .../kickc/test/ref/c64dtv-gfxexplorer.log | 165 ++-- .../kickc/test/ref/c64dtv-gfxexplorer.sym | 1 - .../kickc/test/ref/c64dtv-gfxmodes.asm | 4 +- .../kickc/test/ref/c64dtv-gfxmodes.cfg | 2 +- .../kickc/test/ref/c64dtv-gfxmodes.log | 26 +- .../test/ref/cast-precedence-problem.asm | 4 +- .../test/ref/cast-precedence-problem.cfg | 4 +- .../test/ref/cast-precedence-problem.log | 34 +- .../kickc/test/ref/chained-assignment.asm | 2 +- .../kickc/test/ref/chained-assignment.cfg | 2 +- .../kickc/test/ref/chained-assignment.log | 17 +- .../kickc/test/ref/compound-assignment.log | 44 +- .../kickc/test/ref/const-condition.asm | 2 +- .../kickc/test/ref/const-condition.cfg | 2 +- .../kickc/test/ref/const-condition.log | 17 +- .../kickc/test/ref/const-mult-div.asm | 2 +- .../kickc/test/ref/const-mult-div.cfg | 2 +- .../kickc/test/ref/const-mult-div.log | 17 +- .../camelot64/kickc/test/ref/const-param.asm | 2 +- .../camelot64/kickc/test/ref/const-param.cfg | 2 +- .../camelot64/kickc/test/ref/const-param.log | 15 +- .../kickc/test/ref/const-pointer.asm | 2 +- .../kickc/test/ref/const-pointer.cfg | 2 +- .../kickc/test/ref/const-pointer.log | 17 +- .../kickc/test/ref/const-word-pointer.asm | 2 +- .../kickc/test/ref/const-word-pointer.cfg | 2 +- .../kickc/test/ref/const-word-pointer.log | 15 +- .../kickc/test/ref/double-assignment.asm | 2 +- .../kickc/test/ref/double-assignment.cfg | 2 +- .../kickc/test/ref/double-assignment.log | 17 +- .../dk/camelot64/kickc/test/ref/fibmem.asm | 2 +- .../dk/camelot64/kickc/test/ref/fibmem.cfg | 2 +- .../dk/camelot64/kickc/test/ref/fibmem.log | 19 +- .../kickc/test/ref/forrangedwords.asm | 2 +- .../kickc/test/ref/forrangedwords.cfg | 2 +- .../kickc/test/ref/forrangedwords.log | 15 +- .../kickc/test/ref/fragment-synth.asm | 2 +- .../kickc/test/ref/fragment-synth.cfg | 2 +- .../kickc/test/ref/fragment-synth.log | 15 +- .../dk/camelot64/kickc/test/ref/halfscii.asm | 2 +- .../dk/camelot64/kickc/test/ref/halfscii.cfg | 2 +- .../dk/camelot64/kickc/test/ref/halfscii.log | 15 +- .../kickc/test/ref/inline-function-if.asm | 2 +- .../kickc/test/ref/inline-function-if.cfg | 2 +- .../kickc/test/ref/inline-function-if.log | 17 +- .../kickc/test/ref/inline-function-level2.asm | 8 +- .../kickc/test/ref/inline-function-level2.cfg | 4 +- .../kickc/test/ref/inline-function-level2.log | 42 +- .../kickc/test/ref/inline-function-min.asm | 2 +- .../kickc/test/ref/inline-function-min.cfg | 2 +- .../kickc/test/ref/inline-function-min.log | 17 +- .../dk/camelot64/kickc/test/ref/line-anim.asm | 4 +- .../dk/camelot64/kickc/test/ref/line-anim.cfg | 2 +- .../dk/camelot64/kickc/test/ref/line-anim.log | 26 +- .../dk/camelot64/kickc/test/ref/literals.asm | 2 +- .../dk/camelot64/kickc/test/ref/literals.cfg | 2 +- .../dk/camelot64/kickc/test/ref/literals.log | 19 +- .../dk/camelot64/kickc/test/ref/modglobal.asm | 2 +- .../dk/camelot64/kickc/test/ref/modglobal.cfg | 2 +- .../dk/camelot64/kickc/test/ref/modglobal.log | 15 +- .../camelot64/kickc/test/ref/modglobalmin.asm | 2 +- .../camelot64/kickc/test/ref/modglobalmin.cfg | 2 +- .../camelot64/kickc/test/ref/modglobalmin.log | 15 +- .../kickc/test/ref/operator-lohi-problem.asm | 2 +- .../kickc/test/ref/operator-lohi-problem.cfg | 2 +- .../kickc/test/ref/operator-lohi-problem.log | 17 +- .../camelot64/kickc/test/ref/raster-bars.asm | 2 +- .../camelot64/kickc/test/ref/raster-bars.cfg | 2 +- .../camelot64/kickc/test/ref/raster-bars.log | 15 +- .../dk/camelot64/kickc/test/ref/scrollbig.asm | 4 +- .../dk/camelot64/kickc/test/ref/scrollbig.cfg | 2 +- .../dk/camelot64/kickc/test/ref/scrollbig.log | 28 +- .../camelot64/kickc/test/ref/scrolllogo.asm | 12 +- .../camelot64/kickc/test/ref/scrolllogo.cfg | 12 +- .../camelot64/kickc/test/ref/scrolllogo.log | 280 +++--- .../camelot64/kickc/test/ref/signed-words.asm | 12 +- .../camelot64/kickc/test/ref/signed-words.cfg | 12 +- .../camelot64/kickc/test/ref/signed-words.log | 106 ++- .../camelot64/kickc/test/ref/sine-plotter.asm | 4 +- .../camelot64/kickc/test/ref/sine-plotter.cfg | 2 +- .../camelot64/kickc/test/ref/sine-plotter.log | 26 +- .../kickc/test/ref/test-address-of-param.asm | 2 +- .../kickc/test/ref/test-address-of-param.cfg | 2 +- .../kickc/test/ref/test-address-of-param.log | 15 +- .../kickc/test/ref/test-lohiconst.asm | 2 +- .../kickc/test/ref/test-lohiconst.cfg | 2 +- .../kickc/test/ref/test-lohiconst.log | 17 +- .../kickc/test/ref/true-inline-words.asm | 4 +- .../kickc/test/ref/true-inline-words.log | 19 +- .../kickc/test/ref/true-inline-words.sym | 4 +- .../kickc/test/ref/unroll-loop-modifyvar.log | 68 +- .../test/ref/unroll-screenfill-for-double.asm | 42 +- .../test/ref/unroll-screenfill-for-double.cfg | 42 +- .../test/ref/unroll-screenfill-for-double.log | 859 +++++++++--------- .../kickc/test/ref/unroll-screenfill-for.asm | 2 +- .../kickc/test/ref/unroll-screenfill-for.cfg | 2 +- .../kickc/test/ref/unroll-screenfill-for.log | 114 +-- .../test/ref/unroll-screenfill-while.asm | 2 +- .../test/ref/unroll-screenfill-while.cfg | 2 +- .../test/ref/unroll-screenfill-while.log | 114 +-- .../kickc/test/ref/unused-method.asm | 2 +- .../kickc/test/ref/unused-method.cfg | 2 +- .../kickc/test/ref/unused-method.log | 17 +- .../dk/camelot64/kickc/test/ref/voronoi.asm | 12 +- .../dk/camelot64/kickc/test/ref/voronoi.cfg | 16 +- .../dk/camelot64/kickc/test/ref/voronoi.log | 136 +-- 127 files changed, 1569 insertions(+), 1443 deletions(-) rename src/main/java/dk/camelot64/kickc/fragment/asm/{unused => }/vbuaa=vbuaa_plus_0.asm (100%) delete mode 100644 src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIntIncrementConsolidation.java create mode 100644 src/main/java/dk/camelot64/kickc/passes/Pass2ConstantSimplification.java diff --git a/src/main/java/dk/camelot64/kickc/Compiler.java b/src/main/java/dk/camelot64/kickc/Compiler.java index d834cc5ec..67beaae81 100644 --- a/src/main/java/dk/camelot64/kickc/Compiler.java +++ b/src/main/java/dk/camelot64/kickc/Compiler.java @@ -240,7 +240,7 @@ public class Compiler { constantOptimizations.add(new Pass2IdenticalPhiElimination(program)); constantOptimizations.add(new Pass2ConstantIdentification(program)); constantOptimizations.add(new Pass2ConstantAdditionElimination(program)); - constantOptimizations.add(new Pass2ConstantIntIncrementConsolidation(program)); + constantOptimizations.add(new Pass2ConstantSimplification(program)); constantOptimizations.add(new Pass2ConstantIfs(program)); pass2Execute(constantOptimizations); } diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/unused/vbuaa=vbuaa_plus_0.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/vbuaa=vbuaa_plus_0.asm similarity index 100% rename from src/main/java/dk/camelot64/kickc/fragment/asm/unused/vbuaa=vbuaa_plus_0.asm rename to src/main/java/dk/camelot64/kickc/fragment/asm/vbuaa=vbuaa_plus_0.asm diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIntIncrementConsolidation.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIntIncrementConsolidation.java deleted file mode 100644 index ab56b355a..000000000 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIntIncrementConsolidation.java +++ /dev/null @@ -1,39 +0,0 @@ -package dk.camelot64.kickc.passes; - -import dk.camelot64.kickc.model.Program; -import dk.camelot64.kickc.model.iterator.ProgramValueIterator; -import dk.camelot64.kickc.model.operators.Operators; -import dk.camelot64.kickc.model.values.ConstantInteger; -import dk.camelot64.kickc.model.values.ConstantUnary; - -/** Optimizes constants number++ to the number plus one (replacing a ConstantUnary with a ConstantInteger)*/ -public class Pass2ConstantIntIncrementConsolidation extends Pass2SsaOptimization { - - public Pass2ConstantIntIncrementConsolidation(Program program) { - super(program); - } - - @Override - public boolean step() { - final boolean[] optimized = {false}; - ProgramValueIterator.execute(getProgram(), (programValue, currentStmt, stmtIt, currentBlock) -> { - if(programValue.get() instanceof ConstantUnary) { - ConstantUnary unary = (ConstantUnary) programValue.get(); - if(Operators.INCREMENT.equals(unary.getOperator()) && unary.getOperand() instanceof ConstantInteger) { - // Found a candidate!! - ConstantInteger intOperand = (ConstantInteger) unary.getOperand(); - getLog().append("Optimizing constant integer increment "+unary); - programValue.set(new ConstantInteger(intOperand.getValue()+1)); - optimized[0] = true; - } else if(Operators.DECREMENT.equals(unary.getOperator()) && unary.getOperand() instanceof ConstantInteger) { - // Found a candidate!! - ConstantInteger intOperand = (ConstantInteger) unary.getOperand(); - getLog().append("Optimizing constant integer decrement "+unary); - programValue.set(new ConstantInteger(intOperand.getValue()+1)); - optimized[0] = true; - } - } - }); - return optimized[0]; - } -} diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantSimplification.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantSimplification.java new file mode 100644 index 000000000..8b748d28e --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantSimplification.java @@ -0,0 +1,64 @@ +package dk.camelot64.kickc.passes; + +import dk.camelot64.kickc.model.Program; +import dk.camelot64.kickc.model.iterator.ProgramValueIterator; +import dk.camelot64.kickc.model.operators.Operators; +import dk.camelot64.kickc.model.values.ConstantBinary; +import dk.camelot64.kickc.model.values.ConstantInteger; +import dk.camelot64.kickc.model.values.ConstantUnary; + +/** Simplifies constant values + * - ++123 to 124 + * - --123 to 122 + * - x+0 to x + * - x*0 to 0 + * */ +public class Pass2ConstantSimplification extends Pass2SsaOptimization { + + public Pass2ConstantSimplification(Program program) { + super(program); + } + + @Override + public boolean step() { + final boolean[] optimized = {false}; + ProgramValueIterator.execute(getProgram(), (programValue, currentStmt, stmtIt, currentBlock) -> { + if(programValue.get() instanceof ConstantUnary) { + ConstantUnary unary = (ConstantUnary) programValue.get(); + if(Operators.INCREMENT.equals(unary.getOperator()) && unary.getOperand() instanceof ConstantInteger) { + // Found a candidate!! + ConstantInteger intOperand = (ConstantInteger) unary.getOperand(); + getLog().append("Simplifying constant integer increment "+unary); + programValue.set(new ConstantInteger(intOperand.getValue()+1)); + optimized[0] = true; + } else if(Operators.DECREMENT.equals(unary.getOperator()) && unary.getOperand() instanceof ConstantInteger) { + // Found a candidate!! + ConstantInteger intOperand = (ConstantInteger) unary.getOperand(); + getLog().append("Simplifying constant integer decrement "+unary); + programValue.set(new ConstantInteger(intOperand.getValue()+1)); + optimized[0] = true; + } + } else if(programValue.get() instanceof ConstantBinary) { + ConstantBinary binary = (ConstantBinary) programValue.get(); + if(Operators.MULTIPLY.equals(binary.getOperator())) { + if(binary.getLeft() instanceof ConstantInteger && ((ConstantInteger) binary.getLeft()).getValue() == 0) { + getLog().append("Simplifying constant multiply by zero " + binary); + programValue.set(new ConstantInteger(0L)); + } else if(binary.getRight() instanceof ConstantInteger && ((ConstantInteger) binary.getRight()).getValue() == 0) { + getLog().append("Simplifying constant multiply by zero " + binary); + programValue.set(new ConstantInteger(0L)); + } + } else if(Operators.PLUS.equals(binary.getOperator())) { + if(binary.getLeft() instanceof ConstantInteger && ((ConstantInteger) binary.getLeft()).getValue() == 0) { + getLog().append("Simplifying constant plus zero " + binary); + programValue.set(binary.getRight()); + } else if(binary.getRight() instanceof ConstantInteger && ((ConstantInteger) binary.getRight()).getValue() == 0) { + getLog().append("Simplifying constant plus zero " + binary); + programValue.set(binary.getLeft()); + } + } + } + }); + return optimized[0]; + } +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.asm b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.asm index 5fd5aa4e8..840bb4d6a 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.asm @@ -5,7 +5,7 @@ jsr main main: { lda #'c' - sta b+0 + sta b sta SCREEN lda c+1 sta SCREEN+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.cfg b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.cfg index da5dccd16..db56abfe3 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.cfg @@ -8,8 +8,8 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) - [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) + [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) + [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) [ ] ( main:2 [ ] ) to:main::@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.log b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.log index fa15198f9..5e9dba454 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/arrays-init.log @@ -128,6 +128,8 @@ Constant inlined main::$1 = (const byte*) SCREEN#0+(byte/signed byte/word/signed Constant inlined $0 = (const byte[]) d#0 Constant inlined main::$0 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero b#0+0 +Simplifying constant plus zero b#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -156,8 +158,8 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) - [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) + [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) + [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) [ ] ( main:2 [ ] ) to:main::@return @@ -199,11 +201,11 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta b+0 - //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 - lda b+0 + sta b + //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + lda b sta SCREEN //SEG11 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda c+1 @@ -222,8 +224,8 @@ main: { d: .text "cml" REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -257,11 +259,11 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta b+0 - //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 - lda b+0 + sta b + //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + lda b sta SCREEN //SEG11 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda c+1 @@ -284,7 +286,7 @@ Removing instruction jmp b1 Removing instruction jmp bend Removing instruction jmp breturn Succesful ASM optimization Pass5NextJumpElimination -Removing instruction lda b+0 +Removing instruction lda b Succesful ASM optimization Pass5UnnecesaryLoadElimination Removing instruction bbegin: Removing instruction b1_from_bbegin: @@ -330,10 +332,10 @@ Score: 38 //SEG7 @end //SEG8 main main: { - //SEG9 [4] *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta b+0 - //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + sta b + //SEG10 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 sta SCREEN //SEG11 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda c+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.asm b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.asm index 1c7bbb5eb..aad8f762c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.asm @@ -330,9 +330,9 @@ bitmap_clear: { .label bitmap = 9 .label y = 2 .label _3 = 9 - lda bitmap_plot_xlo+0 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 lda #0 sta y diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.cfg b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.cfg index 6f99b82a4..b09caee1f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.cfg @@ -299,7 +299,7 @@ init_screen::@return: scope:[init_screen] from init_screen::@1 [159] return [ ] ( main:2::init_screen:12 [ ] ) to:@return bitmap_clear: scope:[bitmap_clear] from main::@3 - [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) + [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log index 0ee30db89..b6209d445 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log @@ -2895,6 +2895,8 @@ Constant inlined init_screen::$0 = (const byte*) SCREEN#0+(word/signed word/dwor Constant inlined main::$8 = ((word))(const byte*) BITMAP#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 Constant inlined bitmap_init::bitmap#0 = (const byte*) BITMAP#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero bitmap_plot_xhi#0+0 +Simplifying constant plus zero bitmap_plot_xlo#0+0 Block Sequence Planned @begin @14 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return init_screen init_screen::@1 init_screen::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return Added new block during phi lifting lines::@4(between lines::@3 and lines::@1) Added new block during phi lifting bitmap_line_xdyi::@6(between bitmap_line_xdyi::@2 and bitmap_line_xdyi::@1) @@ -3395,7 +3397,7 @@ init_screen::@return: scope:[init_screen] from init_screen::@1 [159] return [ ] ( main:2::init_screen:12 [ ] ) to:@return bitmap_clear: scope:[bitmap_clear] from main::@3 - [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) + [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 @@ -4721,10 +4723,10 @@ bitmap_clear: { .label x = $22 .label y = $1f .label _3 = $3d - //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG301 [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) -- pbuz1=pbuz2 lda _3 @@ -5034,7 +5036,7 @@ Statement [146] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + Statement [149] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::lines:14::bitmap_line:21::bitmap_line_ydxd:50 [ lines::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::lines:14::bitmap_line:21::bitmap_line_ydxd:66 [ lines::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a Statement [156] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word/dword/signed dword) 20 [ init_screen::c#2 ] ( main:2::init_screen:12 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y Statement [158] if((byte*) init_screen::c#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1024) goto init_screen::@1 [ init_screen::c#1 ] ( main:2::init_screen:12 [ init_screen::c#1 ] ) always clobbers reg byte a -Statement [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [164] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:10 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:31 [ bitmap_clear::y#4 bitmap_clear::y#1 ] @@ -5079,7 +5081,7 @@ Statement [146] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + Statement [149] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::lines:14::bitmap_line:21::bitmap_line_ydxd:50 [ lines::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::lines:14::bitmap_line:21::bitmap_line_ydxd:66 [ lines::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a Statement [156] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word/dword/signed dword) 20 [ init_screen::c#2 ] ( main:2::init_screen:12 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y Statement [158] if((byte*) init_screen::c#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1024) goto init_screen::@1 [ init_screen::c#1 ] ( main:2::init_screen:12 [ init_screen::c#1 ] ) always clobbers reg byte a -Statement [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [164] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:10 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Statement [173] (byte~) bitmap_init::$0 ← (byte) bitmap_init::x#2 & (byte/word/signed word/dword/signed dword) 248 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ( main:2::bitmap_init:8 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ) always clobbers reg byte a @@ -6073,10 +6075,10 @@ bitmap_clear: { .label bitmap = 9 .label y = 2 .label _3 = 9 - //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG301 [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:9 @@ -7451,10 +7453,10 @@ bitmap_clear: { .label bitmap = 9 .label y = 2 .label _3 = 9 - //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG300 [160] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:10 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG301 [161] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:10 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:9 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.asm b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.asm index 8f934a8ca..9f58075e8 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.asm @@ -21,6 +21,6 @@ bool_const_vars: { } bool_const_if: { lda #'t' - sta SCREEN+0 + sta SCREEN rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.cfg b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.cfg index 665496d1d..ebfeef3ad 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.cfg @@ -44,7 +44,7 @@ bool_const_if: scope:[bool_const_if] from main [17] phi() [ ] ( main:2::bool_const_if:5 [ ] ) to:bool_const_if::@1 bool_const_if::@1: scope:[bool_const_if] from bool_const_if - [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) + [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) to:bool_const_if::@return bool_const_if::@return: scope:[bool_const_if] from bool_const_if::@1 [19] return [ ] ( main:2::bool_const_if:5 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.log b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.log index f264d4e2b..b2d7ec7e3 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-const.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-const.log @@ -446,6 +446,7 @@ Culled Empty Block (label) bool_const_vars::@6 Culled Empty Block (label) bool_const_vars::@7 Succesful SSA optimization Pass2CullEmptyBlocks OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @4 @end main main::@1 main::@2 main::@return bool_const_inline bool_const_inline::@1 bool_const_inline::@return bool_const_vars bool_const_vars::@3 bool_const_vars::@return bool_const_if bool_const_if::@1 bool_const_if::@return Block Sequence Planned @begin @4 @end main main::@1 main::@2 main::@return bool_const_inline bool_const_inline::@1 bool_const_inline::@return bool_const_vars bool_const_vars::@3 bool_const_vars::@return bool_const_if bool_const_if::@1 bool_const_if::@return Adding NOP phi() at start of @begin @@ -523,7 +524,7 @@ bool_const_if: scope:[bool_const_if] from main [17] phi() [ ] ( main:2::bool_const_if:5 [ ] ) to:bool_const_if::@1 bool_const_if::@1: scope:[bool_const_if] from bool_const_if - [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) + [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) to:bool_const_if::@return bool_const_if::@return: scope:[bool_const_if] from bool_const_if::@1 [19] return [ ] ( main:2::bool_const_if:5 [ ] ) @@ -632,9 +633,9 @@ bool_const_if: { jmp b1 //SEG33 bool_const_if::@1 b1: - //SEG34 [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG34 [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #'t' - sta SCREEN+0 + sta SCREEN jmp breturn //SEG35 bool_const_if::@return breturn: @@ -645,7 +646,7 @@ bool_const_if: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't' [ ] ( main:2::bool_const_inline:9 [ ] ) always clobbers reg byte a Statement [15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f' [ ] ( main:2::bool_const_vars:7 [ ] ) always clobbers reg byte a -Statement [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) always clobbers reg byte a +Statement [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -746,9 +747,9 @@ bool_const_if: { jmp b1 //SEG33 bool_const_if::@1 b1: - //SEG34 [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG34 [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #'t' - sta SCREEN+0 + sta SCREEN jmp breturn //SEG35 bool_const_if::@return breturn: @@ -879,9 +880,9 @@ bool_const_vars: { //SEG32 bool_const_if bool_const_if: { //SEG33 bool_const_if::@1 - //SEG34 [18] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG34 [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #'t' - sta SCREEN+0 + sta SCREEN //SEG35 bool_const_if::@return //SEG36 [19] return [ ] ( main:2::bool_const_if:5 [ ] ) rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.asm b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.asm index f96378a59..b5dc8dd7e 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.asm @@ -4,7 +4,7 @@ jsr main main: { lda #1 - sta $400+0 + sta $400 lda #0 sta $400+1 lda #1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.cfg b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.cfg index 8df18bce0..85c29a1ac 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) + [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) [6] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true [ ] ( main:2 [ ] ) [7] if(*(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@2 [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.log b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.log index 618bce278..0d5f2a0c6 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/bool-pointer.log @@ -129,6 +129,7 @@ Constant inlined main::bscreen#2 = ++((bool*))(word/signed word/dword/signed dwo Constant inlined main::bscreen#0 = ((bool*))(word/signed word/dword/signed dword) 1024 Constant inlined main::bscreen#1 = ((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero ((bool*))1024+0 Block Sequence Planned @begin @1 @end main main::@return main::@2 Block Sequence Planned @begin @1 @end main main::@return main::@2 Adding NOP phi() at start of @begin @@ -157,7 +158,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) + [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) [6] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true [ ] ( main:2 [ ] ) [7] if(*(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@2 [ ] ( main:2 [ ] ) @@ -199,9 +200,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 + //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #1 - sta $400+0 + sta $400 //SEG10 [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #0 sta $400+1 @@ -226,7 +227,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] if(*(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@2 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -261,9 +262,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 + //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #1 - sta $400+0 + sta $400 //SEG10 [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #0 sta $400+1 @@ -330,9 +331,9 @@ Score: 43 //SEG7 @end //SEG8 main main: { - //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 0) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 + //SEG9 [4] *(((bool*))(word/signed word/dword/signed dword) 1024) ← true [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #1 - sta $400+0 + sta $400 //SEG10 [5] *(((bool*))(word/signed word/dword/signed dword) 1024+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) -- _deref_pboc1=vboc2 lda #0 sta $400+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/bresenhamarr.asm b/src/test/java/dk/camelot64/kickc/test/ref/bresenhamarr.asm index 60eb3d1ac..f14708f16 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/bresenhamarr.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/bresenhamarr.asm @@ -15,9 +15,7 @@ main: { sta y ldy #yd/2 tax - lda #<0+0*$28 sta idx - lda #>0+0*$28 sta idx+1 b1: lda #main::@1#2] -- vbuz1=vbuc1 lda #0 sta x - //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 [phi:main->main::@1#3] -- vwuz1=vbuc1 - lda #<0+0*$28 + //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 + lda #<0 sta idx - lda #>0+0*$28 + lda #>0 sta idx+1 jmp b1 //SEG15 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -686,10 +688,10 @@ main: { ldy #yd/2 //SEG13 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#2] -- vbuxx=vbuc1 ldx #0 - //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 [phi:main->main::@1#3] -- vwuz1=vbuc1 - lda #<0+0*$28 + //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 + lda #<0 sta idx - lda #>0+0*$28 + lda #>0 sta idx+1 jmp b1 //SEG15 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -774,6 +776,9 @@ Removing instruction jmp b2 Removing instruction jmp breturn Succesful ASM optimization Pass5NextJumpElimination Replacing instruction ldx #0 with TAX +Removing instruction lda #<0 +Removing instruction lda #>0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination Replacing label b2_from_b1 with b2 Replacing label b2_from_b1 with b2 Replacing label b1_from_b2 with b1 @@ -842,7 +847,7 @@ zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ] FINAL ASSEMBLER -Score: 1112 +Score: 1072 //SEG0 Basic Upstart .pc = $801 "Basic" @@ -875,10 +880,8 @@ main: { ldy #yd/2 //SEG13 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#2] -- vbuxx=vbuc1 tax - //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 [phi:main->main::@1#3] -- vwuz1=vbuc1 - lda #<0+0*$28 + //SEG14 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 sta idx - lda #>0+0*$28 sta idx+1 //SEG15 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] //SEG16 [5] phi (byte) main::y#2 = (byte) main::y#4 [phi:main::@2->main::@1#0] -- register_copy diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm index 8f414b21a..9105fd43b 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm @@ -87,7 +87,6 @@ .const form_fields_cnt = $24 .const FORM_CURSOR_BLINK = $28 .const KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT - .label form_preset = form_fields_val+0 .label form_ctrl_bmm = form_fields_val+1 .label form_ctrl_mcm = form_fields_val+2 .label form_ctrl_ecm = form_fields_val+3 @@ -892,7 +891,7 @@ form_mode: { jsr print_str_lines jsr form_set_screen jsr form_render_values - lda form_preset + lda form_fields_val jsr render_preset_name lda #($ffffffff&FORM_CHARSET)/$10000 sta DTV_GRAPHICS_VIC_BANK @@ -928,7 +927,7 @@ form_mode: { lda #0 sta BGCOL sta BORDERCOL - lda form_preset + lda form_fields_val sta preset_current b5: lda RASTER @@ -940,14 +939,14 @@ form_mode: { beq b8 rts b8: - lda form_preset + lda form_fields_val cmp preset_current beq b5 jsr apply_preset - lda form_preset + lda form_fields_val sta preset_current jsr form_render_values - lda form_preset + lda form_fields_val jsr render_preset_name jmp b5 } @@ -2117,9 +2116,9 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - lda bitmap_plot_xlo+0 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 lda #0 sta y diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.cfg b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.cfg index aede7bbe1..960471ec1 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.cfg @@ -500,7 +500,7 @@ form_mode::@27: scope:[form_mode] from form_mode::@26 [269] call form_render_values [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) to:form_mode::@28 form_mode::@28: scope:[form_mode] from form_mode::@27 - [270] (byte) render_preset_name::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) + [270] (byte) render_preset_name::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) [271] call render_preset_name [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) to:form_mode::@29 form_mode::@29: scope:[form_mode] from form_mode::@28 @@ -526,7 +526,7 @@ form_mode::@1: scope:[form_mode] from form_mode::@1 form_mode::@29 form_mode::@10: scope:[form_mode] from form_mode::@1 [288] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) [289] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) - [290] (byte) form_mode::preset_current#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) + [290] (byte) form_mode::preset_current#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) to:form_mode::@2 form_mode::@2: scope:[form_mode] from form_mode::@10 form_mode::@32 form_mode::@8 [291] (byte) form_mode::preset_current#6 ← phi( form_mode::@10/(byte) form_mode::preset_current#0 form_mode::@32/(byte) form_mode::preset_current#1 ) [ keyboard_events_size#47 form_cursor_count#21 form_field_idx#28 form_mode::preset_current#6 ] ( main:2::form_mode:13 [ keyboard_events_size#47 form_cursor_count#21 form_field_idx#28 form_mode::preset_current#6 ] ) @@ -550,18 +550,18 @@ form_mode::@return: scope:[form_mode] from form_mode::@30 [298] return [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:@return form_mode::@8: scope:[form_mode] from form_mode::@30 - [299] if((byte) form_mode::preset_current#6==*((const byte*) form_preset#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) + [299] if((byte) form_mode::preset_current#6==*((const byte[]) form_fields_val#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:form_mode::@18 form_mode::@18: scope:[form_mode] from form_mode::@8 - [300] (byte) apply_preset::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) + [300] (byte) apply_preset::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) [301] call apply_preset [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:form_mode::@31 form_mode::@31: scope:[form_mode] from form_mode::@18 - [302] (byte) form_mode::preset_current#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) + [302] (byte) form_mode::preset_current#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) [303] call form_render_values [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) to:form_mode::@32 form_mode::@32: scope:[form_mode] from form_mode::@31 - [304] (byte) render_preset_name::idx#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) + [304] (byte) render_preset_name::idx#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) [305] call render_preset_name [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) to:form_mode::@2 render_preset_name: scope:[render_preset_name] from form_mode::@28 form_mode::@32 @@ -1467,7 +1467,7 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 [746] return [ ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 ] ) to:@return bitmap_clear: scope:[bitmap_clear] from gfx_init_vic_bitmap::@3 - [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) + [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log index 6bfc053d9..e9bab88b5 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log @@ -16013,6 +16013,35 @@ Inlining constant with var siblings (const byte*) render_preset_name::name#8 Inlining constant with var siblings (const byte*) render_preset_name::name#9 Inlining constant with var siblings (const byte*) render_preset_name::name#10 Inlining constant with var siblings (const byte*) render_preset_name::name#11 +Simplifying constant plus zero form_fields_val#0+0 +Simplifying constant plus zero bitmap_plot_xhi#0+0 +Simplifying constant plus zero bitmap_plot_xlo#0+0 +Inlining constant with var siblings (const byte*) render_preset_name::name#0 +Inlining constant with var siblings (const byte*) render_preset_name::name#1 +Inlining constant with var siblings (const byte*) render_preset_name::name#2 +Inlining constant with var siblings (const byte*) render_preset_name::name#3 +Inlining constant with var siblings (const byte*) render_preset_name::name#4 +Inlining constant with var siblings (const byte*) render_preset_name::name#5 +Inlining constant with var siblings (const byte*) render_preset_name::name#6 +Inlining constant with var siblings (const byte*) render_preset_name::name#7 +Inlining constant with var siblings (const byte*) render_preset_name::name#8 +Inlining constant with var siblings (const byte*) render_preset_name::name#9 +Inlining constant with var siblings (const byte*) render_preset_name::name#10 +Inlining constant with var siblings (const byte*) render_preset_name::name#11 +Constant inlined form_preset#0 = (const byte[]) form_fields_val#0 +Succesful SSA optimization Pass2ConstantInlining +Inlining constant with var siblings (const byte*) render_preset_name::name#0 +Inlining constant with var siblings (const byte*) render_preset_name::name#1 +Inlining constant with var siblings (const byte*) render_preset_name::name#2 +Inlining constant with var siblings (const byte*) render_preset_name::name#3 +Inlining constant with var siblings (const byte*) render_preset_name::name#4 +Inlining constant with var siblings (const byte*) render_preset_name::name#5 +Inlining constant with var siblings (const byte*) render_preset_name::name#6 +Inlining constant with var siblings (const byte*) render_preset_name::name#7 +Inlining constant with var siblings (const byte*) render_preset_name::name#8 +Inlining constant with var siblings (const byte*) render_preset_name::name#9 +Inlining constant with var siblings (const byte*) render_preset_name::name#10 +Inlining constant with var siblings (const byte*) render_preset_name::name#11 Inlining constant with var siblings (const byte*) render_preset_name::name#0 Inlining constant with var siblings (const byte*) render_preset_name::name#1 Inlining constant with var siblings (const byte*) render_preset_name::name#2 @@ -17401,7 +17430,7 @@ form_mode::@27: scope:[form_mode] from form_mode::@26 [269] call form_render_values [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) to:form_mode::@28 form_mode::@28: scope:[form_mode] from form_mode::@27 - [270] (byte) render_preset_name::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) + [270] (byte) render_preset_name::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) [271] call render_preset_name [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) to:form_mode::@29 form_mode::@29: scope:[form_mode] from form_mode::@28 @@ -17427,7 +17456,7 @@ form_mode::@1: scope:[form_mode] from form_mode::@1 form_mode::@29 form_mode::@10: scope:[form_mode] from form_mode::@1 [288] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) [289] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) - [290] (byte) form_mode::preset_current#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) + [290] (byte) form_mode::preset_current#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) to:form_mode::@2 form_mode::@2: scope:[form_mode] from form_mode::@10 form_mode::@32 form_mode::@8 [291] (byte) form_mode::preset_current#6 ← phi( form_mode::@10/(byte) form_mode::preset_current#0 form_mode::@32/(byte) form_mode::preset_current#1 ) [ keyboard_events_size#47 form_cursor_count#21 form_field_idx#28 form_mode::preset_current#6 ] ( main:2::form_mode:13 [ keyboard_events_size#47 form_cursor_count#21 form_field_idx#28 form_mode::preset_current#6 ] ) @@ -17451,18 +17480,18 @@ form_mode::@return: scope:[form_mode] from form_mode::@30 [298] return [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:@return form_mode::@8: scope:[form_mode] from form_mode::@30 - [299] if((byte) form_mode::preset_current#6==*((const byte*) form_preset#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) + [299] if((byte) form_mode::preset_current#6==*((const byte[]) form_fields_val#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:form_mode::@18 form_mode::@18: scope:[form_mode] from form_mode::@8 - [300] (byte) apply_preset::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) + [300] (byte) apply_preset::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) [301] call apply_preset [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) to:form_mode::@31 form_mode::@31: scope:[form_mode] from form_mode::@18 - [302] (byte) form_mode::preset_current#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) + [302] (byte) form_mode::preset_current#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) [303] call form_render_values [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) to:form_mode::@32 form_mode::@32: scope:[form_mode] from form_mode::@31 - [304] (byte) render_preset_name::idx#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) + [304] (byte) render_preset_name::idx#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) [305] call render_preset_name [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) to:form_mode::@2 render_preset_name: scope:[render_preset_name] from form_mode::@28 form_mode::@32 @@ -18368,7 +18397,7 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 [746] return [ ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 ] ) to:@return bitmap_clear: scope:[bitmap_clear] from gfx_init_vic_bitmap::@3 - [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) + [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 @@ -20380,7 +20409,6 @@ INITIAL ASM .const form_fields_cnt = $24 .const FORM_CURSOR_BLINK = $28 .const KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT - .label form_preset = form_fields_val+0 .label form_ctrl_bmm = form_fields_val+1 .label form_ctrl_mcm = form_fields_val+2 .label form_ctrl_ecm = form_fields_val+3 @@ -22209,8 +22237,8 @@ form_mode: { jmp b28 //SEG515 form_mode::@28 b28: - //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta render_preset_name.idx //SEG517 [271] call render_preset_name [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) //SEG518 [306] phi from form_mode::@28 to render_preset_name [phi:form_mode::@28->render_preset_name] @@ -22287,8 +22315,8 @@ form_mode: { //SEG543 [289] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL - //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG545 [291] phi from form_mode::@10 form_mode::@32 to form_mode::@2 [phi:form_mode::@10/form_mode::@32->form_mode::@2] b2_from_b10: @@ -22339,23 +22367,23 @@ form_mode: { rts //SEG566 form_mode::@8 b8: - //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte*) form_preset#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 - lda form_preset + //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte[]) form_fields_val#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 + lda form_fields_val cmp preset_current beq b2_from_b8 jmp b18 //SEG568 form_mode::@18 b18: - //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta apply_preset.idx //SEG570 [301] call apply_preset [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) jsr apply_preset jmp b31 //SEG571 form_mode::@31 b31: - //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG573 [303] call form_render_values [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG574 [330] phi from form_mode::@31 to form_render_values [phi:form_mode::@31->form_render_values] @@ -22364,8 +22392,8 @@ form_mode: { jmp b32 //SEG575 form_mode::@32 b32: - //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta render_preset_name.idx //SEG577 [305] call render_preset_name [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG578 [306] phi from form_mode::@32 to render_preset_name [phi:form_mode::@32->render_preset_name] @@ -25193,10 +25221,10 @@ bitmap_clear: { .label x = $7e .label y = $7b .label _3 = $14d - //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1517 [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) -- pbuz1=pbuz2 lda _3 @@ -26285,7 +26313,7 @@ Statement [727] (byte) bitmap_line_xdyd::e#2 ← (byte) bitmap_line_xdyd::e#1 - Statement [733] (byte) bitmap_line_ydxd::e#0 ← (byte) bitmap_line_ydxd::xd#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ) always clobbers reg byte a Statement [739] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + (byte) bitmap_line_ydxd::xd#2 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ) always clobbers reg byte a Statement [742] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a -Statement [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [751] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] @@ -26546,7 +26574,7 @@ Statement [727] (byte) bitmap_line_xdyd::e#2 ← (byte) bitmap_line_xdyd::e#1 - Statement [733] (byte) bitmap_line_ydxd::e#0 ← (byte) bitmap_line_ydxd::xd#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ) always clobbers reg byte a Statement [739] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + (byte) bitmap_line_ydxd::xd#2 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ) always clobbers reg byte a Statement [742] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:643 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_line:614::bitmap_line_ydxd:659 [ gfx_init_vic_bitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a -Statement [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [751] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Statement [760] (byte~) bitmap_init::$0 ← (byte) bitmap_init::x#2 & (byte/word/signed word/dword/signed dword) 248 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_init:606 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ) always clobbers reg byte a @@ -27425,7 +27453,6 @@ ASSEMBLER BEFORE OPTIMIZATION .const form_fields_cnt = $24 .const FORM_CURSOR_BLINK = $28 .const KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT - .label form_preset = form_fields_val+0 .label form_ctrl_bmm = form_fields_val+1 .label form_ctrl_mcm = form_fields_val+2 .label form_ctrl_ecm = form_fields_val+3 @@ -29017,8 +29044,8 @@ form_mode: { jmp b28 //SEG515 form_mode::@28 b28: - //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuaa=_deref_pbuc1 - lda form_preset + //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuaa=_deref_pbuc1 + lda form_fields_val //SEG517 [271] call render_preset_name [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) //SEG518 [306] phi from form_mode::@28 to render_preset_name [phi:form_mode::@28->render_preset_name] render_preset_name_from_b28: @@ -29091,8 +29118,8 @@ form_mode: { //SEG543 [289] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL - //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG545 [291] phi from form_mode::@10 form_mode::@32 to form_mode::@2 [phi:form_mode::@10/form_mode::@32->form_mode::@2] b2_from_b10: @@ -29141,22 +29168,22 @@ form_mode: { rts //SEG566 form_mode::@8 b8: - //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte*) form_preset#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 - lda form_preset + //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte[]) form_fields_val#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 + lda form_fields_val cmp preset_current beq b2_from_b8 jmp b18 //SEG568 form_mode::@18 b18: - //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuaa=_deref_pbuc1 - lda form_preset + //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuaa=_deref_pbuc1 + lda form_fields_val //SEG570 [301] call apply_preset [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) jsr apply_preset jmp b31 //SEG571 form_mode::@31 b31: - //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG573 [303] call form_render_values [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG574 [330] phi from form_mode::@31 to form_render_values [phi:form_mode::@31->form_render_values] @@ -29165,8 +29192,8 @@ form_mode: { jmp b32 //SEG575 form_mode::@32 b32: - //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuaa=_deref_pbuc1 - lda form_preset + //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuaa=_deref_pbuc1 + lda form_fields_val //SEG577 [305] call render_preset_name [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG578 [306] phi from form_mode::@32 to render_preset_name [phi:form_mode::@32->render_preset_name] render_preset_name_from_b32: @@ -31776,10 +31803,10 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1517 [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:3 @@ -33497,7 +33524,7 @@ Removing instruction jmp b2 Succesful ASM optimization Pass5NextJumpElimination Removing instruction ldy col Replacing instruction ldy #0 with TAY -Removing instruction lda form_preset +Removing instruction lda form_fields_val Removing instruction lda x0 Succesful ASM optimization Pass5UnnecesaryLoadElimination Removing instruction b2: @@ -33526,18 +33553,18 @@ Removing instruction b37: Succesful ASM optimization Pass5UnusedLabelElimination Removing unreachable instruction jmp b7 Succesful ASM optimization Pass5UnreachableCodeElimination -Fixing long branch [686] beq b5 to bne -Fixing long branch [690] beq b6 to bne -Fixing long branch [694] beq b7 to bne -Fixing long branch [698] beq b8 to bne -Fixing long branch [684] beq b4 to bne -Fixing long branch [704] beq b9 to bne -Fixing long branch [708] beq b10 to bne -Fixing long branch [712] beq b11 to bne -Fixing long branch [716] beq b12 to bne -Fixing long branch [682] beq b3 to bne -Fixing long branch [722] beq b13 to bne -Fixing long branch [1246] bmi b2 to bpl +Fixing long branch [685] beq b5 to bne +Fixing long branch [689] beq b6 to bne +Fixing long branch [693] beq b7 to bne +Fixing long branch [697] beq b8 to bne +Fixing long branch [683] beq b4 to bne +Fixing long branch [703] beq b9 to bne +Fixing long branch [707] beq b10 to bne +Fixing long branch [711] beq b11 to bne +Fixing long branch [715] beq b12 to bne +Fixing long branch [681] beq b3 to bne +Fixing long branch [721] beq b13 to bne +Fixing long branch [1245] bmi b2 to bpl FINAL SYMBOL TABLE (label) @62 @@ -34169,7 +34196,6 @@ FINAL SYMBOL TABLE (byte) form_mode::preset_current#1 preset_current zp ZP_BYTE:15 50.5 (byte) form_mode::preset_current#6 preset_current zp ZP_BYTE:15 157.71428571428572 (byte*) form_preset -(const byte*) form_preset#0 form_preset = (const byte[]) form_fields_val#0+(byte/signed byte/word/signed word/dword/signed dword) 0 (void()) form_render_values() (label) form_render_values::@1 (label) form_render_values::@3 @@ -35160,7 +35186,6 @@ Score: 11369461 .const form_fields_cnt = $24 .const FORM_CURSOR_BLINK = $28 .const KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT - .label form_preset = form_fields_val+0 .label form_ctrl_bmm = form_fields_val+1 .label form_ctrl_mcm = form_fields_val+2 .label form_ctrl_ecm = form_fields_val+3 @@ -36500,8 +36525,8 @@ form_mode: { //SEG514 [330] phi from form_mode::@27 to form_render_values [phi:form_mode::@27->form_render_values] jsr form_render_values //SEG515 form_mode::@28 - //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuaa=_deref_pbuc1 - lda form_preset + //SEG516 [270] (byte) render_preset_name::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 render_preset_name::idx#0 ] ) -- vbuaa=_deref_pbuc1 + lda form_fields_val //SEG517 [271] call render_preset_name [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) //SEG518 [306] phi from form_mode::@28 to render_preset_name [phi:form_mode::@28->render_preset_name] //SEG519 [306] phi (byte) render_preset_name::idx#10 = (byte) render_preset_name::idx#0 [phi:form_mode::@28->render_preset_name#0] -- register_copy @@ -36564,8 +36589,8 @@ form_mode: { sta BGCOL //SEG543 [289] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ) -- _deref_pbuc1=vbuc2 sta BORDERCOL - //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte*) form_preset#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG544 [290] (byte) form_mode::preset_current#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 form_mode::preset_current#0 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG545 [291] phi from form_mode::@10 form_mode::@32 to form_mode::@2 [phi:form_mode::@10/form_mode::@32->form_mode::@2] //SEG546 [291] phi (byte) form_mode::preset_current#6 = (byte) form_mode::preset_current#0 [phi:form_mode::@10/form_mode::@32->form_mode::@2#0] -- register_copy @@ -36600,24 +36625,24 @@ form_mode: { rts //SEG566 form_mode::@8 b8: - //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte*) form_preset#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 - lda form_preset + //SEG567 [299] if((byte) form_mode::preset_current#6==*((const byte[]) form_fields_val#0)) goto form_mode::@2 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) -- vbuz1_eq__deref_pbuc1_then_la1 + lda form_fields_val cmp preset_current beq b5 //SEG568 form_mode::@18 - //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuaa=_deref_pbuc1 + //SEG569 [300] (byte) apply_preset::idx#0 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 apply_preset::idx#0 ] ) -- vbuaa=_deref_pbuc1 //SEG570 [301] call apply_preset [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 ] ) jsr apply_preset //SEG571 form_mode::@31 - //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 - lda form_preset + //SEG572 [302] (byte) form_mode::preset_current#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) -- vbuz1=_deref_pbuc1 + lda form_fields_val sta preset_current //SEG573 [303] call form_render_values [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG574 [330] phi from form_mode::@31 to form_render_values [phi:form_mode::@31->form_render_values] jsr form_render_values //SEG575 form_mode::@32 - //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte*) form_preset#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuaa=_deref_pbuc1 - lda form_preset + //SEG576 [304] (byte) render_preset_name::idx#1 ← *((const byte[]) form_fields_val#0) [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 render_preset_name::idx#1 ] ) -- vbuaa=_deref_pbuc1 + lda form_fields_val //SEG577 [305] call render_preset_name [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ( main:2::form_mode:13 [ form_cursor_count#16 keyboard_events_size#24 form_field_idx#18 form_mode::preset_current#1 ] ) //SEG578 [306] phi from form_mode::@32 to render_preset_name [phi:form_mode::@32->render_preset_name] //SEG579 [306] phi (byte) render_preset_name::idx#10 = (byte) render_preset_name::idx#1 [phi:form_mode::@32->render_preset_name#0] -- register_copy @@ -38762,10 +38787,10 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1516 [747] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1517 [748] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::gfx_init:10::gfx_init_vic_bitmap:462::bitmap_clear:608 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.sym b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.sym index bb9930d4d..28c4ed61d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.sym +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.sym @@ -627,7 +627,6 @@ (byte) form_mode::preset_current#1 preset_current zp ZP_BYTE:15 50.5 (byte) form_mode::preset_current#6 preset_current zp ZP_BYTE:15 157.71428571428572 (byte*) form_preset -(const byte*) form_preset#0 form_preset = (const byte[]) form_fields_val#0+(byte/signed byte/word/signed word/dword/signed dword) 0 (void()) form_render_values() (label) form_render_values::@1 (label) form_render_values::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.asm b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.asm index 81d551d7e..0ed58ac63 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.asm @@ -1609,9 +1609,9 @@ bitmap_clear: { .label bitmap = 2 .label y = 4 .label _3 = 2 - lda bitmap_plot_xlo+0 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 lda #0 sta y diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.cfg b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.cfg index 9cc82522f..ebb540958 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.cfg @@ -1264,7 +1264,7 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 [720] return [ ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 ] ) to:@return bitmap_clear: scope:[bitmap_clear] from mode_stdbitmap::@9 - [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) + [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.log b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.log index 777317f6f..5de982f11 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxmodes.log @@ -14529,6 +14529,8 @@ Constant inlined bitmap_init::$1 = >(const byte*) mode_stdbitmap::BITMAP#0 Constant inlined dtv_control#39 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0 Constant inlined dtv_control#36 = (const byte) DTV_HIGHCOLOR#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero bitmap_plot_xhi#0+0 +Simplifying constant plus zero bitmap_plot_xlo#0+0 Block Sequence Planned @begin @48 @end main main::@2 menu menu::@1 menu::@2 menu::@19 menu::@47 menu::@48 menu::@4 menu::@50 menu::@22 menu::@return menu::@6 menu::@51 menu::@24 menu::@7 menu::@53 menu::@26 menu::@8 menu::@55 menu::@28 menu::@9 menu::@57 menu::@30 menu::@10 menu::@59 menu::@32 menu::@11 menu::@61 menu::@34 menu::@12 menu::@63 menu::@36 menu::@13 menu::@65 menu::@38 menu::@14 menu::@67 menu::@40 menu::@15 menu::@69 menu::@42 menu::@16 menu::@71 menu::@44 mode_8bppchunkybmm mode_8bppchunkybmm::@1 mode_8bppchunkybmm::@5 mode_8bppchunkybmm::@2 mode_8bppchunkybmm::@3 mode_8bppchunkybmm::@6 mode_8bppchunkybmm::@10 mode_8bppchunkybmm::@4 mode_8bppchunkybmm::@7 mode_8bppchunkybmm::@8 mode_8bppchunkybmm::@11 mode_8bppchunkybmm::@return mode_ctrl mode_ctrl::@1 mode_ctrl::@4 mode_ctrl::@6 mode_ctrl::@32 mode_ctrl::@return mode_ctrl::@7 mode_ctrl::@33 mode_ctrl::@23 mode_ctrl::@8 mode_ctrl::@34 mode_ctrl::@24 mode_ctrl::@9 mode_ctrl::@35 mode_ctrl::@25 mode_ctrl::@10 mode_ctrl::@36 mode_ctrl::@26 mode_ctrl::@11 mode_ctrl::@37 mode_ctrl::@27 mode_ctrl::@12 mode_ctrl::@38 mode_ctrl::@28 mode_ctrl::@13 mode_ctrl::@39 mode_ctrl::@29 mode_ctrl::@14 mode_ctrl::@30 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return mode_8bpppixelcell mode_8bpppixelcell::@1 mode_8bpppixelcell::@2 mode_8bpppixelcell::@3 mode_8bpppixelcell::@9 mode_8bpppixelcell::@10 mode_8bpppixelcell::@4 mode_8bpppixelcell::@5 mode_8bpppixelcell::@6 mode_8bpppixelcell::@11 mode_8bpppixelcell::@7 mode_8bpppixelcell::@12 mode_8bpppixelcell::@13 mode_8bpppixelcell::@14 mode_8bpppixelcell::@return mode_sixsfred mode_sixsfred::@1 mode_sixsfred::@8 mode_sixsfred::@2 mode_sixsfred::@3 mode_sixsfred::@9 mode_sixsfred::@4 mode_sixsfred::@5 mode_sixsfred::@11 mode_sixsfred::@6 mode_sixsfred::@7 mode_sixsfred::@13 mode_sixsfred::@14 mode_sixsfred::@return mode_twoplanebitmap mode_twoplanebitmap::@1 mode_twoplanebitmap::@10 mode_twoplanebitmap::@2 mode_twoplanebitmap::@3 mode_twoplanebitmap::@11 mode_twoplanebitmap::@4 mode_twoplanebitmap::@5 mode_twoplanebitmap::@13 mode_twoplanebitmap::@7 mode_twoplanebitmap::@15 mode_twoplanebitmap::@8 mode_twoplanebitmap::@9 mode_twoplanebitmap::@17 mode_twoplanebitmap::@18 mode_twoplanebitmap::@return mode_twoplanebitmap::@6 mode_sixsfred2 mode_sixsfred2::@1 mode_sixsfred2::@8 mode_sixsfred2::@2 mode_sixsfred2::@3 mode_sixsfred2::@9 mode_sixsfred2::@4 mode_sixsfred2::@5 mode_sixsfred2::@11 mode_sixsfred2::@6 mode_sixsfred2::@7 mode_sixsfred2::@13 mode_sixsfred2::@14 mode_sixsfred2::@return mode_hicolmcchar mode_hicolmcchar::@1 mode_hicolmcchar::@4 mode_hicolmcchar::@2 mode_hicolmcchar::@3 mode_hicolmcchar::@5 mode_hicolmcchar::@6 mode_hicolmcchar::@return mode_hicolecmchar mode_hicolecmchar::@1 mode_hicolecmchar::@4 mode_hicolecmchar::@2 mode_hicolecmchar::@3 mode_hicolecmchar::@5 mode_hicolecmchar::@6 mode_hicolecmchar::@return mode_hicolstdchar mode_hicolstdchar::@1 mode_hicolstdchar::@4 mode_hicolstdchar::@2 mode_hicolstdchar::@3 mode_hicolstdchar::@5 mode_hicolstdchar::@6 mode_hicolstdchar::@return mode_stdbitmap mode_stdbitmap::@1 mode_stdbitmap::@5 mode_stdbitmap::@2 mode_stdbitmap::@3 mode_stdbitmap::@6 mode_stdbitmap::@7 mode_stdbitmap::@9 mode_stdbitmap::@4 mode_stdbitmap::@11 mode_stdbitmap::@8 mode_stdbitmap::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return mode_mcchar mode_mcchar::@1 mode_mcchar::@4 mode_mcchar::@2 mode_mcchar::@3 mode_mcchar::@5 mode_mcchar::@6 mode_mcchar::@return mode_ecmchar mode_ecmchar::@1 mode_ecmchar::@4 mode_ecmchar::@2 mode_ecmchar::@3 mode_ecmchar::@5 mode_ecmchar::@6 mode_ecmchar::@return mode_stdchar mode_stdchar::@1 mode_stdchar::@4 mode_stdchar::@2 mode_stdchar::@3 mode_stdchar::@5 mode_stdchar::@6 mode_stdchar::@return print_str_lines print_str_lines::@1 print_str_lines::@return print_str_lines::@4 print_str_lines::@8 print_str_lines::@5 print_str_lines::@9 print_ln print_ln::@1 print_ln::@return print_cls print_cls::@1 print_cls::@return print_set_screen print_set_screen::@return Added new block during phi lifting menu::@74(between menu::@1 and menu::@1) Added new block during phi lifting menu::@75(between menu::@2 and menu::@2) @@ -16448,7 +16450,7 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 [720] return [ ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 ] ) to:@return bitmap_clear: scope:[bitmap_clear] from mode_stdbitmap::@9 - [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) + [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 @@ -22366,10 +22368,10 @@ bitmap_clear: { .label x = $7e .label y = $7b .label _3 = $10d - //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1347 [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) -- pbuz1=pbuz2 lda _3 @@ -23751,7 +23753,7 @@ Statement [701] (byte) bitmap_line_xdyd::e#2 ← (byte) bitmap_line_xdyd::e#1 - Statement [707] (byte) bitmap_line_ydxd::e#0 ← (byte) bitmap_line_ydxd::xd#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ) always clobbers reg byte a Statement [713] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + (byte) bitmap_line_ydxd::xd#2 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ) always clobbers reg byte a Statement [716] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a -Statement [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [725] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] @@ -24096,7 +24098,7 @@ Statement [701] (byte) bitmap_line_xdyd::e#2 ← (byte) bitmap_line_xdyd::e#1 - Statement [707] (byte) bitmap_line_ydxd::e#0 ← (byte) bitmap_line_ydxd::xd#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::x#5 bitmap_line_ydxd::y#7 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::e#0 ] ) always clobbers reg byte a Statement [713] (byte) bitmap_line_ydxd::e#1 ← (byte) bitmap_line_ydxd::e#3 + (byte) bitmap_line_ydxd::xd#2 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::x#3 bitmap_line_ydxd::y#3 bitmap_line_ydxd::e#1 ] ) always clobbers reg byte a Statement [716] (byte) bitmap_line_ydxd::e#2 ← (byte) bitmap_line_ydxd::e#1 - (byte) bitmap_line_ydxd::yd#5 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:617 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] main:2::menu:9::mode_stdbitmap:62::bitmap_line:586::bitmap_line_ydxd:633 [ mode_stdbitmap::l#2 bitmap_line_ydxd::xd#2 bitmap_line_ydxd::yd#5 bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y#3 bitmap_line_ydxd::x#2 bitmap_line_ydxd::e#2 ] ) always clobbers reg byte a -Statement [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [725] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Statement [734] (byte~) bitmap_init::$0 ← (byte) bitmap_init::x#2 & (byte/word/signed word/dword/signed dword) 248 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_init:578 [ bitmap_init::x#2 bitmap_init::bits#3 bitmap_init::$0 ] ) always clobbers reg byte a @@ -28557,10 +28559,10 @@ bitmap_clear: { .label bitmap = 2 .label y = 4 .label _3 = 2 - //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1347 [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:2 @@ -34709,10 +34711,10 @@ bitmap_clear: { .label bitmap = 2 .label y = 4 .label _3 = 2 - //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_xlo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_xlo+0 + //SEG1346 [721] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_xhi#0) w= *((const byte[256]) bitmap_plot_xlo#0) [ bitmap_clear::$3 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_xlo sta _3 - lda bitmap_plot_xhi+0 + lda bitmap_plot_xhi sta _3+1 //SEG1347 [722] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::menu:9::mode_stdbitmap:62::bitmap_clear:580 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.asm b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.asm index f40e06ace..7620013d2 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.asm @@ -12,10 +12,10 @@ main: { .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 lda #midw - sta SCREEN+0 + sta SCREEN lda #midb sta SCREEN+1 - lda SCREEN+0 + lda SCREEN cmp SCREEN+1 beq b1 lda #2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.cfg b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.cfg index 7a461395a..5d604af39 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.cfg @@ -8,9 +8,9 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) - [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) + [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) to:main::@3 main::@3: scope:[main] from main [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.log b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.log index 22384f84c..5c07cd193 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/cast-precedence-problem.log @@ -214,6 +214,8 @@ Constant inlined main::$1 = (const word) main::sumw#0>>(byte/signed byte/word/si Constant inlined main::$2 = ((byte))(const word) main::sumw#0>>(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined main::$0 = (const byte) main::min#0+(const byte) main::max#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant plus zero main::SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@3 main::@return main::@1 Block Sequence Planned @begin @1 @end main main::@3 main::@return main::@1 Adding NOP phi() at start of @begin @@ -242,9 +244,9 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) - [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) + [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) to:main::@3 main::@3: scope:[main] from main [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) @@ -301,14 +303,14 @@ main: { .const sumw = min+max .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midw - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 - //SEG11 [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 - lda SCREEN+0 + //SEG11 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + lda SCREEN cmp SCREEN+1 beq b1 jmp b3 @@ -331,9 +333,9 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -374,14 +376,14 @@ main: { .const sumw = min+max .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midw - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 - //SEG11 [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 - lda SCREEN+0 + //SEG11 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + lda SCREEN cmp SCREEN+1 beq b1 jmp b3 @@ -470,14 +472,14 @@ main: { .const sumw = min+max .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midw - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 - //SEG11 [6] if(*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 - lda SCREEN+0 + //SEG11 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + lda SCREEN cmp SCREEN+1 beq b1 //SEG12 main::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.asm b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.asm index dde6c69df..7eb6108c0 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.asm @@ -5,7 +5,7 @@ main: { .label screen = $400 lda #'c' - sta screen+0 + sta screen sta screen+$28 lda #'m' sta screen+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.cfg b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.cfg index 0d0ee3671..b51f63088 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) [7] (byte) main::a#1 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ main::a#1 ] ( main:2 [ main::a#1 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.log b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.log index 008c7a467..27e76b14f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/chained-assignment.log @@ -115,6 +115,7 @@ Constant inlined main::a#0 = (byte) 'c' Constant inlined main::a#2 = (byte) 'l' Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -145,7 +146,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) [7] (byte) main::a#1 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ main::a#1 ] ( main:2 [ main::a#1 ] ) @@ -194,9 +195,9 @@ bend: main: { .label screen = $400 .label a = 2 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' sta screen+$28 @@ -223,7 +224,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -260,9 +261,9 @@ bend: //SEG8 main main: { .label screen = $400 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' sta screen+$28 @@ -335,9 +336,9 @@ Score: 44 //SEG8 main main: { .label screen = $400 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'c' - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) 'c' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta screen+$28 //SEG11 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/compound-assignment.log b/src/test/java/dk/camelot64/kickc/test/ref/compound-assignment.log index 188835675..82a4af230 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/compound-assignment.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/compound-assignment.log @@ -788,28 +788,28 @@ Constant inlined test::a#1 = (byte/signed byte/word/signed word/dword/signed dwo Constant inlined test::a#2 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined test::a#3 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 Succesful SSA optimization Pass2ConstantInlining -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++9 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant integer increment ++9 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9 main::@10 main::@return test test::@3 test::@return test::@1 Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9 main::@10 main::@return test test::@3 test::@return test::@1 Adding NOP phi() at start of @begin diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.asm b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.asm index e962fc153..666ab285f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.asm @@ -5,6 +5,6 @@ main: { .label SCREEN = $400 lda #'!' - sta SCREEN+0 + sta SCREEN rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.cfg b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.cfg index 84a09e025..473a777d2 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.cfg @@ -11,7 +11,7 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@3 main::@3: scope:[main] from main - [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) + [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main::@3 [6] return [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.log b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.log index 0ef52e44e..b19cddc07 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-condition.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-condition.log @@ -109,6 +109,7 @@ Succesful SSA optimization Pass2ConstantIfs Removing unused block main::@1 Succesful SSA optimization Pass2EliminateUnusedBlocks OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero main::SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@3 main::@return Block Sequence Planned @begin @1 @end main main::@3 main::@return Adding NOP phi() at start of @begin @@ -142,7 +143,7 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@3 main::@3: scope:[main] from main - [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) + [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main::@3 [6] return [ ] ( main:2 [ ] ) @@ -184,9 +185,9 @@ main: { jmp b3 //SEG10 main::@3 b3: - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'!' - sta SCREEN+0 + sta SCREEN jmp breturn //SEG12 main::@return breturn: @@ -195,7 +196,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -232,9 +233,9 @@ main: { jmp b3 //SEG10 main::@3 b3: - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'!' - sta SCREEN+0 + sta SCREEN jmp breturn //SEG12 main::@return breturn: @@ -291,9 +292,9 @@ Score: 18 main: { .label SCREEN = $400 //SEG10 main::@3 - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'!' - sta SCREEN+0 + sta SCREEN //SEG12 main::@return //SEG13 [6] return [ ] ( main:2 [ ] ) rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.asm b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.asm index 9fcaac85b..606a67b14 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.asm @@ -6,6 +6,6 @@ main: { .label screen = $400 .const b = 6*$e/3+mod($16,3) lda #b - sta screen+0 + sta screen rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.cfg b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.cfg index c944ec8d8..b97f2a8fa 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main [5] return [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.log b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.log index 9a52a8683..ead5907da 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-mult-div.log @@ -102,6 +102,7 @@ Constant inlined main::$1 = (byte/signed byte/word/signed word/dword/signed dwor Constant inlined main::$2 = (byte/signed byte/word/signed word/dword/signed dword) 22%(byte/signed byte/word/signed word/dword/signed dword) 3 Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) 14/(byte/signed byte/word/signed word/dword/signed dword) 3 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -130,7 +131,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main [5] return [ ] ( main:2 [ ] ) @@ -169,9 +170,9 @@ bend: main: { .label screen = $400 .const b = 6*$e/3+mod($16,3) - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #b - sta screen+0 + sta screen jmp breturn //SEG10 main::@return breturn: @@ -180,7 +181,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -213,9 +214,9 @@ bend: main: { .label screen = $400 .const b = 6*$e/3+mod($16,3) - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #b - sta screen+0 + sta screen jmp breturn //SEG10 main::@return breturn: @@ -269,9 +270,9 @@ Score: 18 main: { .label screen = $400 .const b = 6*$e/3+mod($16,3) - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #b - sta screen+0 + sta screen //SEG10 main::@return //SEG11 [5] return [ ] ( main:2 [ ] ) rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-param.asm b/src/test/java/dk/camelot64/kickc/test/ref/const-param.asm index 14a4faef5..c03fcefcd 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-param.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-param.asm @@ -7,7 +7,7 @@ main: { .label reverse = $80 lda #'c' jsr sum - sta screen+0 + sta screen lda #'m' jsr sum sta screen+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-param.cfg b/src/test/java/dk/camelot64/kickc/test/ref/const-param.cfg index 2d30716ef..a64781df7 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-param.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-param.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) sum::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) - [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) + [8] *((const byte*) main::screen#0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) [9] call sum [ sum::return#3 ] ( main:2 [ sum::return#3 ] ) [10] (byte) sum::return#1 ← (byte) sum::return#3 [ sum::return#1 ] ( main:2 [ sum::return#1 ] ) to:main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-param.log b/src/test/java/dk/camelot64/kickc/test/ref/const-param.log index 5eff102df..3a1c0f984 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-param.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-param.log @@ -213,6 +213,7 @@ Constant inlined sum::a#0 = (const byte) main::reverse#0 Succesful SSA optimization Pass2ConstantInlining Identical Phi Values (byte) sum::a#3 (const byte) main::reverse#0 Succesful SSA optimization Pass2IdenticalPhiElimination +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@return sum sum::@return Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@3 main::@return sum sum::@return Adding NOP phi() at start of @begin @@ -254,7 +255,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) sum::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) - [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) + [8] *((const byte*) main::screen#0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) [9] call sum [ sum::return#3 ] ( main:2 [ sum::return#3 ] ) [10] (byte) sum::return#1 ← (byte) sum::return#3 [ sum::return#1 ] ( main:2 [ sum::return#1 ] ) to:main::@2 @@ -369,9 +370,9 @@ main: { //SEG15 [7] (byte~) main::$0 ← (byte) sum::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) -- vbuz1=vbuz2 lda sum.return sta _0 - //SEG16 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 + //SEG16 [8] *((const byte*) main::screen#0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 lda _0 - sta screen+0 + sta screen //SEG17 [9] call sum [ sum::return#3 ] ( main:2 [ sum::return#3 ] ) //SEG18 [18] phi from main::@1 to sum [phi:main::@1->sum] sum_from_b1: @@ -497,8 +498,8 @@ main: { b1: //SEG15 [7] (byte~) main::$0 ← (byte) sum::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) // (byte~) main::$0 = (byte) sum::return#0 // register copy reg byte a - //SEG16 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG16 [8] *((const byte*) main::screen#0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG17 [9] call sum [ sum::return#3 ] ( main:2 [ sum::return#3 ] ) //SEG18 [18] phi from main::@1 to sum [phi:main::@1->sum] sum_from_b1: @@ -640,8 +641,8 @@ main: { //SEG14 main::@1 //SEG15 [7] (byte~) main::$0 ← (byte) sum::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) // (byte~) main::$0 = (byte) sum::return#0 // register copy reg byte a - //SEG16 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG16 [8] *((const byte*) main::screen#0) ← (byte~) main::$0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG17 [9] call sum [ sum::return#3 ] ( main:2 [ sum::return#3 ] ) //SEG18 [18] phi from main::@1 to sum [phi:main::@1->sum] //SEG19 [18] phi (byte) sum::b#3 = (byte) 'm' [phi:main::@1->sum#0] -- vbuaa=vbuc1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.asm b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.asm index 121388002..1db1fa469 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.asm @@ -5,6 +5,6 @@ main: { .label screen = $400 lda #'*' - sta screen+0 + sta screen rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.cfg b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.cfg index 68ffad59f..738d58111 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.cfg @@ -11,7 +11,7 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) + [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main::@1 [6] return [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.log b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.log index 83720c150..a5393b8d1 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-pointer.log @@ -133,6 +133,7 @@ Succesful SSA optimization PassNEliminateUnusedVars Removing unused block main::@3 Succesful SSA optimization Pass2EliminateUnusedBlocks OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @1 @end main main::@1 main::@return Block Sequence Planned @begin @1 @end main main::@1 main::@return Adding NOP phi() at start of @begin @@ -166,7 +167,7 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) + [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main::@1 [6] return [ ] ( main:2 [ ] ) @@ -210,9 +211,9 @@ main: { jmp b1 //SEG10 main::@1 b1: - //SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'*' - sta screen+0 + sta screen jmp breturn //SEG12 main::@return breturn: @@ -221,7 +222,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -258,9 +259,9 @@ main: { jmp b1 //SEG10 main::@1 b1: - //SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'*' - sta screen+0 + sta screen jmp breturn //SEG12 main::@return breturn: @@ -319,9 +320,9 @@ Score: 18 main: { .label screen = $400 //SEG10 main::@1 - //SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #'*' - sta screen+0 + sta screen //SEG12 main::@return //SEG13 [6] return [ ] ( main:2 [ ] ) rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.asm b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.asm index 7e944f4b2..45cda7c18 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.asm @@ -11,7 +11,7 @@ main: { lda #>$d03 sta w+1 lda wp - sta screen+0 + sta screen lda wp+1 sta screen+1 lda #<$210c diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.cfg b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.cfg index c728ce3a4..ce0436aa1 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.cfg @@ -10,7 +10,7 @@ main: scope:[main] from @1 [4] (word) main::w#0 ← (word/signed word/dword/signed dword) 3331 [ ] ( main:2 [ ] ) [5] (byte~) main::$1 ← < *((const word*) main::wp#0) [ main::$1 ] ( main:2 [ main::$1 ] ) - [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) + [6] *((const byte*) main::screen#0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) [7] (byte~) main::$2 ← > *((const word*) main::wp#0) [ main::$2 ] ( main:2 [ main::$2 ] ) [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$2 [ ] ( main:2 [ ] ) [9] *((const word*) main::wp#0) ← (word/signed word/dword/signed dword) 8460 [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.log b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.log index 1174822fc..70ce28d2e 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/const-word-pointer.log @@ -120,6 +120,7 @@ Consolidated array index constant in *(main::screen#0+2) Consolidated array index constant in *(main::screen#0+3) Succesful SSA optimization Pass2ConstantAdditionElimination OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -152,7 +153,7 @@ FINAL CONTROL FLOW GRAPH main: scope:[main] from @1 [4] (word) main::w#0 ← (word/signed word/dword/signed dword) 3331 [ ] ( main:2 [ ] ) [5] (byte~) main::$1 ← < *((const word*) main::wp#0) [ main::$1 ] ( main:2 [ main::$1 ] ) - [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) + [6] *((const byte*) main::screen#0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) [7] (byte~) main::$2 ← > *((const word*) main::wp#0) [ main::$2 ] ( main:2 [ main::$2 ] ) [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$2 [ ] ( main:2 [ ] ) [9] *((const word*) main::wp#0) ← (word/signed word/dword/signed dword) 8460 [ ] ( main:2 [ ] ) @@ -232,9 +233,9 @@ main: { //SEG10 [5] (byte~) main::$1 ← < *((const word*) main::wp#0) [ main::$1 ] ( main:2 [ main::$1 ] ) -- vbuz1=_lo__deref_pwuc1 lda wp sta _1 - //SEG11 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 + //SEG11 [6] *((const byte*) main::screen#0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 lda _1 - sta screen+0 + sta screen //SEG12 [7] (byte~) main::$2 ← > *((const word*) main::wp#0) [ main::$2 ] ( main:2 [ main::$2 ] ) -- vbuz1=_hi__deref_pwuc1 lda wp+1 sta _2 @@ -314,8 +315,8 @@ main: { sta w+1 //SEG10 [5] (byte~) main::$1 ← < *((const word*) main::wp#0) [ main::$1 ] ( main:2 [ main::$1 ] ) -- vbuaa=_lo__deref_pwuc1 lda wp - //SEG11 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG11 [6] *((const byte*) main::screen#0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG12 [7] (byte~) main::$2 ← > *((const word*) main::wp#0) [ main::$2 ] ( main:2 [ main::$2 ] ) -- vbuaa=_hi__deref_pwuc1 lda wp+1 //SEG13 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa @@ -405,8 +406,8 @@ main: { sta w+1 //SEG10 [5] (byte~) main::$1 ← < *((const word*) main::wp#0) [ main::$1 ] ( main:2 [ main::$1 ] ) -- vbuaa=_lo__deref_pwuc1 lda wp - //SEG11 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG11 [6] *((const byte*) main::screen#0) ← (byte~) main::$1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG12 [7] (byte~) main::$2 ← > *((const word*) main::wp#0) [ main::$2 ] ( main:2 [ main::$2 ] ) -- vbuaa=_hi__deref_pwuc1 lda wp+1 //SEG13 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.asm b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.asm index 5996eac59..5236dc25d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.asm @@ -6,7 +6,7 @@ main: { .label screen = $400 .const a = $c lda #a - sta screen+0 + sta screen sta screen+1 rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.cfg b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.cfg index 3398e1777..2b5ae2d70 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main diff --git a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.log b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.log index 241f9fae4..462e6cb9d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/double-assignment.log @@ -89,6 +89,7 @@ Consolidated array index constant in *(main::screen#0+0) Consolidated array index constant in *(main::screen#0+1) Succesful SSA optimization Pass2ConstantAdditionElimination OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -117,7 +118,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main @@ -158,9 +159,9 @@ bend: main: { .label screen = $400 .const a = $c - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #a - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #a sta screen+1 @@ -172,7 +173,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -206,9 +207,9 @@ bend: main: { .label screen = $400 .const a = $c - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #a - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #a sta screen+1 @@ -268,9 +269,9 @@ Score: 22 main: { .label screen = $400 .const a = $c - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #a - sta screen+0 + sta screen //SEG10 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::a#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta screen+1 //SEG11 main::@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.asm b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.asm index dc34d2e11..b18e86671 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.asm @@ -5,7 +5,7 @@ jsr main main: { lda #0 - sta fibs+0 + sta fibs lda #1 sta fibs+1 ldx #0 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.cfg b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.cfg index 0b8726dea..83749df0a 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main main::@1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.log b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.log index b9b6de980..aa65bb908 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fibmem.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/fibmem.log @@ -128,6 +128,7 @@ OPTIMIZING CONTROL FLOW GRAPH Inlining constant with var siblings (const byte) main::i#0 Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero fibs#0+0 Block Sequence Planned @begin @1 @end main main::@1 main::@return Added new block during phi lifting main::@3(between main::@1 and main::@1) Block Sequence Planned @begin @1 @end main main::@1 main::@return main::@3 @@ -161,7 +162,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main main::@1 @@ -218,9 +219,9 @@ bend: main: { .label _2 = 3 .label i = 2 - //SEG9 [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta fibs+0 + sta fibs //SEG10 [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 sta fibs+1 @@ -260,11 +261,11 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← *((const byte[15]) fibs#0 + (byte) main::i#2) + *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ] -Statement [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← *((const byte[15]) fibs#0 + (byte) main::i#2) + *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::i#2) [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , @@ -300,9 +301,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta fibs+0 + sta fibs //SEG10 [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 sta fibs+1 @@ -391,9 +392,9 @@ Score: 269 //SEG7 @end //SEG8 main main: { - //SEG9 [4] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte[15]) fibs#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta fibs+0 + sta fibs //SEG10 [5] *((const byte[15]) fibs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 sta fibs+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.asm b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.asm index 50870f7d7..122074cd4 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.asm @@ -11,7 +11,7 @@ main: { sta w+1 b1: lda w - sta SCREEN+0 + sta SCREEN lda w+1 sta SCREEN+1 inc w diff --git a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.cfg b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.cfg index 816548689..7d296800c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (word) main::w#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(word) main::w#1 ) [ main::w#2 ] ( main:2 [ main::w#2 ] ) [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) - [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) + [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) [8] (byte~) main::$1 ← > (word) main::w#2 [ main::w#2 main::$1 ] ( main:2 [ main::w#2 main::$1 ] ) [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 [ main::w#2 ] ( main:2 [ main::w#2 ] ) [10] (word) main::w#1 ← ++ (word) main::w#2 [ main::w#1 ] ( main:2 [ main::w#1 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.log b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.log index 839b2e930..b11d3137e 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/forrangedwords.log @@ -191,6 +191,7 @@ Inlining constant with var siblings (const signed word) main::sw#0 Constant inlined main::w#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::sw#0 = -(word/signed word/dword/signed dword) 32767 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@return Added new block during phi lifting main::@5(between main::@1 and main::@1) Added new block during phi lifting main::@6(between main::@2 and main::@2) @@ -236,7 +237,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (word) main::w#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(word) main::w#1 ) [ main::w#2 ] ( main:2 [ main::w#2 ] ) [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) - [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) + [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) [8] (byte~) main::$1 ← > (word) main::w#2 [ main::w#2 main::$1 ] ( main:2 [ main::w#2 main::$1 ] ) [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 [ main::w#2 ] ( main:2 [ main::w#2 ] ) [10] (word) main::w#1 ← ++ (word) main::w#2 [ main::w#1 ] ( main:2 [ main::w#1 ] ) @@ -339,9 +340,9 @@ main: { //SEG15 [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) -- vbuz1=_lo_vwuz2 lda w sta _0 - //SEG16 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuz1 + //SEG16 [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuz1 lda _0 - sta SCREEN+0 + sta SCREEN //SEG17 [8] (byte~) main::$1 ← > (word) main::w#2 [ main::w#2 main::$1 ] ( main:2 [ main::w#2 main::$1 ] ) -- vbuz1=_hi_vwuz2 lda w+1 sta _1 @@ -469,8 +470,8 @@ main: { b1: //SEG15 [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) -- vbuaa=_lo_vwuz1 lda w - //SEG16 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa - sta SCREEN+0 + //SEG16 [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa + sta SCREEN //SEG17 [8] (byte~) main::$1 ← > (word) main::w#2 [ main::w#2 main::$1 ] ( main:2 [ main::w#2 main::$1 ] ) -- vbuaa=_hi_vwuz1 lda w+1 //SEG18 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa @@ -616,8 +617,8 @@ main: { b1: //SEG15 [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) -- vbuaa=_lo_vwuz1 lda w - //SEG16 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa - sta SCREEN+0 + //SEG16 [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa + sta SCREEN //SEG17 [8] (byte~) main::$1 ← > (word) main::w#2 [ main::w#2 main::$1 ] ( main:2 [ main::w#2 main::$1 ] ) -- vbuaa=_hi_vwuz1 lda w+1 //SEG18 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 [ main::w#2 ] ( main:2 [ main::w#2 ] ) -- _deref_pbuc1=vbuaa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.asm b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.asm index 9ce891fef..1108e1e13 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.asm @@ -14,7 +14,7 @@ main: { sta fct.z+1 ldx #$aa jsr fct - sta screen+0 + sta screen lda #<$450+1 sta fct.z lda #>$450+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.cfg b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.cfg index 5f399d9ae..43f8b82f6 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [8] (byte) main::a1#0 ← (byte) fct::return#0 [ main::a1#0 ] ( main:2 [ main::a1#0 ] ) - [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) + [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) [10] call fct [ fct::return#2 ] ( main:2 [ fct::return#2 ] ) [11] (byte) fct::return#1 ← (byte) fct::return#2 [ fct::return#1 ] ( main:2 [ fct::return#1 ] ) to:main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.log b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.log index 48cda38bd..178a49eb3 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/fragment-synth.log @@ -244,6 +244,7 @@ Constant inlined main::x#1 = (byte/signed byte/word/signed word/dword/signed dwo Constant inlined fct::x#0 = (byte/word/signed word/dword/signed dword) 170 Constant inlined fct::x#1 = (byte/signed byte/word/signed word/dword/signed dword) 85 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return fct fct::@return Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return fct fct::@return Adding NOP phi() at start of @begin @@ -284,7 +285,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [8] (byte) main::a1#0 ← (byte) fct::return#0 [ main::a1#0 ] ( main:2 [ main::a1#0 ] ) - [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) + [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) [10] call fct [ fct::return#2 ] ( main:2 [ fct::return#2 ] ) [11] (byte) fct::return#1 ← (byte) fct::return#2 [ fct::return#1 ] ( main:2 [ fct::return#1 ] ) to:main::@2 @@ -399,9 +400,9 @@ main: { //SEG17 [8] (byte) main::a1#0 ← (byte) fct::return#0 [ main::a1#0 ] ( main:2 [ main::a1#0 ] ) -- vbuz1=vbuz2 lda fct.return sta a1 - //SEG18 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 + //SEG18 [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuz1 lda a1 - sta screen+0 + sta screen //SEG19 [10] call fct [ fct::return#2 ] ( main:2 [ fct::return#2 ] ) //SEG20 [15] phi from main::@1 to fct [phi:main::@1->fct] fct_from_b1: @@ -517,8 +518,8 @@ main: { b1: //SEG17 [8] (byte) main::a1#0 ← (byte) fct::return#0 [ main::a1#0 ] ( main:2 [ main::a1#0 ] ) // (byte) main::a1#0 = (byte) fct::return#0 // register copy reg byte a - //SEG18 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG18 [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG19 [10] call fct [ fct::return#2 ] ( main:2 [ fct::return#2 ] ) //SEG20 [15] phi from main::@1 to fct [phi:main::@1->fct] fct_from_b1: @@ -657,8 +658,8 @@ main: { //SEG16 main::@1 //SEG17 [8] (byte) main::a1#0 ← (byte) fct::return#0 [ main::a1#0 ] ( main:2 [ main::a1#0 ] ) // (byte) main::a1#0 = (byte) fct::return#0 // register copy reg byte a - //SEG18 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa - sta screen+0 + //SEG18 [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuaa + sta screen //SEG19 [10] call fct [ fct::return#2 ] ( main:2 [ fct::return#2 ] ) //SEG20 [15] phi from main::@1 to fct [phi:main::@1->fct] //SEG21 [15] phi (byte*) fct::z#2 = ++((byte*))(word/signed word/dword/signed dword) 1104 [phi:main::@1->fct#0] -- pbuz1=pbuc1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.asm b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.asm index 05c27c03d..958bd11c5 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.asm @@ -50,7 +50,7 @@ main: { lda bits_count,y cmp #2 bcc b7 - lda #0+1 + lda #1 jmp b2 b7: lda #0 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.cfg b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.cfg index 22aab3e10..d7883d63c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.cfg @@ -28,7 +28,7 @@ main::@7: scope:[main] from main::@1 [16] phi() [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ) to:main::@2 main::@2: scope:[main] from main::@1 main::@7 - [17] (byte) main::bits_gen#9 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 ) [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ) + [17] (byte) main::bits_gen#9 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 1 ) [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ) [18] (byte) main::bits_gen#1 ← (byte) main::bits_gen#9 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 ] ) [19] (byte~) main::$11 ← *((byte*) main::chargen#10) & (byte/signed byte/word/signed word/dword/signed dword) 24 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 ] ) [20] (byte~) main::$12 ← *((byte*) main::chargen1#0) & (byte/signed byte/word/signed word/dword/signed dword) 24 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 main::$12 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 main::$12 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.log b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.log index 7dd724dc9..99bce064e 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/halfscii.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/halfscii.log @@ -760,6 +760,7 @@ Constant inlined main::bits_gen#0 = (byte/signed byte/word/signed word/dword/sig Constant inlined main::$38 = (const byte*) CHARGEN#0+(word/signed word/dword/signed dword) 2048 Constant inlined main::charset4#0 = (const byte*) CHARSET4#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero 0+1 Block Sequence Planned @begin @1 @end main main::@1 main::@7 main::@2 main::@8 main::@3 main::@9 main::@4 main::@10 main::@5 main::@11 main::@6 main::@12 main::@return Added new block during phi lifting main::@13(between main::@5 and main::@1) Added new block during phi lifting main::@14(between main::@2 and main::@3) @@ -905,7 +906,7 @@ main::@7: scope:[main] from main::@1 [16] phi() [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ) to:main::@2 main::@2: scope:[main] from main::@1 main::@7 - [17] (byte) main::bits_gen#9 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 ) [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ) + [17] (byte) main::bits_gen#9 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 1 ) [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#9 ] ) [18] (byte) main::bits_gen#1 ← (byte) main::bits_gen#9 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 ] ) [19] (byte~) main::$11 ← *((byte*) main::chargen#10) & (byte/signed byte/word/signed word/dword/signed dword) 24 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 ] ) [20] (byte~) main::$12 ← *((byte*) main::chargen1#0) & (byte/signed byte/word/signed word/dword/signed dword) 24 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 main::$12 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::bits_gen#1 main::$11 main::$12 ] ) @@ -1270,8 +1271,8 @@ main: { b7: //SEG29 [17] phi from main::@7 to main::@2 [phi:main::@7->main::@2] b2_from_b7: - //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuz1=vbuc1 - lda #0+1 + //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuz1=vbuc1 + lda #1 sta bits_gen_9 jmp b2 //SEG31 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2] @@ -1764,8 +1765,8 @@ main: { b7: //SEG29 [17] phi from main::@7 to main::@2 [phi:main::@7->main::@2] b2_from_b7: - //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuaa=vbuc1 - lda #0+1 + //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuaa=vbuc1 + lda #1 jmp b2 //SEG31 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2] b2_from_b1: @@ -2211,8 +2212,8 @@ main: { //SEG27 [16] phi from main::@1 to main::@7 [phi:main::@1->main::@7] //SEG28 main::@7 //SEG29 [17] phi from main::@7 to main::@2 [phi:main::@7->main::@2] - //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuaa=vbuc1 - lda #0+1 + //SEG30 [17] phi (byte) main::bits_gen#9 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->main::@2#0] -- vbuaa=vbuc1 + lda #1 jmp b2 //SEG31 [17] phi from main::@1 to main::@2 [phi:main::@1->main::@2] b7: diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.asm b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.asm index 7a881d74d..c0d8c2e63 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.asm @@ -8,7 +8,7 @@ main: { .const toUpper2_ch = 'm' .const toUpper1_res = toUpper1_ch+$40 lda #toUpper1_res - sta screen+0 + sta screen lda #toUpper2_ch sta screen+1 rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.cfg b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.cfg index caea19dab..a38898774 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.cfg @@ -14,7 +14,7 @@ main::toUpper1: scope:[main] from main [5] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main::toUpper1 - [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) + [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) to:main::toUpper2 main::toUpper2: scope:[main] from main::@1 [7] phi() [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.log b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.log index fc74b2323..9426348b7 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-if.log @@ -298,6 +298,7 @@ Culled Empty Block (label) main::toUpper1_@1 Culled Empty Block (label) main::toUpper2_@1 Succesful SSA optimization Pass2CullEmptyBlocks OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero screen#0+0 Block Sequence Planned @begin @2 @end main main::toUpper1 main::@1 main::toUpper2 main::@2 main::@return Block Sequence Planned @begin @2 @end main main::toUpper1 main::@1 main::toUpper2 main::@2 main::@return Adding NOP phi() at start of @begin @@ -338,7 +339,7 @@ main::toUpper1: scope:[main] from main [5] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main::toUpper1 - [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) + [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) to:main::toUpper2 main::toUpper2: scope:[main] from main::@1 [7] phi() [ ] ( main:2 [ ] ) @@ -404,9 +405,9 @@ main: { jmp b1 //SEG12 main::@1 b1: - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #toUpper1_res - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] toUpper2_from_b1: jmp toUpper2 @@ -426,7 +427,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [8] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::toUpper2_ch#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -472,9 +473,9 @@ main: { jmp b1 //SEG12 main::@1 b1: - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #toUpper1_res - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] toUpper2_from_b1: jmp toUpper2 @@ -571,9 +572,9 @@ main: { //SEG10 [5] phi from main to main::toUpper1 [phi:main->main::toUpper1] //SEG11 main::toUpper1 //SEG12 main::@1 - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_res#1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #toUpper1_res - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] //SEG15 main::toUpper2 //SEG16 main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.asm b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.asm index 740f3fd3f..1d0366ce0 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.asm @@ -42,9 +42,9 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - lda #line1_xpos*$100+0 + lda #>line1_xpos*$100 sta line1_pos+1 line1_b1: lda line1_pos+1 @@ -79,9 +79,9 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - lda #line2_xpos*$100+0 + lda #>line2_xpos*$100 sta line2_pos+1 line2_b1: lda line2_pos+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.cfg b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.cfg index 11b31ab2d..a4d403251 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.cfg @@ -22,7 +22,7 @@ main::line1: scope:[main] from main::@1 main::line1_@1: scope:[main] from main::@4 main::line1 [10] (byte) main::line1_i#2 ← phi( main::@4/(byte) main::line1_i#1 main::line1/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) [10] (byte*) cur_line#13 ← phi( main::@4/(byte*) cur_line#1 main::line1/((byte*))(word/signed word/dword/signed dword) 1024 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) - [10] (word) main::line1_pos#2 ← phi( main::@4/(word) main::line1_pos#1 main::line1/(const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) + [10] (word) main::line1_pos#2 ← phi( main::@4/(word) main::line1_pos#1 main::line1/(const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ) to:main::plot1 main::plot1: scope:[main] from main::line1_@1 @@ -41,7 +41,7 @@ main::line2: scope:[main] from main::@4 main::line2_@1: scope:[main] from main::@6 main::line2 [19] (byte) main::line2_i#2 ← phi( main::@6/(byte) main::line2_i#1 main::line2/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) [19] (byte*) cur_line#10 ← phi( main::@6/(byte*) cur_line#11 main::line2/((byte*))(word/signed word/dword/signed dword) 1024 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) - [19] (word) main::line2_pos#2 ← phi( main::@6/(word) main::line2_pos#1 main::line2/(const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) + [19] (word) main::line2_pos#2 ← phi( main::@6/(word) main::line2_pos#1 main::line2/(const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) [20] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ) to:main::plot2 main::plot2: scope:[main] from main::line2_@1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.log b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.log index 8f3d72e29..9964c0f64 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-level2.log @@ -515,6 +515,8 @@ Constant inlined main::sc#0 = ((byte*))(word/signed word/dword/signed dword) 102 Constant inlined cur_line#2 = ((byte*))(word/signed word/dword/signed dword) 1024 Constant inlined main::line1_pos#0 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::line1_xpos#0*256+0 +Simplifying constant plus zero main::line2_xpos#0*256+0 Block Sequence Planned @begin @3 @end main main::@1 main::line1 main::line1_@1 main::plot1 main::@4 main::line2 main::line2_@1 main::plot2 main::@6 main::@return Added new block during phi lifting main::@7(between main::@1 and main::@1) Added new block during phi lifting main::@8(between main::@4 and main::line1_@1) @@ -588,7 +590,7 @@ main::line1: scope:[main] from main::@1 main::line1_@1: scope:[main] from main::@4 main::line1 [10] (byte) main::line1_i#2 ← phi( main::@4/(byte) main::line1_i#1 main::line1/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) [10] (byte*) cur_line#13 ← phi( main::@4/(byte*) cur_line#1 main::line1/((byte*))(word/signed word/dword/signed dword) 1024 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) - [10] (word) main::line1_pos#2 ← phi( main::@4/(word) main::line1_pos#1 main::line1/(const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) + [10] (word) main::line1_pos#2 ← phi( main::@4/(word) main::line1_pos#1 main::line1/(const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256 ) [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 ] ) [11] (byte) main::plot1_xpos#0 ← > (word) main::line1_pos#2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ( main:2 [ main::line1_pos#2 cur_line#13 main::line1_i#2 main::plot1_xpos#0 ] ) to:main::plot1 main::plot1: scope:[main] from main::line1_@1 @@ -607,7 +609,7 @@ main::line2: scope:[main] from main::@4 main::line2_@1: scope:[main] from main::@6 main::line2 [19] (byte) main::line2_i#2 ← phi( main::@6/(byte) main::line2_i#1 main::line2/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) [19] (byte*) cur_line#10 ← phi( main::@6/(byte*) cur_line#11 main::line2/((byte*))(word/signed word/dword/signed dword) 1024 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) - [19] (word) main::line2_pos#2 ← phi( main::@6/(word) main::line2_pos#1 main::line2/(const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) + [19] (word) main::line2_pos#2 ← phi( main::@6/(word) main::line2_pos#1 main::line2/(const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256 ) [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 ] ) [20] (byte) main::plot2_xpos#0 ← > (word) main::line2_pos#2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ( main:2 [ main::line2_pos#2 cur_line#10 main::line2_i#2 main::plot2_xpos#0 ] ) to:main::plot2 main::plot2: scope:[main] from main::line2_@1 @@ -797,10 +799,10 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - //SEG23 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1 - lda #main::line1_@1#2] -- vwuz1=vwuc1 + lda #line1_xpos*$100+0 + lda #>line1_xpos*$100 sta line1_pos+1 jmp line1_b1 //SEG24 [10] phi from main::@4 to main::line1_@1 [phi:main::@4->main::line1_@1] @@ -869,10 +871,10 @@ main: { sta cur_line_10 lda #>$400 sta cur_line_10+1 - //SEG43 [19] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1 - lda #main::line2_@1#2] -- vwuz1=vwuc1 + lda #line2_xpos*$100+0 + lda #>line2_xpos*$100 sta line2_pos+1 jmp line2_b1 //SEG44 [19] phi from main::@6 to main::line2_@1 [phi:main::@6->main::line2_@1] @@ -1071,10 +1073,10 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - //SEG23 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1 - lda #main::line1_@1#2] -- vwuz1=vwuc1 + lda #line1_xpos*$100+0 + lda #>line1_xpos*$100 sta line1_pos+1 jmp line1_b1 //SEG24 [10] phi from main::@4 to main::line1_@1 [phi:main::@4->main::line1_@1] @@ -1139,10 +1141,10 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - //SEG43 [19] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1 - lda #main::line2_@1#2] -- vwuz1=vwuc1 + lda #line2_xpos*$100+0 + lda #>line2_xpos*$100 sta line2_pos+1 jmp line2_b1 //SEG44 [19] phi from main::@6 to main::line2_@1 [phi:main::@6->main::line2_@1] @@ -1391,10 +1393,10 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - //SEG23 [10] phi (word) main::line1_pos#2 = (const byte) main::line1_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line1->main::line1_@1#2] -- vwuz1=vwuc1 - lda #main::line1_@1#2] -- vwuz1=vwuc1 + lda #line1_xpos*$100+0 + lda #>line1_xpos*$100 sta line1_pos+1 //SEG24 [10] phi from main::@4 to main::line1_@1 [phi:main::@4->main::line1_@1] //SEG25 [10] phi (byte) main::line1_i#2 = (byte) main::line1_i#1 [phi:main::@4->main::line1_@1#0] -- register_copy @@ -1448,10 +1450,10 @@ main: { sta cur_line lda #>$400 sta cur_line+1 - //SEG43 [19] phi (word) main::line2_pos#2 = (const byte) main::line2_xpos#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::line2->main::line2_@1#2] -- vwuz1=vwuc1 - lda #main::line2_@1#2] -- vwuz1=vwuc1 + lda #line2_xpos*$100+0 + lda #>line2_xpos*$100 sta line2_pos+1 //SEG44 [19] phi from main::@6 to main::line2_@1 [phi:main::@6->main::line2_@1] //SEG45 [19] phi (byte) main::line2_i#2 = (byte) main::line2_i#1 [phi:main::@6->main::line2_@1#0] -- register_copy diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.asm b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.asm index d380858d0..723d22cd4 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.asm @@ -14,7 +14,7 @@ main: { .const sum2_return = sum2_a+sum2_b .const sum3_return = sum3_a+sum3_b lda #sum1_return - sta screen+0 + sta screen lda #sum2_return sta screen+1 lda #sum3_return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.cfg b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.cfg index e3f0cce8c..b76ea2942 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.cfg @@ -14,7 +14,7 @@ main::sum1: scope:[main] from main [5] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main::sum1 - [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) + [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) to:main::sum2 main::sum2: scope:[main] from main::@1 [7] phi() [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.log b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.log index a0793c860..61dc4c5ba 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/inline-function-min.log @@ -268,6 +268,7 @@ Culled Empty Block (label) main::sum2_@return Culled Empty Block (label) main::sum3_@return Succesful SSA optimization Pass2CullEmptyBlocks OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero screen#0+0 Block Sequence Planned @begin @2 @end main main::sum1 main::@1 main::sum2 main::@2 main::sum3 main::@3 main::@return Block Sequence Planned @begin @2 @end main main::sum1 main::@1 main::sum2 main::@2 main::sum3 main::@3 main::@return Adding NOP phi() at start of @begin @@ -310,7 +311,7 @@ main::sum1: scope:[main] from main [5] phi() [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main::sum1 - [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) + [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) to:main::sum2 main::sum2: scope:[main] from main::@1 [7] phi() [ ] ( main:2 [ ] ) @@ -390,9 +391,9 @@ main: { jmp b1 //SEG12 main::@1 b1: - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #sum1_return - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] sum2_from_b1: jmp sum2 @@ -423,7 +424,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [8] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::sum2_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [10] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) main::sum3_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -476,9 +477,9 @@ main: { jmp b1 //SEG12 main::@1 b1: - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #sum1_return - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] sum2_from_b1: jmp sum2 @@ -607,9 +608,9 @@ main: { //SEG10 [5] phi from main to main::sum1 [phi:main->main::sum1] //SEG11 main::sum1 //SEG12 main::@1 - //SEG13 [6] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #sum1_return - sta screen+0 + sta screen //SEG14 [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] //SEG15 main::sum2 //SEG16 main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.asm b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.asm index 1a1ad4f5a..a4bd08bcf 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.asm @@ -397,9 +397,9 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - lda bitmap_plot_ylo+0 + lda bitmap_plot_ylo sta _3 - lda bitmap_plot_yhi+0 + lda bitmap_plot_yhi sta _3+1 lda #0 sta y diff --git a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.cfg b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.cfg index cd3746e2d..f8fe45ff2 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.cfg @@ -244,7 +244,7 @@ screen_fill::@return: scope:[screen_fill] from screen_fill::@3 [118] return [ ] ( main:2::screen_fill:17 [ ] ) to:@return bitmap_clear: scope:[bitmap_clear] from main::@17 - [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) + [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.log b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.log index 5df84a679..1af03aaa8 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/line-anim.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/line-anim.log @@ -3402,6 +3402,8 @@ Constant inlined screen_fill::y#0 = (byte/signed byte/word/signed word/dword/sig Constant inlined bitmap_init::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined bitmap_init::bitmap#0 = (const byte*) BITMAP#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero bitmap_plot_yhi#0+0 +Simplifying constant plus zero bitmap_plot_ylo#0+0 Block Sequence Planned @begin @18 @end main main::vicSelectGfxBank1 main::vicSelectGfxBank1_toDd001 main::vicSelectGfxBank1_@1 main::toD0181 main::@16 main::@17 main::@18 main::@1 main::@20 main::@21 main::@5 main::@7 bitmap_plot bitmap_plot::@return point_init point_init::abs16s1 point_init::abs16s1_@return point_init::abs16s2 point_init::abs16s2_@return point_init::@10 point_init::@2 point_init::@return point_init::@1 point_init::@7 point_init::@4 point_init::@11 point_init::@3 point_init::abs16s2_@1 point_init::abs16s1_@1 divr16s divr16s::@16 divr16s::@2 divr16s::@4 divr16s::@15 divr16s::@11 divr16s::@return divr16s::@3 divr16s::@1 divr16u divr16u::@1 divr16u::@4 divr16u::@2 divr16u::@5 divr16u::@3 divr16u::@return screen_fill screen_fill::@1 screen_fill::@2 screen_fill::@3 screen_fill::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return Added new block during phi lifting main::@22(between main::@21 and main::@1) Added new block during phi lifting point_init::@12(between point_init::abs16s1 and point_init::abs16s1_@return) @@ -3778,7 +3780,7 @@ screen_fill::@return: scope:[screen_fill] from screen_fill::@3 [118] return [ ] ( main:2::screen_fill:17 [ ] ) to:@return bitmap_clear: scope:[bitmap_clear] from main::@17 - [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) + [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) to:bitmap_clear::@1 bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3 @@ -5062,10 +5064,10 @@ bitmap_clear: { .label x = $1e .label y = $1b .label _3 = $59 - //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_ylo+0 + //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_ylo sta _3 - lda bitmap_plot_yhi+0 + lda bitmap_plot_yhi sta _3+1 //SEG219 [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) -- pbuz1=pbuz2 lda _3 @@ -5356,7 +5358,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:23 [ s Removing always clobbered register reg byte y as potential for zp ZP_BYTE:23 [ screen_fill::y#4 screen_fill::y#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:26 [ screen_fill::x#2 screen_fill::x#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:26 [ screen_fill::x#2 screen_fill::x#1 ] -Statement [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [123] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:27 [ bitmap_clear::y#4 bitmap_clear::y#1 ] @@ -5432,7 +5434,7 @@ Statement [98] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed by Statement [102] if((word) divr16u::rem#5<(word) divr16u::divisor#0) goto divr16u::@3 [ divr16u::divisor#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::point_init:20::divr16s:58::divr16u:79 [ main::i#2 point_init::point_idx#0 point_init::point_idx1#0 divr16s::neg#4 divr16u::divisor#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a Statement [104] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (word) divr16u::divisor#0 [ divr16u::divisor#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::point_init:20::divr16s:58::divr16u:79 [ main::i#2 point_init::point_idx#0 point_init::point_idx1#0 divr16s::neg#4 divr16u::divisor#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [112] *((byte*) screen_fill::screen#2) ← (const byte) screen_fill::ch#0 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] ) always clobbers reg byte a reg byte y -Statement [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) always clobbers reg byte a +Statement [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) always clobbers reg byte a Statement [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) always clobbers reg byte a Statement [123] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ) always clobbers reg byte a reg byte y Statement [139] (byte~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 ] ) always clobbers reg byte a @@ -6328,10 +6330,10 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_ylo+0 + //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_ylo sta _3 - lda bitmap_plot_yhi+0 + lda bitmap_plot_yhi sta _3+1 //SEG219 [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:3 @@ -7667,10 +7669,10 @@ bitmap_clear: { .label bitmap = 3 .label y = 2 .label _3 = 3 - //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 - lda bitmap_plot_ylo+0 + //SEG218 [119] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0) w= *((const byte[256]) bitmap_plot_ylo#0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] ) -- vwuz1=_deref_pbuc1_word__deref_pbuc2 + lda bitmap_plot_ylo sta _3 - lda bitmap_plot_yhi+0 + lda bitmap_plot_yhi sta _3+1 //SEG219 [120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] ) // (byte*~) bitmap_clear::bitmap#5 = (byte*)(word~) bitmap_clear::$3 // register copy zp ZP_WORD:3 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/literals.asm b/src/test/java/dk/camelot64/kickc/test/ref/literals.asm index 46ead635e..180e8440f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/literals.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/literals.asm @@ -7,7 +7,7 @@ jsr main main: { lda #char - sta SCREEN+0 + sta SCREEN lda #num sta SCREEN+2 ldx #0 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/literals.cfg b/src/test/java/dk/camelot64/kickc/test/ref/literals.cfg index 58766c545..cf023c747 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/literals.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/literals.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main main::@1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/literals.log b/src/test/java/dk/camelot64/kickc/test/ref/literals.log index d9520f0fe..b7db3639d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/literals.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/literals.log @@ -201,6 +201,7 @@ OPTIMIZING CONTROL FLOW GRAPH Inlining constant with var siblings (const byte) main::i#0 Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@1 main::@return Added new block during phi lifting main::@3(between main::@1 and main::@1) Block Sequence Planned @begin @1 @end main main::@1 main::@return main::@3 @@ -234,7 +235,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) to:main::@1 main::@1: scope:[main] from main main::@1 @@ -292,9 +293,9 @@ bend: //SEG8 main main: { .label i = 2 - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #char - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 @@ -334,12 +335,12 @@ main: { str: .text "bc"+"d"+'e' REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) main::i#2) ← *((const byte[]) str#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ] Statement [8] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) main::i#2) ← *((const byte[]) nums#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) main::i#2) ← *((const byte[]) str#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [8] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) main::i#2) ← *((const byte[]) nums#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -377,9 +378,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #char - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 @@ -478,9 +479,9 @@ Score: 299 //SEG7 @end //SEG8 main main: { - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← (const byte) char#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #char - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.asm b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.asm index b264d29f1..4279f6975 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.asm @@ -6,7 +6,7 @@ main: { ldx #0 jsr inccnt - sta SCREEN+0 + sta SCREEN inx jsr inccnt sta SCREEN+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.cfg b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.cfg index 5e959122c..7d8e2ccc6 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#12 ] ( main:2 [ main::$0 cnt#12 ] ) - [8] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) + [8] *((const byte[256]) SCREEN#0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) [9] (byte) cnt#2 ← ++ (byte) cnt#12 [ cnt#2 ] ( main:2 [ cnt#2 ] ) [10] call inccnt [ inccnt::return#2 ] ( main:2 [ inccnt::return#2 ] ) [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2 [ inccnt::return#1 ] ( main:2 [ inccnt::return#1 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.log b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.log index 3801cdabb..b896845d5 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobal.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobal.log @@ -214,6 +214,7 @@ OPTIMIZING CONTROL FLOW GRAPH Inlining constant with var siblings (const byte) cnt#0 Constant inlined cnt#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return inccnt inccnt::@return Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return inccnt inccnt::@return Adding NOP phi() at start of @begin @@ -262,7 +263,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#12 ] ( main:2 [ main::$0 cnt#12 ] ) - [8] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) + [8] *((const byte[256]) SCREEN#0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) [9] (byte) cnt#2 ← ++ (byte) cnt#12 [ cnt#2 ] ( main:2 [ cnt#2 ] ) [10] call inccnt [ inccnt::return#2 ] ( main:2 [ inccnt::return#2 ] ) [11] (byte) inccnt::return#1 ← (byte) inccnt::return#2 [ inccnt::return#1 ] ( main:2 [ inccnt::return#1 ] ) @@ -368,9 +369,9 @@ main: { //SEG15 [7] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#12 ] ( main:2 [ main::$0 cnt#12 ] ) -- vbuz1=vbuz2 lda inccnt.return sta _0 - //SEG16 [8] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuz1 + //SEG16 [8] *((const byte[256]) SCREEN#0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuz1 lda _0 - sta SCREEN+0 + sta SCREEN //SEG17 [9] (byte) cnt#2 ← ++ (byte) cnt#12 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuz1=_inc_vbuz2 ldy cnt_12 iny @@ -473,8 +474,8 @@ main: { b1: //SEG15 [7] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#12 ] ( main:2 [ main::$0 cnt#12 ] ) // (byte~) main::$0 = (byte) inccnt::return#0 // register copy reg byte a - //SEG16 [8] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuaa - sta SCREEN+0 + //SEG16 [8] *((const byte[256]) SCREEN#0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuaa + sta SCREEN //SEG17 [9] (byte) cnt#2 ← ++ (byte) cnt#12 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuxx=_inc_vbuxx inx //SEG18 [10] call inccnt [ inccnt::return#2 ] ( main:2 [ inccnt::return#2 ] ) @@ -594,8 +595,8 @@ main: { //SEG14 main::@1 //SEG15 [7] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#12 ] ( main:2 [ main::$0 cnt#12 ] ) // (byte~) main::$0 = (byte) inccnt::return#0 // register copy reg byte a - //SEG16 [8] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuaa - sta SCREEN+0 + //SEG16 [8] *((const byte[256]) SCREEN#0) ← (byte~) main::$0 [ cnt#12 ] ( main:2 [ cnt#12 ] ) -- _deref_pbuc1=vbuaa + sta SCREEN //SEG17 [9] (byte) cnt#2 ← ++ (byte) cnt#12 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuxx=_inc_vbuxx inx //SEG18 [10] call inccnt [ inccnt::return#2 ] ( main:2 [ inccnt::return#2 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.asm b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.asm index 979649527..918784a3c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.asm @@ -6,7 +6,7 @@ main: { ldx #0 jsr inccnt - stx SCREEN+0 + stx SCREEN inx jsr inccnt inx diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.cfg b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.cfg index 745770d13..9ba4a6ff6 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.cfg @@ -12,7 +12,7 @@ main: scope:[main] from @2 [5] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) to:main::@1 main::@1: scope:[main] from main - [6] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) + [6] *((const byte[256]) SCREEN#0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) [7] (byte) cnt#2 ← ++ (byte) cnt#13 [ cnt#2 ] ( main:2 [ cnt#2 ] ) [8] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) to:main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.log b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.log index 543087445..96ae7d43c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/modglobalmin.log @@ -176,6 +176,7 @@ OPTIMIZING CONTROL FLOW GRAPH Inlining constant with var siblings (const byte) cnt#0 Constant inlined cnt#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return inccnt inccnt::@return Block Sequence Planned @begin @2 @end main main::@1 main::@2 main::@return inccnt inccnt::@return Adding NOP phi() at start of @begin @@ -216,7 +217,7 @@ main: scope:[main] from @2 [5] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) to:main::@1 main::@1: scope:[main] from main - [6] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) + [6] *((const byte[256]) SCREEN#0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) [7] (byte) cnt#2 ← ++ (byte) cnt#13 [ cnt#2 ] ( main:2 [ cnt#2 ] ) [8] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) to:main::@2 @@ -296,9 +297,9 @@ main: { jmp b1 //SEG13 main::@1 b1: - //SEG14 [6] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuz1 + //SEG14 [6] *((const byte[256]) SCREEN#0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuz1 lda cnt_13 - sta SCREEN+0 + sta SCREEN //SEG15 [7] (byte) cnt#2 ← ++ (byte) cnt#13 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuz1=_inc_vbuz2 ldy cnt_13 iny @@ -385,8 +386,8 @@ main: { jmp b1 //SEG13 main::@1 b1: - //SEG14 [6] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuxx - stx SCREEN+0 + //SEG14 [6] *((const byte[256]) SCREEN#0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuxx + stx SCREEN //SEG15 [7] (byte) cnt#2 ← ++ (byte) cnt#13 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuxx=_inc_vbuxx inx //SEG16 [8] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) @@ -489,8 +490,8 @@ main: { ldx #0 jsr inccnt //SEG13 main::@1 - //SEG14 [6] *((const byte[256]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuxx - stx SCREEN+0 + //SEG14 [6] *((const byte[256]) SCREEN#0) ← (byte) cnt#13 [ cnt#13 ] ( main:2 [ cnt#13 ] ) -- _deref_pbuc1=vbuxx + stx SCREEN //SEG15 [7] (byte) cnt#2 ← ++ (byte) cnt#13 [ cnt#2 ] ( main:2 [ cnt#2 ] ) -- vbuxx=_inc_vbuxx inx //SEG16 [8] call inccnt [ cnt#13 ] ( main:2 [ cnt#13 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.asm b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.asm index fc824490f..3a3476d8d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.asm @@ -6,7 +6,7 @@ jsr main main: { lda #DVAL/$400 - sta SCREEN+0 + sta SCREEN lda #0 sta SCREEN+1 rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.cfg b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.cfg index 9ec314a69..fd76acfe0 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) + [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main diff --git a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.log b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.log index 35da99b22..652427987 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/operator-lohi-problem.log @@ -124,6 +124,7 @@ Constant inlined main::$5 = >((word))(const dword) DVAL#0/(word/signed word/dwor Constant inlined main::$3 = (const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 Constant inlined main::$4 = ((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -152,7 +153,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) + [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main @@ -192,9 +193,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #DVAL/$400 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 sta SCREEN+1 @@ -206,7 +207,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -240,9 +241,9 @@ bend_from_b1: bend: //SEG8 main main: { - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #DVAL/$400 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 sta SCREEN+1 @@ -299,9 +300,9 @@ Score: 24 //SEG7 @end //SEG8 main main: { - //SEG9 [4] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) SCREEN#0) ← <((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #DVAL/$400 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 sta SCREEN+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.asm b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.asm index 33d44d04b..602c913af 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.asm @@ -38,7 +38,7 @@ raster: { nop nop nop - lda rastercols+0 + lda rastercols ldx #0 b1: sta BGCOL diff --git a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.cfg b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.cfg index 741c4b445..deca30826 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.cfg @@ -22,7 +22,7 @@ main::@5: scope:[main] from main::@3 to:main::@2 raster: scope:[raster] from main::@5 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) + [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) to:raster::@1 raster::@1: scope:[raster] from raster raster::@1 [11] (byte) raster::i#2 ← phi( raster/(byte/signed byte/word/signed word/dword/signed dword) 0 raster::@1/(byte) raster::i#1 ) [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.log b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.log index ec0212b38..97be5145c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/raster-bars.log @@ -761,6 +761,7 @@ OPTIMIZING CONTROL FLOW GRAPH Inlining constant with var siblings (const byte) raster::i#0 Constant inlined raster::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero rastercols#0+0 Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return Added new block during phi lifting raster::@3(between raster::@1 and raster::@1) Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return raster::@3 @@ -818,7 +819,7 @@ main::@5: scope:[main] from main::@3 to:main::@2 raster: scope:[raster] from main::@5 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) + [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) to:raster::@1 raster::@1: scope:[raster] from raster raster::@1 [11] (byte) raster::i#2 ← phi( raster/(byte/signed byte/word/signed word/dword/signed dword) 0 raster::@1/(byte) raster::i#1 ) [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] ) @@ -933,8 +934,8 @@ raster: { nop nop nop - //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuz1=_deref_pbuc1 - lda rastercols+0 + //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuz1=_deref_pbuc1 + lda rastercols sta col //SEG20 [11] phi from raster to raster::@1 [phi:raster->raster::@1] b1_from_raster: @@ -1084,8 +1085,8 @@ raster: { nop nop nop - //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 - lda rastercols+0 + //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 + lda rastercols //SEG20 [11] phi from raster to raster::@1 [phi:raster->raster::@1] b1_from_raster: //SEG21 [11] phi (byte) raster::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:raster->raster::@1#0] -- vbuxx=vbuc1 @@ -1259,8 +1260,8 @@ raster: { nop nop nop - //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 - lda rastercols+0 + //SEG19 [10] (byte) raster::col#0 ← *((const byte[]) rastercols#0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 + lda rastercols //SEG20 [11] phi from raster to raster::@1 [phi:raster->raster::@1] //SEG21 [11] phi (byte) raster::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:raster->raster::@1#0] -- vbuxx=vbuc1 ldx #0 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.asm b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.asm index 597e91fd9..0f284f7e0 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.asm @@ -115,8 +115,8 @@ scroll_bit: { scroll_hard: { ldx #0 b1: - lda SCREEN+$28*0+1,x - sta SCREEN+$28*0,x + lda SCREEN+1,x + sta SCREEN,x lda SCREEN+$28*1+1,x sta SCREEN+$28*1,x lda SCREEN+$28*2+1,x diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.cfg b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.cfg index 3f4a89e06..3b1b533d9 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.cfg @@ -100,7 +100,7 @@ scroll_hard: scope:[scroll_hard] from scroll_bit::@1 to:scroll_hard::@1 scroll_hard::@1: scope:[scroll_hard] from scroll_hard scroll_hard::@1 [46] (byte) scroll_hard::i#2 ← phi( scroll_hard/(byte/signed byte/word/signed word/dword/signed dword) 0 scroll_hard::@1/(byte) scroll_hard::i#1 ) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) - [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) + [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [49] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [50] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.log b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.log index 11770e5dd..e1710205d 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrollbig.log @@ -1749,6 +1749,10 @@ Constant inlined scroll_hard::$11 = (const byte*) SCREEN#0+(byte/signed byte/wor Constant inlined scroll_hard::$33 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 6 Constant inlined scroll#14 = (byte/signed byte/word/signed word/dword/signed dword) 7 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant multiply by zero 40*0 +Simplifying constant multiply by zero 40*0 +Simplifying constant plus zero SCREEN#0+0 +Simplifying constant plus zero SCREEN#0+0 Block Sequence Planned @begin @6 @end main main::@2 main::@3 main::@5 main::@8 scroll_soft scroll_soft::@2 scroll_soft::@1 scroll_soft::@return scroll_bit scroll_bit::@4 scroll_bit::@8 scroll_bit::@1 scroll_bit::@7 scroll_bit::@2 scroll_bit::@5 scroll_bit::@3 scroll_bit::@6 scroll_bit::@return scroll_hard scroll_hard::@1 scroll_hard::@return next_char next_char::@2 next_char::@1 next_char::@return fillscreen fillscreen::@1 fillscreen::@return Added new block during phi lifting scroll_soft::@4(between scroll_soft and scroll_soft::@1) Added new block during phi lifting scroll_bit::@9(between scroll_bit and scroll_bit::@1) @@ -1952,7 +1956,7 @@ scroll_hard: scope:[scroll_hard] from scroll_bit::@1 to:scroll_hard::@1 scroll_hard::@1: scope:[scroll_hard] from scroll_hard scroll_hard::@1 [46] (byte) scroll_hard::i#2 ← phi( scroll_hard/(byte/signed byte/word/signed word/dword/signed dword) 0 scroll_hard::@1/(byte) scroll_hard::i#1 ) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) - [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) + [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [49] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) [50] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) @@ -2423,10 +2427,10 @@ scroll_hard: { jmp b1 //SEG109 scroll_hard::@1 b1: - //SEG110 [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + //SEG110 [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy i - lda SCREEN+$28*0+1,y - sta SCREEN+$28*0,y + lda SCREEN+1,y + sta SCREEN,y //SEG111 [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy i lda SCREEN+$28*1+1,y @@ -2574,7 +2578,7 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ cu Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ scroll_bit::r#2 scroll_bit::r#1 ] Statement [39] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ) always clobbers reg byte a Statement [42] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) 55 [ current_bit#21 nxt#36 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#36 current_chargen#19 ] ) always clobbers reg byte a -Statement [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ scroll_hard::i#2 scroll_hard::i#1 ] Statement [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [49] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a @@ -2597,7 +2601,7 @@ Statement [34] (byte~) scroll_bit::$9 ← (byte) scroll_bit::bits#0 & (byte) cur Statement [38] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ) always clobbers reg byte y Statement [39] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ) always clobbers reg byte a Statement [42] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) 55 [ current_bit#21 nxt#36 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#36 current_chargen#19 ] ) always clobbers reg byte a -Statement [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [49] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [50] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a @@ -2941,9 +2945,9 @@ scroll_hard: { jmp b1 //SEG109 scroll_hard::@1 b1: - //SEG110 [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx - lda SCREEN+$28*0+1,x - sta SCREEN+$28*0,x + //SEG110 [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda SCREEN+1,x + sta SCREEN,x //SEG111 [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*1+1,x sta SCREEN+$28*1,x @@ -3494,9 +3498,9 @@ scroll_hard: { //SEG108 [46] phi (byte) scroll_hard::i#2 = (byte) scroll_hard::i#1 [phi:scroll_hard::@1->scroll_hard::@1#0] -- register_copy //SEG109 scroll_hard::@1 b1: - //SEG110 [47] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx - lda SCREEN+$28*0+1,x - sta SCREEN+$28*0,x + //SEG110 [47] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda SCREEN+1,x + sta SCREEN,x //SEG111 [48] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:29 [ current_bit#21 nxt#36 current_chargen#19 scroll_hard::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*1+1,x sta SCREEN+$28*1,x diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.asm b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.asm index f547484d2..4bc18cc9b 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.asm @@ -144,9 +144,7 @@ render_logo: { rts b9: tya - clc - adc #$28*0 - sta SCREEN+$28*0,x + sta SCREEN,x tya clc adc #$28*1 @@ -172,7 +170,7 @@ render_logo: { jmp b6 b5: lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x sta SCREEN+$28*1,x sta SCREEN+$28*2,x sta SCREEN+$28*3,x @@ -196,7 +194,7 @@ render_logo: { jmp breturn b18: lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x sta SCREEN+$28*1,x sta SCREEN+$28*2,x sta SCREEN+$28*3,x @@ -206,9 +204,7 @@ render_logo: { jmp b15 b14: tya - clc - adc #$28*0 - sta SCREEN+$28*0,x + sta SCREEN,x tya clc adc #$28*1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.cfg b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.cfg index 4635cee09..5274a7d50 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.cfg @@ -101,8 +101,8 @@ render_logo::@return: scope:[render_logo] from render_logo::@15 render_logo::@6 [49] return [ ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 ] ) to:@return render_logo::@9: scope:[render_logo] from render_logo::@6 - [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) - [51] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) + [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) + [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) to:render_logo::@9_1 render_logo::@9_1: scope:[render_logo] from render_logo::@9 [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) @@ -129,7 +129,7 @@ render_logo::@26: scope:[render_logo] from render_logo::@9_5 [63] (byte) render_logo::logo_idx#2 ← ++ (byte) render_logo::logo_idx#11 [ render_logo::screen_idx#3 render_logo::logo_idx#2 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#3 render_logo::logo_idx#2 ] ) to:render_logo::@6 render_logo::@5: scope:[render_logo] from render_logo::@2 - [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) + [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) to:render_logo::@5_1 render_logo::@5_1: scope:[render_logo] from render_logo::@5 [65] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) @@ -163,7 +163,7 @@ render_logo::@15: scope:[render_logo] from render_logo::@11 render_logo::@35 [76] if((byte) render_logo::screen_idx#14!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto render_logo::@18 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) to:render_logo::@return render_logo::@18: scope:[render_logo] from render_logo::@15 - [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) + [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) to:render_logo::@18_1 render_logo::@18_1: scope:[render_logo] from render_logo::@18 [78] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) @@ -184,8 +184,8 @@ render_logo::@35: scope:[render_logo] from render_logo::@18_5 [83] (byte) render_logo::screen_idx#5 ← ++ (byte) render_logo::screen_idx#14 [ render_logo::screen_idx#5 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#5 ] ) to:render_logo::@15 render_logo::@14: scope:[render_logo] from render_logo::@11 - [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) - [85] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) + [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) + [85] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) to:render_logo::@14_1 render_logo::@14_1: scope:[render_logo] from render_logo::@14 [86] (byte/signed word/word/dword/signed dword~) render_logo::$80 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.log b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.log index 7bedd8861..68aa2d2fd 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/scrolllogo.log @@ -5334,54 +5334,64 @@ Succesful SSA optimization Pass2ConstantInlining Identical Phi Values (word) divr16u::divisor#6 (const word) XSIN_SIZE#0 Identical Phi Values (word) fill::size#2 (word/signed word/dword/signed dword) 1000 Succesful SSA optimization Pass2IdenticalPhiElimination -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant multiply by zero 40*0 +Simplifying constant multiply by zero 40*0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant multiply by zero 40*0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant multiply by zero 40*0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant multiply by zero 40*0 +Simplifying constant multiply by zero 40*0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant plus zero SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant plus zero SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant plus zero SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant plus zero SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @24 @27 @end main main::toD0181 main::@3 main::@4 main::@1 main::@2 main::@6 main::@return loop loop::@1 loop::@4 loop::@6 loop::@15 loop::@13 loop::@7 render_logo render_logo::@2 render_logo::@6 render_logo::@return render_logo::@9 render_logo::@9_1 render_logo::@9_2 render_logo::@9_3 render_logo::@9_4 render_logo::@9_5 render_logo::@26 render_logo::@5 render_logo::@5_1 render_logo::@5_2 render_logo::@5_3 render_logo::@5_4 render_logo::@5_5 render_logo::@22 render_logo::@1 render_logo::@11 render_logo::@15 render_logo::@18 render_logo::@18_1 render_logo::@18_2 render_logo::@18_3 render_logo::@18_4 render_logo::@18_5 render_logo::@35 render_logo::@14 render_logo::@14_1 render_logo::@14_2 render_logo::@14_3 render_logo::@14_4 render_logo::@14_5 render_logo::@31 sin16s_gen2 sin16s_gen2::@3 sin16s_gen2::@1 sin16s_gen2::@4 sin16s_gen2::@5 sin16s_gen2::@return mul16s mul16s::@6 mul16s::@3 mul16s::@1 mul16s::@2 mul16s::@return mul16u mul16u::@1 mul16u::@return mul16u::@2 mul16u::@7 mul16u::@4 sin16s sin16s::@4 sin16s::@1 sin16s::@5 sin16s::@2 sin16s::@8 sin16s::@9 sin16s::@10 sin16s::@11 sin16s::@12 sin16s::@6 sin16s::@3 sin16s::@return mulu16_sel mulu16_sel::@2 mulu16_sel::@return div32u16u div32u16u::@2 div32u16u::@3 div32u16u::@return divr16u divr16u::@1 divr16u::@4 divr16u::@2 divr16u::@5 divr16u::@3 divr16u::@6 divr16u::@return fill fill::@1 fill::@return Added new block during phi lifting main::@8(between main::@1 and main::@1) Added new block during phi lifting loop::@16(between loop::@15 and loop::@7) @@ -5682,8 +5692,8 @@ render_logo::@return: scope:[render_logo] from render_logo::@15 render_logo::@6 [49] return [ ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 ] ) to:@return render_logo::@9: scope:[render_logo] from render_logo::@6 - [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) - [51] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) + [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) + [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) to:render_logo::@9_1 render_logo::@9_1: scope:[render_logo] from render_logo::@9 [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) @@ -5710,7 +5720,7 @@ render_logo::@26: scope:[render_logo] from render_logo::@9_5 [63] (byte) render_logo::logo_idx#2 ← ++ (byte) render_logo::logo_idx#11 [ render_logo::screen_idx#3 render_logo::logo_idx#2 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#3 render_logo::logo_idx#2 ] ) to:render_logo::@6 render_logo::@5: scope:[render_logo] from render_logo::@2 - [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) + [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) to:render_logo::@5_1 render_logo::@5_1: scope:[render_logo] from render_logo::@5 [65] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) @@ -5744,7 +5754,7 @@ render_logo::@15: scope:[render_logo] from render_logo::@11 render_logo::@35 [76] if((byte) render_logo::screen_idx#14!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto render_logo::@18 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) to:render_logo::@return render_logo::@18: scope:[render_logo] from render_logo::@15 - [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) + [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) to:render_logo::@18_1 render_logo::@18_1: scope:[render_logo] from render_logo::@18 [78] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) @@ -5765,8 +5775,8 @@ render_logo::@35: scope:[render_logo] from render_logo::@18_5 [83] (byte) render_logo::screen_idx#5 ← ++ (byte) render_logo::screen_idx#14 [ render_logo::screen_idx#5 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#5 ] ) to:render_logo::@15 render_logo::@14: scope:[render_logo] from render_logo::@11 - [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) - [85] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) + [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) + [85] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) to:render_logo::@14_1 render_logo::@14_1: scope:[render_logo] from render_logo::@14 [86] (byte/signed word/word/dword/signed dword~) render_logo::$80 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ) @@ -6891,15 +6901,13 @@ render_logo: { rts //SEG93 render_logo::@9 b9: - //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuz1=vbuz2_plus_vbuc1 - lda #$28*0 - clc - adc logo_idx + //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuz1=vbuz2_plus_0 + lda logo_idx sta _15 - //SEG95 [51] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG95 [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuz1=vbuz2 lda _15 ldy screen_idx - sta SCREEN+$28*0,y + sta SCREEN,y jmp b9_1 //SEG96 render_logo::@9_1 b9_1: @@ -6974,10 +6982,10 @@ render_logo: { jmp b6 //SEG117 render_logo::@5 b5: - //SEG118 [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 + //SEG118 [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 ldy screen_idx lda #0 - sta SCREEN+$28*0,y + sta SCREEN,y jmp b5_1 //SEG119 render_logo::@5_1 b5_1: @@ -7060,10 +7068,10 @@ render_logo: { jmp breturn //SEG145 render_logo::@18 b18: - //SEG146 [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 + //SEG146 [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 ldy screen_idx_14 lda #0 - sta SCREEN+$28*0,y + sta SCREEN,y jmp b18_1 //SEG147 render_logo::@18_1 b18_1: @@ -7107,15 +7115,13 @@ render_logo: { jmp b15_from_b35 //SEG159 render_logo::@14 b14: - //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuz1=vbuz2_plus_vbuc1 - lda #$28*0 - clc - adc logo_idx_10 + //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuz1=vbuz2_plus_0 + lda logo_idx_10 sta _23 - //SEG161 [85] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG161 [85] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuz1=vbuz2 lda _23 ldy screen_idx_20 - sta SCREEN+$28*0,y + sta SCREEN,y jmp b14_1 //SEG162 render_logo::@14_1 b14_1: @@ -8249,31 +8255,29 @@ Statement [42] (signed word~) render_logo::$3 ← (signed word) render_logo::xpo Statement [43] (signed byte) render_logo::x_char#0 ← ((signed byte)) (signed word~) render_logo::$3 [ render_logo::xpos#0 render_logo::x_char#0 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::xpos#0 render_logo::x_char#0 ] ) always clobbers reg byte a Statement [44] if((signed word) render_logo::xpos#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_logo::@1 [ render_logo::x_char#0 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:66 [ render_logo::x_char#0 ] -Statement [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) always clobbers reg byte a +Statement [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ render_logo::screen_idx#19 render_logo::screen_idx#3 render_logo::screen_idx#17 render_logo::screen_idx#2 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ render_logo::logo_idx#11 render_logo::logo_idx#2 ] -Statement [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) always clobbers reg byte a Statement [54] (byte/signed word/word/dword/signed dword~) render_logo::$38 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$38 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$38 ] ) always clobbers reg byte a Statement [56] (byte/signed word/word/dword/signed dword~) render_logo::$42 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$42 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$42 ] ) always clobbers reg byte a Statement [58] (byte/signed word/word/dword/signed dword~) render_logo::$46 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$46 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$46 ] ) always clobbers reg byte a Statement [60] (byte/signed word/word/dword/signed dword~) render_logo::$50 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$50 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$50 ] ) always clobbers reg byte a -Statement [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a +Statement [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [65] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [66] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [67] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [68] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [69] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 [ render_logo::$17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::$17 ] ) always clobbers reg byte a -Statement [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a +Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ render_logo::screen_idx#14 render_logo::screen_idx#20 render_logo::screen_idx#4 render_logo::screen_idx#5 ] Statement [78] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [79] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [80] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [81] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [82] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a -Statement [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ render_logo::logo_idx#10 render_logo::logo_idx#13 render_logo::logo_idx#3 ] Statement [86] (byte/signed word/word/dword/signed dword~) render_logo::$80 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ render_logo::logo_idx#10 render_logo::logo_idx#13 render_logo::logo_idx#3 ] Statement [88] (byte/signed word/word/dword/signed dword~) render_logo::$84 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$84 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$84 ] ) always clobbers reg byte a Statement [90] (byte/signed word/word/dword/signed dword~) render_logo::$88 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$88 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$88 ] ) always clobbers reg byte a Statement [92] (byte/signed word/word/dword/signed dword~) render_logo::$92 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$92 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$92 ] ) always clobbers reg byte a @@ -8378,26 +8382,26 @@ Statement [40] (byte~) render_logo::$2 ← (const byte) VIC_MCM#0 | (byte~) rend Statement [42] (signed word~) render_logo::$3 ← (signed word) render_logo::xpos#0 >> (byte/signed byte/word/signed word/dword/signed dword) 3 [ render_logo::xpos#0 render_logo::$3 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::xpos#0 render_logo::$3 ] ) always clobbers reg byte a Statement [43] (signed byte) render_logo::x_char#0 ← ((signed byte)) (signed word~) render_logo::$3 [ render_logo::xpos#0 render_logo::x_char#0 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::xpos#0 render_logo::x_char#0 ] ) always clobbers reg byte a Statement [44] if((signed word) render_logo::xpos#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_logo::@1 [ render_logo::x_char#0 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 ] ) always clobbers reg byte a -Statement [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) always clobbers reg byte a +Statement [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) always clobbers reg byte a Statement [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) always clobbers reg byte a Statement [54] (byte/signed word/word/dword/signed dword~) render_logo::$38 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$38 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$38 ] ) always clobbers reg byte a Statement [56] (byte/signed word/word/dword/signed dword~) render_logo::$42 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$42 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$42 ] ) always clobbers reg byte a Statement [58] (byte/signed word/word/dword/signed dword~) render_logo::$46 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$46 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$46 ] ) always clobbers reg byte a Statement [60] (byte/signed word/word/dword/signed dword~) render_logo::$50 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$50 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$50 ] ) always clobbers reg byte a -Statement [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a +Statement [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [65] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [66] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [67] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [68] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [69] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) always clobbers reg byte a Statement [71] (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#0 [ render_logo::$17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::$17 ] ) always clobbers reg byte a -Statement [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a +Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [78] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [79] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [80] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [81] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a Statement [82] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) always clobbers reg byte a -Statement [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) always clobbers reg byte a +Statement [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) always clobbers reg byte a Statement [86] (byte/signed word/word/dword/signed dword~) render_logo::$80 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ) always clobbers reg byte a Statement [88] (byte/signed word/word/dword/signed dword~) render_logo::$84 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 2 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$84 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$84 ] ) always clobbers reg byte a Statement [90] (byte/signed word/word/dword/signed dword~) render_logo::$88 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 3 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$88 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$88 ] ) always clobbers reg byte a @@ -8582,61 +8586,61 @@ Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] Uplift Scope [] 26.71: zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] 0.8: zp ZP_WORD:177 [ rem16u#1 ] Uplift Scope [div32u16u] 4: zp ZP_DWORD:80 [ div32u16u::return#2 ] 4: zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] 1.33: zp ZP_DWORD:171 [ div32u16u::return#0 ] 0.8: zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] -Uplifting [mul16u] best 76900 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#8 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#2 mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ] -Uplifting [divr16u] best 76710 combination zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:163 [ divr16u::return#2 ] zp ZP_WORD:167 [ divr16u::return#3 ] -Uplifting [sin16s_gen2] best 76710 combination zp ZP_DWORD:96 [ sin16s_gen2::$5 ] zp ZP_WORD:102 [ sin16s_gen2::$8 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:100 [ sin16s_gen2::$6 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:84 [ sin16s_gen2::step#0 ] -Uplifting [sin16s] best 76710 combination zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:88 [ sin16s::return#0 ] zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:117 [ sin16s::$6 ] zp ZP_WORD:125 [ sin16s::x2#0 ] zp ZP_WORD:133 [ sin16s::x3_6#0 ] zp ZP_WORD:139 [ sin16s::x4#0 ] zp ZP_WORD:143 [ sin16s::x5#0 ] zp ZP_WORD:145 [ sin16s::x5_128#0 ] zp ZP_WORD:129 [ sin16s::x3#0 ] zp ZP_WORD:147 [ sin16s::usinx#1 ] zp ZP_WORD:121 [ sin16s::x1#0 ] zp ZP_WORD:135 [ sin16s::usinx#0 ] zp ZP_BYTE:33 [ sin16s::isUpper#2 ] -Uplifting [mulu16_sel] best 76694 combination zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:123 [ mulu16_sel::return#0 ] zp ZP_WORD:127 [ mulu16_sel::return#1 ] zp ZP_WORD:131 [ mulu16_sel::return#2 ] zp ZP_WORD:137 [ mulu16_sel::return#10 ] zp ZP_WORD:141 [ mulu16_sel::return#11 ] zp ZP_DWORD:153 [ mulu16_sel::$0 ] zp ZP_DWORD:157 [ mulu16_sel::$1 ] zp ZP_WORD:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [mul16s] best 76694 combination zp ZP_DWORD:92 [ mul16s::return#2 ] zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp ZP_DWORD:112 [ mul16s::return#0 ] zp ZP_WORD:108 [ mul16s::$6 ] zp ZP_WORD:110 [ mul16s::$16 ] zp ZP_WORD:90 [ mul16s::a#0 ] -Uplifting [loop] best 76694 combination zp ZP_WORD:55 [ loop::$1 ] zp ZP_WORD:57 [ loop::xpos#0 ] -Uplifting [fill] best 76678 combination zp ZP_WORD:53 [ fill::addr#2 fill::addr#0 fill::addr#1 ] zp ZP_WORD:179 [ fill::end#0 ] reg byte x [ fill::val#3 ] -Uplifting [main] best 76558 combination reg byte x [ main::ch#2 main::ch#1 ] -Uplifting [] best 76558 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ] -Uplifting [div32u16u] best 76558 combination zp ZP_DWORD:80 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] +Uplifting [mul16u] best 76100 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#8 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#2 mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ] +Uplifting [divr16u] best 75910 combination zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:163 [ divr16u::return#2 ] zp ZP_WORD:167 [ divr16u::return#3 ] +Uplifting [sin16s_gen2] best 75910 combination zp ZP_DWORD:96 [ sin16s_gen2::$5 ] zp ZP_WORD:102 [ sin16s_gen2::$8 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:100 [ sin16s_gen2::$6 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:84 [ sin16s_gen2::step#0 ] +Uplifting [sin16s] best 75910 combination zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:88 [ sin16s::return#0 ] zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:117 [ sin16s::$6 ] zp ZP_WORD:125 [ sin16s::x2#0 ] zp ZP_WORD:133 [ sin16s::x3_6#0 ] zp ZP_WORD:139 [ sin16s::x4#0 ] zp ZP_WORD:143 [ sin16s::x5#0 ] zp ZP_WORD:145 [ sin16s::x5_128#0 ] zp ZP_WORD:129 [ sin16s::x3#0 ] zp ZP_WORD:147 [ sin16s::usinx#1 ] zp ZP_WORD:121 [ sin16s::x1#0 ] zp ZP_WORD:135 [ sin16s::usinx#0 ] zp ZP_BYTE:33 [ sin16s::isUpper#2 ] +Uplifting [mulu16_sel] best 75894 combination zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:123 [ mulu16_sel::return#0 ] zp ZP_WORD:127 [ mulu16_sel::return#1 ] zp ZP_WORD:131 [ mulu16_sel::return#2 ] zp ZP_WORD:137 [ mulu16_sel::return#10 ] zp ZP_WORD:141 [ mulu16_sel::return#11 ] zp ZP_DWORD:153 [ mulu16_sel::$0 ] zp ZP_DWORD:157 [ mulu16_sel::$1 ] zp ZP_WORD:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [mul16s] best 75894 combination zp ZP_DWORD:92 [ mul16s::return#2 ] zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp ZP_DWORD:112 [ mul16s::return#0 ] zp ZP_WORD:108 [ mul16s::$6 ] zp ZP_WORD:110 [ mul16s::$16 ] zp ZP_WORD:90 [ mul16s::a#0 ] +Uplifting [loop] best 75894 combination zp ZP_WORD:55 [ loop::$1 ] zp ZP_WORD:57 [ loop::xpos#0 ] +Uplifting [fill] best 75878 combination zp ZP_WORD:53 [ fill::addr#2 fill::addr#0 fill::addr#1 ] zp ZP_WORD:179 [ fill::end#0 ] reg byte x [ fill::val#3 ] +Uplifting [main] best 75758 combination reg byte x [ main::ch#2 main::ch#1 ] +Uplifting [] best 75758 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ] +Uplifting [div32u16u] best 75758 combination zp ZP_DWORD:80 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ render_logo::screen_idx#19 render_logo::screen_idx#3 render_logo::screen_idx#17 render_logo::screen_idx#2 ] -Uplifting [render_logo] best 71458 combination reg byte x [ render_logo::screen_idx#19 render_logo::screen_idx#3 render_logo::screen_idx#17 render_logo::screen_idx#2 ] +Uplifting [render_logo] best 70658 combination reg byte x [ render_logo::screen_idx#19 render_logo::screen_idx#3 render_logo::screen_idx#17 render_logo::screen_idx#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ render_logo::screen_idx#14 render_logo::screen_idx#20 render_logo::screen_idx#4 render_logo::screen_idx#5 ] -Uplifting [render_logo] best 66658 combination reg byte x [ render_logo::screen_idx#14 render_logo::screen_idx#20 render_logo::screen_idx#4 render_logo::screen_idx#5 ] +Uplifting [render_logo] best 65858 combination reg byte x [ render_logo::screen_idx#14 render_logo::screen_idx#20 render_logo::screen_idx#4 render_logo::screen_idx#5 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ render_logo::logo_idx#10 render_logo::logo_idx#13 render_logo::logo_idx#3 ] -Uplifting [render_logo] best 65455 combination reg byte y [ render_logo::logo_idx#10 render_logo::logo_idx#13 render_logo::logo_idx#3 ] +Uplifting [render_logo] best 64655 combination reg byte y [ render_logo::logo_idx#10 render_logo::logo_idx#13 render_logo::logo_idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ render_logo::logo_idx#11 render_logo::logo_idx#2 ] -Uplifting [render_logo] best 64255 combination reg byte y [ render_logo::logo_idx#11 render_logo::logo_idx#2 ] +Uplifting [render_logo] best 63455 combination reg byte y [ render_logo::logo_idx#11 render_logo::logo_idx#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:67 [ render_logo::$15 ] -Uplifting [render_logo] best 63655 combination reg byte a [ render_logo::$15 ] +Uplifting [render_logo] best 62855 combination reg byte a [ render_logo::$15 ] Attempting to uplift remaining variables inzp ZP_BYTE:68 [ render_logo::$34 ] -Uplifting [render_logo] best 63055 combination reg byte a [ render_logo::$34 ] +Uplifting [render_logo] best 62255 combination reg byte a [ render_logo::$34 ] Attempting to uplift remaining variables inzp ZP_BYTE:69 [ render_logo::$38 ] -Uplifting [render_logo] best 62455 combination reg byte a [ render_logo::$38 ] +Uplifting [render_logo] best 61655 combination reg byte a [ render_logo::$38 ] Attempting to uplift remaining variables inzp ZP_BYTE:70 [ render_logo::$42 ] -Uplifting [render_logo] best 61855 combination reg byte a [ render_logo::$42 ] +Uplifting [render_logo] best 61055 combination reg byte a [ render_logo::$42 ] Attempting to uplift remaining variables inzp ZP_BYTE:71 [ render_logo::$46 ] -Uplifting [render_logo] best 61255 combination reg byte a [ render_logo::$46 ] +Uplifting [render_logo] best 60455 combination reg byte a [ render_logo::$46 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ render_logo::$50 ] -Uplifting [render_logo] best 60655 combination reg byte a [ render_logo::$50 ] +Uplifting [render_logo] best 59855 combination reg byte a [ render_logo::$50 ] Attempting to uplift remaining variables inzp ZP_BYTE:74 [ render_logo::$23 ] -Uplifting [render_logo] best 60055 combination reg byte a [ render_logo::$23 ] +Uplifting [render_logo] best 59255 combination reg byte a [ render_logo::$23 ] Attempting to uplift remaining variables inzp ZP_BYTE:75 [ render_logo::$80 ] -Uplifting [render_logo] best 59455 combination reg byte a [ render_logo::$80 ] +Uplifting [render_logo] best 58655 combination reg byte a [ render_logo::$80 ] Attempting to uplift remaining variables inzp ZP_BYTE:76 [ render_logo::$84 ] -Uplifting [render_logo] best 58855 combination reg byte a [ render_logo::$84 ] +Uplifting [render_logo] best 58055 combination reg byte a [ render_logo::$84 ] Attempting to uplift remaining variables inzp ZP_BYTE:77 [ render_logo::$88 ] -Uplifting [render_logo] best 58255 combination reg byte a [ render_logo::$88 ] +Uplifting [render_logo] best 57455 combination reg byte a [ render_logo::$88 ] Attempting to uplift remaining variables inzp ZP_BYTE:78 [ render_logo::$92 ] -Uplifting [render_logo] best 57655 combination reg byte a [ render_logo::$92 ] +Uplifting [render_logo] best 56855 combination reg byte a [ render_logo::$92 ] Attempting to uplift remaining variables inzp ZP_BYTE:79 [ render_logo::$96 ] -Uplifting [render_logo] best 57055 combination reg byte a [ render_logo::$96 ] +Uplifting [render_logo] best 56255 combination reg byte a [ render_logo::$96 ] Attempting to uplift remaining variables inzp ZP_BYTE:61 [ render_logo::$0 ] -Uplifting [render_logo] best 57049 combination reg byte a [ render_logo::$0 ] +Uplifting [render_logo] best 56249 combination reg byte a [ render_logo::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:62 [ render_logo::$1 ] -Uplifting [render_logo] best 57043 combination reg byte a [ render_logo::$1 ] +Uplifting [render_logo] best 56243 combination reg byte a [ render_logo::$1 ] Attempting to uplift remaining variables inzp ZP_BYTE:63 [ render_logo::$2 ] -Uplifting [render_logo] best 57037 combination reg byte a [ render_logo::$2 ] +Uplifting [render_logo] best 56237 combination reg byte a [ render_logo::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:73 [ render_logo::$17 ] -Uplifting [render_logo] best 57033 combination reg byte a [ render_logo::$17 ] +Uplifting [render_logo] best 56233 combination reg byte a [ render_logo::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:66 [ render_logo::x_char#0 ] -Uplifting [render_logo] best 57033 combination zp ZP_BYTE:66 [ render_logo::x_char#0 ] +Uplifting [render_logo] best 56233 combination zp ZP_BYTE:66 [ render_logo::x_char#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 57033 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ] +Uplifting [sin16s] best 56233 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ] Coalescing zero page register with common assignment [ zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp ZP_WORD:147 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] ] with [ zp ZP_WORD:129 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] ] with [ zp ZP_WORD:177 [ rem16u#1 ] ] - score: 2 @@ -8997,12 +9001,10 @@ render_logo: { rts //SEG93 render_logo::@9 b9: - //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuaa=vbuyy_plus_vbuc1 + //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuaa=vbuyy_plus_0 tya - clc - adc #$28*0 - //SEG95 [51] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuxx=vbuaa - sta SCREEN+$28*0,x + //SEG95 [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuxx=vbuaa + sta SCREEN,x jmp b9_1 //SEG96 render_logo::@9_1 b9_1: @@ -9062,9 +9064,9 @@ render_logo: { jmp b6 //SEG117 render_logo::@5 b5: - //SEG118 [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG118 [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x jmp b5_1 //SEG119 render_logo::@5_1 b5_1: @@ -9137,9 +9139,9 @@ render_logo: { jmp breturn //SEG145 render_logo::@18 b18: - //SEG146 [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG146 [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x jmp b18_1 //SEG147 render_logo::@18_1 b18_1: @@ -9178,12 +9180,10 @@ render_logo: { jmp b15_from_b35 //SEG159 render_logo::@14 b14: - //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuaa=vbuyy_plus_vbuc1 + //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuaa=vbuyy_plus_0 tya - clc - adc #$28*0 - //SEG161 [85] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuxx=vbuaa - sta SCREEN+$28*0,x + //SEG161 [85] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuxx=vbuaa + sta SCREEN,x jmp b14_1 //SEG162 render_logo::@14_1 b14_1: @@ -10788,7 +10788,7 @@ reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 42193 +Score: 41393 //SEG0 Basic Upstart .pc = $801 "Basic" @@ -11030,12 +11030,10 @@ render_logo: { rts //SEG93 render_logo::@9 b9: - //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuaa=vbuyy_plus_vbuc1 + //SEG94 [50] (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$15 ] ) -- vbuaa=vbuyy_plus_0 tya - clc - adc #$28*0 - //SEG95 [51] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuxx=vbuaa - sta SCREEN+$28*0,x + //SEG95 [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#19) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 [ render_logo::screen_idx#19 render_logo::logo_idx#11 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 ] ) -- pbuc1_derefidx_vbuxx=vbuaa + sta SCREEN,x //SEG96 render_logo::@9_1 //SEG97 [52] (byte/signed word/word/dword/signed dword~) render_logo::$34 ← (byte) render_logo::logo_idx#11 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#19 render_logo::logo_idx#11 render_logo::$34 ] ) -- vbuaa=vbuyy_plus_vbuc1 tya @@ -11082,9 +11080,9 @@ render_logo: { jmp b6 //SEG117 render_logo::@5 b5: - //SEG118 [64] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG118 [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x //SEG119 render_logo::@5_1 //SEG120 [65] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#17) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::x_char#0 render_logo::screen_idx#17 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#17 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 sta SCREEN+$28*1,x @@ -11134,9 +11132,9 @@ render_logo: { jmp breturn //SEG145 render_logo::@18 b18: - //SEG146 [77] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG146 [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 - sta SCREEN+$28*0,x + sta SCREEN,x //SEG147 render_logo::@18_1 //SEG148 [78] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) render_logo::screen_idx#14) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::screen_idx#14 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::screen_idx#14 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 sta SCREEN+$28*1,x @@ -11158,12 +11156,10 @@ render_logo: { jmp b15 //SEG159 render_logo::@14 b14: - //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuaa=vbuyy_plus_vbuc1 + //SEG160 [84] (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 0 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$23 ] ) -- vbuaa=vbuyy_plus_0 tya - clc - adc #$28*0 - //SEG161 [85] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuxx=vbuaa - sta SCREEN+$28*0,x + //SEG161 [85] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#20) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 [ render_logo::logo_idx#10 render_logo::screen_idx#20 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 ] ) -- pbuc1_derefidx_vbuxx=vbuaa + sta SCREEN,x //SEG162 render_logo::@14_1 //SEG163 [86] (byte/signed word/word/dword/signed dword~) render_logo::$80 ← (byte) render_logo::logo_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 1 [ render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ( main:3::loop:23::render_logo:32 [ xsin_idx#11 render_logo::logo_idx#10 render_logo::screen_idx#20 render_logo::$80 ] ) -- vbuaa=vbuyy_plus_vbuc1 tya diff --git a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.asm b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.asm index e6a5a1d40..c472af769 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.asm @@ -164,9 +164,9 @@ anim: { sbc sprite_y+1 sta sprite_y+1 lda sprite_x - sta SPRITES_XPOS+0 + sta SPRITES_XPOS lda sprite_y - sta SPRITES_YPOS+0 + sta SPRITES_YPOS lda sprite_x+1 sta SPRITES_XMSB rts @@ -179,12 +179,12 @@ init: { sta SPRITES_EXPAND_X sta SPRITES_EXPAND_Y lda #$64 - sta SPRITES_XPOS+0 - sta SPRITES_YPOS+0 + sta SPRITES_XPOS + sta SPRITES_YPOS lda #WHITE - sta SPRITES_COLS+0 + sta SPRITES_COLS lda #$ff&SPRITE/$40 - sta SPRITES_PTR+0 + sta SPRITES_PTR lda #SCREEN diff --git a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.cfg b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.cfg index 34bd658bb..8d1463e6a 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.cfg @@ -49,9 +49,9 @@ anim::@1: scope:[anim] from anim anim::@2 [22] (signed word~) anim::$12 ← (signed word) ypos#11 >> (byte/signed byte/word/signed word/dword/signed dword) 5 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$12 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$12 ] ) [23] (signed word) anim::sprite_y#0 ← (byte/word/signed word/dword/signed dword) 230 - (signed word~) anim::$12 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) [24] (byte~) anim::$14 ← ((byte)) (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ) - [25] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) + [25] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) [26] (byte~) anim::$15 ← ((byte)) (signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ) - [27] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) + [27] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ) [29] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$16 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) to:anim::@return @@ -65,10 +65,10 @@ init: scope:[init] from main [32] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::init:5 [ ] ) [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) - [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) - [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) - [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) - [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) + [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) + [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) + [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) + [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) to:init::@1 init::@1: scope:[init] from init init::@1 [39] (byte*) init::sc#2 ← phi( init/(const byte*) SCREEN#0 init::@1/(byte*) init::sc#1 ) [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.log b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.log index e44be8bbe..4c05ad62a 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/signed-words.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/signed-words.log @@ -1334,6 +1334,12 @@ Constant inlined xpos#14 = (byte/signed byte/word/signed word/dword/signed dword Constant inlined yvel_init#4 = (byte/word/signed word/dword/signed dword) 200 Constant inlined init::sc#0 = (const byte*) SCREEN#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero SPRITES_XPOS#0+0 +Simplifying constant plus zero SPRITES_YPOS#0+0 +Simplifying constant plus zero SPRITES_COLS#0+0 +Simplifying constant plus zero SPRITES_PTR#0+0 +Simplifying constant plus zero SPRITES_XPOS#0+0 +Simplifying constant plus zero SPRITES_YPOS#0+0 Block Sequence Planned @begin @6 @end main main::@2 main::@3 anim anim::@3 anim::@4 anim::@2 anim::@1 anim::@return init init::@1 init::@2 init::@return Added new block during phi lifting anim::@5(between anim::@3 and anim::@2) Added new block during phi lifting anim::@6(between anim and anim::@1) @@ -1467,9 +1473,9 @@ anim::@1: scope:[anim] from anim anim::@2 [22] (signed word~) anim::$12 ← (signed word) ypos#11 >> (byte/signed byte/word/signed word/dword/signed dword) 5 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$12 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$12 ] ) [23] (signed word) anim::sprite_y#0 ← (byte/word/signed word/dword/signed dword) 230 - (signed word~) anim::$12 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) [24] (byte~) anim::$14 ← ((byte)) (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ) - [25] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) + [25] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) [26] (byte~) anim::$15 ← ((byte)) (signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ) - [27] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) + [27] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ) [29] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$16 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) to:anim::@return @@ -1483,10 +1489,10 @@ init: scope:[init] from main [32] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::init:5 [ ] ) [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) - [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) - [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) - [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) - [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) + [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) + [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) + [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) + [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) to:init::@1 init::@1: scope:[init] from init init::@1 [39] (byte*) init::sc#2 ← phi( init/(const byte*) SCREEN#0 init::@1/(byte*) init::sc#1 ) [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) @@ -1866,15 +1872,15 @@ anim: { //SEG59 [24] (byte~) anim::$14 ← ((byte)) (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ) -- vbuz1=_byte_vwsz2 lda sprite_x sta _14 - //SEG60 [25] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuz1 + //SEG60 [25] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuz1 lda _14 - sta SPRITES_XPOS+0 + sta SPRITES_XPOS //SEG61 [26] (byte~) anim::$15 ← ((byte)) (signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ) -- vbuz1=_byte_vwsz2 lda sprite_y sta _15 - //SEG62 [27] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuz1 + //SEG62 [27] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuz1 lda _15 - sta SPRITES_YPOS+0 + sta SPRITES_YPOS //SEG63 [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ) -- vbuz1=_hi_vwsz2 lda sprite_x+1 sta _16 @@ -1909,18 +1915,18 @@ init: { //SEG74 [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 sta SPRITES_EXPAND_Y - //SEG75 [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG75 [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$64 - sta SPRITES_XPOS+0 - //SEG76 [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_XPOS + //SEG76 [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$64 - sta SPRITES_YPOS+0 - //SEG77 [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_YPOS + //SEG77 [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #WHITE - sta SPRITES_COLS+0 - //SEG78 [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_COLS + //SEG78 [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$ff&SPRITE/$40 - sta SPRITES_PTR+0 + sta SPRITES_PTR //SEG79 [39] phi from init to init::@1 [phi:init->init::@1] b1_from_init: //SEG80 [39] phi (byte*) init::sc#2 = (const byte*) SCREEN#0 [phi:init->init::@1#0] -- pbuz1=pbuc1 @@ -2000,10 +2006,10 @@ Statement [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 Statement [32] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [40] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a reg byte y Statement [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto init::@1 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) always clobbers reg byte a Statement [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte/word/signed word/dword/signed dword) 255 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a @@ -2027,10 +2033,10 @@ Statement [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 Statement [32] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [33] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a +Statement [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [40] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) always clobbers reg byte a reg byte y Statement [42] if((byte*) init::sc#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto init::@1 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) always clobbers reg byte a Statement [44] *((const byte*) SPRITE#0 + (byte) init::i#2) ← (byte/word/signed word/dword/signed dword) 255 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a @@ -2322,12 +2328,12 @@ anim: { sta sprite_y+1 //SEG59 [24] (byte~) anim::$14 ← ((byte)) (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ) -- vbuaa=_byte_vwsz1 lda sprite_x - //SEG60 [25] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuaa - sta SPRITES_XPOS+0 + //SEG60 [25] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuaa + sta SPRITES_XPOS //SEG61 [26] (byte~) anim::$15 ← ((byte)) (signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ) -- vbuaa=_byte_vwsz1 lda sprite_y - //SEG62 [27] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuaa - sta SPRITES_YPOS+0 + //SEG62 [27] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuaa + sta SPRITES_YPOS //SEG63 [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ) -- vbuaa=_hi_vwsz1 lda sprite_x+1 //SEG64 [29] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$16 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) -- _deref_pbuc1=vbuaa @@ -2359,18 +2365,18 @@ init: { //SEG74 [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 sta SPRITES_EXPAND_Y - //SEG75 [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG75 [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$64 - sta SPRITES_XPOS+0 - //SEG76 [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_XPOS + //SEG76 [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$64 - sta SPRITES_YPOS+0 - //SEG77 [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_YPOS + //SEG77 [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #WHITE - sta SPRITES_COLS+0 - //SEG78 [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_COLS + //SEG78 [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$ff&SPRITE/$40 - sta SPRITES_PTR+0 + sta SPRITES_PTR //SEG79 [39] phi from init to init::@1 [phi:init->init::@1] b1_from_init: //SEG80 [39] phi (byte*) init::sc#2 = (const byte*) SCREEN#0 [phi:init->init::@1#0] -- pbuz1=pbuc1 @@ -2816,12 +2822,12 @@ anim: { sta sprite_y+1 //SEG59 [24] (byte~) anim::$14 ← ((byte)) (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 anim::$14 ] ) -- vbuaa=_byte_vwsz1 lda sprite_x - //SEG60 [25] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuaa - sta SPRITES_XPOS+0 + //SEG60 [25] *((const byte*) SPRITES_XPOS#0) ← (byte~) anim::$14 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::sprite_y#0 ] ) -- _deref_pbuc1=vbuaa + sta SPRITES_XPOS //SEG61 [26] (byte~) anim::$15 ← ((byte)) (signed word) anim::sprite_y#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 anim::$15 ] ) -- vbuaa=_byte_vwsz1 lda sprite_y - //SEG62 [27] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuaa - sta SPRITES_YPOS+0 + //SEG62 [27] *((const byte*) SPRITES_YPOS#0) ← (byte~) anim::$15 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::sprite_x#0 ] ) -- _deref_pbuc1=vbuaa + sta SPRITES_YPOS //SEG63 [28] (byte~) anim::$16 ← > (signed word) anim::sprite_x#0 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 anim::$16 ] ) -- vbuaa=_hi_vwsz1 lda sprite_x+1 //SEG64 [29] *((const byte*) SPRITES_XMSB#0) ← (byte~) anim::$16 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ( main:2::anim:9 [ yvel#10 xpos#10 ypos#11 xvel#10 yvel_init#11 ] ) -- _deref_pbuc1=vbuaa @@ -2845,17 +2851,17 @@ init: { sta SPRITES_EXPAND_X //SEG74 [34] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 sta SPRITES_EXPAND_Y - //SEG75 [35] *((const byte*) SPRITES_XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG75 [35] *((const byte*) SPRITES_XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$64 - sta SPRITES_XPOS+0 - //SEG76 [36] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 - sta SPRITES_YPOS+0 - //SEG77 [37] *((const byte*) SPRITES_COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_XPOS + //SEG76 [36] *((const byte*) SPRITES_YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 100 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_YPOS + //SEG77 [37] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #WHITE - sta SPRITES_COLS+0 - //SEG78 [38] *((const byte*) SPRITES_PTR#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 + sta SPRITES_COLS + //SEG78 [38] *((const byte*) SPRITES_PTR#0) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) 64 [ ] ( main:2::init:5 [ ] ) -- _deref_pbuc1=vbuc2 lda #$ff&SPRITE/$40 - sta SPRITES_PTR+0 + sta SPRITES_PTR //SEG79 [39] phi from init to init::@1 [phi:init->init::@1] //SEG80 [39] phi (byte*) init::sc#2 = (const byte*) SCREEN#0 [phi:init->init::@1#0] -- pbuz1=pbuc1 lda #PI_u4f28>>$10 - sta SCREEN+0 + sta SCREEN lda #>$10 sta SCREEN+1 lda #>PI_u4f28&$ffff diff --git a/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.cfg b/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.cfg index 5e8ae6deb..aa7be91c1 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← ><(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← <<(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.log b/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.log index c80b8105a..e14faf679 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/test-lohiconst.log @@ -138,6 +138,7 @@ Constant inlined main::$3 = <>(const dword) PI_u4f28#0 Constant inlined main::$4 = <(const dword) PI_u4f28#0 Constant inlined main::$7 = <<(const dword) PI_u4f28#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::SCREEN#0+0 Block Sequence Planned @begin @1 @end main main::@return Block Sequence Planned @begin @1 @end main main::@return Adding NOP phi() at start of @begin @@ -166,7 +167,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @1 [3] phi() [ ] ( ) main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← ><(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← <<(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) @@ -208,9 +209,9 @@ bend: //SEG8 main main: { .label SCREEN = $400 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 @@ -228,7 +229,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← ><(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← <<(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -264,9 +265,9 @@ bend: //SEG8 main main: { .label SCREEN = $400 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 @@ -329,9 +330,9 @@ Score: 36 //SEG8 main main: { .label SCREEN = $400 - //SEG9 [4] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 - sta SCREEN+0 + sta SCREEN //SEG10 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← <>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.asm b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.asm index 74acd6c5d..5d2afe7ae 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.asm @@ -6,8 +6,8 @@ main: { .const b = 4 .label pos = $501 .label bgcol = $d021 - .const w = b*$100+0 - .const w2 = 1*$100+1+w+0*$100+0 + .const w = b*$100 + .const w2 = 1*$100+1+w+0 lda bs+1 sta w2 lda pos diff --git a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.log b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.log index 01a1e0dab..8bf59ad47 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.log @@ -188,6 +188,9 @@ Constant inlined main::$5 = (byte/signed byte/word/signed word/dword/signed dwor Constant inlined main::$4 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1+(const word) main::w#0 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero main::b#0*256+0 +Simplifying constant plus zero 0*256+0 +Simplifying constant multiply by zero 0*256 Block Sequence Planned @begin @1 @end main main::@3 main::@return main::@1 Block Sequence Planned @begin @1 @end main main::@3 main::@return main::@1 Adding NOP phi() at start of @begin @@ -268,8 +271,8 @@ main: { .const b = 4 .label pos = $501 .label bgcol = $d021 - .const w = b*$100+0 - .const w2 = 1*$100+1+w+0*$100+0 + .const w = b*$100 + .const w2 = 1*$100+1+w+0 //SEG9 [4] *((byte*)(const word) main::w2#0) ← *((const byte[]) main::bs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda bs+1 sta w2 @@ -335,8 +338,8 @@ main: { .const b = 4 .label pos = $501 .label bgcol = $d021 - .const w = b*$100+0 - .const w2 = 1*$100+1+w+0*$100+0 + .const w = b*$100 + .const w2 = 1*$100+1+w+0 //SEG9 [4] *((byte*)(const word) main::w2#0) ← *((const byte[]) main::bs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda bs+1 sta w2 @@ -397,9 +400,9 @@ FINAL SYMBOL TABLE (const byte*) main::pos#0 pos = ((byte*))(word/signed word/dword/signed dword) 1281 (byte*) main::sc (word) main::w -(const word) main::w#0 w = (const byte) main::b#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 +(const word) main::w#0 w = (const byte) main::b#0*(word/signed word/dword/signed dword) 256 (word) main::w2 -(const word) main::w2#0 w2 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1+(const word) main::w#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 +(const word) main::w2#0 w2 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1+(const word) main::w#0+(byte/signed byte/word/signed word/dword/signed dword) 0 @@ -423,8 +426,8 @@ main: { .const b = 4 .label pos = $501 .label bgcol = $d021 - .const w = b*$100+0 - .const w2 = 1*$100+1+w+0*$100+0 + .const w = b*$100 + .const w2 = 1*$100+1+w+0 //SEG9 [4] *((byte*)(const word) main::w2#0) ← *((const byte[]) main::bs#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_deref_pbuc2 lda bs+1 sta w2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.sym b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.sym index a1d35e311..89e9c750c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.sym +++ b/src/test/java/dk/camelot64/kickc/test/ref/true-inline-words.sym @@ -15,7 +15,7 @@ (const byte*) main::pos#0 pos = ((byte*))(word/signed word/dword/signed dword) 1281 (byte*) main::sc (word) main::w -(const word) main::w#0 w = (const byte) main::b#0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 +(const word) main::w#0 w = (const byte) main::b#0*(word/signed word/dword/signed dword) 256 (word) main::w2 -(const word) main::w2#0 w2 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1+(const word) main::w#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 0 +(const word) main::w2#0 w2 = (byte/signed byte/word/signed word/dword/signed dword) 1*(word/signed word/dword/signed dword) 256+(byte/signed byte/word/signed word/dword/signed dword) 1+(const word) main::w#0+(byte/signed byte/word/signed word/dword/signed dword) 0 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log index 4a22aa30e..4a19ad9bb 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log @@ -328,40 +328,40 @@ Constant inlined main::a#16 = ++++++++++++(byte/signed byte/word/signed word/dwo Constant inlined main::a#7 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 Constant inlined main::a#4 = ++++(byte/signed byte/word/signed word/dword/signed dword) 3 Succesful SSA optimization Pass2ConstantInlining -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return Adding NOP phi() at start of @begin diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.asm index 46323da30..04bb0c00f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.asm @@ -5,19 +5,19 @@ main: { .label SCREEN = $400 lda #0 - sta SCREEN+0*$28+0 - sta SCREEN+1*$28+0 - sta SCREEN+2*$28+0 - sta SCREEN+3*$28+0 - sta SCREEN+4*$28+0 - sta SCREEN+5*$28+0 - sta SCREEN+6*$28+0 - sta SCREEN+7*$28+0 - sta SCREEN+8*$28+0 - sta SCREEN+9*$28+0 - sta SCREEN+$a*$28+0 + sta SCREEN + sta SCREEN+1*$28 + sta SCREEN+2*$28 + sta SCREEN+3*$28 + sta SCREEN+4*$28 + sta SCREEN+5*$28 + sta SCREEN+6*$28 + sta SCREEN+7*$28 + sta SCREEN+8*$28 + sta SCREEN+9*$28 + sta SCREEN+$a*$28 lda #1 - sta SCREEN+0*$28+1 + sta SCREEN+1 sta SCREEN+1*$28+1 sta SCREEN+2*$28+1 sta SCREEN+3*$28+1 @@ -29,7 +29,7 @@ main: { sta SCREEN+9*$28+1 sta SCREEN+$a*$28+1 lda #2 - sta SCREEN+0*$28+2 + sta SCREEN+2 sta SCREEN+1*$28+2 sta SCREEN+2*$28+2 sta SCREEN+3*$28+2 @@ -41,7 +41,7 @@ main: { sta SCREEN+9*$28+2 sta SCREEN+$a*$28+2 lda #3 - sta SCREEN+0*$28+3 + sta SCREEN+3 sta SCREEN+1*$28+3 sta SCREEN+2*$28+3 sta SCREEN+3*$28+3 @@ -53,7 +53,7 @@ main: { sta SCREEN+9*$28+3 sta SCREEN+$a*$28+3 lda #4 - sta SCREEN+0*$28+4 + sta SCREEN+4 sta SCREEN+1*$28+4 sta SCREEN+2*$28+4 sta SCREEN+3*$28+4 @@ -65,7 +65,7 @@ main: { sta SCREEN+9*$28+4 sta SCREEN+$a*$28+4 lda #5 - sta SCREEN+0*$28+5 + sta SCREEN+5 sta SCREEN+1*$28+5 sta SCREEN+2*$28+5 sta SCREEN+3*$28+5 @@ -77,7 +77,7 @@ main: { sta SCREEN+9*$28+5 sta SCREEN+$a*$28+5 lda #6 - sta SCREEN+0*$28+6 + sta SCREEN+6 sta SCREEN+1*$28+6 sta SCREEN+2*$28+6 sta SCREEN+3*$28+6 @@ -89,7 +89,7 @@ main: { sta SCREEN+9*$28+6 sta SCREEN+$a*$28+6 lda #7 - sta SCREEN+0*$28+7 + sta SCREEN+7 sta SCREEN+1*$28+7 sta SCREEN+2*$28+7 sta SCREEN+3*$28+7 @@ -101,7 +101,7 @@ main: { sta SCREEN+9*$28+7 sta SCREEN+$a*$28+7 lda #8 - sta SCREEN+0*$28+8 + sta SCREEN+8 sta SCREEN+1*$28+8 sta SCREEN+2*$28+8 sta SCREEN+3*$28+8 @@ -113,7 +113,7 @@ main: { sta SCREEN+9*$28+8 sta SCREEN+$a*$28+8 lda #9 - sta SCREEN+0*$28+9 + sta SCREEN+9 sta SCREEN+1*$28+9 sta SCREEN+2*$28+9 sta SCREEN+3*$28+9 @@ -125,7 +125,7 @@ main: { sta SCREEN+9*$28+9 sta SCREEN+$a*$28+9 lda #$a - sta SCREEN+0*$28+$a + sta SCREEN+$a sta SCREEN+1*$28+$a sta SCREEN+2*$28+$a sta SCREEN+3*$28+$a diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.cfg index e06ff6db7..0eae51e43 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.cfg @@ -11,40 +11,40 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@2 main::@2: scope:[main] from main - [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_1 main::@2_1: scope:[main] from main::@2 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_2 main::@2_2: scope:[main] from main::@2_1 - [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_3 main::@2_3: scope:[main] from main::@2_2 - [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_4 main::@2_4: scope:[main] from main::@2_3 - [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_5 main::@2_5: scope:[main] from main::@2_4 - [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_6 main::@2_6: scope:[main] from main::@2_5 - [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_7 main::@2_7: scope:[main] from main::@2_6 - [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_8 main::@2_8: scope:[main] from main::@2_7 - [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_9 main::@2_9: scope:[main] from main::@2_8 - [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_10 main::@2_10: scope:[main] from main::@2_9 - [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_11 main::@2_11: scope:[main] from main::@2_10 - [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) + [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@2_12 main::@2_12: scope:[main] from main::@2_11 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) @@ -77,7 +77,7 @@ main::@2_21: scope:[main] from main::@2_20 [26] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@2_22 main::@2_22: scope:[main] from main::@2_21 - [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) + [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) to:main::@2_23 main::@2_23: scope:[main] from main::@2_22 [28] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) @@ -110,7 +110,7 @@ main::@2_32: scope:[main] from main::@2_31 [37] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) to:main::@2_33 main::@2_33: scope:[main] from main::@2_32 - [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) to:main::@2_34 main::@2_34: scope:[main] from main::@2_33 [39] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) @@ -143,7 +143,7 @@ main::@2_43: scope:[main] from main::@2_42 [48] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) to:main::@2_44 main::@2_44: scope:[main] from main::@2_43 - [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) + [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) to:main::@2_45 main::@2_45: scope:[main] from main::@2_44 [50] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) @@ -176,7 +176,7 @@ main::@2_54: scope:[main] from main::@2_53 [59] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) to:main::@2_55 main::@2_55: scope:[main] from main::@2_54 - [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) + [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) to:main::@2_56 main::@2_56: scope:[main] from main::@2_55 [61] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) @@ -209,7 +209,7 @@ main::@2_65: scope:[main] from main::@2_64 [70] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) to:main::@2_66 main::@2_66: scope:[main] from main::@2_65 - [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) + [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) to:main::@2_67 main::@2_67: scope:[main] from main::@2_66 [72] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) @@ -242,7 +242,7 @@ main::@2_76: scope:[main] from main::@2_75 [81] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) to:main::@2_77 main::@2_77: scope:[main] from main::@2_76 - [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) + [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) to:main::@2_78 main::@2_78: scope:[main] from main::@2_77 [83] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) @@ -275,7 +275,7 @@ main::@2_87: scope:[main] from main::@2_86 [92] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) to:main::@2_88 main::@2_88: scope:[main] from main::@2_87 - [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) + [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) to:main::@2_89 main::@2_89: scope:[main] from main::@2_88 [94] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) @@ -308,7 +308,7 @@ main::@2_98: scope:[main] from main::@2_97 [103] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) to:main::@2_99 main::@2_99: scope:[main] from main::@2_98 - [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) + [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) to:main::@2_100 main::@2_100: scope:[main] from main::@2_99 [105] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) @@ -341,7 +341,7 @@ main::@2_109: scope:[main] from main::@2_108 [114] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) to:main::@2_110 main::@2_110: scope:[main] from main::@2_109 - [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) + [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) to:main::@2_111 main::@2_111: scope:[main] from main::@2_110 [116] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.log index bd711ea7d..5e0373b4f 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for-double.log @@ -680,256 +680,279 @@ Constant inlined main::line#16 = ++++++++++++++++(byte/signed byte/word/signed w Constant inlined main::$8 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 Constant inlined main::x#20 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++9 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant plus zero main::SCREEN#0+0*40+0 +Simplifying constant multiply by zero 0*40 +Simplifying constant plus zero main::SCREEN#0+++0*40+0 +Simplifying constant integer increment ++0 +Simplifying constant plus zero main::SCREEN#0+++++0*40+0 +Simplifying constant integer increment ++0 +Simplifying constant plus zero main::SCREEN#0+++++1*40+0 +Simplifying constant integer increment ++1 +Simplifying constant plus zero main::SCREEN#0+++++2*40+0 +Simplifying constant integer increment ++2 +Simplifying constant plus zero main::SCREEN#0+++++3*40+0 +Simplifying constant integer increment ++3 +Simplifying constant plus zero main::SCREEN#0+++++4*40+0 +Simplifying constant integer increment ++4 +Simplifying constant plus zero main::SCREEN#0+++++5*40+0 +Simplifying constant integer increment ++5 +Simplifying constant plus zero main::SCREEN#0+++++6*40+0 +Simplifying constant integer increment ++6 +Simplifying constant plus zero main::SCREEN#0+++++7*40+0 +Simplifying constant integer increment ++7 +Simplifying constant plus zero main::SCREEN#0+++++8*40+0 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++0 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++1 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++2 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++3 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++4 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++5 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++6 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++7 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++8 +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++9 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @1 @end main main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@2_25 main::@2_26 main::@2_27 main::@2_28 main::@2_29 main::@2_30 main::@2_31 main::@2_32 main::@2_33 main::@2_34 main::@2_35 main::@2_36 main::@2_37 main::@2_38 main::@2_39 main::@2_40 main::@2_41 main::@2_42 main::@2_43 main::@2_44 main::@2_45 main::@2_46 main::@2_47 main::@2_48 main::@2_49 main::@2_50 main::@2_51 main::@2_52 main::@2_53 main::@2_54 main::@2_55 main::@2_56 main::@2_57 main::@2_58 main::@2_59 main::@2_60 main::@2_61 main::@2_62 main::@2_63 main::@2_64 main::@2_65 main::@2_66 main::@2_67 main::@2_68 main::@2_69 main::@2_70 main::@2_71 main::@2_72 main::@2_73 main::@2_74 main::@2_75 main::@2_76 main::@2_77 main::@2_78 main::@2_79 main::@2_80 main::@2_81 main::@2_82 main::@2_83 main::@2_84 main::@2_85 main::@2_86 main::@2_87 main::@2_88 main::@2_89 main::@2_90 main::@2_91 main::@2_92 main::@2_93 main::@2_94 main::@2_95 main::@2_96 main::@2_97 main::@2_98 main::@2_99 main::@2_100 main::@2_101 main::@2_102 main::@2_103 main::@2_104 main::@2_105 main::@2_106 main::@2_107 main::@2_108 main::@2_109 main::@2_110 main::@2_111 main::@2_112 main::@2_113 main::@2_114 main::@2_115 main::@2_116 main::@2_117 main::@2_118 main::@2_119 main::@2_120 main::@return Block Sequence Planned @begin @1 @end main main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@2_25 main::@2_26 main::@2_27 main::@2_28 main::@2_29 main::@2_30 main::@2_31 main::@2_32 main::@2_33 main::@2_34 main::@2_35 main::@2_36 main::@2_37 main::@2_38 main::@2_39 main::@2_40 main::@2_41 main::@2_42 main::@2_43 main::@2_44 main::@2_45 main::@2_46 main::@2_47 main::@2_48 main::@2_49 main::@2_50 main::@2_51 main::@2_52 main::@2_53 main::@2_54 main::@2_55 main::@2_56 main::@2_57 main::@2_58 main::@2_59 main::@2_60 main::@2_61 main::@2_62 main::@2_63 main::@2_64 main::@2_65 main::@2_66 main::@2_67 main::@2_68 main::@2_69 main::@2_70 main::@2_71 main::@2_72 main::@2_73 main::@2_74 main::@2_75 main::@2_76 main::@2_77 main::@2_78 main::@2_79 main::@2_80 main::@2_81 main::@2_82 main::@2_83 main::@2_84 main::@2_85 main::@2_86 main::@2_87 main::@2_88 main::@2_89 main::@2_90 main::@2_91 main::@2_92 main::@2_93 main::@2_94 main::@2_95 main::@2_96 main::@2_97 main::@2_98 main::@2_99 main::@2_100 main::@2_101 main::@2_102 main::@2_103 main::@2_104 main::@2_105 main::@2_106 main::@2_107 main::@2_108 main::@2_109 main::@2_110 main::@2_111 main::@2_112 main::@2_113 main::@2_114 main::@2_115 main::@2_116 main::@2_117 main::@2_118 main::@2_119 main::@2_120 main::@return Adding NOP phi() at start of @begin @@ -963,40 +986,40 @@ main: scope:[main] from @1 [4] phi() [ ] ( main:2 [ ] ) to:main::@2 main::@2: scope:[main] from main - [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_1 main::@2_1: scope:[main] from main::@2 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_2 main::@2_2: scope:[main] from main::@2_1 - [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_3 main::@2_3: scope:[main] from main::@2_2 - [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_4 main::@2_4: scope:[main] from main::@2_3 - [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_5 main::@2_5: scope:[main] from main::@2_4 - [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_6 main::@2_6: scope:[main] from main::@2_5 - [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_7 main::@2_7: scope:[main] from main::@2_6 - [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_8 main::@2_8: scope:[main] from main::@2_7 - [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_9 main::@2_9: scope:[main] from main::@2_8 - [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_10 main::@2_10: scope:[main] from main::@2_9 - [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) + [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) to:main::@2_11 main::@2_11: scope:[main] from main::@2_10 - [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) + [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@2_12 main::@2_12: scope:[main] from main::@2_11 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) @@ -1029,7 +1052,7 @@ main::@2_21: scope:[main] from main::@2_20 [26] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@2_22 main::@2_22: scope:[main] from main::@2_21 - [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) + [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) to:main::@2_23 main::@2_23: scope:[main] from main::@2_22 [28] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) @@ -1062,7 +1085,7 @@ main::@2_32: scope:[main] from main::@2_31 [37] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) to:main::@2_33 main::@2_33: scope:[main] from main::@2_32 - [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) to:main::@2_34 main::@2_34: scope:[main] from main::@2_33 [39] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) @@ -1095,7 +1118,7 @@ main::@2_43: scope:[main] from main::@2_42 [48] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) to:main::@2_44 main::@2_44: scope:[main] from main::@2_43 - [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) + [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) to:main::@2_45 main::@2_45: scope:[main] from main::@2_44 [50] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) @@ -1128,7 +1151,7 @@ main::@2_54: scope:[main] from main::@2_53 [59] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) to:main::@2_55 main::@2_55: scope:[main] from main::@2_54 - [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) + [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) to:main::@2_56 main::@2_56: scope:[main] from main::@2_55 [61] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) @@ -1161,7 +1184,7 @@ main::@2_65: scope:[main] from main::@2_64 [70] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) to:main::@2_66 main::@2_66: scope:[main] from main::@2_65 - [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) + [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) to:main::@2_67 main::@2_67: scope:[main] from main::@2_66 [72] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) @@ -1194,7 +1217,7 @@ main::@2_76: scope:[main] from main::@2_75 [81] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) to:main::@2_77 main::@2_77: scope:[main] from main::@2_76 - [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) + [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) to:main::@2_78 main::@2_78: scope:[main] from main::@2_77 [83] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) @@ -1227,7 +1250,7 @@ main::@2_87: scope:[main] from main::@2_86 [92] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) to:main::@2_88 main::@2_88: scope:[main] from main::@2_87 - [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) + [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) to:main::@2_89 main::@2_89: scope:[main] from main::@2_88 [94] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) @@ -1260,7 +1283,7 @@ main::@2_98: scope:[main] from main::@2_97 [103] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) to:main::@2_99 main::@2_99: scope:[main] from main::@2_98 - [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) + [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) to:main::@2_100 main::@2_100: scope:[main] from main::@2_99 [105] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) @@ -1293,7 +1316,7 @@ main::@2_109: scope:[main] from main::@2_108 [114] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) to:main::@2_110 main::@2_110: scope:[main] from main::@2_109 - [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) + [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) to:main::@2_111 main::@2_111: scope:[main] from main::@2_110 [116] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) @@ -1367,75 +1390,75 @@ main: { jmp b2 //SEG10 main::@2 b2: - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+0*$28+0 + sta SCREEN jmp b2_1 //SEG12 main::@2_1 b2_1: - //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+1*$28+0 + sta SCREEN+1*$28 jmp b2_2 //SEG14 main::@2_2 b2_2: - //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+2*$28+0 + sta SCREEN+2*$28 jmp b2_3 //SEG16 main::@2_3 b2_3: - //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+3*$28+0 + sta SCREEN+3*$28 jmp b2_4 //SEG18 main::@2_4 b2_4: - //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+4*$28+0 + sta SCREEN+4*$28 jmp b2_5 //SEG20 main::@2_5 b2_5: - //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+5*$28+0 + sta SCREEN+5*$28 jmp b2_6 //SEG22 main::@2_6 b2_6: - //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+6*$28+0 + sta SCREEN+6*$28 jmp b2_7 //SEG24 main::@2_7 b2_7: - //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+7*$28+0 + sta SCREEN+7*$28 jmp b2_8 //SEG26 main::@2_8 b2_8: - //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+8*$28+0 + sta SCREEN+8*$28 jmp b2_9 //SEG28 main::@2_9 b2_9: - //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+9*$28+0 + sta SCREEN+9*$28 jmp b2_10 //SEG30 main::@2_10 b2_10: - //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+$a*$28+0 + sta SCREEN+$a*$28 jmp b2_11 //SEG32 main::@2_11 b2_11: - //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta SCREEN+0*$28+1 + sta SCREEN+1 jmp b2_12 //SEG34 main::@2_12 b2_12: @@ -1499,9 +1522,9 @@ main: { jmp b2_22 //SEG54 main::@2_22 b2_22: - //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #2 - sta SCREEN+0*$28+2 + sta SCREEN+2 jmp b2_23 //SEG56 main::@2_23 b2_23: @@ -1565,9 +1588,9 @@ main: { jmp b2_33 //SEG76 main::@2_33 b2_33: - //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #3 - sta SCREEN+0*$28+3 + sta SCREEN+3 jmp b2_34 //SEG78 main::@2_34 b2_34: @@ -1631,9 +1654,9 @@ main: { jmp b2_44 //SEG98 main::@2_44 b2_44: - //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #4 - sta SCREEN+0*$28+4 + sta SCREEN+4 jmp b2_45 //SEG100 main::@2_45 b2_45: @@ -1697,9 +1720,9 @@ main: { jmp b2_55 //SEG120 main::@2_55 b2_55: - //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #5 - sta SCREEN+0*$28+5 + sta SCREEN+5 jmp b2_56 //SEG122 main::@2_56 b2_56: @@ -1763,9 +1786,9 @@ main: { jmp b2_66 //SEG142 main::@2_66 b2_66: - //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #6 - sta SCREEN+0*$28+6 + sta SCREEN+6 jmp b2_67 //SEG144 main::@2_67 b2_67: @@ -1829,9 +1852,9 @@ main: { jmp b2_77 //SEG164 main::@2_77 b2_77: - //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #7 - sta SCREEN+0*$28+7 + sta SCREEN+7 jmp b2_78 //SEG166 main::@2_78 b2_78: @@ -1895,9 +1918,9 @@ main: { jmp b2_88 //SEG186 main::@2_88 b2_88: - //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #8 - sta SCREEN+0*$28+8 + sta SCREEN+8 jmp b2_89 //SEG188 main::@2_89 b2_89: @@ -1961,9 +1984,9 @@ main: { jmp b2_99 //SEG208 main::@2_99 b2_99: - //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #9 - sta SCREEN+0*$28+9 + sta SCREEN+9 jmp b2_100 //SEG210 main::@2_100 b2_100: @@ -2027,9 +2050,9 @@ main: { jmp b2_110 //SEG230 main::@2_110 b2_110: - //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #$a - sta SCREEN+0*$28+$a + sta SCREEN+$a jmp b2_111 //SEG232 main::@2_111 b2_111: @@ -2098,18 +2121,18 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [18] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2120,7 +2143,7 @@ Statement [23] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [24] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [25] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [26] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [28] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [29] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [30] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2131,7 +2154,7 @@ Statement [34] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [35] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [36] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [37] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [39] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [40] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [41] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2142,7 +2165,7 @@ Statement [45] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [46] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [47] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [48] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [50] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [51] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [52] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2153,7 +2176,7 @@ Statement [56] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [57] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [58] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [59] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [61] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [62] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [63] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2164,7 +2187,7 @@ Statement [67] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [68] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [69] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [70] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [72] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [73] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [74] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2175,7 +2198,7 @@ Statement [78] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [79] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [80] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [81] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [83] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [84] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [85] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2186,7 +2209,7 @@ Statement [89] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word Statement [90] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [91] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [92] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [94] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [95] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [96] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2197,7 +2220,7 @@ Statement [100] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed wor Statement [101] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [102] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [103] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [105] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [106] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [107] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2208,7 +2231,7 @@ Statement [111] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed wor Statement [112] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [113] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [114] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [116] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [117] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [118] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2255,75 +2278,75 @@ main: { jmp b2 //SEG10 main::@2 b2: - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+0*$28+0 + sta SCREEN jmp b2_1 //SEG12 main::@2_1 b2_1: - //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+1*$28+0 + sta SCREEN+1*$28 jmp b2_2 //SEG14 main::@2_2 b2_2: - //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+2*$28+0 + sta SCREEN+2*$28 jmp b2_3 //SEG16 main::@2_3 b2_3: - //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+3*$28+0 + sta SCREEN+3*$28 jmp b2_4 //SEG18 main::@2_4 b2_4: - //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+4*$28+0 + sta SCREEN+4*$28 jmp b2_5 //SEG20 main::@2_5 b2_5: - //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+5*$28+0 + sta SCREEN+5*$28 jmp b2_6 //SEG22 main::@2_6 b2_6: - //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+6*$28+0 + sta SCREEN+6*$28 jmp b2_7 //SEG24 main::@2_7 b2_7: - //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+7*$28+0 + sta SCREEN+7*$28 jmp b2_8 //SEG26 main::@2_8 b2_8: - //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+8*$28+0 + sta SCREEN+8*$28 jmp b2_9 //SEG28 main::@2_9 b2_9: - //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+9*$28+0 + sta SCREEN+9*$28 jmp b2_10 //SEG30 main::@2_10 b2_10: - //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+$a*$28+0 + sta SCREEN+$a*$28 jmp b2_11 //SEG32 main::@2_11 b2_11: - //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta SCREEN+0*$28+1 + sta SCREEN+1 jmp b2_12 //SEG34 main::@2_12 b2_12: @@ -2387,9 +2410,9 @@ main: { jmp b2_22 //SEG54 main::@2_22 b2_22: - //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #2 - sta SCREEN+0*$28+2 + sta SCREEN+2 jmp b2_23 //SEG56 main::@2_23 b2_23: @@ -2453,9 +2476,9 @@ main: { jmp b2_33 //SEG76 main::@2_33 b2_33: - //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #3 - sta SCREEN+0*$28+3 + sta SCREEN+3 jmp b2_34 //SEG78 main::@2_34 b2_34: @@ -2519,9 +2542,9 @@ main: { jmp b2_44 //SEG98 main::@2_44 b2_44: - //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #4 - sta SCREEN+0*$28+4 + sta SCREEN+4 jmp b2_45 //SEG100 main::@2_45 b2_45: @@ -2585,9 +2608,9 @@ main: { jmp b2_55 //SEG120 main::@2_55 b2_55: - //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #5 - sta SCREEN+0*$28+5 + sta SCREEN+5 jmp b2_56 //SEG122 main::@2_56 b2_56: @@ -2651,9 +2674,9 @@ main: { jmp b2_66 //SEG142 main::@2_66 b2_66: - //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #6 - sta SCREEN+0*$28+6 + sta SCREEN+6 jmp b2_67 //SEG144 main::@2_67 b2_67: @@ -2717,9 +2740,9 @@ main: { jmp b2_77 //SEG164 main::@2_77 b2_77: - //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #7 - sta SCREEN+0*$28+7 + sta SCREEN+7 jmp b2_78 //SEG166 main::@2_78 b2_78: @@ -2783,9 +2806,9 @@ main: { jmp b2_88 //SEG186 main::@2_88 b2_88: - //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #8 - sta SCREEN+0*$28+8 + sta SCREEN+8 jmp b2_89 //SEG188 main::@2_89 b2_89: @@ -2849,9 +2872,9 @@ main: { jmp b2_99 //SEG208 main::@2_99 b2_99: - //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #9 - sta SCREEN+0*$28+9 + sta SCREEN+9 jmp b2_100 //SEG210 main::@2_100 b2_100: @@ -2915,9 +2938,9 @@ main: { jmp b2_110 //SEG230 main::@2_110 b2_110: - //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #$a - sta SCREEN+0*$28+$a + sta SCREEN+$a jmp b2_111 //SEG232 main::@2_111 b2_111: @@ -3507,43 +3530,43 @@ Score: 518 main: { .label SCREEN = $400 //SEG10 main::@2 - //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG11 [5] *((const byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta SCREEN+0*$28+0 + sta SCREEN //SEG12 main::@2_1 - //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+1*$28+0 + //SEG13 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+1*$28 //SEG14 main::@2_2 - //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+2*$28+0 + //SEG15 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+2*$28 //SEG16 main::@2_3 - //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+3*$28+0 + //SEG17 [8] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+3*$28 //SEG18 main::@2_4 - //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+4*$28+0 + //SEG19 [9] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+4*$28 //SEG20 main::@2_5 - //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+5*$28+0 + //SEG21 [10] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+5*$28 //SEG22 main::@2_6 - //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+6*$28+0 + //SEG23 [11] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+6*$28 //SEG24 main::@2_7 - //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+7*$28+0 + //SEG25 [12] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+7*$28 //SEG26 main::@2_8 - //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+8*$28+0 + //SEG27 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+8*$28 //SEG28 main::@2_9 - //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+9*$28+0 + //SEG29 [14] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+9*$28 //SEG30 main::@2_10 - //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 - sta SCREEN+$a*$28+0 + //SEG31 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + sta SCREEN+$a*$28 //SEG32 main::@2_11 - //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG33 [16] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta SCREEN+0*$28+1 + sta SCREEN+1 //SEG34 main::@2_12 //SEG35 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+1 @@ -3575,9 +3598,9 @@ main: { //SEG53 [26] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+1 //SEG54 main::@2_22 - //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG55 [27] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #2 - sta SCREEN+0*$28+2 + sta SCREEN+2 //SEG56 main::@2_23 //SEG57 [28] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+2 @@ -3609,9 +3632,9 @@ main: { //SEG75 [37] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+2 //SEG76 main::@2_33 - //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG77 [38] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #3 - sta SCREEN+0*$28+3 + sta SCREEN+3 //SEG78 main::@2_34 //SEG79 [39] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+3 @@ -3643,9 +3666,9 @@ main: { //SEG97 [48] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+3 //SEG98 main::@2_44 - //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG99 [49] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #4 - sta SCREEN+0*$28+4 + sta SCREEN+4 //SEG100 main::@2_45 //SEG101 [50] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+4 @@ -3677,9 +3700,9 @@ main: { //SEG119 [59] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte/signed byte/word/signed word/dword/signed dword) 4 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+4 //SEG120 main::@2_55 - //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG121 [60] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #5 - sta SCREEN+0*$28+5 + sta SCREEN+5 //SEG122 main::@2_56 //SEG123 [61] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+5 @@ -3711,9 +3734,9 @@ main: { //SEG141 [70] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+5 //SEG142 main::@2_66 - //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG143 [71] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #6 - sta SCREEN+0*$28+6 + sta SCREEN+6 //SEG144 main::@2_67 //SEG145 [72] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+6 @@ -3745,9 +3768,9 @@ main: { //SEG163 [81] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+6 //SEG164 main::@2_77 - //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG165 [82] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #7 - sta SCREEN+0*$28+7 + sta SCREEN+7 //SEG166 main::@2_78 //SEG167 [83] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+7 @@ -3779,9 +3802,9 @@ main: { //SEG185 [92] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 7) ← (byte/signed byte/word/signed word/dword/signed dword) 7 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+7 //SEG186 main::@2_88 - //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG187 [93] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #8 - sta SCREEN+0*$28+8 + sta SCREEN+8 //SEG188 main::@2_89 //SEG189 [94] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+8 @@ -3813,9 +3836,9 @@ main: { //SEG207 [103] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 8) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+8 //SEG208 main::@2_99 - //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG209 [104] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #9 - sta SCREEN+0*$28+9 + sta SCREEN+9 //SEG210 main::@2_100 //SEG211 [105] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+9 @@ -3847,9 +3870,9 @@ main: { //SEG229 [114] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 9) ← (byte/signed byte/word/signed word/dword/signed dword) 9 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+$a*$28+9 //SEG230 main::@2_110 - //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG231 [115] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #$a - sta SCREEN+0*$28+$a + sta SCREEN+$a //SEG232 main::@2_111 //SEG233 [116] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 10) ← (byte/signed byte/word/signed word/dword/signed dword) 10 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 sta SCREEN+1*$28+$a diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm index 44b8783c6..2d0d972af 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm @@ -7,7 +7,7 @@ main: { ldx #0 b2: txa - sta SCREEN+0*$28,x + sta SCREEN,x txa sta SCREEN+1*$28,x txa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg index 3338e6ce5..e2ce156aa 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg @@ -14,7 +14,7 @@ main::@1: scope:[main] from main main::@3 [5] (byte) main::x#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 ) [ main::x#4 ] ( main:2 [ main::x#4 ] ) to:main::@2 main::@2: scope:[main] from main::@1 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + [6] *((const byte*) main::SCREEN#0 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) to:main::@2_1 main::@2_1: scope:[main] from main::@2 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log index 9c33d0ea0..482ef4c35 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log @@ -606,55 +606,57 @@ Constant inlined main::$7 = (const byte*) main::SCREEN#0+++++(byte/signed byte/w Constant inlined main::line#38 = ++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::$8 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 Succesful SSA optimization Pass2ConstantInlining -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Optimizing constant integer increment ++14 -Optimizing constant integer increment ++15 -Optimizing constant integer increment ++16 -Optimizing constant integer increment ++17 -Optimizing constant integer increment ++18 -Optimizing constant integer increment ++19 -Optimizing constant integer increment ++20 -Optimizing constant integer increment ++21 -Optimizing constant integer increment ++22 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Optimizing constant integer increment ++14 -Optimizing constant integer increment ++15 -Optimizing constant integer increment ++16 -Optimizing constant integer increment ++17 -Optimizing constant integer increment ++18 -Optimizing constant integer increment ++19 -Optimizing constant integer increment ++20 -Optimizing constant integer increment ++21 -Optimizing constant integer increment ++22 -Optimizing constant integer increment ++23 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant multiply by zero 0*40 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Simplifying constant integer increment ++14 +Simplifying constant integer increment ++15 +Simplifying constant integer increment ++16 +Simplifying constant integer increment ++17 +Simplifying constant integer increment ++18 +Simplifying constant integer increment ++19 +Simplifying constant integer increment ++20 +Simplifying constant integer increment ++21 +Simplifying constant integer increment ++22 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Simplifying constant integer increment ++14 +Simplifying constant integer increment ++15 +Simplifying constant integer increment ++16 +Simplifying constant integer increment ++17 +Simplifying constant integer increment ++18 +Simplifying constant integer increment ++19 +Simplifying constant integer increment ++20 +Simplifying constant integer increment ++21 +Simplifying constant integer increment ++22 +Simplifying constant integer increment ++23 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return Added new block during phi lifting main::@5(between main::@3 and main::@1) Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return main::@5 @@ -696,7 +698,7 @@ main::@1: scope:[main] from main main::@3 [5] (byte) main::x#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 ) [ main::x#4 ] ( main:2 [ main::x#4 ] ) to:main::@2 main::@2: scope:[main] from main::@1 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + [6] *((const byte*) main::SCREEN#0 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) to:main::@2_1 main::@2_1: scope:[main] from main::@2 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) @@ -834,10 +836,10 @@ main: { jmp b2 //SEG15 main::@2 b2: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 ldy x tya - sta SCREEN+0*$28,y + sta SCREEN,y jmp b2_1 //SEG17 main::@2_1 b2_1: @@ -1071,9 +1073,9 @@ main: { jmp b2 //SEG15 main::@2 b2: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa - sta SCREEN+0*$28,x + sta SCREEN,x jmp b2_1 //SEG17 main::@2_1 b2_1: @@ -1377,9 +1379,9 @@ main: { //SEG14 main::@1 //SEG15 main::@2 b2: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa - sta SCREEN+0*$28,x + sta SCREEN,x //SEG17 main::@2_1 //SEG18 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm index 8a1f4d65e..3310ec53b 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm @@ -7,7 +7,7 @@ main: { ldx #0 b3: txa - sta SCREEN+0*$28,x + sta SCREEN,x txa sta SCREEN+1*$28,x txa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg index d3da8b87e..927a5e7d2 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg @@ -14,7 +14,7 @@ main::@1: scope:[main] from main main::@4 [5] (byte) main::x#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::x#1 ) [ main::x#5 ] ( main:2 [ main::x#5 ] ) to:main::@3 main::@3: scope:[main] from main::@1 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + [6] *((const byte*) main::SCREEN#0 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) to:main::@3_1 main::@3_1: scope:[main] from main::@3 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log index adb085879..5ac8922a2 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log @@ -703,55 +703,57 @@ Constant inlined main::$7 = (const byte*) main::SCREEN#0+++++(byte/signed byte/w Constant inlined main::$8 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 Constant inlined main::line#37 = ++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 Succesful SSA optimization Pass2ConstantInlining -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++0 -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Optimizing constant integer increment ++14 -Optimizing constant integer increment ++15 -Optimizing constant integer increment ++16 -Optimizing constant integer increment ++17 -Optimizing constant integer increment ++18 -Optimizing constant integer increment ++19 -Optimizing constant integer increment ++20 -Optimizing constant integer increment ++21 -Optimizing constant integer increment ++22 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation -Optimizing constant integer increment ++1 -Optimizing constant integer increment ++2 -Optimizing constant integer increment ++3 -Optimizing constant integer increment ++4 -Optimizing constant integer increment ++5 -Optimizing constant integer increment ++6 -Optimizing constant integer increment ++7 -Optimizing constant integer increment ++8 -Optimizing constant integer increment ++9 -Optimizing constant integer increment ++10 -Optimizing constant integer increment ++11 -Optimizing constant integer increment ++12 -Optimizing constant integer increment ++13 -Optimizing constant integer increment ++14 -Optimizing constant integer increment ++15 -Optimizing constant integer increment ++16 -Optimizing constant integer increment ++17 -Optimizing constant integer increment ++18 -Optimizing constant integer increment ++19 -Optimizing constant integer increment ++20 -Optimizing constant integer increment ++21 -Optimizing constant integer increment ++22 -Optimizing constant integer increment ++23 -Succesful SSA optimization Pass2ConstantIntIncrementConsolidation +Simplifying constant multiply by zero 0*40 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Simplifying constant integer increment ++14 +Simplifying constant integer increment ++15 +Simplifying constant integer increment ++16 +Simplifying constant integer increment ++17 +Simplifying constant integer increment ++18 +Simplifying constant integer increment ++19 +Simplifying constant integer increment ++20 +Simplifying constant integer increment ++21 +Simplifying constant integer increment ++22 +Succesful SSA optimization Pass2ConstantSimplification +Simplifying constant plus zero main::SCREEN#0+0 +Simplifying constant integer increment ++1 +Simplifying constant integer increment ++2 +Simplifying constant integer increment ++3 +Simplifying constant integer increment ++4 +Simplifying constant integer increment ++5 +Simplifying constant integer increment ++6 +Simplifying constant integer increment ++7 +Simplifying constant integer increment ++8 +Simplifying constant integer increment ++9 +Simplifying constant integer increment ++10 +Simplifying constant integer increment ++11 +Simplifying constant integer increment ++12 +Simplifying constant integer increment ++13 +Simplifying constant integer increment ++14 +Simplifying constant integer increment ++15 +Simplifying constant integer increment ++16 +Simplifying constant integer increment ++17 +Simplifying constant integer increment ++18 +Simplifying constant integer increment ++19 +Simplifying constant integer increment ++20 +Simplifying constant integer increment ++21 +Simplifying constant integer increment ++22 +Simplifying constant integer increment ++23 +Succesful SSA optimization Pass2ConstantSimplification Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return Added new block during phi lifting main::@9(between main::@4 and main::@1) Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return main::@9 @@ -793,7 +795,7 @@ main::@1: scope:[main] from main main::@4 [5] (byte) main::x#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::x#1 ) [ main::x#5 ] ( main:2 [ main::x#5 ] ) to:main::@3 main::@3: scope:[main] from main::@1 - [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + [6] *((const byte*) main::SCREEN#0 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) to:main::@3_1 main::@3_1: scope:[main] from main::@3 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) @@ -931,10 +933,10 @@ main: { jmp b3 //SEG15 main::@3 b3: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 ldy x tya - sta SCREEN+0*$28,y + sta SCREEN,y jmp b3_1 //SEG17 main::@3_1 b3_1: @@ -1168,9 +1170,9 @@ main: { jmp b3 //SEG15 main::@3 b3: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa - sta SCREEN+0*$28,x + sta SCREEN,x jmp b3_1 //SEG17 main::@3_1 b3_1: @@ -1474,9 +1476,9 @@ main: { //SEG14 main::@1 //SEG15 main::@3 b3: - //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + //SEG16 [6] *((const byte*) main::SCREEN#0 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa - sta SCREEN+0*$28,x + sta SCREEN,x //SEG17 main::@3_1 //SEG18 [7] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx txa diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.asm b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.asm index 94eb95862..2c86e02e5 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.asm @@ -5,6 +5,6 @@ main: { .label screen = $400 lda #1 - sta screen+0 + sta screen rts } diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.cfg index bd32b9dcf..d387fed27 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.cfg @@ -8,7 +8,7 @@ @end: scope:[] from @2 [3] phi() [ ] ( ) main: scope:[main] from @2 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main [5] return [ ] ( main:2 [ ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.log b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.log index 1497e3654..ed6656f0e 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/unused-method.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/unused-method.log @@ -92,6 +92,7 @@ Succesful SSA optimization Pass2ConstantIdentification Consolidated array index constant in *(main::screen#0+0) Succesful SSA optimization Pass2ConstantAdditionElimination OPTIMIZING CONTROL FLOW GRAPH +Simplifying constant plus zero main::screen#0+0 Block Sequence Planned @begin @2 @end main main::@return Block Sequence Planned @begin @2 @end main main::@return Adding NOP phi() at start of @begin @@ -120,7 +121,7 @@ FINAL CONTROL FLOW GRAPH @end: scope:[] from @2 [3] phi() [ ] ( ) main: scope:[main] from @2 - [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) + [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main [5] return [ ] ( main:2 [ ] ) @@ -157,9 +158,9 @@ bend: //SEG8 main main: { .label screen = $400 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta screen+0 + sta screen jmp breturn //SEG10 main::@return breturn: @@ -168,7 +169,7 @@ main: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -200,9 +201,9 @@ bend: //SEG8 main main: { .label screen = $400 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta screen+0 + sta screen jmp breturn //SEG10 main::@return breturn: @@ -253,9 +254,9 @@ Score: 18 //SEG8 main main: { .label screen = $400 - //SEG9 [4] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG9 [4] *((const byte*) main::screen#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 lda #1 - sta screen+0 + sta screen //SEG10 main::@return //SEG11 [5] return [ ] ( main:2 [ ] ) rts diff --git a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.asm b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.asm index 0fe344513..a59b4233c 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.asm +++ b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.asm @@ -14,23 +14,23 @@ main: { jmp b1 } animate: { - ldx XPOS+0 + ldx XPOS inx - stx XPOS+0 + stx XPOS txa cmp #$28 bne b1 lda #0 - sta XPOS+0 + sta XPOS b1: - ldx YPOS+0 + ldx YPOS inx - stx YPOS+0 + stx YPOS txa cmp #$19 bne b2 lda #0 - sta YPOS+0 + sta YPOS b2: lda XPOS+1 sec diff --git a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.cfg b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.cfg index b338b6598..a090c92c8 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.cfg +++ b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.cfg @@ -20,20 +20,20 @@ main::@4: scope:[main] from main::@1 [9] call animate [ ] ( main:2 [ ] ) to:main::@1 animate: scope:[animate] from main::@4 - [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) - [11] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) - [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) + [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) + [11] *((const byte[]) XPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) + [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) to:animate::@7 animate::@7: scope:[animate] from animate - [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) + [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) to:animate::@1 animate::@1: scope:[animate] from animate animate::@7 - [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) - [15] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) - [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) + [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) + [15] *((const byte[]) YPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) + [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) to:animate::@8 animate::@8: scope:[animate] from animate::@1 - [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) + [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) to:animate::@2 animate::@2: scope:[animate] from animate::@1 animate::@8 [18] (byte/signed word/word/dword/signed dword~) animate::$6 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) - (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$6 ] ( main:2::animate:9 [ animate::$6 ] ) diff --git a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.log b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.log index 929c79885..47cbdb362 100644 --- a/src/test/java/dk/camelot64/kickc/test/ref/voronoi.log +++ b/src/test/java/dk/camelot64/kickc/test/ref/voronoi.log @@ -1301,6 +1301,14 @@ Constant inlined findcol::mincol#0 = (byte/signed byte/word/signed word/dword/si Constant inlined findcol::mindiff#0 = (byte/word/signed word/dword/signed dword) 255 Constant inlined initscreen::$0 = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000 Succesful SSA optimization Pass2ConstantInlining +Simplifying constant plus zero XPOS#0+0 +Simplifying constant plus zero XPOS#0+0 +Simplifying constant plus zero XPOS#0+0 +Simplifying constant plus zero YPOS#0+0 +Simplifying constant plus zero YPOS#0+0 +Simplifying constant plus zero YPOS#0+0 +Simplifying constant plus zero XPOS#0+0 +Simplifying constant plus zero YPOS#0+0 Block Sequence Planned @begin @5 @end main main::@1 main::@4 animate animate::@7 animate::@1 animate::@8 animate::@2 animate::@9 animate::@3 animate::@10 animate::@4 animate::@11 animate::@12 animate::@return render render::@1 render::@2 render::@5 render::@3 render::@return findcol findcol::@1 findcol::@9 findcol::@return findcol::@2 findcol::@12 findcol::@5 findcol::@14 findcol::@7 findcol::@16 findcol::@8 findcol::@6 findcol::@4 initscreen initscreen::@1 initscreen::@return Added new block during phi lifting render::@6(between render::@3 and render::@1) Added new block during phi lifting render::@7(between render::@5 and render::@2) @@ -1410,20 +1418,20 @@ main::@4: scope:[main] from main::@1 [9] call animate [ ] ( main:2 [ ] ) to:main::@1 animate: scope:[animate] from main::@4 - [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) - [11] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) - [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) + [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) + [11] *((const byte[]) XPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) + [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) to:animate::@7 animate::@7: scope:[animate] from animate - [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) + [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) to:animate::@1 animate::@1: scope:[animate] from animate animate::@7 - [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) - [15] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) - [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) + [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) + [15] *((const byte[]) YPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) + [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) to:animate::@8 animate::@8: scope:[animate] from animate::@1 - [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) + [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) to:animate::@2 animate::@2: scope:[animate] from animate::@1 animate::@8 [18] (byte/signed word/word/dword/signed dword~) animate::$6 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) - (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$6 ] ( main:2::animate:9 [ animate::$6 ] ) @@ -1761,43 +1769,43 @@ animate: { .label _12 = $11 .label _15 = $12 .label _18 = $13 - //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuz1=_deref_pbuc1_plus_1 - ldy XPOS+0 + //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuz1=_deref_pbuc1_plus_1 + ldy XPOS iny sty _0 - //SEG21 [11] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuz1 + //SEG21 [11] *((const byte[]) XPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuz1 lda _0 - sta XPOS+0 - //SEG22 [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 - lda XPOS+0 + sta XPOS + //SEG22 [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + lda XPOS cmp #$28 bne b1 jmp b7 //SEG23 animate::@7 b7: - //SEG24 [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG24 [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta XPOS+0 + sta XPOS jmp b1 //SEG25 animate::@1 b1: - //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuz1=_deref_pbuc1_plus_1 - ldy YPOS+0 + //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuz1=_deref_pbuc1_plus_1 + ldy YPOS iny sty _3 - //SEG27 [15] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuz1 + //SEG27 [15] *((const byte[]) YPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuz1 lda _3 - sta YPOS+0 - //SEG28 [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 - lda YPOS+0 + sta YPOS + //SEG28 [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + lda YPOS cmp #$19 bne b2 jmp b8 //SEG29 animate::@8 b8: - //SEG30 [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG30 [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta YPOS+0 + sta YPOS jmp b2 //SEG31 animate::@2 b2: @@ -2196,10 +2204,10 @@ initscreen: { COLS: .byte 1, 2, 3, 4, 5, 7 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [20] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1)!=(byte/word/signed word/dword/signed dword) 255) goto animate::@3 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [21] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 40 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [24] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 2)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@4 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a @@ -2227,10 +2235,10 @@ Statement [74] (byte) findcol::diff#2 ← (byte) findcol::diff#4 + (byte~) findc Statement [75] (byte) findcol::diff#0 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mindiff#10 findcol::mincol#10 findcol::yp#0 findcol::diff#0 ] ( main:2::render:7::findcol:41 [ render::y#4 render::colline#5 render::x#2 findcol::x#0 findcol::y#0 findcol::i#10 findcol::mindiff#10 findcol::mincol#10 findcol::yp#0 findcol::diff#0 ] ) always clobbers reg byte a Statement [78] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a reg byte y Statement [80] if((byte*) initscreen::screen#1<(const byte*) SCREEN#0+(word/signed word/dword/signed dword) 1000) goto initscreen::@1 [ initscreen::screen#1 ] ( main:2::initscreen:5 [ initscreen::screen#1 ] ) always clobbers reg byte a -Statement [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a -Statement [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a +Statement [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [20] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1)!=(byte/word/signed word/dword/signed dword) 255) goto animate::@3 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [21] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 40 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [24] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 2)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@4 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a @@ -2377,39 +2385,39 @@ main: { } //SEG19 animate animate: { - //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuxx=_deref_pbuc1_plus_1 - ldx XPOS+0 + //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuxx=_deref_pbuc1_plus_1 + ldx XPOS inx - //SEG21 [11] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx - stx XPOS+0 - //SEG22 [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 - lda XPOS+0 + //SEG21 [11] *((const byte[]) XPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx + stx XPOS + //SEG22 [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + lda XPOS cmp #$28 bne b1 jmp b7 //SEG23 animate::@7 b7: - //SEG24 [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG24 [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta XPOS+0 + sta XPOS jmp b1 //SEG25 animate::@1 b1: - //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuxx=_deref_pbuc1_plus_1 - ldx YPOS+0 + //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuxx=_deref_pbuc1_plus_1 + ldx YPOS inx - //SEG27 [15] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx - stx YPOS+0 - //SEG28 [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 - lda YPOS+0 + //SEG27 [15] *((const byte[]) YPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx + stx YPOS + //SEG28 [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + lda YPOS cmp #$19 bne b2 jmp b8 //SEG29 animate::@8 b8: - //SEG30 [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG30 [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta YPOS+0 + sta YPOS jmp b2 //SEG31 animate::@2 b2: @@ -2808,8 +2816,8 @@ Removing instruction jmp b8 Removing instruction jmp b1 Removing instruction jmp breturn Succesful ASM optimization Pass5NextJumpElimination -Replacing instruction lda XPOS+0 with TXA -Replacing instruction lda YPOS+0 with TXA +Replacing instruction lda XPOS with TXA +Replacing instruction lda YPOS with TXA Removing instruction lda XPOS+1 Removing instruction lda YPOS+2 Replacing instruction lda YPOS+3 with TXA @@ -3052,34 +3060,34 @@ main: { } //SEG19 animate animate: { - //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuxx=_deref_pbuc1_plus_1 - ldx XPOS+0 + //SEG20 [10] (byte/signed word/word/dword/signed dword~) animate::$0 ← *((const byte[]) XPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$0 ] ( main:2::animate:9 [ animate::$0 ] ) -- vbuxx=_deref_pbuc1_plus_1 + ldx XPOS inx - //SEG21 [11] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx - stx XPOS+0 - //SEG22 [12] if(*((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + //SEG21 [11] *((const byte[]) XPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx + stx XPOS + //SEG22 [12] if(*((const byte[]) XPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 txa cmp #$28 bne b1 //SEG23 animate::@7 - //SEG24 [13] *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG24 [13] *((const byte[]) XPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta XPOS+0 + sta XPOS //SEG25 animate::@1 b1: - //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuxx=_deref_pbuc1_plus_1 - ldx YPOS+0 + //SEG26 [14] (byte/signed word/word/dword/signed dword~) animate::$3 ← *((const byte[]) YPOS#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$3 ] ( main:2::animate:9 [ animate::$3 ] ) -- vbuxx=_deref_pbuc1_plus_1 + ldx YPOS inx - //SEG27 [15] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx - stx YPOS+0 - //SEG28 [16] if(*((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 + //SEG27 [15] *((const byte[]) YPOS#0) ← (byte/signed word/word/dword/signed dword~) animate::$3 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuxx + stx YPOS + //SEG28 [16] if(*((const byte[]) YPOS#0)!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 txa cmp #$19 bne b2 //SEG29 animate::@8 - //SEG30 [17] *((const byte[]) YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 + //SEG30 [17] *((const byte[]) YPOS#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::animate:9 [ ] ) -- _deref_pbuc1=vbuc2 lda #0 - sta YPOS+0 + sta YPOS //SEG31 animate::@2 b2: //SEG32 [18] (byte/signed word/word/dword/signed dword~) animate::$6 ← *((const byte[]) XPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) - (byte/signed byte/word/signed word/dword/signed dword) 1 [ animate::$6 ] ( main:2::animate:9 [ animate::$6 ] ) -- vbuaa=_deref_pbuc1_minus_1