From bfdd2fb0a5743a10c80c7943f87e7fa99f86b38e Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sun, 29 Sep 2019 22:36:00 +0200 Subject: [PATCH] Optimizing constant detection - avoiding versions. --- .../kickc/model/symbols/SymbolVariable.java | 20 + .../kickc/model/symbols/Variable.java | 49 +- .../Pass1EarlyConstantIdentification.java | 3 + ...ss1GenerateSingleStaticAssignmentForm.java | 6 +- .../kickc/passes/Pass1UnwindBlockScopes.java | 2 + .../kickc/passes/Pass2AliasElimination.java | 2 +- .../kickc/passes/PassNTypeInference.java | 3 + src/test/ref/address-of-0.cfg | 2 +- src/test/ref/address-of-0.log | 23 +- src/test/ref/address-of-0.sym | 3 +- src/test/ref/address-of-1.cfg | 6 +- src/test/ref/address-of-1.log | 59 +- src/test/ref/address-of-1.sym | 3 +- src/test/ref/array-16bit-lookup.cfg | 2 +- src/test/ref/array-16bit-lookup.log | 25 +- src/test/ref/array-16bit-lookup.sym | 3 +- src/test/ref/array-length-symbolic-min.cfg | 4 +- src/test/ref/array-length-symbolic-min.log | 57 +- src/test/ref/array-length-symbolic-min.sym | 5 +- src/test/ref/array-length-symbolic.cfg | 8 +- src/test/ref/array-length-symbolic.log | 104 +- src/test/ref/array-length-symbolic.sym | 8 +- src/test/ref/arrays-init-kasm-0.cfg | 2 +- src/test/ref/arrays-init-kasm-0.log | 31 +- src/test/ref/arrays-init-kasm-0.sym | 3 +- src/test/ref/arrays-init.cfg | 6 +- src/test/ref/arrays-init.log | 67 +- src/test/ref/arrays-init.sym | 3 +- src/test/ref/asm-mnemonic-names.cfg | 4 +- src/test/ref/asm-mnemonic-names.log | 41 +- src/test/ref/asm-mnemonic-names.sym | 3 +- src/test/ref/assignment-chained.cfg | 14 +- src/test/ref/assignment-chained.log | 117 +- src/test/ref/assignment-chained.sym | 3 +- src/test/ref/assignment-compound.cfg | 6 +- src/test/ref/assignment-compound.log | 98 +- src/test/ref/assignment-compound.sym | 14 +- src/test/ref/bitmap-plot-0.cfg | 4 +- src/test/ref/bitmap-plot-0.log | 94 +- src/test/ref/bitmap-plot-0.sym | 8 +- src/test/ref/bitmap-plot-1.cfg | 4 +- src/test/ref/bitmap-plot-1.log | 94 +- src/test/ref/bitmap-plot-1.sym | 8 +- src/test/ref/bitmap-plot-2.cfg | 4 +- src/test/ref/bitmap-plot-2.log | 94 +- src/test/ref/bitmap-plot-2.sym | 8 +- src/test/ref/bitmap-plot-3.cfg | 6 +- src/test/ref/bitmap-plot-3.log | 112 +- src/test/ref/bitmap-plot-3.sym | 8 +- src/test/ref/bitmap-plotter.cfg | 20 +- src/test/ref/bitmap-plotter.log | 302 ++-- src/test/ref/bitmap-plotter.sym | 30 +- src/test/ref/bitwise-not.cfg | 4 +- src/test/ref/bitwise-not.log | 35 +- src/test/ref/bitwise-not.sym | 3 +- src/test/ref/bool-const.log | 109 +- src/test/ref/bool-const.sym | 3 - src/test/ref/bool-function.cfg | 4 +- src/test/ref/bool-function.log | 39 +- src/test/ref/bool-function.sym | 3 +- src/test/ref/bresenham.cfg | 10 +- src/test/ref/bresenham.log | 167 +- src/test/ref/bresenham.sym | 19 +- src/test/ref/bresenhamarr.cfg | 16 +- src/test/ref/bresenhamarr.log | 197 +-- src/test/ref/bresenhamarr.sym | 15 +- src/test/ref/c-types.cfg | 10 +- src/test/ref/c-types.log | 306 ++-- src/test/ref/c-types.sym | 38 +- src/test/ref/c64dtv-8bppcharstretch.cfg | 2 +- src/test/ref/c64dtv-8bppcharstretch.log | 21 +- src/test/ref/c64dtv-8bppcharstretch.sym | 3 +- src/test/ref/c64dtv-8bppchunkystretch.cfg | 2 +- src/test/ref/c64dtv-8bppchunkystretch.log | 21 +- src/test/ref/c64dtv-8bppchunkystretch.sym | 3 +- src/test/ref/c64dtv-blitter-box.cfg | 2 +- src/test/ref/c64dtv-blitter-box.log | 23 +- src/test/ref/c64dtv-blitter-box.sym | 3 +- src/test/ref/c64dtv-blittermin.cfg | 2 +- src/test/ref/c64dtv-blittermin.log | 25 +- src/test/ref/c64dtv-blittermin.sym | 3 +- src/test/ref/c64dtv-gfxexplorer.cfg | 12 +- src/test/ref/c64dtv-gfxexplorer.log | 119 +- src/test/ref/c64dtv-gfxexplorer.sym | 9 +- src/test/ref/c64dtv-gfxmodes.cfg | 6 +- src/test/ref/c64dtv-gfxmodes.log | 69 +- src/test/ref/c64dtv-gfxmodes.sym | 9 +- src/test/ref/call-parameter-autocast.cfg | 2 +- src/test/ref/call-parameter-autocast.log | 27 +- src/test/ref/call-parameter-autocast.sym | 3 +- src/test/ref/cast-deref.cfg | 2 +- src/test/ref/cast-deref.log | 25 +- src/test/ref/cast-deref.sym | 3 +- src/test/ref/cast-not-needed-3.cfg | 2 +- src/test/ref/cast-not-needed-3.log | 25 +- src/test/ref/cast-not-needed-3.sym | 3 +- src/test/ref/cast-not-needed.cfg | 2 +- src/test/ref/cast-not-needed.log | 54 +- src/test/ref/cast-not-needed.sym | 8 +- src/test/ref/cast-precedence-problem.cfg | 10 +- src/test/ref/cast-precedence-problem.log | 150 +- src/test/ref/cast-precedence-problem.sym | 16 +- src/test/ref/casting.cfg | 2 +- src/test/ref/casting.log | 87 +- src/test/ref/casting.sym | 17 +- src/test/ref/chargen.cfg | 6 +- src/test/ref/chargen.log | 93 +- src/test/ref/chargen.sym | 11 +- src/test/ref/clobber-a-problem.cfg | 6 +- src/test/ref/clobber-a-problem.log | 82 +- src/test/ref/clobber-a-problem.sym | 12 +- src/test/ref/comma-decl.cfg | 2 +- src/test/ref/comma-decl.log | 39 +- src/test/ref/comma-decl.sym | 5 +- src/test/ref/comma-expr-1.log | 27 +- src/test/ref/comma-expr-1.sym | 5 +- .../ref/complex/clearscreen/clearscreen.cfg | 2 +- .../ref/complex/clearscreen/clearscreen.log | 23 +- .../ref/complex/clearscreen/clearscreen.sym | 3 +- src/test/ref/complex/medusa/medusa.cfg | 4 +- src/test/ref/complex/medusa/medusa.log | 47 +- src/test/ref/complex/medusa/medusa.sym | 3 +- src/test/ref/complex/tetris/test-sprites.cfg | 2 +- src/test/ref/complex/tetris/test-sprites.log | 33 +- src/test/ref/complex/tetris/test-sprites.sym | 5 +- src/test/ref/complex/tetris/tetris.cfg | 8 +- src/test/ref/complex/tetris/tetris.log | 233 ++- src/test/ref/complex/tetris/tetris.sym | 15 +- src/test/ref/condition-type-mismatch.cfg | 2 +- src/test/ref/condition-type-mismatch.log | 46 +- src/test/ref/condition-type-mismatch.sym | 4 +- .../ref/consolidate-array-index-problem.cfg | 4 +- .../ref/consolidate-array-index-problem.log | 63 +- .../ref/consolidate-array-index-problem.sym | 9 +- src/test/ref/const-early-identification.cfg | 10 +- src/test/ref/const-early-identification.log | 107 +- src/test/ref/const-early-identification.sym | 9 +- src/test/ref/const-if-problem.cfg | 2 +- src/test/ref/const-if-problem.log | 44 +- src/test/ref/const-if-problem.sym | 4 +- src/test/ref/const-mult-div.cfg | 2 +- src/test/ref/const-mult-div.log | 42 +- src/test/ref/const-mult-div.sym | 6 +- src/test/ref/const-param.cfg | 6 +- src/test/ref/const-param.log | 53 +- src/test/ref/const-param.sym | 3 +- src/test/ref/const-pointer.cfg | 2 +- src/test/ref/const-pointer.log | 61 +- src/test/ref/const-pointer.sym | 5 +- src/test/ref/const-signed-promotion.cfg | 2 +- src/test/ref/const-signed-promotion.log | 27 +- src/test/ref/const-signed-promotion.sym | 3 +- src/test/ref/const-word-pointer.cfg | 8 +- src/test/ref/const-word-pointer.log | 67 +- src/test/ref/const-word-pointer.sym | 3 +- src/test/ref/constant-string-concat-0.cfg | 2 +- src/test/ref/constant-string-concat-0.log | 25 +- src/test/ref/constant-string-concat-0.sym | 3 +- src/test/ref/constant-string-concat.cfg | 2 +- src/test/ref/constant-string-concat.log | 25 +- src/test/ref/constant-string-concat.sym | 3 +- src/test/ref/constantmin.cfg | 2 +- src/test/ref/constantmin.log | 52 +- src/test/ref/constantmin.sym | 6 +- src/test/ref/constants.cfg | 4 +- src/test/ref/constants.log | 74 +- src/test/ref/constants.sym | 6 +- src/test/ref/deep-nesting.cfg | 2 +- src/test/ref/deep-nesting.log | 27 +- src/test/ref/deep-nesting.sym | 3 +- src/test/ref/default-font.cfg | 2 +- src/test/ref/default-font.log | 39 +- src/test/ref/default-font.sym | 5 +- src/test/ref/double-assignment.cfg | 4 +- src/test/ref/double-assignment.log | 43 +- src/test/ref/double-assignment.sym | 3 +- src/test/ref/double-indexing-arrays.cfg | 20 +- src/test/ref/double-indexing-arrays.log | 194 +-- src/test/ref/double-indexing-arrays.sym | 6 +- src/test/ref/dword.cfg | 2 +- src/test/ref/dword.log | 27 +- src/test/ref/dword.sym | 3 +- src/test/ref/emptyblock-error.cfg | 2 +- src/test/ref/emptyblock-error.log | 29 +- src/test/ref/emptyblock-error.sym | 3 +- src/test/ref/enum-0.log | 11 +- src/test/ref/enum-0.sym | 1 - src/test/ref/enum-1.log | 11 +- src/test/ref/enum-1.sym | 1 - src/test/ref/enum-2.log | 11 +- src/test/ref/enum-2.sym | 1 - src/test/ref/enum-3.log | 11 +- src/test/ref/enum-3.sym | 1 - src/test/ref/enum-4.log | 11 +- src/test/ref/enum-4.sym | 1 - src/test/ref/enum-5.log | 22 +- src/test/ref/enum-5.sym | 2 - src/test/ref/enum-7.cfg | 2 +- src/test/ref/enum-7.log | 42 +- src/test/ref/enum-7.sym | 4 +- src/test/ref/enum-8.cfg | 2 +- src/test/ref/enum-8.log | 42 +- src/test/ref/enum-8.sym | 4 +- src/test/ref/euclid-problem.cfg | 2 +- src/test/ref/euclid-problem.log | 21 +- src/test/ref/euclid-problem.sym | 3 +- src/test/ref/examples/3d/3d.cfg | 34 +- src/test/ref/examples/3d/3d.log | 641 ++++--- src/test/ref/examples/3d/3d.sym | 47 +- src/test/ref/examples/3d/perspective.cfg | 14 +- src/test/ref/examples/3d/perspective.log | 153 +- src/test/ref/examples/3d/perspective.sym | 15 +- .../examples/bresenham/bitmap-bresenham.cfg | 2 +- .../examples/bresenham/bitmap-bresenham.log | 25 +- .../examples/bresenham/bitmap-bresenham.sym | 3 +- .../ref/examples/chargen/chargen-analysis.cfg | 8 +- .../ref/examples/chargen/chargen-analysis.log | 143 +- .../ref/examples/chargen/chargen-analysis.sym | 3 +- .../examples/fastmultiply/fastmultiply8.cfg | 16 +- .../examples/fastmultiply/fastmultiply8.log | 166 +- .../examples/fastmultiply/fastmultiply8.sym | 12 +- src/test/ref/examples/fire/fire.cfg | 22 +- src/test/ref/examples/fire/fire.log | 310 ++-- src/test/ref/examples/fire/fire.sym | 16 +- src/test/ref/examples/linking/linking.cfg | 8 +- src/test/ref/examples/linking/linking.log | 78 +- src/test/ref/examples/linking/linking.sym | 6 +- .../multiplexer/simple-multiplexer.cfg | 4 +- .../multiplexer/simple-multiplexer.log | 64 +- .../multiplexer/simple-multiplexer.sym | 8 +- src/test/ref/examples/rotate/rotate.cfg | 6 +- src/test/ref/examples/rotate/rotate.log | 92 +- src/test/ref/examples/rotate/rotate.sym | 8 +- src/test/ref/examples/scroll/scroll.cfg | 20 +- src/test/ref/examples/scroll/scroll.log | 195 +-- src/test/ref/examples/scroll/scroll.sym | 17 +- src/test/ref/examples/scrollbig/scrollbig.cfg | 46 +- src/test/ref/examples/scrollbig/scrollbig.log | 567 +++---- src/test/ref/examples/scrollbig/scrollbig.sym | 21 +- .../ref/examples/scrolllogo/scrolllogo.cfg | 54 +- .../ref/examples/scrolllogo/scrolllogo.log | 480 +++--- .../ref/examples/scrolllogo/scrolllogo.sym | 8 +- src/test/ref/examples/showlogo/showlogo.cfg | 8 +- src/test/ref/examples/showlogo/showlogo.log | 106 +- src/test/ref/examples/showlogo/showlogo.sym | 8 +- .../ref/examples/sinplotter/sine-plotter.cfg | 4 +- .../ref/examples/sinplotter/sine-plotter.log | 98 +- .../ref/examples/sinplotter/sine-plotter.sym | 8 +- .../ref/examples/sinsprites/sinus-sprites.cfg | 2 +- .../ref/examples/sinsprites/sinus-sprites.log | 25 +- .../ref/examples/sinsprites/sinus-sprites.sym | 3 +- src/test/ref/examples/zpcode/zpcode.cfg | 8 +- src/test/ref/examples/zpcode/zpcode.log | 78 +- src/test/ref/examples/zpcode/zpcode.sym | 6 +- src/test/ref/fill-square.cfg | 2 +- src/test/ref/fill-square.log | 25 +- src/test/ref/fill-square.sym | 3 +- src/test/ref/fillscreen.cfg | 4 +- src/test/ref/fillscreen.log | 61 +- src/test/ref/fillscreen.sym | 9 +- src/test/ref/flipper-rex2.cfg | 6 +- src/test/ref/flipper-rex2.log | 78 +- src/test/ref/flipper-rex2.sym | 6 +- src/test/ref/font-hex-show.cfg | 4 +- src/test/ref/font-hex-show.log | 76 +- src/test/ref/font-hex-show.sym | 8 +- src/test/ref/forincrementassign.cfg | 2 +- src/test/ref/forincrementassign.log | 21 +- src/test/ref/forincrementassign.sym | 3 +- src/test/ref/forrangedwords.cfg | 8 +- src/test/ref/forrangedwords.log | 67 +- src/test/ref/forrangedwords.sym | 3 +- src/test/ref/forrangemin.cfg | 4 +- src/test/ref/forrangemin.log | 42 +- src/test/ref/forrangemin.sym | 6 +- src/test/ref/fragment-synth.cfg | 4 +- src/test/ref/fragment-synth.log | 39 +- src/test/ref/fragment-synth.sym | 3 +- src/test/ref/fragment-variations.cfg | 4 +- src/test/ref/fragment-variations.log | 39 +- src/test/ref/fragment-variations.sym | 3 +- src/test/ref/halfscii.cfg | 14 +- src/test/ref/halfscii.log | 169 +- src/test/ref/halfscii.sym | 15 +- src/test/ref/helloworld0.cfg | 2 +- src/test/ref/helloworld0.log | 25 +- src/test/ref/helloworld0.sym | 3 +- src/test/ref/helloworld2-inline.cfg | 8 +- src/test/ref/helloworld2-inline.log | 100 +- src/test/ref/helloworld2-inline.sym | 8 +- src/test/ref/helloworld2.cfg | 6 +- src/test/ref/helloworld2.log | 90 +- src/test/ref/helloworld2.sym | 6 +- src/test/ref/hex2dec-ptrptr.cfg | 4 +- src/test/ref/hex2dec-ptrptr.log | 53 +- src/test/ref/hex2dec-ptrptr.sym | 3 +- src/test/ref/hex2dec.cfg | 4 +- src/test/ref/hex2dec.log | 53 +- src/test/ref/hex2dec.sym | 3 +- src/test/ref/ifmin.cfg | 2 +- src/test/ref/ifmin.log | 21 +- src/test/ref/ifmin.sym | 3 +- src/test/ref/importing.cfg | 2 +- src/test/ref/importing.log | 27 +- src/test/ref/importing.sym | 3 +- src/test/ref/incd020.cfg | 4 +- src/test/ref/incd020.log | 31 +- src/test/ref/incd020.sym | 3 +- src/test/ref/infloop-error.cfg | 6 +- src/test/ref/infloop-error.log | 53 +- src/test/ref/infloop-error.sym | 3 +- src/test/ref/inline-asm-clobber.cfg | 4 +- src/test/ref/inline-asm-clobber.log | 35 +- src/test/ref/inline-asm-clobber.sym | 3 +- src/test/ref/inline-asm-param.log | 11 +- src/test/ref/inline-asm-param.sym | 3 +- src/test/ref/inline-function-if.cfg | 4 +- src/test/ref/inline-function-if.log | 43 +- src/test/ref/inline-function-if.sym | 3 +- src/test/ref/inline-function-min.cfg | 6 +- src/test/ref/inline-function-min.log | 59 +- src/test/ref/inline-function-min.sym | 3 +- src/test/ref/inline-function-print.cfg | 8 +- src/test/ref/inline-function-print.log | 100 +- src/test/ref/inline-function-print.sym | 8 +- src/test/ref/inline-function.cfg | 12 +- src/test/ref/inline-function.log | 202 +-- src/test/ref/inline-function.sym | 22 +- src/test/ref/inline-kasm-clobber.cfg | 2 +- src/test/ref/inline-kasm-clobber.log | 25 +- src/test/ref/inline-kasm-clobber.sym | 3 +- src/test/ref/inline-word-0.cfg | 2 +- src/test/ref/inline-word-0.log | 25 +- src/test/ref/inline-word-0.sym | 3 +- src/test/ref/inline-word-1.cfg | 2 +- src/test/ref/inline-word-1.log | 25 +- src/test/ref/inline-word-1.sym | 3 +- src/test/ref/inline-word-2.cfg | 2 +- src/test/ref/inline-word-2.log | 25 +- src/test/ref/inline-word-2.sym | 3 +- src/test/ref/inlinearrayproblem.cfg | 4 +- src/test/ref/inlinearrayproblem.log | 52 +- src/test/ref/inlinearrayproblem.sym | 6 +- src/test/ref/inmem-const-array.cfg | 4 +- src/test/ref/inmem-const-array.log | 97 +- src/test/ref/inmem-const-array.sym | 17 +- src/test/ref/inmemarray.cfg | 2 +- src/test/ref/inmemarray.log | 25 +- src/test/ref/inmemarray.sym | 3 +- src/test/ref/inmemstring.cfg | 4 +- src/test/ref/inmemstring.log | 47 +- src/test/ref/inmemstring.sym | 3 +- src/test/ref/keyboard-glitch.cfg | 2 +- src/test/ref/keyboard-glitch.log | 21 +- src/test/ref/keyboard-glitch.sym | 3 +- src/test/ref/line-anim.cfg | 4 +- src/test/ref/line-anim.log | 94 +- src/test/ref/line-anim.sym | 10 +- src/test/ref/literals.cfg | 8 +- src/test/ref/literals.log | 101 +- src/test/ref/literals.sym | 9 +- src/test/ref/liverange-call-problem.cfg | 4 +- src/test/ref/liverange-call-problem.log | 39 +- src/test/ref/liverange-call-problem.sym | 3 +- src/test/ref/liverange.cfg | 4 +- src/test/ref/liverange.log | 39 +- src/test/ref/liverange.sym | 3 +- src/test/ref/local-string.cfg | 2 +- src/test/ref/local-string.log | 25 +- src/test/ref/local-string.sym | 3 +- src/test/ref/localscope-simple.cfg | 4 +- src/test/ref/localscope-simple.log | 50 +- src/test/ref/localscope-simple.sym | 6 +- src/test/ref/longjump.cfg | 2 +- src/test/ref/longjump.log | 21 +- src/test/ref/longjump.sym | 3 +- src/test/ref/longjump2.cfg | 4 +- src/test/ref/longjump2.log | 42 +- src/test/ref/longjump2.sym | 6 +- src/test/ref/loop-for-sideeffect.cfg | 4 +- src/test/ref/loop-for-sideeffect.log | 33 +- src/test/ref/loop-for-sideeffect.sym | 3 +- src/test/ref/loop-memset-min.log | 19 +- src/test/ref/loop-memset-min.sym | 5 +- src/test/ref/loop-problem.cfg | 4 +- src/test/ref/loop-problem.log | 33 +- src/test/ref/loop-problem.sym | 3 +- src/test/ref/loop-while-min.cfg | 2 +- src/test/ref/loop-while-min.log | 21 +- src/test/ref/loop-while-min.sym | 3 +- src/test/ref/loop-while-sideeffect.cfg | 4 +- src/test/ref/loop-while-sideeffect.log | 33 +- src/test/ref/loop-while-sideeffect.sym | 3 +- src/test/ref/loopnest.cfg | 2 +- src/test/ref/loopnest.log | 21 +- src/test/ref/loopnest.sym | 3 +- src/test/ref/loopnest2.cfg | 2 +- src/test/ref/loopnest2.log | 21 +- src/test/ref/loopnest2.sym | 3 +- src/test/ref/malloc-0.log | 23 +- src/test/ref/malloc-0.sym | 5 +- src/test/ref/malloc-1.log | 23 +- src/test/ref/malloc-1.sym | 5 +- src/test/ref/memory-heap.cfg | 6 +- src/test/ref/memory-heap.log | 72 +- src/test/ref/memory-heap.sym | 6 +- src/test/ref/min-fmul-16.cfg | 12 +- src/test/ref/min-fmul-16.log | 149 +- src/test/ref/min-fmul-16.sym | 15 +- src/test/ref/mixed-array-0.cfg | 6 +- src/test/ref/mixed-array-0.log | 67 +- src/test/ref/mixed-array-0.sym | 3 +- src/test/ref/mixed-array-1.cfg | 6 +- src/test/ref/mixed-array-1.log | 67 +- src/test/ref/mixed-array-1.sym | 3 +- .../simple-multiplexer-irq.cfg | 4 +- .../simple-multiplexer-irq.log | 62 +- .../simple-multiplexer-irq.sym | 4 +- src/test/ref/norom-charset.cfg | 4 +- src/test/ref/norom-charset.log | 93 +- src/test/ref/norom-charset.sym | 9 +- src/test/ref/number-inference-sum.log | 27 +- src/test/ref/number-inference-sum.sym | 5 +- src/test/ref/operator-lohi-problem.log | 37 +- src/test/ref/operator-lohi-problem.sym | 5 +- src/test/ref/overlap-allocation-2.cfg | 2 +- src/test/ref/overlap-allocation-2.log | 25 +- src/test/ref/overlap-allocation-2.sym | 3 +- src/test/ref/overlap-allocation.cfg | 2 +- src/test/ref/overlap-allocation.log | 25 +- src/test/ref/overlap-allocation.sym | 3 +- src/test/ref/plasma-center.cfg | 2 +- src/test/ref/plasma-center.log | 23 +- src/test/ref/plasma-center.sym | 3 +- src/test/ref/pointer-cast-4.log | 21 +- src/test/ref/pointer-cast-4.sym | 5 +- src/test/ref/pointer-cast.cfg | 32 +- src/test/ref/pointer-cast.log | 496 +++--- src/test/ref/pointer-cast.sym | 24 +- src/test/ref/pointer-plus-signed-word.cfg | 2 +- src/test/ref/pointer-plus-signed-word.log | 25 +- src/test/ref/pointer-plus-signed-word.sym | 3 +- src/test/ref/pointer-pointer-3.cfg | 2 +- src/test/ref/pointer-pointer-3.log | 50 +- src/test/ref/pointer-pointer-3.sym | 6 +- src/test/ref/print-problem.cfg | 4 +- src/test/ref/print-problem.log | 39 +- src/test/ref/print-problem.sym | 3 +- src/test/ref/problem-negative-word-const.cfg | 2 +- src/test/ref/problem-negative-word-const.log | 25 +- src/test/ref/problem-negative-word-const.sym | 3 +- src/test/ref/ptr-complex.cfg | 10 +- src/test/ref/ptr-complex.log | 154 +- src/test/ref/ptr-complex.sym | 6 +- src/test/ref/ptrtest.cfg | 6 +- src/test/ref/ptrtest.log | 69 +- src/test/ref/ptrtest.sym | 9 +- src/test/ref/roll-variable.cfg | 2 +- src/test/ref/roll-variable.log | 21 +- src/test/ref/roll-variable.sym | 3 +- src/test/ref/runtime-unused-procedure.cfg | 2 +- src/test/ref/runtime-unused-procedure.log | 68 +- src/test/ref/runtime-unused-procedure.sym | 4 +- src/test/ref/screen-center-angle.cfg | 2 +- src/test/ref/screen-center-angle.log | 80 +- src/test/ref/screen-center-angle.sym | 8 +- src/test/ref/screen-center-distance.cfg | 2 +- src/test/ref/screen-center-distance.log | 103 +- src/test/ref/screen-center-distance.sym | 13 +- src/test/ref/screen-show-spiral-buckets.cfg | 2 +- src/test/ref/screen-show-spiral-buckets.log | 23 +- src/test/ref/screen-show-spiral-buckets.sym | 3 +- src/test/ref/screen-show-spiral.cfg | 2 +- src/test/ref/screen-show-spiral.log | 23 +- src/test/ref/screen-show-spiral.sym | 3 +- src/test/ref/scroll-clobber.cfg | 2 +- src/test/ref/scroll-clobber.log | 21 +- src/test/ref/scroll-clobber.sym | 3 +- src/test/ref/scrollbig-clobber.cfg | 8 +- src/test/ref/scrollbig-clobber.log | 68 +- src/test/ref/scrollbig-clobber.sym | 6 +- src/test/ref/sieve-min.cfg | 6 +- src/test/ref/sieve-min.log | 77 +- src/test/ref/sieve-min.sym | 5 +- src/test/ref/sieve.cfg | 8 +- src/test/ref/sieve.log | 85 +- src/test/ref/sieve.sym | 3 +- src/test/ref/signed-bytes.cfg | 2 +- src/test/ref/signed-bytes.log | 25 +- src/test/ref/signed-bytes.sym | 3 +- src/test/ref/signed-char-comparison.cfg | 2 +- src/test/ref/signed-char-comparison.log | 29 +- src/test/ref/signed-char-comparison.sym | 3 +- src/test/ref/signed-word-minus-byte-2.cfg | 2 +- src/test/ref/signed-word-minus-byte-2.log | 25 +- src/test/ref/signed-word-minus-byte-2.sym | 3 +- src/test/ref/sinusgen16.cfg | 8 +- src/test/ref/sinusgen16.log | 85 +- src/test/ref/sinusgen16.sym | 3 +- src/test/ref/sinusgen16b.cfg | 8 +- src/test/ref/sinusgen16b.log | 89 +- src/test/ref/sinusgen16b.sym | 3 +- src/test/ref/sinusgen8.cfg | 6 +- src/test/ref/sinusgen8.log | 59 +- src/test/ref/sinusgen8.sym | 3 +- src/test/ref/sinusgen8b.cfg | 8 +- src/test/ref/sinusgen8b.log | 85 +- src/test/ref/sinusgen8b.sym | 3 +- src/test/ref/sinusgenscale8.cfg | 6 +- src/test/ref/sinusgenscale8.log | 59 +- src/test/ref/sinusgenscale8.sym | 3 +- src/test/ref/sizeof-arrays.cfg | 2 +- src/test/ref/sizeof-arrays.log | 43 +- src/test/ref/sizeof-arrays.sym | 3 +- src/test/ref/string-encoding-literals.cfg | 14 +- src/test/ref/string-encoding-literals.log | 167 +- src/test/ref/string-encoding-literals.sym | 3 +- src/test/ref/string-encoding-pragma.cfg | 12 +- src/test/ref/string-encoding-pragma.log | 145 +- src/test/ref/string-encoding-pragma.sym | 3 +- src/test/ref/string-escapes-0.cfg | 2 +- src/test/ref/string-escapes-0.log | 25 +- src/test/ref/string-escapes-0.sym | 3 +- src/test/ref/string-pointer-problem.cfg | 2 +- src/test/ref/string-pointer-problem.log | 27 +- src/test/ref/string-pointer-problem.sym | 3 +- src/test/ref/struct-11.cfg | 4 +- src/test/ref/struct-11.log | 100 +- src/test/ref/struct-11.sym | 12 +- src/test/ref/struct-4.cfg | 2 +- src/test/ref/struct-4.log | 56 +- src/test/ref/struct-4.sym | 8 +- src/test/ref/struct-5.cfg | 4 +- src/test/ref/struct-5.log | 70 +- src/test/ref/struct-5.sym | 6 +- src/test/ref/struct-6.cfg | 6 +- src/test/ref/struct-6.log | 83 +- src/test/ref/struct-6.sym | 9 +- src/test/ref/struct-7.cfg | 12 +- src/test/ref/struct-7.log | 164 +- src/test/ref/struct-7.sym | 18 +- src/test/ref/struct-8.cfg | 6 +- src/test/ref/struct-8.log | 83 +- src/test/ref/struct-8.sym | 9 +- src/test/ref/struct-9.cfg | 4 +- src/test/ref/struct-9.log | 56 +- src/test/ref/struct-9.sym | 6 +- src/test/ref/struct-pos-fill.cfg | 4 +- src/test/ref/struct-pos-fill.log | 54 +- src/test/ref/struct-pos-fill.sym | 6 +- src/test/ref/struct-ptr-13.cfg | 8 +- src/test/ref/struct-ptr-13.log | 119 +- src/test/ref/struct-ptr-13.sym | 3 +- src/test/ref/struct-ptr-16.cfg | 12 +- src/test/ref/struct-ptr-16.log | 147 +- src/test/ref/struct-ptr-16.sym | 9 +- src/test/ref/struct-ptr-17.cfg | 4 +- src/test/ref/struct-ptr-17.log | 57 +- src/test/ref/struct-ptr-17.sym | 3 +- src/test/ref/struct-ptr-24.cfg | 4 +- src/test/ref/struct-ptr-24.log | 48 +- src/test/ref/struct-ptr-24.sym | 6 +- src/test/ref/struct-ptr-25.log | 34 +- src/test/ref/struct-ptr-25.sym | 2 - src/test/ref/struct-ptr-34.cfg | 4 +- src/test/ref/struct-ptr-34.log | 100 +- src/test/ref/struct-ptr-34.sym | 12 +- src/test/ref/struct-ptr-4.cfg | 4 +- src/test/ref/struct-ptr-4.log | 39 +- src/test/ref/struct-ptr-4.sym | 3 +- src/test/ref/struct-ptr-5.cfg | 6 +- src/test/ref/struct-ptr-5.log | 73 +- src/test/ref/struct-ptr-5.sym | 7 +- src/test/ref/subexpr-optimize-1.cfg | 8 +- src/test/ref/subexpr-optimize-1.log | 129 +- src/test/ref/subexpr-optimize-1.sym | 3 +- src/test/ref/summin.cfg | 2 +- src/test/ref/summin.log | 21 +- src/test/ref/summin.sym | 3 +- src/test/ref/switch-2.cfg | 2 +- src/test/ref/switch-2.log | 48 +- src/test/ref/switch-2.sym | 4 +- src/test/ref/test-comments-block.cfg | 2 +- src/test/ref/test-comments-block.log | 23 +- src/test/ref/test-comments-block.sym | 3 +- src/test/ref/test-comments-single.cfg | 2 +- src/test/ref/test-comments-single.log | 23 +- src/test/ref/test-comments-single.sym | 3 +- src/test/ref/test-kasm-pc.cfg | 4 +- src/test/ref/test-kasm-pc.log | 46 +- src/test/ref/test-kasm-pc.sym | 6 +- src/test/ref/test-lohiconst.cfg | 8 +- src/test/ref/test-lohiconst.log | 75 +- src/test/ref/test-lohiconst.sym | 3 +- src/test/ref/test-multiply-16bit.cfg | 6 +- src/test/ref/test-multiply-16bit.log | 65 +- src/test/ref/test-multiply-16bit.sym | 3 +- src/test/ref/test-multiply-8bit.cfg | 16 +- src/test/ref/test-multiply-8bit.log | 150 +- src/test/ref/test-multiply-8bit.sym | 6 +- src/test/ref/test-word-size-arrays.cfg | 6 +- src/test/ref/test-word-size-arrays.log | 57 +- src/test/ref/test-word-size-arrays.sym | 3 +- src/test/ref/tetris-npe.cfg | 6 +- src/test/ref/tetris-npe.log | 89 +- src/test/ref/tetris-npe.sym | 9 +- src/test/ref/true-inline-words.cfg | 6 +- src/test/ref/true-inline-words.log | 103 +- src/test/ref/true-inline-words.sym | 11 +- src/test/ref/type-mix.cfg | 2 +- src/test/ref/type-mix.log | 21 +- src/test/ref/type-mix.sym | 3 +- src/test/ref/typedef-0.cfg | 2 +- src/test/ref/typedef-0.log | 32 +- src/test/ref/typedef-0.sym | 6 +- src/test/ref/typedef-1.cfg | 4 +- src/test/ref/typedef-1.log | 83 +- src/test/ref/typedef-1.sym | 9 +- src/test/ref/typeid-plus-byte-problem.cfg | 2 +- src/test/ref/typeid-plus-byte-problem.log | 46 +- src/test/ref/typeid-plus-byte-problem.sym | 6 +- src/test/ref/typeid-plus-bytes.cfg | 20 +- src/test/ref/typeid-plus-bytes.log | 260 ++- src/test/ref/typeid-plus-bytes.sym | 8 +- src/test/ref/uninitialized.cfg | 2 +- src/test/ref/uninitialized.log | 75 +- src/test/ref/uninitialized.sym | 5 +- src/test/ref/unroll-for-min.cfg | 6 +- src/test/ref/unroll-for-min.log | 49 +- src/test/ref/unroll-for-min.sym | 3 +- src/test/ref/unroll-loop-modifyvar.cfg | 24 +- src/test/ref/unroll-loop-modifyvar.log | 159 +- src/test/ref/unroll-loop-modifyvar.sym | 3 +- src/test/ref/unroll-screenfill-for-double.cfg | 242 +-- src/test/ref/unroll-screenfill-for-double.log | 1509 ++++++++--------- src/test/ref/unroll-screenfill-for-double.sym | 3 +- src/test/ref/unroll-screenfill-for.cfg | 50 +- src/test/ref/unroll-screenfill-for.log | 363 ++-- src/test/ref/unroll-screenfill-for.sym | 3 +- src/test/ref/unroll-screenfill-while.cfg | 50 +- src/test/ref/unroll-screenfill-while.log | 363 ++-- src/test/ref/unroll-screenfill-while.sym | 3 +- src/test/ref/unroll-while-min.cfg | 4 +- src/test/ref/unroll-while-min.log | 37 +- src/test/ref/unroll-while-min.sym | 3 +- src/test/ref/unused-method.cfg | 2 +- src/test/ref/unused-method.log | 31 +- src/test/ref/unused-method.sym | 3 +- src/test/ref/unused-vars.cfg | 2 +- src/test/ref/unused-vars.log | 38 +- src/test/ref/unused-vars.sym | 6 +- src/test/ref/unusedblockproblem.cfg | 2 +- src/test/ref/unusedblockproblem.log | 23 +- src/test/ref/unusedblockproblem.sym | 3 +- src/test/ref/useglobal.cfg | 2 +- src/test/ref/useglobal.log | 27 +- src/test/ref/useglobal.sym | 3 +- src/test/ref/useuninitialized.cfg | 4 +- src/test/ref/useuninitialized.log | 43 +- src/test/ref/useuninitialized.sym | 3 +- src/test/ref/var-export.cfg | 2 +- src/test/ref/var-export.log | 27 +- src/test/ref/var-export.sym | 3 +- src/test/ref/var-register-noarg.cfg | 2 +- src/test/ref/var-register-noarg.log | 25 +- src/test/ref/var-register-noarg.sym | 3 +- src/test/ref/var-register-zp-3.cfg | 2 +- src/test/ref/var-register-zp-3.log | 27 +- src/test/ref/var-register-zp-3.sym | 3 +- src/test/ref/var-register-zp.cfg | 4 +- src/test/ref/var-register-zp.log | 35 +- src/test/ref/var-register-zp.sym | 3 +- src/test/ref/var-register.cfg | 2 +- src/test/ref/var-register.log | 21 +- src/test/ref/var-register.sym | 3 +- src/test/ref/voronoi.cfg | 10 +- src/test/ref/voronoi.log | 124 +- src/test/ref/voronoi.sym | 12 +- src/test/ref/word-pointer-math-0.cfg | 4 +- src/test/ref/word-pointer-math-0.log | 47 +- src/test/ref/word-pointer-math-0.sym | 3 +- src/test/ref/word-pointer-math-1.log | 32 +- src/test/ref/word-pointer-math-1.sym | 8 +- src/test/ref/zpparammin.cfg | 4 +- src/test/ref/zpparammin.log | 44 +- src/test/ref/zpparammin.sym | 6 +- src/test/ref/zpptr.cfg | 2 +- src/test/ref/zpptr.log | 25 +- src/test/ref/zpptr.sym | 3 +- 689 files changed, 10138 insertions(+), 11877 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/model/symbols/SymbolVariable.java b/src/main/java/dk/camelot64/kickc/model/symbols/SymbolVariable.java index f8f79f2e0..55652f1ce 100644 --- a/src/main/java/dk/camelot64/kickc/model/symbols/SymbolVariable.java +++ b/src/main/java/dk/camelot64/kickc/model/symbols/SymbolVariable.java @@ -245,6 +245,26 @@ public abstract class SymbolVariable implements Symbol { this.storageStrategy = storageStrategy; } + public boolean isStorageConstant() { + return StorageStrategy.CONSTANT.equals(getStorageStrategy()); + } + + public boolean isStoragePhiMaster() { + return StorageStrategy.PHI_MASTER.equals(getStorageStrategy()); + } + + public boolean isStoragePhiVersion() { + return StorageStrategy.PHI_VERSION.equals(getStorageStrategy()); + } + + public boolean isStorageMemory() { + return StorageStrategy.MEMORY.equals(getStorageStrategy()); + } + + public boolean isStorageIntermediate() { + return StorageStrategy.INTERMEDIATE.equals(getStorageStrategy()); + } + public List getComments() { return comments; } diff --git a/src/main/java/dk/camelot64/kickc/model/symbols/Variable.java b/src/main/java/dk/camelot64/kickc/model/symbols/Variable.java index 289ac011e..7d546aae1 100644 --- a/src/main/java/dk/camelot64/kickc/model/symbols/Variable.java +++ b/src/main/java/dk/camelot64/kickc/model/symbols/Variable.java @@ -7,18 +7,19 @@ import dk.camelot64.kickc.model.values.VariableRef; import java.util.Objects; -/** A Variable in the program. - * +/** + * A Variable in the program. + *

* There are several types of variables - * + *

* - Intermediate: A variable added by the compiler to hold some intermediate value. Intermediate variables are names $1, $2, ... * - PHI-variable: A variable with storage strategy PHI is turned into versions. The variable itself is never used directly in the program. * - PHI-versions: A variable with storage strategy PHI is turned into versions. Versions of the PHI-variable name are named name#1, name#2, name#3 * - Memory: A variable with storage strategy memory is used directly in the program. - * */ + */ public class Variable extends SymbolVariable { - /** The number of the next version (only used for PHI masters)*/ + /** The number of the next version (only used for PHI masters) */ private Integer nextPhiVersionNumber; /** If the variable is assigned to a specific "register", this contains the register. If null the variable has no allocation (yet). Constants are never assigned to registers. */ @@ -32,11 +33,12 @@ public class Variable extends SymbolVariable { /** * Create a version of a PHI master variable + * * @param phiMaster The PHI master variable. * @param version The version number */ public Variable(Variable phiMaster, int version) { - super(phiMaster.getName()+"#"+version, phiMaster.getScope(), phiMaster.getType(), StorageStrategy.PHI_VERSION, phiMaster.getDataSegment()); + super(phiMaster.getName() + "#" + version, phiMaster.getScope(), phiMaster.getType(), StorageStrategy.PHI_VERSION, phiMaster.getDataSegment()); this.setDeclaredAlignment(phiMaster.getDeclaredAlignment()); this.setDeclaredAsRegister(phiMaster.isDeclaredAsRegister()); this.setDeclaredAsMemory(phiMaster.isDeclaredAsMemory()); @@ -57,33 +59,15 @@ public class Variable extends SymbolVariable { this.allocation = allocation; } - public boolean isStorageConstant() { - return StorageStrategy.CONSTANT.equals(getStorageStrategy()); - } - - public boolean isStoragePhiMaster() { - return StorageStrategy.PHI_MASTER.equals(getStorageStrategy()); - } - - public boolean isStoragePhiVersion() { - return StorageStrategy.PHI_VERSION.equals(getStorageStrategy()); - } - - public boolean isStorageMemory() { - return StorageStrategy.MEMORY.equals(getStorageStrategy()); - } - - public boolean isStorageIntermediate() { - return StorageStrategy.INTERMEDIATE.equals(getStorageStrategy()); - } /** * Creates a new PHI-version from a PHI-master + * * @return The new version of the PHI master */ public Variable createVersion() { if(!isStoragePhiMaster()) - throw new InternalError("Cannot version non-PHI variable"); + throw new InternalError("Cannot version non-PHI variable " + this.toString()); Variable version = new Variable(this, nextPhiVersionNumber++); getScope().add(version); return version; @@ -91,16 +75,15 @@ public class Variable extends SymbolVariable { /** * If the variable is a version of a variable returns the original variable. + * * @return The original variable. Null if this is not a version. */ public Variable getVersionOf() { - if(isStoragePhiVersion()) { - String name = getName(); - String versionOfName = name.substring(0, name.indexOf("#")); - return getScope().getVariable(versionOfName); - } else { - return null; - } + if(!isStoragePhiVersion()) + throw new InternalError("Cannot get master for non-PHI version variable " + this.toString()); + String name = getName(); + String versionOfName = name.substring(0, name.indexOf("#")); + return getScope().getVariable(versionOfName); } public VariableRef getRef() { diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java b/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java index c25277d4a..919af24ac 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java @@ -8,6 +8,7 @@ import dk.camelot64.kickc.model.statements.StatementAssignment; import dk.camelot64.kickc.model.statements.StatementLValue; import dk.camelot64.kickc.model.symbols.Procedure; import dk.camelot64.kickc.model.symbols.Scope; +import dk.camelot64.kickc.model.symbols.SymbolVariable; import dk.camelot64.kickc.model.symbols.Variable; import dk.camelot64.kickc.model.values.ConstantValue; import dk.camelot64.kickc.model.values.VariableRef; @@ -38,9 +39,11 @@ public class Pass1EarlyConstantIdentification extends Pass1Base { if(assign.getrValue1() == null && assign.getOperator() == null && assign.getrValue2() instanceof ConstantValue) { getLog().append("Identified constant variable " + variable.toString(getProgram())); earlyConstants.add(variableRef); + variable.setStorageStrategy(SymbolVariable.StorageStrategy.CONSTANT); } else if(assign.getrValue1() == null && assign.getOperator() instanceof OperatorCastPtr && assign.getrValue2() instanceof ConstantValue) { getLog().append("Identified constant variable " + variable.toString(getProgram())); earlyConstants.add(variableRef); + variable.setStorageStrategy(SymbolVariable.StorageStrategy.CONSTANT); } } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java index 90c4123b0..1bd54a5a3 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java @@ -2,6 +2,7 @@ package dk.camelot64.kickc.passes; import dk.camelot64.kickc.model.CompileError; import dk.camelot64.kickc.model.ControlFlowBlock; +import dk.camelot64.kickc.model.InternalError; import dk.camelot64.kickc.model.Program; import dk.camelot64.kickc.model.iterator.ProgramValue; import dk.camelot64.kickc.model.iterator.ProgramValueIterator; @@ -85,8 +86,9 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { if(versions.size() != 0) { throw new CompileError("Error! Constants can not be modified", source); } - version = assignedSymbol.createVersion(); - version.setDeclaredConstant(true); + throw new InternalError("ERR!"); + //version = assignedSymbol.createVersion(); + //version.setDeclaredConstant(true); } else { version = assignedSymbol.createVersion(); } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1UnwindBlockScopes.java b/src/main/java/dk/camelot64/kickc/passes/Pass1UnwindBlockScopes.java index a30930353..0f9797098 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1UnwindBlockScopes.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1UnwindBlockScopes.java @@ -84,8 +84,10 @@ public class Pass1UnwindBlockScopes extends Pass1Base { unwound.setDeclaredRegister((var.getDeclaredRegister())); unwound.setDeclaredExport(var.isDeclaredExport()); unwoundSymbols.put(symbol.getRef(), unwound.getRef()); + unwound.setStorageStrategy(var.getStorageStrategy()); } else if(variable.isStorageIntermediate()) { Variable unwound = procedure.addVariableIntermediate(); + unwound.setStorageStrategy(variable.getStorageStrategy()); unwoundSymbols.put(symbol.getRef(), unwound.getRef()); } else { throw new CompileError("ERROR! Unexpected symbol encountered in block scope " + symbol.toString(getProgram())); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2AliasElimination.java b/src/main/java/dk/camelot64/kickc/passes/Pass2AliasElimination.java index d03aec8e9..6ec456312 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2AliasElimination.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2AliasElimination.java @@ -420,7 +420,7 @@ public class Pass2AliasElimination extends Pass2SsaOptimization { String name; int score; Variable variable = scope.getVariable(var); - if(variable.isDeclaredConstant()) { + if(variable.isDeclaredConstant() || variable.isStorageConstant()) { name = var.getFullNameUnversioned(); score = 100; } else if(var.isVersion()) { diff --git a/src/main/java/dk/camelot64/kickc/passes/PassNTypeInference.java b/src/main/java/dk/camelot64/kickc/passes/PassNTypeInference.java index c674698d9..e7f55803c 100644 --- a/src/main/java/dk/camelot64/kickc/passes/PassNTypeInference.java +++ b/src/main/java/dk/camelot64/kickc/passes/PassNTypeInference.java @@ -6,6 +6,7 @@ import dk.camelot64.kickc.model.Program; import dk.camelot64.kickc.model.statements.*; import dk.camelot64.kickc.model.symbols.Procedure; import dk.camelot64.kickc.model.symbols.ProgramScope; +import dk.camelot64.kickc.model.symbols.SymbolVariable; import dk.camelot64.kickc.model.symbols.Variable; import dk.camelot64.kickc.model.types.*; import dk.camelot64.kickc.model.values.AssignmentRValue; @@ -135,8 +136,10 @@ public class PassNTypeInference extends Pass2SsaOptimization { // If the type is an array or a string the symbol is constant if(symbol.getType() instanceof SymbolTypeArray) { symbol.setDeclaredConstant(true); + symbol.setStorageStrategy(SymbolVariable.StorageStrategy.CONSTANT); } else if(SymbolType.STRING.equals(symbol.getType())) { symbol.setDeclaredConstant(true); + symbol.setStorageStrategy(SymbolVariable.StorageStrategy.CONSTANT); } } } diff --git a/src/test/ref/address-of-0.cfg b/src/test/ref/address-of-0.cfg index 56f1e90b6..9db611f0f 100644 --- a/src/test/ref/address-of-0.cfg +++ b/src/test/ref/address-of-0.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 - [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 + [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 [8] (byte) main::b#1 ← ++ (byte) main::b#2 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/address-of-0.log b/src/test/ref/address-of-0.log index d6ab9ab9d..82ca3d186 100644 --- a/src/test/ref/address-of-0.log +++ b/src/test/ref/address-of-0.log @@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::b#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@1 (byte*) main::bp#0 ← (byte*~) main::$0 (number~) main::$1 ← *((byte*) main::bp#0) + (number) 1 (byte) main::c#0 ← (number~) main::$1 - *((byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 + *((byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 (byte) main::b#1 ← (byte) main::b#2 + rangenext(0,$a) (bool~) main::$2 ← (byte) main::b#1 != rangelast(0,$a) if((bool~) main::$2) goto main::@1 @@ -44,7 +44,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::b (byte) main::b#0 (byte) main::b#1 @@ -57,7 +56,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 1 in (number~) main::$1 ← *((byte*) main::bp#0) + (number) 1 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← *((byte*) main::bp#0) + (unumber)(number) 1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -72,7 +71,7 @@ Simple Condition (bool~) main::$2 [10] if((byte) main::b#1!=rangelast(0,$a)) got Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [3] (byte*) main::bp#0 ← & (byte) main::b#2 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte*) main::bp#0 = &main::b#2 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [8] main::b#1 ← ++ main::b#2 to ++ @@ -119,7 +118,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) [6] (byte) main::c#0 ← *((const byte*) main::bp#0) + (byte) 1 - [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 + [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 [8] (byte) main::b#1 ← ++ (byte) main::b#2 [9] if((byte) main::b#1!=(byte) $b) goto main::@1 to:main::@return @@ -130,7 +129,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::b (byte) main::b#0 4.0 (byte) main::b#1 16.5 @@ -191,7 +189,7 @@ main: { ldy.z bp iny sty.z c - // [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z c ldy.z b sta SCREEN,y @@ -211,7 +209,7 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::b#0 ← (byte) 0 [ main::b#0 ] ( main:2 [ main::b#0 ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte y +Statement [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte y Statement [9] if((byte) main::b#1!=(byte) $b) goto main::@1 [ main::b#1 ] ( main:2 [ main::b#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#0 main::b#1 ] : zp ZP_BYTE:2 , Potential registers zp ZP_BYTE:3 [ main::c#0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -266,7 +264,7 @@ main: { lda.z bp clc adc #1 - // [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa + // [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z b sta SCREEN,y // [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1 @@ -312,8 +310,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b (byte) main::b#0 b zp ZP_BYTE:2 4.0 (byte) main::b#1 b zp ZP_BYTE:2 16.5 @@ -362,7 +359,7 @@ main: { clc adc #1 // SCREEN[b] = c - // [7] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa + // [7] *((const byte*) main::SCREEN + (byte) main::b#2) ← (byte) main::c#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z b sta SCREEN,y // for( byte b: 0..10) diff --git a/src/test/ref/address-of-0.sym b/src/test/ref/address-of-0.sym index 5299a9b43..c8b3182b4 100644 --- a/src/test/ref/address-of-0.sym +++ b/src/test/ref/address-of-0.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b (byte) main::b#0 b zp ZP_BYTE:2 4.0 (byte) main::b#1 b zp ZP_BYTE:2 16.5 diff --git a/src/test/ref/address-of-1.cfg b/src/test/ref/address-of-1.cfg index 31a9ec483..0a4dc1edd 100644 --- a/src/test/ref/address-of-1.cfg +++ b/src/test/ref/address-of-1.cfg @@ -24,9 +24,9 @@ main::@2: scope:[main] from main::@1 [11] call setByte to:main::@3 main::@3: scope:[main] from main::@2 - [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 - [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 - [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 + [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 + [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 + [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 to:main::@return main::@return: scope:[main] from main::@3 [15] return diff --git a/src/test/ref/address-of-1.log b/src/test/ref/address-of-1.log index 1e2a6723d..efb0ea472 100644 --- a/src/test/ref/address-of-1.log +++ b/src/test/ref/address-of-1.log @@ -10,7 +10,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::b1#0 ← (number) 0 (byte) main::b2#0 ← (number) 0 (byte) main::b3#0 ← (number) 0 @@ -41,9 +41,9 @@ main::@3: scope:[main] from main::@2 (byte) main::b3#2 ← phi( main::@2/(byte) main::b3#1 ) (byte) main::b2#2 ← phi( main::@2/(byte) main::b2#3 ) (byte) main::b1#1 ← phi( main::@2/(byte) main::b1#2 ) - *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b1#1 - *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::b2#2 - *((byte*) main::SCREEN#0 + (number) 2) ← (byte) main::b3#2 + *((byte*) main::SCREEN + (number) 0) ← (byte) main::b1#1 + *((byte*) main::SCREEN + (number) 1) ← (byte) main::b2#2 + *((byte*) main::SCREEN + (number) 2) ← (byte) main::b3#2 to:main::@return main::@return: scope:[main] from main::@3 return @@ -79,7 +79,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::b1 (byte) main::b1#0 (byte) main::b1#1 @@ -111,11 +110,11 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::b1#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::b2#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::b3#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b1#1 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::b2#2 -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 2) ← (byte) main::b3#2 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::b1#1 +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::b2#2 +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::b3#2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::b1#0 ← (unumber)(number) 0 Inlining cast (byte) main::b2#0 ← (unumber)(number) 0 Inlining cast (byte) main::b3#0 ← (unumber)(number) 0 @@ -146,7 +145,7 @@ Constant right-side identified [4] (byte*) setByte::ptr#0 ← & (byte) main::b1# Constant right-side identified [9] (byte*) setByte::ptr#1 ← & (byte) main::b2#0 Constant right-side identified [14] (byte*) setByte::ptr#2 ← & (byte) main::b3#0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte*) setByte::ptr#0 = &main::b1#0 Constant (const byte) setByte::b#0 = 'c' Constant (const byte*) setByte::ptr#1 = &main::b2#0 @@ -154,7 +153,7 @@ Constant (const byte) setByte::b#1 = 'm' Constant (const byte*) setByte::ptr#2 = &main::b3#0 Constant (const byte) setByte::b#2 = 'l' Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN#0 in [19] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte) main::b1#0 +Simplifying expression containing zero main::SCREEN in [19] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::b1#0 Successful SSA optimization PassNSimplifyExpressionWithZero Inlining constant with var siblings (const byte*) setByte::ptr#0 Inlining constant with var siblings (const byte) setByte::b#0 @@ -169,8 +168,8 @@ Constant inlined setByte::b#2 = (byte) 'l' Constant inlined setByte::b#1 = (byte) 'm' Constant inlined setByte::b#0 = (byte) 'c' Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+1) -Consolidated array index constant in *(main::SCREEN#0+2) +Consolidated array index constant in *(main::SCREEN+1) +Consolidated array index constant in *(main::SCREEN+2) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -219,9 +218,9 @@ main::@2: scope:[main] from main::@1 [11] call setByte to:main::@3 main::@3: scope:[main] from main::@2 - [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 - [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 - [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 + [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 + [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 + [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 to:main::@return main::@return: scope:[main] from main::@3 [15] return @@ -240,7 +239,6 @@ setByte::@return: scope:[setByte] from setByte VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::b1 (byte) main::b1#0 0.36363636363636365 (byte) main::b2 @@ -355,13 +353,13 @@ main: { jmp b3 // main::@3 b3: - // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 + // [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 lda.z b1 sta SCREEN - // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 lda.z b2 sta SCREEN+1 - // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 lda.z b3 sta SCREEN+2 jmp breturn @@ -391,9 +389,9 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::b1#0 ← (byte) 0 [ main::b1#0 ] ( main:2 [ main::b1#0 ] ) always clobbers reg byte a Statement [5] (byte) main::b2#0 ← (byte) 0 [ main::b1#0 main::b2#0 ] ( main:2 [ main::b1#0 main::b2#0 ] ) always clobbers reg byte a Statement [6] (byte) main::b3#0 ← (byte) 0 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 [ main::b2#0 main::b3#0 ] ( main:2 [ main::b2#0 main::b3#0 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 [ main::b3#0 ] ( main:2 [ main::b3#0 ] ) always clobbers reg byte a -Statement [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 [ main::b2#0 main::b3#0 ] ( main:2 [ main::b2#0 main::b3#0 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 [ main::b3#0 ] ( main:2 [ main::b3#0 ] ) always clobbers reg byte a +Statement [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2::setByte:7 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:9 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:11 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte y Potential registers zp ZP_BYTE:2 [ setByte::b#3 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_WORD:3 [ setByte::ptr#3 ] : zp ZP_WORD:3 , @@ -503,13 +501,13 @@ main: { jmp b3 // main::@3 b3: - // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 + // [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 lda.z b1 sta SCREEN - // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 lda.z b2 sta SCREEN+1 - // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 lda.z b3 sta SCREEN+2 jmp breturn @@ -577,8 +575,7 @@ FINAL SYMBOL TABLE (label) main::@2 (label) main::@3 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b1 (byte) main::b1#0 b1 zp ZP_BYTE:4 0.36363636363636365 (byte) main::b2 @@ -670,15 +667,15 @@ main: { jsr setByte // main::@3 // SCREEN[0] = b1 - // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 + // [12] *((const byte*) main::SCREEN) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 lda.z b1 sta SCREEN // SCREEN[1] = b2 - // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 lda.z b2 sta SCREEN+1 // SCREEN[2] = b3 - // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) main::SCREEN+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 lda.z b3 sta SCREEN+2 // main::@return diff --git a/src/test/ref/address-of-1.sym b/src/test/ref/address-of-1.sym index 158103e77..005ac000d 100644 --- a/src/test/ref/address-of-1.sym +++ b/src/test/ref/address-of-1.sym @@ -6,8 +6,7 @@ (label) main::@2 (label) main::@3 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b1 (byte) main::b1#0 b1 zp ZP_BYTE:4 0.36363636363636365 (byte) main::b2 diff --git a/src/test/ref/array-16bit-lookup.cfg b/src/test/ref/array-16bit-lookup.cfg index a4cc60030..7151e4eed 100644 --- a/src/test/ref/array-16bit-lookup.cfg +++ b/src/test/ref/array-16bit-lookup.cfg @@ -21,7 +21,7 @@ main::@1: scope:[main] from main main::@2 main::@2: scope:[main] from main::@1 [9] (word~) main::$0 ← (word) getValue::return#0 [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 - [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 + [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 [12] (byte) main::idx#1 ← ++ (byte) main::idx#2 [13] if((byte) main::idx#1!=(byte) $81) goto main::@1 to:main::@return diff --git a/src/test/ref/array-16bit-lookup.log b/src/test/ref/array-16bit-lookup.log index 7cce533c6..4bb9175f9 100644 --- a/src/test/ref/array-16bit-lookup.log +++ b/src/test/ref/array-16bit-lookup.log @@ -10,7 +10,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (word*) main::SCREEN#0 ← ((word*)) (number) $400 + (word*) main::SCREEN ← ((word*)) (number) $400 (byte) main::idx#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@3 @@ -24,7 +24,7 @@ main::@3: scope:[main] from main::@1 (word) getValue::return#3 ← phi( main::@1/(word) getValue::return#0 ) (word~) main::$0 ← (word) getValue::return#3 (byte~) main::$2 ← (byte) main::idx#3 * (const byte) SIZEOF_WORD - *((word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 + *((word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 (byte) main::idx#1 ← (byte) main::idx#3 + rangenext(0,$80) (bool~) main::$1 ← (byte) main::idx#1 != rangelast(0,$80) if((bool~) main::$1) goto main::@1 @@ -90,7 +90,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (word*) main::SCREEN -(word*) main::SCREEN#0 (byte) main::idx (byte) main::idx#0 (byte) main::idx#1 @@ -105,7 +104,7 @@ Adding number conversion cast (unumber) getValue::$1 in (number~) getValue::$1 Adding number conversion cast (unumber) 1 in (number~) getValue::$2 ← (unumber~) getValue::$1 >> (number) 1 Adding number conversion cast (unumber) getValue::$2 in (number~) getValue::$2 ← (unumber~) getValue::$1 >> (unumber)(number) 1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) main::SCREEN#0 ← (word*)(number) $400 +Inlining cast (word*) main::SCREEN ← (word*)(number) $400 Inlining cast (word~) getValue::$3 ← (word)(unumber~) getValue::$2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (word*) 1024 @@ -131,7 +130,7 @@ Simple Condition (bool~) main::$1 [12] if((byte) main::idx#1!=rangelast(0,$80)) Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [14] (word[$80]) arr16 ← { fill( $80, 0) } Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word*) main::SCREEN#0 = (word*) 1024 +Constant (const word*) main::SCREEN = (word*) 1024 Constant (const byte) main::idx#0 = 0 Constant (const word[$80]) arr16 = { fill( $80, 0) } Successful SSA optimization Pass2ConstantIdentification @@ -199,7 +198,7 @@ main::@1: scope:[main] from main main::@2 main::@2: scope:[main] from main::@1 [9] (word~) main::$0 ← (word) getValue::return#0 [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 - [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 + [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 [12] (byte) main::idx#1 ← ++ (byte) main::idx#2 [13] if((byte) main::idx#1!=(byte) $81) goto main::@1 to:main::@return @@ -234,7 +233,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (word~) main::$0 11.0 (byte~) main::$2 22.0 -(word*) main::SCREEN (byte) main::idx (byte) main::idx#1 16.5 (byte) main::idx#2 6.285714285714286 @@ -340,7 +338,7 @@ main: { lda.z idx asl sta.z _2 - // [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuz1=vwuz2 + // [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuz1=vwuz2 ldy.z _2 lda.z _0 sta SCREEN,y @@ -405,7 +403,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ ma Statement [8] (word) getValue::return#0 ← (word) getValue::return#1 [ main::idx#2 getValue::return#0 ] ( main:2 [ main::idx#2 getValue::return#0 ] ) always clobbers reg byte a Statement [9] (word~) main::$0 ← (word) getValue::return#0 [ main::idx#2 main::$0 ] ( main:2 [ main::idx#2 main::$0 ] ) always clobbers reg byte a Statement [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 [ main::idx#2 main::$0 main::$2 ] ( main:2 [ main::idx#2 main::$0 main::$2 ] ) always clobbers reg byte a -Statement [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 [ main::idx#2 ] ( main:2 [ main::idx#2 ] ) always clobbers reg byte a +Statement [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 [ main::idx#2 ] ( main:2 [ main::idx#2 ] ) always clobbers reg byte a Statement [15] (byte~) getValue::$0 ← (word) getValue::index#0 & (byte) $7f [ getValue::$0 ] ( main:2::getValue:7 [ main::idx#2 getValue::$0 ] ) always clobbers reg byte a Statement [16] (byte~) getValue::$4 ← (byte~) getValue::$0 << (byte) 1 [ getValue::$4 ] ( main:2::getValue:7 [ main::idx#2 getValue::$4 ] ) always clobbers reg byte a Statement [17] (byte~) getValue::$1 ← *((const word[$80]) arr16 + (byte~) getValue::$4) & (byte) $ff [ getValue::$1 ] ( main:2::getValue:7 [ main::idx#2 getValue::$1 ] ) always clobbers reg byte a @@ -415,7 +413,7 @@ Statement [6] (word) getValue::index#0 ← (byte) main::idx#2 [ main::idx#2 getV Statement [8] (word) getValue::return#0 ← (word) getValue::return#1 [ main::idx#2 getValue::return#0 ] ( main:2 [ main::idx#2 getValue::return#0 ] ) always clobbers reg byte a Statement [9] (word~) main::$0 ← (word) getValue::return#0 [ main::idx#2 main::$0 ] ( main:2 [ main::idx#2 main::$0 ] ) always clobbers reg byte a Statement [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 [ main::idx#2 main::$0 main::$2 ] ( main:2 [ main::idx#2 main::$0 main::$2 ] ) always clobbers reg byte a -Statement [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 [ main::idx#2 ] ( main:2 [ main::idx#2 ] ) always clobbers reg byte a +Statement [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 [ main::idx#2 ] ( main:2 [ main::idx#2 ] ) always clobbers reg byte a Statement [15] (byte~) getValue::$0 ← (word) getValue::index#0 & (byte) $7f [ getValue::$0 ] ( main:2::getValue:7 [ main::idx#2 getValue::$0 ] ) always clobbers reg byte a Statement [16] (byte~) getValue::$4 ← (byte~) getValue::$0 << (byte) 1 [ getValue::$4 ] ( main:2::getValue:7 [ main::idx#2 getValue::$4 ] ) always clobbers reg byte a Statement [17] (byte~) getValue::$1 ← *((const word[$80]) arr16 + (byte~) getValue::$4) & (byte) $ff [ getValue::$1 ] ( main:2::getValue:7 [ main::idx#2 getValue::$1 ] ) always clobbers reg byte a @@ -501,7 +499,7 @@ main: { // [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuaa=vwuz1 + // [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z _0 sta SCREEN,y @@ -598,8 +596,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(word*) main::SCREEN -(const word*) main::SCREEN#0 SCREEN = (word*) 1024 +(const word*) main::SCREEN SCREEN = (word*) 1024 (byte) main::idx (byte) main::idx#1 reg byte x 16.5 (byte) main::idx#2 reg byte x 6.285714285714286 @@ -658,7 +655,7 @@ main: { // [10] (byte~) main::$2 ← (byte) main::idx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [11] *((const word*) main::SCREEN#0 + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuaa=vwuz1 + // [11] *((const word*) main::SCREEN + (byte~) main::$2) ← (word~) main::$0 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z _0 sta SCREEN,y diff --git a/src/test/ref/array-16bit-lookup.sym b/src/test/ref/array-16bit-lookup.sym index 8e057f49a..cc3de62c8 100644 --- a/src/test/ref/array-16bit-lookup.sym +++ b/src/test/ref/array-16bit-lookup.sym @@ -19,8 +19,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(word*) main::SCREEN -(const word*) main::SCREEN#0 SCREEN = (word*) 1024 +(const word*) main::SCREEN SCREEN = (word*) 1024 (byte) main::idx (byte) main::idx#1 reg byte x 16.5 (byte) main::idx#2 reg byte x 6.285714285714286 diff --git a/src/test/ref/array-length-symbolic-min.cfg b/src/test/ref/array-length-symbolic-min.cfg index 3e7255b98..0cde757e5 100644 --- a/src/test/ref/array-length-symbolic-min.cfg +++ b/src/test/ref/array-length-symbolic-min.cfg @@ -14,9 +14,9 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::sub#2 ← phi( main/(byte) 0 main::@1/(byte) main::sub#1 ) - [6] *((const byte[SZ#0]) items + (byte) main::sub#2) ← (byte) main::sub#2 + [6] *((const byte[SZ]) items + (byte) main::sub#2) ← (byte) main::sub#2 [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 - [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 + [8] if((byte) main::sub#1!=(const byte) SZ+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 [9] return diff --git a/src/test/ref/array-length-symbolic-min.log b/src/test/ref/array-length-symbolic-min.log index f9b8353f4..8dba816cf 100644 --- a/src/test/ref/array-length-symbolic-min.log +++ b/src/test/ref/array-length-symbolic-min.log @@ -3,21 +3,21 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) SZ#0 ← (number) $f - (byte[SZ#0]) items ← { fill( SZ#0, 0) } + (byte) SZ ← (number) $f + (byte[SZ]) items ← { fill( SZ, 0) } to:@1 (void()) main() main: scope:[main] from @1 - (byte*) main::cur_item#0 ← (byte[SZ#0]) items + (byte*) main::cur_item#0 ← (byte[SZ]) items (byte) main::sub#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte*) main::cur_item#1 ← phi( main/(byte*) main::cur_item#0 main::@1/(byte*) main::cur_item#1 ) (byte) main::sub#2 ← phi( main/(byte) main::sub#0 main::@1/(byte) main::sub#1 ) *((byte*) main::cur_item#1 + (byte) main::sub#2) ← (byte) main::sub#2 - (byte) main::sub#1 ← (byte) main::sub#2 + rangenext(0,SZ#0) - (bool~) main::$0 ← (byte) main::sub#1 != rangelast(0,SZ#0) + (byte) main::sub#1 ← (byte) main::sub#2 + rangenext(0,SZ) + (bool~) main::$0 ← (byte) main::sub#1 != rangelast(0,SZ) if((bool~) main::$0) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 @@ -36,8 +36,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) SZ -(byte) SZ#0 -(byte[SZ#0]) items +(byte[SZ]) items (void()) main() (bool~) main::$0 (label) main::@1 @@ -50,9 +49,9 @@ SYMBOL TABLE SSA (byte) main::sub#1 (byte) main::sub#2 -Adding number conversion cast (unumber) $f in (byte) SZ#0 ← (number) $f +Adding number conversion cast (unumber) $f in (byte) SZ ← (number) $f Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) SZ#0 ← (unumber)(number) $f +Inlining cast (byte) SZ ← (unumber)(number) $f Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $f Successful SSA optimization PassNCastSimplification @@ -60,30 +59,30 @@ Finalized unsigned number type (byte) $f Successful SSA optimization PassNFinalizeNumberTypeConversions Identical Phi Values (byte*) main::cur_item#1 (byte*) main::cur_item#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$0 [8] if((byte) main::sub#1!=rangelast(0,SZ#0)) goto main::@1 +Simple Condition (bool~) main::$0 [8] if((byte) main::sub#1!=rangelast(0,SZ)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) SZ#0 = $f +Constant (const byte) SZ = $f Constant (const byte) main::sub#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified { fill( SZ#0, 0) } in [1] (byte[SZ#0]) items ← { fill( SZ#0, 0) } +Constant value identified { fill( SZ, 0) } in [1] (byte[SZ]) items ← { fill( SZ, 0) } Successful SSA optimization Pass2ConstantValues Resolved ranged next value [6] main::sub#1 ← ++ main::sub#2 to ++ -Resolved ranged comparison value [8] if(main::sub#1!=rangelast(0,SZ#0)) goto main::@1 to (const byte) SZ#0+(number) 1 -Adding number conversion cast (unumber) SZ#0+1 in if((byte) main::sub#1!=(const byte) SZ#0+(number) 1) goto main::@1 -Adding number conversion cast (unumber) 1 in if((byte) main::sub#1!=(unumber)(const byte) SZ#0+(number) 1) goto main::@1 +Resolved ranged comparison value [8] if(main::sub#1!=rangelast(0,SZ)) goto main::@1 to (const byte) SZ+(number) 1 +Adding number conversion cast (unumber) SZ+1 in if((byte) main::sub#1!=(const byte) SZ+(number) 1) goto main::@1 +Adding number conversion cast (unumber) 1 in if((byte) main::sub#1!=(unumber)(const byte) SZ+(number) 1) goto main::@1 Successful SSA optimization PassNAddNumberTypeConversions -Simplifying constant integer cast (const byte) SZ#0+(unumber)(number) 1 +Simplifying constant integer cast (const byte) SZ+(unumber)(number) 1 Simplifying constant integer cast 1 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant (const byte[SZ#0]) items = { fill( SZ#0, 0) } +Constant (const byte[SZ]) items = { fill( SZ, 0) } Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) main::cur_item#0 = items Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::sub#0 Constant inlined main::sub#0 = (byte) 0 -Constant inlined main::cur_item#0 = (const byte[SZ#0]) items +Constant inlined main::cur_item#0 = (const byte[SZ]) items Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@3(between main::@1 and main::@1) Adding NOP phi() at start of @begin @@ -121,9 +120,9 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::sub#2 ← phi( main/(byte) 0 main::@1/(byte) main::sub#1 ) - [6] *((const byte[SZ#0]) items + (byte) main::sub#2) ← (byte) main::sub#2 + [6] *((const byte[SZ]) items + (byte) main::sub#2) ← (byte) main::sub#2 [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 - [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 + [8] if((byte) main::sub#1!=(const byte) SZ+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 [9] return @@ -131,7 +130,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte) SZ (void()) main() (byte*) main::cur_item (byte) main::sub @@ -186,13 +184,13 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte[SZ#0]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [6] *((const byte[SZ]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z sub tya sta items,y // [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuz1=_inc_vbuz1 inc.z sub - // [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + // [8] if((byte) main::sub#1!=(const byte) SZ+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 lda #SZ+1 cmp.z sub bne b1_from_b1 @@ -254,12 +252,12 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte[SZ#0]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [6] *((const byte[SZ]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta items,x // [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuxx=_inc_vbuxx inx - // [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + // [8] if((byte) main::sub#1!=(const byte) SZ+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #SZ+1 bne b1_from_b1 jmp breturn @@ -300,9 +298,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte) SZ -(const byte) SZ#0 SZ = (byte) $f -(const byte[SZ#0]) items items = { fill( SZ#0, 0) } +(const byte) SZ SZ = (byte) $f +(const byte[SZ]) items items = { fill( SZ, 0) } (void()) main() (label) main::@1 (label) main::@return @@ -343,13 +340,13 @@ main: { // main::@1 b1: // cur_item[sub] = sub - // [6] *((const byte[SZ#0]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [6] *((const byte[SZ]) items + (byte) main::sub#2) ← (byte) main::sub#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta items,x // for( byte sub: 0..SZ) // [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuxx=_inc_vbuxx inx - // [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + // [8] if((byte) main::sub#1!=(const byte) SZ+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #SZ+1 bne b1 // main::@return diff --git a/src/test/ref/array-length-symbolic-min.sym b/src/test/ref/array-length-symbolic-min.sym index cd6f0af78..9f6b29cd4 100644 --- a/src/test/ref/array-length-symbolic-min.sym +++ b/src/test/ref/array-length-symbolic-min.sym @@ -1,9 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte) SZ -(const byte) SZ#0 SZ = (byte) $f -(const byte[SZ#0]) items items = { fill( SZ#0, 0) } +(const byte) SZ SZ = (byte) $f +(const byte[SZ]) items items = { fill( SZ, 0) } (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/array-length-symbolic.cfg b/src/test/ref/array-length-symbolic.cfg index a2df57352..3a8c337fa 100644 --- a/src/test/ref/array-length-symbolic.cfg +++ b/src/test/ref/array-length-symbolic.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@3 - [5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items main::@3/(byte*) main::cur_item#1 ) + [5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT*ITEM_SIZE]) items main::@3/(byte*) main::cur_item#1 ) [5] (byte) main::item#4 ← phi( main/(byte) 0 main::@3/(byte) main::item#1 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 @@ -22,12 +22,12 @@ main::@2: scope:[main] from main::@1 main::@2 [8] (byte~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2 [9] *((byte*) main::cur_item#4 + (byte) main::sub#2) ← (byte~) main::$3 [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 - [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 + [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE-(byte) 1+(byte) 1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 + [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE [13] (byte) main::item#1 ← ++ (byte) main::item#4 - [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 + [14] if((byte) main::item#1!=(const byte) ITEM_COUNT-(byte) 1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@3 [15] return diff --git a/src/test/ref/array-length-symbolic.log b/src/test/ref/array-length-symbolic.log index a0788a971..684ed6350 100644 --- a/src/test/ref/array-length-symbolic.log +++ b/src/test/ref/array-length-symbolic.log @@ -4,22 +4,22 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) ITEM_COUNT#0 ← (number) 3 - (byte) ITEM_SIZE#0 ← (number) 5 - (byte~) $0 ← (byte) ITEM_COUNT#0 * (byte) ITEM_SIZE#0 + (byte) ITEM_COUNT ← (number) 3 + (byte) ITEM_SIZE ← (number) 5 + (byte~) $0 ← (byte) ITEM_COUNT * (byte) ITEM_SIZE (byte[$0]) items ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } to:@1 (void()) main() main: scope:[main] from @1 (byte*) main::cur_item#0 ← (byte[$0]) items - (number~) main::$0 ← (byte) ITEM_COUNT#0 - (number) 1 + (number~) main::$0 ← (byte) ITEM_COUNT - (number) 1 (byte) main::item#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@3 (byte*) main::cur_item#4 ← phi( main/(byte*) main::cur_item#0 main::@3/(byte*) main::cur_item#1 ) (byte) main::item#4 ← phi( main/(byte) main::item#0 main::@3/(byte) main::item#1 ) - (number~) main::$1 ← (byte) ITEM_SIZE#0 - (number) 1 + (number~) main::$1 ← (byte) ITEM_SIZE - (number) 1 (byte) main::sub#0 ← (byte) 0 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 @@ -36,7 +36,7 @@ main::@2: scope:[main] from main::@1 main::@2 main::@3: scope:[main] from main::@2 (byte) main::item#3 ← phi( main::@2/(byte) main::item#2 ) (byte*) main::cur_item#3 ← phi( main::@2/(byte*) main::cur_item#2 ) - (byte*) main::cur_item#1 ← (byte*) main::cur_item#3 + (byte) ITEM_SIZE#0 + (byte*) main::cur_item#1 ← (byte*) main::cur_item#3 + (byte) ITEM_SIZE (byte) main::item#1 ← (byte) main::item#3 + rangenext(0,main::$0) (bool~) main::$5 ← (byte) main::item#1 != rangelast(0,main::$0) if((bool~) main::$5) goto main::@1 @@ -58,9 +58,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) ITEM_COUNT -(byte) ITEM_COUNT#0 (byte) ITEM_SIZE -(byte) ITEM_SIZE#0 (byte[$0]) items (void()) main() (number~) main::$0 @@ -90,20 +88,20 @@ SYMBOL TABLE SSA (byte) main::sub#1 (byte) main::sub#2 -Adding number conversion cast (unumber) 3 in (byte) ITEM_COUNT#0 ← (number) 3 -Adding number conversion cast (unumber) 5 in (byte) ITEM_SIZE#0 ← (number) 5 -Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) ITEM_COUNT#0 - (number) 1 -Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) ITEM_COUNT#0 - (unumber)(number) 1 -Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (byte) ITEM_SIZE#0 - (number) 1 -Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) ITEM_SIZE#0 - (unumber)(number) 1 +Adding number conversion cast (unumber) 3 in (byte) ITEM_COUNT ← (number) 3 +Adding number conversion cast (unumber) 5 in (byte) ITEM_SIZE ← (number) 5 +Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) ITEM_COUNT - (number) 1 +Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) ITEM_COUNT - (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (byte) ITEM_SIZE - (number) 1 +Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) ITEM_SIZE - (unumber)(number) 1 Adding number conversion cast (unumber) $10 in (number~) main::$2 ← (byte) main::item#2 * (number) $10 Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::item#2 * (unumber)(number) $10 Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber~) main::$2 | (byte) main::sub#2 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[$0]) items ← (byte[$0]){ (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte) ITEM_COUNT#0 ← (unumber)(number) 3 -Inlining cast (byte) ITEM_SIZE#0 ← (unumber)(number) 5 +Inlining cast (byte) ITEM_COUNT ← (unumber)(number) 3 +Inlining cast (byte) ITEM_SIZE ← (unumber)(number) 5 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 3 Simplifying constant integer cast 5 @@ -132,8 +130,8 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) $10 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) main::$0 ← (byte) ITEM_COUNT#0 - (byte) 1 -Inferred type updated to byte in (unumber~) main::$1 ← (byte) ITEM_SIZE#0 - (byte) 1 +Inferred type updated to byte in (unumber~) main::$0 ← (byte) ITEM_COUNT - (byte) 1 +Inferred type updated to byte in (unumber~) main::$1 ← (byte) ITEM_SIZE - (byte) 1 Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::item#2 * (byte) $10 Inferred type updated to byte in (unumber~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2 Alias (byte*) main::cur_item#2 = (byte*) main::cur_item#3 @@ -147,21 +145,21 @@ Simple Condition (bool~) main::$5 [21] if((byte) main::item#1!=rangelast(0,main: Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (byte[$0]) { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte) ITEM_COUNT#0 = 3 -Constant (const byte) ITEM_SIZE#0 = 5 +Constant (const byte) ITEM_COUNT = 3 +Constant (const byte) ITEM_SIZE = 5 Constant (const byte[$0]) items = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } Constant (const byte) main::item#0 = 0 Constant (const byte) main::sub#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) main::cur_item#0 = items Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [0] (byte~) $0 ← (const byte) ITEM_COUNT#0 * (const byte) ITEM_SIZE#0 -Constant right-side identified [1] (byte~) main::$0 ← (const byte) ITEM_COUNT#0 - (byte) 1 -Constant right-side identified [3] (byte~) main::$1 ← (const byte) ITEM_SIZE#0 - (byte) 1 +Constant right-side identified [0] (byte~) $0 ← (const byte) ITEM_COUNT * (const byte) ITEM_SIZE +Constant right-side identified [1] (byte~) main::$0 ← (const byte) ITEM_COUNT - (byte) 1 +Constant right-side identified [3] (byte~) main::$1 ← (const byte) ITEM_SIZE - (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) $0 = ITEM_COUNT#0*ITEM_SIZE#0 -Constant (const byte) main::$0 = ITEM_COUNT#0-1 -Constant (const byte) main::$1 = ITEM_SIZE#0-1 +Constant (const byte) $0 = ITEM_COUNT*ITEM_SIZE +Constant (const byte) main::$0 = ITEM_COUNT-1 +Constant (const byte) main::$1 = ITEM_SIZE-1 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [8] main::sub#1 ← ++ main::sub#2 to ++ Resolved ranged comparison value [9] if(main::sub#1!=rangelast(0,main::$1)) goto main::@2 to (const byte) main::$1+(number) 1 @@ -186,10 +184,10 @@ Inlining constant with var siblings (const byte) main::item#0 Inlining constant with var siblings (const byte) main::sub#0 Inlining constant with var siblings (const byte*) main::cur_item#0 Constant inlined main::sub#0 = (byte) 0 -Constant inlined main::$1 = (const byte) ITEM_SIZE#0-(byte) 1 -Constant inlined $0 = (const byte) ITEM_COUNT#0*(const byte) ITEM_SIZE#0 -Constant inlined main::cur_item#0 = (const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items -Constant inlined main::$0 = (const byte) ITEM_COUNT#0-(byte) 1 +Constant inlined main::$1 = (const byte) ITEM_SIZE-(byte) 1 +Constant inlined $0 = (const byte) ITEM_COUNT*(const byte) ITEM_SIZE +Constant inlined main::cur_item#0 = (const byte[ITEM_COUNT*ITEM_SIZE]) items +Constant inlined main::$0 = (const byte) ITEM_COUNT-(byte) 1 Constant inlined main::item#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@3 and main::@1) @@ -231,7 +229,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@3 - [5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items main::@3/(byte*) main::cur_item#1 ) + [5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT*ITEM_SIZE]) items main::@3/(byte*) main::cur_item#1 ) [5] (byte) main::item#4 ← phi( main/(byte) 0 main::@3/(byte) main::item#1 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 @@ -240,12 +238,12 @@ main::@2: scope:[main] from main::@1 main::@2 [8] (byte~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2 [9] *((byte*) main::cur_item#4 + (byte) main::sub#2) ← (byte~) main::$3 [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 - [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 + [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE-(byte) 1+(byte) 1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 + [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE [13] (byte) main::item#1 ← ++ (byte) main::item#4 - [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 + [14] if((byte) main::item#1!=(const byte) ITEM_COUNT-(byte) 1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@3 [15] return @@ -253,8 +251,6 @@ main::@return: scope:[main] from main::@3 VARIABLE REGISTER WEIGHTS -(byte) ITEM_COUNT -(byte) ITEM_SIZE (void()) main() (byte~) main::$2 202.0 (byte~) main::$3 202.0 @@ -323,7 +319,7 @@ main: { .label item = 2 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT*ITEM_SIZE]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #items @@ -368,14 +364,14 @@ main: { sta (cur_item),y // [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuz1=_inc_vbuz1 inc.z sub - // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuz1_neq_vbuc1_then_la1 + // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE-(byte) 1+(byte) 1) goto main::@2 -- vbuz1_neq_vbuc1_then_la1 lda #ITEM_SIZE-1+1 cmp.z sub bne b2_from_b2 jmp b3 // main::@3 b3: - // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 -- pbuz1=pbuz1_plus_vbuc1 + // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE -- pbuz1=pbuz1_plus_vbuc1 lda #ITEM_SIZE clc adc.z cur_item @@ -385,7 +381,7 @@ main: { !: // [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuz1=_inc_vbuz1 inc.z item - // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 lda #ITEM_COUNT-1+1 cmp.z item bne b1_from_b3 @@ -402,9 +398,9 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::item#4 main::item#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::sub#2 main::sub#1 ] -Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a +Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a -Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a +Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::item#4 main::item#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_WORD:3 [ main::cur_item#4 main::cur_item#1 ] : zp ZP_WORD:3 , Potential registers zp ZP_BYTE:5 [ main::sub#2 main::sub#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , @@ -452,7 +448,7 @@ main: { .label cur_item = 2 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT*ITEM_SIZE]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #items @@ -491,13 +487,13 @@ main: { sta (cur_item),y // [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuyy=_inc_vbuyy iny - // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1 + // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1 cpy #ITEM_SIZE-1+1 bne b2_from_b2 jmp b3 // main::@3 b3: - // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 -- pbuz1=pbuz1_plus_vbuc1 + // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE -- pbuz1=pbuz1_plus_vbuc1 lda #ITEM_SIZE clc adc.z cur_item @@ -507,7 +503,7 @@ main: { !: // [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuxx=_inc_vbuxx inx - // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #ITEM_COUNT-1+1 bne b1_from_b3 jmp breturn @@ -555,11 +551,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte) ITEM_COUNT -(const byte) ITEM_COUNT#0 ITEM_COUNT = (byte) 3 -(byte) ITEM_SIZE -(const byte) ITEM_SIZE#0 ITEM_SIZE = (byte) 5 -(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items items = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } +(const byte) ITEM_COUNT ITEM_COUNT = (byte) 3 +(const byte) ITEM_SIZE ITEM_SIZE = (byte) 5 +(const byte[ITEM_COUNT*ITEM_SIZE]) items items = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (void()) main() (byte~) main::$2 reg byte a 202.0 (byte~) main::$3 reg byte a 202.0 @@ -608,7 +602,7 @@ Score: 3416 main: { .label cur_item = 2 // [5] phi from main to main::@1 [phi:main->main::@1] - // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cur_item#4 = (const byte[ITEM_COUNT*ITEM_SIZE]) items [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #items @@ -644,12 +638,12 @@ main: { // for( byte sub: 0..ITEM_SIZE-1) // [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuyy=_inc_vbuyy iny - // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1 + // [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1 cpy #ITEM_SIZE-1+1 bne b2 // main::@3 // cur_item += ITEM_SIZE - // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 -- pbuz1=pbuz1_plus_vbuc1 + // [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE -- pbuz1=pbuz1_plus_vbuc1 lda #ITEM_SIZE clc adc.z cur_item @@ -660,7 +654,7 @@ main: { // for( byte item: 0..ITEM_COUNT-1) // [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuxx=_inc_vbuxx inx - // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + // [14] if((byte) main::item#1!=(const byte) ITEM_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #ITEM_COUNT-1+1 bne b1 // main::@return diff --git a/src/test/ref/array-length-symbolic.sym b/src/test/ref/array-length-symbolic.sym index 8aedf33c0..4de2d0ce6 100644 --- a/src/test/ref/array-length-symbolic.sym +++ b/src/test/ref/array-length-symbolic.sym @@ -1,11 +1,9 @@ (label) @1 (label) @begin (label) @end -(byte) ITEM_COUNT -(const byte) ITEM_COUNT#0 ITEM_COUNT = (byte) 3 -(byte) ITEM_SIZE -(const byte) ITEM_SIZE#0 ITEM_SIZE = (byte) 5 -(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items items = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } +(const byte) ITEM_COUNT ITEM_COUNT = (byte) 3 +(const byte) ITEM_SIZE ITEM_SIZE = (byte) 5 +(const byte[ITEM_COUNT*ITEM_SIZE]) items items = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (void()) main() (byte~) main::$2 reg byte a 202.0 (byte~) main::$3 reg byte a 202.0 diff --git a/src/test/ref/arrays-init-kasm-0.cfg b/src/test/ref/arrays-init-kasm-0.cfg index 5aae69741..38edb3e35 100644 --- a/src/test/ref/arrays-init-kasm-0.cfg +++ b/src/test/ref/arrays-init-kasm-0.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) + [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/arrays-init-kasm-0.log b/src/test/ref/arrays-init-kasm-0.log index 8090f3e12..84b95b80d 100644 --- a/src/test/ref/arrays-init-kasm-0.log +++ b/src/test/ref/arrays-init-kasm-0.log @@ -4,12 +4,12 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte[$100]) SINTAB ← kickasm {{ .fill 256, 128 + 128*sin(i*2*PI/256) }} - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() main: scope:[main] from @1 - *((byte*) SCREEN#0 + (number) 0) ← *((byte[$100]) SINTAB + (number) 0) + *((byte*) SCREEN + (number) 0) ← *((byte[$100]) SINTAB + (number) 0) to:main::@return main::@return: scope:[main] from main return @@ -27,15 +27,14 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte[$100]) SINTAB (void()) main() (label) main::@return -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← *((byte[$100]) SINTAB + (number) 0) -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← *((byte[$100]) SINTAB + (unumber)(number) 0) +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← *((byte[$100]) SINTAB + (number) 0) +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← *((byte[$100]) SINTAB + (unumber)(number) 0) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -46,10 +45,10 @@ Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant (const byte[$100]) SINTAB = kickasm {{ .fill 256, 128 + 128*sin(i*2*PI/256) }} -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero SINTAB in [2] *((const byte*) SCREEN#0 + (byte) 0) ← *((const byte[$100]) SINTAB + (byte) 0) -Simplifying expression containing zero SCREEN#0 in [2] *((const byte*) SCREEN#0 + (byte) 0) ← *((const byte[$100]) SINTAB) +Simplifying expression containing zero SINTAB in [2] *((const byte*) SCREEN + (byte) 0) ← *((const byte[$100]) SINTAB + (byte) 0) +Simplifying expression containing zero SCREEN in [2] *((const byte*) SCREEN + (byte) 0) ← *((const byte[$100]) SINTAB) Successful SSA optimization PassNSimplifyExpressionWithZero Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -78,7 +77,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) + [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) to:main::@return main::@return: scope:[main] from main [5] return @@ -86,7 +85,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() Initial phi equivalence classes @@ -118,7 +116,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 lda SINTAB sta SCREEN jmp breturn @@ -134,7 +132,7 @@ SINTAB: REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -168,7 +166,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 lda SINTAB sta SCREEN jmp breturn @@ -205,8 +203,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$100]) SINTAB SINTAB = kickasm {{ .fill 256, 128 + 128*sin(i*2*PI/256) }} (void()) main() @@ -234,7 +231,7 @@ Score: 14 // main main: { // SCREEN[0] = SINTAB[0] - // [4] *((const byte*) SCREEN#0) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) SCREEN) ← *((const byte[$100]) SINTAB) -- _deref_pbuc1=_deref_pbuc2 lda SINTAB sta SCREEN // main::@return diff --git a/src/test/ref/arrays-init-kasm-0.sym b/src/test/ref/arrays-init-kasm-0.sym index 3a4aec0af..1e7bd49c0 100644 --- a/src/test/ref/arrays-init-kasm-0.sym +++ b/src/test/ref/arrays-init-kasm-0.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$100]) SINTAB SINTAB = kickasm {{ .fill 256, 128 + 128*sin(i*2*PI/256) }} (void()) main() diff --git a/src/test/ref/arrays-init.cfg b/src/test/ref/arrays-init.cfg index 728939288..33741b403 100644 --- a/src/test/ref/arrays-init.cfg +++ b/src/test/ref/arrays-init.cfg @@ -11,9 +11,9 @@ (void()) main() main: scope:[main] from @1 [4] *((const byte[3]) b) ← (byte) 'c' - [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) - [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) - [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) + [5] *((const byte*) SCREEN) ← *((const byte[3]) b) + [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) + [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) to:main::@return main::@return: scope:[main] from main [8] return diff --git a/src/test/ref/arrays-init.log b/src/test/ref/arrays-init.log index 274bc207a..14fae118d 100644 --- a/src/test/ref/arrays-init.log +++ b/src/test/ref/arrays-init.log @@ -5,16 +5,16 @@ CONTROL FLOW GRAPH SSA (byte[3]) b ← { fill( 3, 0) } (byte[]) c ← { (byte) 'c', (byte) 'm', (byte) 'l' } (byte[]) d ← (const string) $0 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() main: scope:[main] from @1 *((byte[3]) b + (number) 0) ← (byte) 'c' - *((byte*) SCREEN#0) ← *((byte[3]) b + (number) 0) - (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) 1 + *((byte*) SCREEN) ← *((byte[3]) b + (number) 0) + (byte*~) main::$0 ← (byte*) SCREEN + (number) 1 *((byte*~) main::$0) ← *((byte[]) c + (number) 1) - (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) 2 + (byte*~) main::$1 ← (byte*) SCREEN + (number) 2 *((byte*~) main::$1) ← *((byte[]) d + (number) 2) to:main::@return main::@return: scope:[main] from main @@ -34,7 +34,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte[3]) b (byte[]) c (byte[]) d @@ -44,13 +43,13 @@ SYMBOL TABLE SSA (label) main::@return Adding number conversion cast (unumber) 0 in *((byte[3]) b + (number) 0) ← (byte) 'c' -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0) ← *((byte[3]) b + (number) 0) -Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) 1 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN) ← *((byte[3]) b + (number) 0) +Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) SCREEN + (number) 1 Adding number conversion cast (unumber) 1 in *((byte*~) main::$0) ← *((byte[]) c + (number) 1) -Adding number conversion cast (unumber) 2 in (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) 2 +Adding number conversion cast (unumber) 2 in (byte*~) main::$1 ← (byte*) SCREEN + (number) 2 Adding number conversion cast (unumber) 2 in *((byte*~) main::$1) ← *((byte[]) d + (number) 2) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -74,23 +73,23 @@ Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte[3]) b = { fill( 3, 0) } Constant (const byte[]) c = { 'c', 'm', 'l' } Constant (const byte[]) d = $0 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$0) ← *((const byte[]) c + (byte) 1) -- *(SCREEN#0 + 1) -Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$1) ← *((const byte[]) d + (byte) 2) -- *(SCREEN#0 + 2) +Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$0) ← *((const byte[]) c + (byte) 1) -- *(SCREEN + 1) +Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$1) ← *((const byte[]) d + (byte) 2) -- *(SCREEN + 2) Successful SSA optimization Pass2InlineDerefIdx Simplifying expression containing zero b in [4] *((const byte[3]) b + (byte) 0) ← (byte) 'c' -Simplifying expression containing zero b in [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b + (byte) 0) +Simplifying expression containing zero b in [5] *((const byte*) SCREEN) ← *((const byte[3]) b + (byte) 0) Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused variable (byte*~) main::$0 and assignment [2] (byte*~) main::$0 ← (const byte*) SCREEN#0 + (byte) 1 -Eliminating unused variable (byte*~) main::$1 and assignment [4] (byte*~) main::$1 ← (const byte*) SCREEN#0 + (byte) 2 +Eliminating unused variable (byte*~) main::$0 and assignment [2] (byte*~) main::$0 ← (const byte*) SCREEN + (byte) 1 +Eliminating unused variable (byte*~) main::$1 and assignment [4] (byte*~) main::$1 ← (const byte*) SCREEN + (byte) 2 Successful SSA optimization PassNEliminateUnusedVars Constant inlined $0 = (const byte[]) d Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(c+1) -Consolidated array index constant in *(SCREEN#0+1) +Consolidated array index constant in *(SCREEN+1) Consolidated array index constant in *(d+2) -Consolidated array index constant in *(SCREEN#0+2) +Consolidated array index constant in *(SCREEN+2) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -120,9 +119,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 [4] *((const byte[3]) b) ← (byte) 'c' - [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) - [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) - [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) + [5] *((const byte*) SCREEN) ← *((const byte[3]) b) + [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) + [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) to:main::@return main::@return: scope:[main] from main [8] return @@ -130,7 +129,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() Initial phi equivalence classes @@ -164,13 +162,13 @@ main: { // [4] *((const byte[3]) b) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta b - // [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) SCREEN) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 lda b sta SCREEN - // [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda c+1 sta SCREEN+1 - // [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda d+2 sta SCREEN+2 jmp breturn @@ -186,9 +184,9 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte[3]) b) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN) ← *((const byte[3]) b) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -224,13 +222,13 @@ main: { // [4] *((const byte[3]) b) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta b - // [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) SCREEN) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 lda b sta SCREEN - // [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda c+1 sta SCREEN+1 - // [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda d+2 sta SCREEN+2 jmp breturn @@ -268,8 +266,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[3]) b b = { fill( 3, 0) } (const byte[]) c c = { (byte) 'c', (byte) 'm', (byte) 'l' } (const byte[]) d d = (string) "cml"z @@ -301,14 +298,14 @@ main: { lda #'c' sta b // *SCREEN = b[0] - // [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) SCREEN) ← *((const byte[3]) b) -- _deref_pbuc1=_deref_pbuc2 sta SCREEN // *(SCREEN+1) = c[1] - // [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 1) ← *((const byte[]) c+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda c+1 sta SCREEN+1 // *(SCREEN+2) = d[2] - // [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) SCREEN+(byte) 2) ← *((const byte[]) d+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda d+2 sta SCREEN+2 // main::@return diff --git a/src/test/ref/arrays-init.sym b/src/test/ref/arrays-init.sym index f72749400..393b4c3c0 100644 --- a/src/test/ref/arrays-init.sym +++ b/src/test/ref/arrays-init.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[3]) b b = { fill( 3, 0) } (const byte[]) c c = { (byte) 'c', (byte) 'm', (byte) 'l' } (const byte[]) d d = (string) "cml"z diff --git a/src/test/ref/asm-mnemonic-names.cfg b/src/test/ref/asm-mnemonic-names.cfg index c92306d50..3158c0210 100644 --- a/src/test/ref/asm-mnemonic-names.cfg +++ b/src/test/ref/asm-mnemonic-names.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) lda) ← (const byte) main::jmp#0 + [4] *((const byte*) lda) ← (const byte) main::jmp [5] call bne to:main::@1 main::@1: scope:[main] from main @@ -22,7 +22,7 @@ main::@return: scope:[main] from main::@1 (void()) bne((byte) bne::jsr) bne: scope:[bne] from main - [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 + [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp to:bne::@return bne::@return: scope:[bne] from bne [9] return diff --git a/src/test/ref/asm-mnemonic-names.log b/src/test/ref/asm-mnemonic-names.log index 7f62ff3c5..7dd4496f7 100644 --- a/src/test/ref/asm-mnemonic-names.log +++ b/src/test/ref/asm-mnemonic-names.log @@ -8,9 +8,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (byte) main::jmp#0 ← (number) 1 - *((byte*) lda) ← (byte) main::jmp#0 - (byte) bne::jsr#0 ← (byte) main::jmp#0 + (byte) main::jmp ← (number) 1 + *((byte*) lda) ← (byte) main::jmp + (byte) bne::jsr#0 ← (byte) main::jmp call bne to:main::@1 main::@1: scope:[main] from main @@ -50,13 +50,12 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte) main::jmp -(byte) main::jmp#0 -Adding number conversion cast (unumber) 1 in (byte) main::jmp#0 ← (number) 1 +Adding number conversion cast (unumber) 1 in (byte) main::jmp ← (number) 1 Adding number conversion cast (unumber) 1 in *((byte*) lda + (number) 1) ← (byte) bne::jsr#1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) lda ← (byte*)(number) $400 -Inlining cast (byte) main::jmp#0 ← (unumber)(number) 1 +Inlining cast (byte) main::jmp ← (unumber)(number) 1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -68,11 +67,11 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Identical Phi Values (byte) bne::jsr#1 (byte) bne::jsr#0 Successful SSA optimization Pass2IdenticalPhiElimination Constant (const byte*) lda = (byte*) 1024 -Constant (const byte) main::jmp#0 = 1 +Constant (const byte) main::jmp = 1 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) bne::jsr#0 = main::jmp#0 +Constant (const byte) bne::jsr#0 = main::jmp Successful SSA optimization Pass2ConstantIdentification -Constant inlined bne::jsr#0 = (const byte) main::jmp#0 +Constant inlined bne::jsr#0 = (const byte) main::jmp Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(lda+1) Successful SSA optimization Pass2ConstantAdditionElimination @@ -105,7 +104,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) lda) ← (const byte) main::jmp#0 + [4] *((const byte*) lda) ← (const byte) main::jmp [5] call bne to:main::@1 main::@1: scope:[main] from main @@ -117,7 +116,7 @@ main::@return: scope:[main] from main::@1 (void()) bne((byte) bne::jsr) bne: scope:[bne] from main - [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 + [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp to:bne::@return bne::@return: scope:[bne] from bne [9] return @@ -128,7 +127,6 @@ VARIABLE REGISTER WEIGHTS (void()) bne((byte) bne::jsr) (byte) bne::jsr (void()) main() -(byte) main::jmp Initial phi equivalence classes Complete equivalence classes @@ -161,7 +159,7 @@ bend: // main main: { .label jmp = 1 - // [4] *((const byte*) lda) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) lda) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #jmp sta lda // [5] call bne @@ -183,7 +181,7 @@ main: { } // bne bne: { - // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #main.jmp sta lda+1 jmp breturn @@ -195,9 +193,9 @@ bne: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) lda) ← (const byte) main::jmp#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) lda) ← (const byte) main::jmp [ ] ( main:2 [ ] ) always clobbers reg byte a Statement asm { ldaa jmpa bnea a: } always clobbers reg byte a -Statement [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 [ ] ( main:2::bne:5 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp [ ] ( main:2::bne:5 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -235,7 +233,7 @@ bend: // main main: { .label jmp = 1 - // [4] *((const byte*) lda) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) lda) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #jmp sta lda // [5] call bne @@ -257,7 +255,7 @@ main: { } // bne bne: { - // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #main.jmp sta lda+1 jmp breturn @@ -304,8 +302,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte) main::jmp -(const byte) main::jmp#0 jmp = (byte) 1 +(const byte) main::jmp jmp = (byte) 1 @@ -331,7 +328,7 @@ Score: 40 main: { .label jmp = 1 // *lda = jmp - // [4] *((const byte*) lda) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) lda) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #jmp sta lda // bne(jmp) @@ -352,7 +349,7 @@ main: { // bne bne: { // lda[1] = jsr - // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) lda+(byte) 1) ← (const byte) main::jmp -- _deref_pbuc1=vbuc2 lda #main.jmp sta lda+1 // bne::@return diff --git a/src/test/ref/asm-mnemonic-names.sym b/src/test/ref/asm-mnemonic-names.sym index 2a6ab36fb..9784003c6 100644 --- a/src/test/ref/asm-mnemonic-names.sym +++ b/src/test/ref/asm-mnemonic-names.sym @@ -8,6 +8,5 @@ (void()) main() (label) main::@1 (label) main::@return -(byte) main::jmp -(const byte) main::jmp#0 jmp = (byte) 1 +(const byte) main::jmp jmp = (byte) 1 diff --git a/src/test/ref/assignment-chained.cfg b/src/test/ref/assignment-chained.cfg index 0af5b9ce1..c1ec7894d 100644 --- a/src/test/ref/assignment-chained.cfg +++ b/src/test/ref/assignment-chained.cfg @@ -10,13 +10,13 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (byte) 'c' - [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' - [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' - [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) - [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 - [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' - [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' + [4] *((const byte*) main::screen) ← (byte) 'c' + [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' + [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' + [7] (byte) main::a#2 ← *((const byte*) main::screen+(byte) 1) + [8] *((const byte*) main::screen+(byte) $29) ← (byte) main::a#2 + [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' + [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' to:main::@return main::@return: scope:[main] from main [11] return diff --git a/src/test/ref/assignment-chained.log b/src/test/ref/assignment-chained.log index e3f9ab90a..98d79976f 100644 --- a/src/test/ref/assignment-chained.log +++ b/src/test/ref/assignment-chained.log @@ -6,18 +6,18 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::a#0 ← (byte) 0 (byte) main::a#1 ← (byte) 'c' - *((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1 - *((byte*) main::screen#0 + (number) $28) ← (byte) main::a#1 - *((byte*) main::screen#0 + (number) 1) ← (byte) 'm' - (byte) main::a#2 ← *((byte*) main::screen#0 + (number) 1) - *((byte*) main::screen#0 + (number) $29) ← (byte) main::a#2 + *((byte*) main::screen + (number) 0) ← (byte) main::a#1 + *((byte*) main::screen + (number) $28) ← (byte) main::a#1 + *((byte*) main::screen + (number) 1) ← (byte) 'm' + (byte) main::a#2 ← *((byte*) main::screen + (number) 1) + *((byte*) main::screen + (number) $29) ← (byte) main::a#2 (byte) main::a#3 ← (byte) 'l' (number~) main::$0 ← (number) 1 + (byte) main::a#3 - *((byte*) main::screen#0 + (number) 2) ← (number~) main::$0 - *((byte*) main::screen#0 + (number) $2a) ← (byte) main::a#3 + *((byte*) main::screen + (number) 2) ← (number~) main::$0 + *((byte*) main::screen + (number) $2a) ← (byte) main::a#3 to:main::@return main::@return: scope:[main] from main return @@ -43,18 +43,17 @@ SYMBOL TABLE SSA (byte) main::a#2 (byte) main::a#3 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1 -Adding number conversion cast (unumber) $28 in *((byte*) main::screen#0 + (number) $28) ← (byte) main::a#1 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte) 'm' -Adding number conversion cast (unumber) $29 in *((byte*) main::screen#0 + (number) $29) ← (byte) main::a#2 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) main::a#1 +Adding number conversion cast (unumber) $28 in *((byte*) main::screen + (number) $28) ← (byte) main::a#1 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← (byte) 'm' +Adding number conversion cast (unumber) $29 in *((byte*) main::screen + (number) $29) ← (byte) main::a#2 Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (number) 1 + (byte) main::a#3 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 1 + (byte) main::a#3 -Adding number conversion cast (unumber) 2 in *((byte*) main::screen#0 + (number) 2) ← (unumber~) main::$0 -Adding number conversion cast (unumber) $2a in *((byte*) main::screen#0 + (number) $2a) ← (byte) main::a#3 +Adding number conversion cast (unumber) 2 in *((byte*) main::screen + (number) 2) ← (unumber~) main::$0 +Adding number conversion cast (unumber) $2a in *((byte*) main::screen + (number) $2a) ← (byte) main::a#3 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -74,12 +73,12 @@ Finalized unsigned number type (byte) 2 Finalized unsigned number type (byte) $2a Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to byte in (unumber~) main::$0 ← (byte) 1 + (byte) main::a#3 -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::a#0 = 0 Constant (const byte) main::a#1 = 'c' Constant (const byte) main::a#3 = 'l' Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [3] *((const byte*) main::screen#0 + (byte) 0) ← (const byte) main::a#1 +Simplifying expression containing zero main::screen in [3] *((const byte*) main::screen + (byte) 0) ← (const byte) main::a#1 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::a#0 Successful SSA optimization PassNEliminateUnusedVars @@ -93,12 +92,12 @@ Constant inlined main::a#3 = (byte) 'l' Constant inlined main::$0 = (byte) 1+(byte) 'l' Constant inlined main::a#1 = (byte) 'c' Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::screen#0+$28) -Consolidated array index constant in *(main::screen#0+1) -Consolidated array index constant in *(main::screen#0+1) -Consolidated array index constant in *(main::screen#0+$29) -Consolidated array index constant in *(main::screen#0+2) -Consolidated array index constant in *(main::screen#0+$2a) +Consolidated array index constant in *(main::screen+$28) +Consolidated array index constant in *(main::screen+1) +Consolidated array index constant in *(main::screen+1) +Consolidated array index constant in *(main::screen+$29) +Consolidated array index constant in *(main::screen+2) +Consolidated array index constant in *(main::screen+$2a) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -127,13 +126,13 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (byte) 'c' - [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' - [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' - [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) - [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 - [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' - [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' + [4] *((const byte*) main::screen) ← (byte) 'c' + [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' + [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' + [7] (byte) main::a#2 ← *((const byte*) main::screen+(byte) 1) + [8] *((const byte*) main::screen+(byte) $29) ← (byte) main::a#2 + [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' + [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' to:main::@return main::@return: scope:[main] from main [11] return @@ -144,7 +143,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte) main::a (byte) main::a#2 4.0 -(byte*) main::screen Initial phi equivalence classes Added variable main::a#2 to zero page equivalence class [ main::a#2 ] @@ -179,25 +177,25 @@ bend: main: { .label screen = $400 .label a = 2 - // [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta screen - // [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta screen+$28 - // [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 lda #'m' sta screen+1 - // [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuz1=_deref_pbuc1 + // [7] (byte) main::a#2 ← *((const byte*) main::screen+(byte) 1) -- vbuz1=_deref_pbuc1 lda screen+1 sta.z a - // [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 + // [8] *((const byte*) main::screen+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 lda.z a sta screen+$29 - // [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 lda #1+'l' sta screen+2 - // [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 // Chained assignment with a modification of the result lda #'l' sta screen+$2a @@ -210,11 +208,11 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::a#2 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , REGISTER UPLIFT SCOPES @@ -249,23 +247,23 @@ bend: // main main: { .label screen = $400 - // [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta screen - // [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta screen+$28 - // [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 lda #'m' sta screen+1 - // [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuaa=_deref_pbuc1 + // [7] (byte) main::a#2 ← *((const byte*) main::screen+(byte) 1) -- vbuaa=_deref_pbuc1 lda screen+1 - // [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa sta screen+$29 - // [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 lda #1+'l' sta screen+2 - // [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 // Chained assignment with a modification of the result lda #'l' sta screen+$2a @@ -306,8 +304,7 @@ FINAL SYMBOL TABLE (label) main::@return (byte) main::a (byte) main::a#2 reg byte a 4.0 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte a [ main::a#2 ] @@ -332,27 +329,27 @@ Score: 38 main: { .label screen = $400 // screen[0] = a = 'c' - // [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 'c' -- _deref_pbuc1=vbuc2 lda #'c' sta screen // screen[40] = a - // [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2 sta screen+$28 // screen[1] = 'm' - // [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2 lda #'m' sta screen+1 // a = screen[1] = 'm' - // [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuaa=_deref_pbuc1 + // [7] (byte) main::a#2 ← *((const byte*) main::screen+(byte) 1) -- vbuaa=_deref_pbuc1 // screen[41] = a - // [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa sta screen+$29 // screen[2] = 1 + (a = 'l') - // [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::screen+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2 lda #1+'l' sta screen+2 // screen[42] = a - // [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) main::screen+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2 // Chained assignment with a modification of the result lda #'l' sta screen+$2a diff --git a/src/test/ref/assignment-chained.sym b/src/test/ref/assignment-chained.sym index 2b381789d..5b058a155 100644 --- a/src/test/ref/assignment-chained.sym +++ b/src/test/ref/assignment-chained.sym @@ -5,7 +5,6 @@ (label) main::@return (byte) main::a (byte) main::a#2 reg byte a 4.0 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte a [ main::a#2 ] diff --git a/src/test/ref/assignment-compound.cfg b/src/test/ref/assignment-compound.cfg index 060f0e15a..8aa6e88a2 100644 --- a/src/test/ref/assignment-compound.cfg +++ b/src/test/ref/assignment-compound.cfg @@ -61,16 +61,16 @@ main::@return: scope:[main] from main::@10 test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9 [27] (byte) test::i#11 ← phi( main/(byte) 0 main::@1/(byte) 1 main::@10/(byte) $a main::@2/(byte) 2 main::@3/(byte) 3 main::@4/(byte) 4 main::@5/(byte) 5 main::@6/(byte) 6 main::@7/(byte) 7 main::@8/(byte) 8 main::@9/(byte) 9 ) [27] (byte) test::a#11 ← phi( main/(byte) 3 main::@1/(byte) 3+(byte) 1 main::@10/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 main::@2/(byte) 3+(byte) 1-(byte) 1 main::@3/(byte) 3+(byte) 1-(byte) 1*(byte) 6 main::@4/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 main::@5/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 main::@6/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 main::@7/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 main::@8/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 main::@9/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 ) - [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 + [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 [29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref + (byte) test::i#11) [30] if(*((const byte[]) ref + (byte) test::i#11)==(byte) test::a#11) goto test::@1 to:test::@2 test::@2: scope:[test] from test - [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 + [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED to:test::@return test::@return: scope:[test] from test::@1 test::@2 [32] return to:@return test::@1: scope:[test] from test - [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 + [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN to:test::@return diff --git a/src/test/ref/assignment-compound.log b/src/test/ref/assignment-compound.log index 945ecd661..4f3061f3f 100644 --- a/src/test/ref/assignment-compound.log +++ b/src/test/ref/assignment-compound.log @@ -9,12 +9,12 @@ Culled Empty Block (label) test::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte[]) ref ← { (number) 3, (number) 4, (number) 3, (number) $12, (number) 9, (number) 1, (number) 4, (number) 2, (number) 4, (number) 5, (number) 1, (number) 0 } - (byte*) screen1#0 ← ((byte*)) (number) $400 - (byte*~) $0 ← (byte*) screen1#0 + (number) $28 + (byte*) screen1 ← ((byte*)) (number) $400 + (byte*~) $0 ← (byte*) screen1 + (number) $28 (byte*) screen2#0 ← (byte*~) $0 - (byte*) cols#0 ← ((byte*)) (number) $d800 - (byte) GREEN#0 ← (number) 5 - (byte) RED#0 ← (number) 2 + (byte*) cols ← ((byte*)) (number) $d800 + (byte) GREEN ← (number) 5 + (byte) RED ← (number) 2 to:@2 (void()) main() @@ -139,18 +139,18 @@ test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main (byte*) screen2#1 ← phi( main/(byte*) screen2#2 main::@1/(byte*) screen2#3 main::@10/(byte*) screen2#4 main::@2/(byte*) screen2#5 main::@3/(byte*) screen2#6 main::@4/(byte*) screen2#7 main::@5/(byte*) screen2#8 main::@6/(byte*) screen2#9 main::@7/(byte*) screen2#10 main::@8/(byte*) screen2#11 main::@9/(byte*) screen2#12 ) (byte) test::i#11 ← phi( main/(byte) test::i#0 main::@1/(byte) test::i#1 main::@10/(byte) test::i#10 main::@2/(byte) test::i#2 main::@3/(byte) test::i#3 main::@4/(byte) test::i#4 main::@5/(byte) test::i#5 main::@6/(byte) test::i#6 main::@7/(byte) test::i#7 main::@8/(byte) test::i#8 main::@9/(byte) test::i#9 ) (byte) test::a#11 ← phi( main/(byte) test::a#0 main::@1/(byte) test::a#1 main::@10/(byte) test::a#10 main::@2/(byte) test::a#2 main::@3/(byte) test::a#3 main::@4/(byte) test::a#4 main::@5/(byte) test::a#5 main::@6/(byte) test::a#6 main::@7/(byte) test::a#7 main::@8/(byte) test::a#8 main::@9/(byte) test::a#9 ) - *((byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 + *((byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 *((byte*) screen2#1 + (byte) test::i#11) ← *((byte[]) ref + (byte) test::i#11) (bool~) test::$0 ← *((byte[]) ref + (byte) test::i#11) == (byte) test::a#11 if((bool~) test::$0) goto test::@1 to:test::@3 test::@1: scope:[test] from test (byte) test::i#12 ← phi( test/(byte) test::i#11 ) - *((byte*) cols#0 + (byte) test::i#12) ← (byte) GREEN#0 + *((byte*) cols + (byte) test::i#12) ← (byte) GREEN to:test::@return test::@3: scope:[test] from test (byte) test::i#13 ← phi( test/(byte) test::i#11 ) - *((byte*) cols#0 + (byte) test::i#13) ← (byte) RED#0 + *((byte*) cols + (byte) test::i#13) ← (byte) RED to:test::@return test::@return: scope:[test] from test::@1 test::@3 return @@ -170,11 +170,8 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) GREEN -(byte) GREEN#0 (byte) RED -(byte) RED#0 (byte*) cols -(byte*) cols#0 (void()) main() (label) main::@1 (label) main::@10 @@ -236,7 +233,6 @@ SYMBOL TABLE SSA (byte) main::i#9 (byte[]) ref (byte*) screen1 -(byte*) screen1#0 (byte*) screen2 (byte*) screen2#0 (byte*) screen2#1 @@ -286,9 +282,9 @@ SYMBOL TABLE SSA (byte) test::i#8 (byte) test::i#9 -Adding number conversion cast (unumber) $28 in (byte*~) $0 ← (byte*) screen1#0 + (number) $28 -Adding number conversion cast (unumber) 5 in (byte) GREEN#0 ← (number) 5 -Adding number conversion cast (unumber) 2 in (byte) RED#0 ← (number) 2 +Adding number conversion cast (unumber) $28 in (byte*~) $0 ← (byte*) screen1 + (number) $28 +Adding number conversion cast (unumber) 5 in (byte) GREEN ← (number) 5 +Adding number conversion cast (unumber) 2 in (byte) RED ← (number) 2 Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 3 in (byte) main::a#0 ← (number) 3 Adding number conversion cast (unumber) 1 in (byte) main::a#1 ← (byte) main::a#11 + (number) 1 @@ -304,10 +300,10 @@ Adding number conversion cast (unumber) 1 in (byte) main::a#10 ← (byte) main:: Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) ref ← (byte[]){ (byte)(number) 3, (byte)(number) 4, (byte)(number) 3, (byte)(number) $12, (byte)(number) 9, (byte)(number) 1, (byte)(number) 4, (byte)(number) 2, (byte)(number) 4, (byte)(number) 5, (byte)(number) 1, (byte)(number) 0 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) screen1#0 ← (byte*)(number) $400 -Inlining cast (byte*) cols#0 ← (byte*)(number) $d800 -Inlining cast (byte) GREEN#0 ← (unumber)(number) 5 -Inlining cast (byte) RED#0 ← (unumber)(number) 2 +Inlining cast (byte*) screen1 ← (byte*)(number) $400 +Inlining cast (byte*) cols ← (byte*)(number) $d800 +Inlining cast (byte) GREEN ← (unumber)(number) 5 +Inlining cast (byte) RED ← (unumber)(number) 2 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Inlining cast (byte) main::a#0 ← (unumber)(number) 3 Successful SSA optimization Pass2InlineCast @@ -390,10 +386,10 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (byte[]) { (byte) 3, (byte) 4, (byte) 3, (byte) $12, (byte) 9, (byte) 1, (byte) 4, (byte) 2, (byte) 4, (byte) 5, (byte) 1, (byte) 0 } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte[]) ref = { 3, 4, 3, $12, 9, 1, 4, 2, 4, 5, 1, 0 } -Constant (const byte*) screen1#0 = (byte*) 1024 -Constant (const byte*) cols#0 = (byte*) 55296 -Constant (const byte) GREEN#0 = 5 -Constant (const byte) RED#0 = 2 +Constant (const byte*) screen1 = (byte*) 1024 +Constant (const byte*) cols = (byte*) 55296 +Constant (const byte) GREEN = 5 +Constant (const byte) RED = 2 Constant (const byte) main::i#0 = 0 Constant (const byte) main::a#0 = 3 Successful SSA optimization Pass2ConstantIdentification @@ -402,11 +398,11 @@ Constant (const byte) test::a#0 = main::a#0 Successful SSA optimization Pass2ConstantIdentification Eliminating unused variable (byte) main::i#11 and assignment [52] (byte) main::i#11 ← ++ (byte) main::i#10 Successful SSA optimization PassNEliminateUnusedVars -Constant right-side identified [0] (byte*) screen2#0 ← (const byte*) screen1#0 + (byte) $28 +Constant right-side identified [0] (byte*) screen2#0 ← (const byte*) screen1 + (byte) $28 Constant right-side identified [2] (byte) main::i#1 ← ++ (const byte) main::i#0 Constant right-side identified [3] (byte) main::a#1 ← (const byte) main::a#0 + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) screen2#0 = screen1#0+$28 +Constant (const byte*) screen2#0 = screen1+$28 Constant (const byte) main::i#1 = ++main::i#0 Constant (const byte) main::a#1 = main::a#0+1 Successful SSA optimization Pass2ConstantIdentification @@ -710,29 +706,25 @@ main::@return: scope:[main] from main::@10 test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9 [27] (byte) test::i#11 ← phi( main/(byte) 0 main::@1/(byte) 1 main::@10/(byte) $a main::@2/(byte) 2 main::@3/(byte) 3 main::@4/(byte) 4 main::@5/(byte) 5 main::@6/(byte) 6 main::@7/(byte) 7 main::@8/(byte) 8 main::@9/(byte) 9 ) [27] (byte) test::a#11 ← phi( main/(byte) 3 main::@1/(byte) 3+(byte) 1 main::@10/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 main::@2/(byte) 3+(byte) 1-(byte) 1 main::@3/(byte) 3+(byte) 1-(byte) 1*(byte) 6 main::@4/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 main::@5/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 main::@6/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 main::@7/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 main::@8/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 main::@9/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 ) - [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 + [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 [29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref + (byte) test::i#11) [30] if(*((const byte[]) ref + (byte) test::i#11)==(byte) test::a#11) goto test::@1 to:test::@2 test::@2: scope:[test] from test - [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 + [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED to:test::@return test::@return: scope:[test] from test::@1 test::@2 [32] return to:@return test::@1: scope:[test] from test - [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 + [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN to:test::@return VARIABLE REGISTER WEIGHTS -(byte) GREEN -(byte) RED -(byte*) cols (void()) main() (byte) main::a (byte) main::i -(byte*) screen1 (byte*) screen2 (void()) test((byte) test::i , (byte) test::a) (byte) test::a @@ -952,7 +944,7 @@ main: { test: { .label a = 2 .label i = 3 - // [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuz1=vbuz2 + // [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z a ldy.z i sta screen1,y @@ -968,7 +960,7 @@ test: { jmp b2 // test::@2 b2: - // [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED -- pbuc1_derefidx_vbuz1=vbuc2 lda #RED ldy.z i sta cols,y @@ -979,7 +971,7 @@ test: { rts // test::@1 b1: - // [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN -- pbuc1_derefidx_vbuz1=vbuc2 lda #GREEN ldy.z i sta cols,y @@ -993,13 +985,13 @@ Statement [29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ test::a#11 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ test::i#11 ] Statement [30] if(*((const byte[]) ref + (byte) test::i#11)==(byte) test::a#11) goto test::@1 [ test::i#11 ] ( main:2::test:5 [ test::i#11 ] main:2::test:7 [ test::i#11 ] main:2::test:9 [ test::i#11 ] main:2::test:11 [ test::i#11 ] main:2::test:13 [ test::i#11 ] main:2::test:15 [ test::i#11 ] main:2::test:17 [ test::i#11 ] main:2::test:19 [ test::i#11 ] main:2::test:21 [ test::i#11 ] main:2::test:23 [ test::i#11 ] main:2::test:25 [ test::i#11 ] ) always clobbers reg byte a -Statement [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a -Statement [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a -Statement [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 [ test::a#11 test::i#11 ] ( main:2::test:5 [ test::a#11 test::i#11 ] main:2::test:7 [ test::a#11 test::i#11 ] main:2::test:9 [ test::a#11 test::i#11 ] main:2::test:11 [ test::a#11 test::i#11 ] main:2::test:13 [ test::a#11 test::i#11 ] main:2::test:15 [ test::a#11 test::i#11 ] main:2::test:17 [ test::a#11 test::i#11 ] main:2::test:19 [ test::a#11 test::i#11 ] main:2::test:21 [ test::a#11 test::i#11 ] main:2::test:23 [ test::a#11 test::i#11 ] main:2::test:25 [ test::a#11 test::i#11 ] ) always clobbers reg byte a +Statement [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a +Statement [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a +Statement [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 [ test::a#11 test::i#11 ] ( main:2::test:5 [ test::a#11 test::i#11 ] main:2::test:7 [ test::a#11 test::i#11 ] main:2::test:9 [ test::a#11 test::i#11 ] main:2::test:11 [ test::a#11 test::i#11 ] main:2::test:13 [ test::a#11 test::i#11 ] main:2::test:15 [ test::a#11 test::i#11 ] main:2::test:17 [ test::a#11 test::i#11 ] main:2::test:19 [ test::a#11 test::i#11 ] main:2::test:21 [ test::a#11 test::i#11 ] main:2::test:23 [ test::a#11 test::i#11 ] main:2::test:25 [ test::a#11 test::i#11 ] ) always clobbers reg byte a Statement [29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref + (byte) test::i#11) [ test::a#11 test::i#11 ] ( main:2::test:5 [ test::a#11 test::i#11 ] main:2::test:7 [ test::a#11 test::i#11 ] main:2::test:9 [ test::a#11 test::i#11 ] main:2::test:11 [ test::a#11 test::i#11 ] main:2::test:13 [ test::a#11 test::i#11 ] main:2::test:15 [ test::a#11 test::i#11 ] main:2::test:17 [ test::a#11 test::i#11 ] main:2::test:19 [ test::a#11 test::i#11 ] main:2::test:21 [ test::a#11 test::i#11 ] main:2::test:23 [ test::a#11 test::i#11 ] main:2::test:25 [ test::a#11 test::i#11 ] ) always clobbers reg byte a Statement [30] if(*((const byte[]) ref + (byte) test::i#11)==(byte) test::a#11) goto test::@1 [ test::i#11 ] ( main:2::test:5 [ test::i#11 ] main:2::test:7 [ test::i#11 ] main:2::test:9 [ test::i#11 ] main:2::test:11 [ test::i#11 ] main:2::test:13 [ test::i#11 ] main:2::test:15 [ test::i#11 ] main:2::test:17 [ test::i#11 ] main:2::test:19 [ test::i#11 ] main:2::test:21 [ test::i#11 ] main:2::test:23 [ test::i#11 ] main:2::test:25 [ test::i#11 ] ) always clobbers reg byte a -Statement [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a -Statement [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a +Statement [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a +Statement [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN [ ] ( main:2::test:5 [ ] main:2::test:7 [ ] main:2::test:9 [ ] main:2::test:11 [ ] main:2::test:13 [ ] main:2::test:15 [ ] main:2::test:17 [ ] main:2::test:19 [ ] main:2::test:21 [ ] main:2::test:23 [ ] main:2::test:25 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ test::a#11 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ test::i#11 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -1204,7 +1196,7 @@ main: { // test(byte register(X) i, byte zeropage(2) a) test: { .label a = 2 - // [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1 + // [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1 lda.z a sta screen1,x // [29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref + (byte) test::i#11) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx @@ -1217,7 +1209,7 @@ test: { jmp b2 // test::@2 b2: - // [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED -- pbuc1_derefidx_vbuxx=vbuc2 lda #RED sta cols,x jmp breturn @@ -1227,7 +1219,7 @@ test: { rts // test::@1 b1: - // [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta cols,x jmp breturn @@ -1305,12 +1297,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte) GREEN -(const byte) GREEN#0 GREEN = (byte) 5 -(byte) RED -(const byte) RED#0 RED = (byte) 2 -(byte*) cols -(const byte*) cols#0 cols = (byte*) 55296 +(const byte) GREEN GREEN = (byte) 5 +(const byte) RED RED = (byte) 2 +(const byte*) cols cols = (byte*) 55296 (void()) main() (label) main::@1 (label) main::@10 @@ -1326,10 +1315,9 @@ FINAL SYMBOL TABLE (byte) main::a (byte) main::i (const byte[]) ref ref = { (byte) 3, (byte) 4, (byte) 3, (byte) $12, (byte) 9, (byte) 1, (byte) 4, (byte) 2, (byte) 4, (byte) 5, (byte) 1, (byte) 0 } -(byte*) screen1 -(const byte*) screen1#0 screen1 = (byte*) 1024 +(const byte*) screen1 screen1 = (byte*) 1024 (byte*) screen2 -(const byte*) screen2#0 screen2 = (const byte*) screen1#0+(byte) $28 +(const byte*) screen2#0 screen2 = (const byte*) screen1+(byte) $28 (void()) test((byte) test::i , (byte) test::a) (label) test::@1 (label) test::@2 @@ -1496,7 +1484,7 @@ main: { test: { .label a = 2 // screen1[i] = a - // [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1 + // [28] *((const byte*) screen1 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1 lda.z a sta screen1,x // screen2[i] = ref[i] @@ -1510,7 +1498,7 @@ test: { beq b1 // test::@2 // cols[i] = RED - // [31] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) RED#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [31] *((const byte*) cols + (byte) test::i#11) ← (const byte) RED -- pbuc1_derefidx_vbuxx=vbuc2 lda #RED sta cols,x // test::@return @@ -1520,7 +1508,7 @@ test: { // test::@1 b1: // cols[i] = GREEN - // [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [33] *((const byte*) cols + (byte) test::i#11) ← (const byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta cols,x rts diff --git a/src/test/ref/assignment-compound.sym b/src/test/ref/assignment-compound.sym index 15ca7d60e..a02e62eda 100644 --- a/src/test/ref/assignment-compound.sym +++ b/src/test/ref/assignment-compound.sym @@ -1,12 +1,9 @@ (label) @1 (label) @begin (label) @end -(byte) GREEN -(const byte) GREEN#0 GREEN = (byte) 5 -(byte) RED -(const byte) RED#0 RED = (byte) 2 -(byte*) cols -(const byte*) cols#0 cols = (byte*) 55296 +(const byte) GREEN GREEN = (byte) 5 +(const byte) RED RED = (byte) 2 +(const byte*) cols cols = (byte*) 55296 (void()) main() (label) main::@1 (label) main::@10 @@ -22,10 +19,9 @@ (byte) main::a (byte) main::i (const byte[]) ref ref = { (byte) 3, (byte) 4, (byte) 3, (byte) $12, (byte) 9, (byte) 1, (byte) 4, (byte) 2, (byte) 4, (byte) 5, (byte) 1, (byte) 0 } -(byte*) screen1 -(const byte*) screen1#0 screen1 = (byte*) 1024 +(const byte*) screen1 screen1 = (byte*) 1024 (byte*) screen2 -(const byte*) screen2#0 screen2 = (const byte*) screen1#0+(byte) $28 +(const byte*) screen2#0 screen2 = (const byte*) screen1+(byte) $28 (void()) test((byte) test::i , (byte) test::a) (label) test::@1 (label) test::@2 diff --git a/src/test/ref/bitmap-plot-0.cfg b/src/test/ref/bitmap-plot-0.cfg index 026c28159..8fe2ce7c5 100644 --- a/src/test/ref/bitmap-plot-0.cfg +++ b/src/test/ref/bitmap-plot-0.cfg @@ -111,7 +111,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [49] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [50] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -151,7 +151,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [67] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/bitmap-plot-0.log b/src/test/ref/bitmap-plot-0.log index c1184f38f..406e5d5d1 100644 --- a/src/test/ref/bitmap-plot-0.log +++ b/src/test/ref/bitmap-plot-0.log @@ -242,8 +242,8 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot @14: scope:[] from @8 (byte*) bitmap_screen#24 ← phi( @8/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#25 ← phi( @8/(byte*) bitmap_gfx#0 ) - (byte*) BITMAP#0 ← ((byte*)) (number) $2000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) BITMAP ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame ← { fill( $100, 0) } to:@15 @@ -252,8 +252,8 @@ main: scope:[main] from @17 (byte) frame_cnt#21 ← phi( @17/(byte) frame_cnt#9 ) (byte*) bitmap_screen#12 ← phi( @17/(byte*) bitmap_screen#14 ) (byte*) bitmap_gfx#13 ← phi( @17/(byte*) bitmap_gfx#15 ) - (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 - (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN call bitmap_init to:main::@12 main::@12: scope:[main] from main @@ -274,8 +274,8 @@ main::@13: scope:[main] from main::@12 (byte~) main::$3 ← (byte~) main::$2 | (byte) VIC_RSEL (number~) main::$4 ← (byte~) main::$3 | (number) 3 *((byte*) D011) ← (number~) main::$4 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@13 (byte) frame_cnt#18 ← phi( main::@13/(byte) frame_cnt#19 ) @@ -479,7 +479,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BITMAP -(byte*) BITMAP#0 (byte) BLACK (byte*) CIA1_INTERRUPT (byte) CIA_INTERRUPT_CLEAR @@ -495,7 +494,6 @@ SYMBOL TABLE SSA (byte) PROCPORT_RAM_IO (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (byte) VIC_BMM (byte*) VIC_CONTROL (byte) VIC_DEN @@ -906,8 +904,8 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80 Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80 Inlining cast (byte) memset::c#1 ← (unumber)(number) 0 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 Inlining cast (word) main::x#0 ← (unumber)(number) 0 @@ -1184,8 +1182,8 @@ Constant (const byte) bitmap_init::y#0 = 0 Constant (const word) memset::num#0 = $3e8 Constant (const byte) memset::c#1 = 0 Constant (const word) memset::num#1 = $1f40 -Constant (const byte*) BITMAP#0 = (byte*) 8192 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) BITMAP = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$100]) plots_per_frame = { fill( $100, 0) } Constant (const word) main::x#0 = 0 Constant (const byte) main::y#0 = 0 @@ -1193,12 +1191,12 @@ Constant (const word) main::vx#0 = 1 Constant (const byte) main::vy#0 = 1 Constant (const void()*) init_irq::$0 = &irq Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte*) bitmap_init::gfx#0 = BITMAP +Constant (const byte*) bitmap_init::screen#0 = SCREEN Constant (const byte) bitmap_clear::bgcol#0 = BLACK Constant (const byte) bitmap_clear::fgcol#0 = WHITE -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) bitmap_gfx#1 = bitmap_init::gfx#0 Constant (const byte*) bitmap_screen#1 = bitmap_init::screen#0 @@ -1303,30 +1301,30 @@ Inlining constant with var siblings (const word) main::x#0 Inlining constant with var siblings (const byte) main::y#0 Inlining constant with var siblings (const word) main::vx#0 Inlining constant with var siblings (const byte) main::vy#0 -Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 -Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP Constant inlined memset::num#1 = (word) $1f40 Constant inlined memset::num#0 = (word) $3e8 Constant inlined bitmap_init::bits#0 = (byte) $80 Constant inlined bitmap_init::bits#2 = (byte) $80 Constant inlined init_irq::$0 = &interrupt(HARDWARE_CLOBBER)(void()) irq() -Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN Constant inlined main::x#0 = (byte) 0 Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE Constant inlined main::y#0 = (byte) 0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined bitmap_screen#1 = (const byte*) SCREEN Constant inlined main::vy#0 = (byte) 1 Constant inlined main::$2 = (const byte) VIC_BMM|(const byte) VIC_DEN Constant inlined main::vx#0 = (byte) 1 @@ -1546,7 +1544,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [49] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [49] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [50] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -1586,7 +1584,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [66] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [67] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [67] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [68] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [69] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -1627,8 +1625,6 @@ irq::@return: scope:[irq] from irq::@1 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP -(byte*) SCREEN (void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) (byte) bitmap_clear::bgcol (byte) bitmap_clear::col @@ -2109,7 +2105,7 @@ bitmap_clear: { // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 lda #col sta.z memset.c - // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -2131,7 +2127,7 @@ bitmap_clear: { // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -2273,7 +2269,7 @@ bitmap_init: { bne b1_from_b2 // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -2875,7 +2871,7 @@ bitmap_clear: { memset_from_bitmap_clear: // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -2896,7 +2892,7 @@ bitmap_clear: { memset_from_b1: // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -3020,7 +3016,7 @@ bitmap_init: { bne b1_from_b2 // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -3243,8 +3239,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 (const byte) CIA_INTERRUPT_CLEAR CIA_INTERRUPT_CLEAR = (byte) $7f @@ -3259,8 +3254,7 @@ FINAL SYMBOL TABLE (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte*) VIC_CONTROL VIC_CONTROL = (byte*) 53265 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -3343,7 +3337,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::vx (word) main::vx#1 vx zp ZP_WORD:5 22.0 @@ -3698,7 +3692,7 @@ bitmap_clear: { // [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset] // [49] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -3716,7 +3710,7 @@ bitmap_clear: { // [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] // [49] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [49] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -3831,7 +3825,7 @@ bitmap_init: { cpx #0 bne b1 // [67] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [67] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/bitmap-plot-0.sym b/src/test/ref/bitmap-plot-0.sym index 120b39abc..ddbb8d7c8 100644 --- a/src/test/ref/bitmap-plot-0.sym +++ b/src/test/ref/bitmap-plot-0.sym @@ -3,8 +3,7 @@ (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 (const byte) CIA_INTERRUPT_CLEAR CIA_INTERRUPT_CLEAR = (byte) $7f @@ -19,8 +18,7 @@ (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte*) VIC_CONTROL VIC_CONTROL = (byte*) 53265 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -103,7 +101,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::vx (word) main::vx#1 vx zp ZP_WORD:5 22.0 diff --git a/src/test/ref/bitmap-plot-1.cfg b/src/test/ref/bitmap-plot-1.cfg index 0622a8bf3..904661d05 100644 --- a/src/test/ref/bitmap-plot-1.cfg +++ b/src/test/ref/bitmap-plot-1.cfg @@ -193,7 +193,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [97] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [97] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [97] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [97] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [98] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -233,7 +233,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [114] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [115] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [115] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [115] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [116] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [117] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/bitmap-plot-1.log b/src/test/ref/bitmap-plot-1.log index 498271ad5..f4a8a060b 100644 --- a/src/test/ref/bitmap-plot-1.log +++ b/src/test/ref/bitmap-plot-1.log @@ -764,8 +764,8 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot (byte*) bitmap_screen#25 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#26 ← phi( @28/(byte*) bitmap_gfx#0 ) (word) rem16u#34 ← phi( @28/(word) rem16u#36 ) - (byte*) BITMAP#0 ← ((byte*)) (number) $2000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) BITMAP ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame ← { fill( $100, 0) } (signed word[$200]) SINUS ← { fill( $200, 0) } to:@35 @@ -788,8 +788,8 @@ main::@12: scope:[main] from main (byte*) bitmap_gfx#13 ← phi( main/(byte*) bitmap_gfx#18 ) (word) rem16u#17 ← phi( main/(word) rem16u#7 ) (word) rem16u#8 ← (word) rem16u#17 - (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 - (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN call bitmap_init to:main::@13 main::@13: scope:[main] from main::@12 @@ -812,8 +812,8 @@ main::@14: scope:[main] from main::@13 (byte~) main::$4 ← (byte~) main::$3 | (byte) VIC_RSEL (number~) main::$5 ← (byte~) main::$4 | (number) 3 *((byte*) D011) ← (number~) main::$5 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@14 (byte) frame_cnt#20 ← phi( main::@14/(byte) frame_cnt#21 ) @@ -1058,7 +1058,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BITMAP -(byte*) BITMAP#0 (byte) BLACK (byte*) CIA1_INTERRUPT (byte) CIA_INTERRUPT_CLEAR @@ -1077,7 +1076,6 @@ SYMBOL TABLE SSA (byte) PROCPORT_RAM_IO (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (signed word[$200]) SINUS (const byte) SIZEOF_SIGNED_WORD = (byte) 2 (byte) VIC_BMM @@ -2047,8 +2045,8 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80 Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80 Inlining cast (byte) memset::c#1 ← (unumber)(number) 0 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) sin16s_gen2::wavelength#0 ← (unumber)(number) $200 Inlining cast (signed word) sin16s_gen2::min#0 ← (snumber)(number) -$1001 Inlining cast (signed word) sin16s_gen2::max#0 ← (snumber)(number) $1001 @@ -2583,8 +2581,8 @@ Constant (const byte) bitmap_init::y#0 = 0 Constant (const word) memset::num#0 = $3e8 Constant (const byte) memset::c#1 = 0 Constant (const word) memset::num#1 = $1f40 -Constant (const byte*) BITMAP#0 = (byte*) 8192 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) BITMAP = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$100]) plots_per_frame = { fill( $100, 0) } Constant (const signed word[$200]) SINUS = { fill( $200, 0) } Constant (const word) sin16s_gen2::wavelength#0 = $200 @@ -2601,12 +2599,12 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 Constant (const word) div32u16u::divisor#0 = sin16s_gen2::wavelength#0 Constant (const signed word*) sin16s_gen2::sintab#1 = SINUS -Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte*) bitmap_init::gfx#0 = BITMAP +Constant (const byte*) bitmap_init::screen#0 = SCREEN Constant (const byte) bitmap_clear::bgcol#0 = BLACK Constant (const byte) bitmap_clear::fgcol#0 = WHITE -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP Successful SSA optimization Pass2ConstantIdentification Constant (const word) divr16u::divisor#0 = div32u16u::divisor#0 Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0 @@ -2768,9 +2766,9 @@ Inlining constant with var siblings (const word) main::idx_x#0 Inlining constant with var siblings (const word) main::idx_y#0 Inlining constant with var siblings (const word) main::idx_x#2 Inlining constant with var siblings (const word) main::idx_y#2 -Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN Constant inlined divr16u::rem#3 = (byte) 0 -Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP Constant inlined sin16s_gen2::i#0 = (byte) 0 Constant inlined sin16s::isUpper#0 = (byte) 0 Constant inlined memset::num#1 = (word) $1f40 @@ -2785,21 +2783,21 @@ Constant inlined init_irq::$0 = &interrupt(HARDWARE_CLOBBER)(void()) irq() Constant inlined main::idx_y#2 = (byte) 0 Constant inlined main::idx_y#0 = (byte) $80 Constant inlined mul16s::b#0 = (const signed word) sin16s_gen2::ampl#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined sin16s_gen2::sintab#1 = (const signed word[$200]) SINUS Constant inlined memset::c#0 = (const byte) bitmap_clear::col#0 Constant inlined bitmap_init::x#0 = (byte) 0 Constant inlined memset::c#1 = (byte) 0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP Constant inlined divr16u::i#0 = (byte) 0 Constant inlined div32u16u::dividend#0 = (const dword) PI2_u4f28 Constant inlined bitmap_init::bits#0 = (byte) $80 @@ -2812,13 +2810,13 @@ Constant inlined divr16u::divisor#1 = (const word) sin16s_gen2::wavelength#0 Constant inlined divr16u::divisor#0 = (const word) sin16s_gen2::wavelength#0 Constant inlined main::idx_x#0 = (byte) 0 Constant inlined mul16s::a#1 = (signed word) $a0 -Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP Constant inlined mul16s::a#2 = (signed byte) $64 -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE Constant inlined divr16u::dividend#1 = >(const dword) PI2_u4f28 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 -Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined bitmap_screen#1 = (const byte*) SCREEN Constant inlined mulu16_sel::v2#2 = (word)(number) $10000/(number) 6 Constant inlined main::$5 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined bitmap_init::y#0 = (byte) 0 @@ -3218,7 +3216,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [97] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [97] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [97] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [97] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [98] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -3258,7 +3256,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [114] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [115] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [115] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [115] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [116] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [117] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -3487,8 +3485,6 @@ irq::@return: scope:[irq] from irq::@1 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP -(byte*) SCREEN (void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) (byte) bitmap_clear::bgcol (byte) bitmap_clear::col @@ -4796,7 +4792,7 @@ bitmap_clear: { // [97] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 lda #col sta.z memset.c - // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -4818,7 +4814,7 @@ bitmap_clear: { // [97] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -4960,7 +4956,7 @@ bitmap_init: { bne b1_from_b2 // [115] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -7056,7 +7052,7 @@ bitmap_clear: { memset_from_bitmap_clear: // [97] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -7077,7 +7073,7 @@ bitmap_clear: { memset_from_b1: // [97] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -7201,7 +7197,7 @@ bitmap_init: { bne b1_from_b2 // [115] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -8227,8 +8223,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 (const byte) CIA_INTERRUPT_CLEAR CIA_INTERRUPT_CLEAR = (byte) $7f @@ -8246,8 +8241,7 @@ FINAL SYMBOL TABLE (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed word[$200]) SINUS SINUS = { fill( $200, 0) } (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -8402,7 +8396,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x (word) main::x#0 x zp ZP_WORD:32 1.8333333333333333 @@ -9247,7 +9241,7 @@ bitmap_clear: { // [97] phi from bitmap_clear to memset [phi:bitmap_clear->memset] // [97] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -9265,7 +9259,7 @@ bitmap_clear: { // [97] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] // [97] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [97] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -9380,7 +9374,7 @@ bitmap_init: { cpx #0 bne b1 // [115] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [115] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/bitmap-plot-1.sym b/src/test/ref/bitmap-plot-1.sym index cc3307ecd..cda64f751 100644 --- a/src/test/ref/bitmap-plot-1.sym +++ b/src/test/ref/bitmap-plot-1.sym @@ -3,8 +3,7 @@ (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 (const byte) CIA_INTERRUPT_CLEAR CIA_INTERRUPT_CLEAR = (byte) $7f @@ -22,8 +21,7 @@ (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed word[$200]) SINUS SINUS = { fill( $200, 0) } (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -178,7 +176,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x (word) main::x#0 x zp ZP_WORD:32 1.8333333333333333 diff --git a/src/test/ref/bitmap-plot-2.cfg b/src/test/ref/bitmap-plot-2.cfg index 0e8329b0e..32106767c 100644 --- a/src/test/ref/bitmap-plot-2.cfg +++ b/src/test/ref/bitmap-plot-2.cfg @@ -212,7 +212,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [106] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [106] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [106] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [106] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [107] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -252,7 +252,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [123] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [124] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [124] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [124] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [125] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [126] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/bitmap-plot-2.log b/src/test/ref/bitmap-plot-2.log index 055f4fd16..7316dfc89 100644 --- a/src/test/ref/bitmap-plot-2.log +++ b/src/test/ref/bitmap-plot-2.log @@ -773,8 +773,8 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot (byte*) bitmap_screen#26 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#27 ← phi( @28/(byte*) bitmap_gfx#0 ) (word) rem16u#35 ← phi( @28/(word) rem16u#37 ) - (byte*) BITMAP#0 ← ((byte*)) (number) $2000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) BITMAP ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame ← { fill( $100, 0) } (signed word[$200]) SINUS ← { fill( $200, 0) } to:@35 @@ -797,8 +797,8 @@ main::@24: scope:[main] from main (byte*) bitmap_gfx#13 ← phi( main/(byte*) bitmap_gfx#18 ) (word) rem16u#17 ← phi( main/(word) rem16u#7 ) (word) rem16u#8 ← (word) rem16u#17 - (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 - (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN call bitmap_init to:main::@25 main::@25: scope:[main] from main::@24 @@ -821,8 +821,8 @@ main::@26: scope:[main] from main::@25 (byte~) main::$4 ← (byte~) main::$3 | (byte) VIC_RSEL (number~) main::$5 ← (byte~) main::$4 | (number) 3 *((byte*) D011) ← (number~) main::$5 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@26 (byte) frame_cnt#21 ← phi( main::@26/(byte) frame_cnt#23 ) @@ -1131,7 +1131,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BITMAP -(byte*) BITMAP#0 (byte) BLACK (byte*) BORDERCOL (byte*) CIA1_INTERRUPT @@ -1151,7 +1150,6 @@ SYMBOL TABLE SSA (byte) PROCPORT_RAM_IO (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (signed word[$200]) SINUS (const byte) SIZEOF_SIGNED_WORD = (byte) 2 (byte) VIC_BMM @@ -2184,8 +2182,8 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80 Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80 Inlining cast (byte) memset::c#1 ← (unumber)(number) 0 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) sin16s_gen2::wavelength#0 ← (unumber)(number) $200 Inlining cast (signed word) sin16s_gen2::min#0 ← (snumber)(number) -$1001 Inlining cast (signed word) sin16s_gen2::max#0 ← (snumber)(number) $1001 @@ -2758,8 +2756,8 @@ Constant (const byte) bitmap_init::y#0 = 0 Constant (const word) memset::num#0 = $3e8 Constant (const byte) memset::c#1 = 0 Constant (const word) memset::num#1 = $1f40 -Constant (const byte*) BITMAP#0 = (byte*) 8192 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) BITMAP = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$100]) plots_per_frame = { fill( $100, 0) } Constant (const signed word[$200]) SINUS = { fill( $200, 0) } Constant (const word) sin16s_gen2::wavelength#0 = $200 @@ -2776,12 +2774,12 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 Constant (const word) div32u16u::divisor#0 = sin16s_gen2::wavelength#0 Constant (const signed word*) sin16s_gen2::sintab#1 = SINUS -Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte*) bitmap_init::gfx#0 = BITMAP +Constant (const byte*) bitmap_init::screen#0 = SCREEN Constant (const byte) bitmap_clear::bgcol#0 = BLACK Constant (const byte) bitmap_clear::fgcol#0 = WHITE -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP Successful SSA optimization Pass2ConstantIdentification Constant (const word) divr16u::divisor#0 = div32u16u::divisor#0 Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0 @@ -2951,9 +2949,9 @@ Inlining constant with var siblings (const signed word) main::r#0 Inlining constant with var siblings (const byte) main::r_add#0 Inlining constant with var siblings (const word) main::idx_x#2 Inlining constant with var siblings (const word) main::idx_y#2 -Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN Constant inlined divr16u::rem#3 = (byte) 0 -Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP Constant inlined sin16s_gen2::i#0 = (byte) 0 Constant inlined sin16s::isUpper#0 = (byte) 0 Constant inlined memset::num#1 = (word) $1f40 @@ -2968,21 +2966,21 @@ Constant inlined init_irq::$0 = &interrupt(HARDWARE_CLOBBER)(void()) irq() Constant inlined main::idx_y#2 = (byte) 0 Constant inlined main::idx_y#0 = (byte) $80 Constant inlined mul16s::b#0 = (const signed word) sin16s_gen2::ampl#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined sin16s_gen2::sintab#1 = (const signed word[$200]) SINUS Constant inlined memset::c#0 = (const byte) bitmap_clear::col#0 Constant inlined bitmap_init::x#0 = (byte) 0 Constant inlined memset::c#1 = (byte) 0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP Constant inlined divr16u::i#0 = (byte) 0 Constant inlined div32u16u::dividend#0 = (const dword) PI2_u4f28 Constant inlined bitmap_init::bits#0 = (byte) $80 @@ -2996,12 +2994,12 @@ Constant inlined divr16u::divisor#1 = (const word) sin16s_gen2::wavelength#0 Constant inlined divr16u::divisor#0 = (const word) sin16s_gen2::wavelength#0 Constant inlined main::idx_x#0 = (byte) 0 Constant inlined main::r#0 = (signed byte) 0 -Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE Constant inlined divr16u::dividend#1 = >(const dword) PI2_u4f28 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 -Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined bitmap_screen#1 = (const byte*) SCREEN Constant inlined mulu16_sel::v2#2 = (word)(number) $10000/(number) 6 Constant inlined main::$5 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined bitmap_init::y#0 = (byte) 0 @@ -3436,7 +3434,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [106] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [106] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [106] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [106] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [107] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -3476,7 +3474,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [123] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [124] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [124] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [124] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [125] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [126] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -3705,8 +3703,6 @@ irq::@return: scope:[irq] from irq::@1 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP -(byte*) SCREEN (void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) (byte) bitmap_clear::bgcol (byte) bitmap_clear::col @@ -5077,7 +5073,7 @@ bitmap_clear: { // [106] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 lda #col sta.z memset.c - // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -5099,7 +5095,7 @@ bitmap_clear: { // [106] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -5241,7 +5237,7 @@ bitmap_init: { bne b1_from_b2 // [124] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -7426,7 +7422,7 @@ bitmap_clear: { memset_from_bitmap_clear: // [106] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -7447,7 +7443,7 @@ bitmap_clear: { memset_from_b1: // [106] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -7571,7 +7567,7 @@ bitmap_init: { bne b1_from_b2 // [124] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -8615,8 +8611,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 @@ -8635,8 +8630,7 @@ FINAL SYMBOL TABLE (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed word[$200]) SINUS SINUS = { fill( $200, 0) } (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -8802,7 +8796,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x (signed word) main::x#0 x zp ZP_WORD:32 0.8461538461538461 @@ -9703,7 +9697,7 @@ bitmap_clear: { // [106] phi from bitmap_clear to memset [phi:bitmap_clear->memset] // [106] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -9721,7 +9715,7 @@ bitmap_clear: { // [106] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] // [106] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [106] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -9836,7 +9830,7 @@ bitmap_init: { cpx #0 bne b1 // [124] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [124] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/bitmap-plot-2.sym b/src/test/ref/bitmap-plot-2.sym index 3ba761051..46d959c45 100644 --- a/src/test/ref/bitmap-plot-2.sym +++ b/src/test/ref/bitmap-plot-2.sym @@ -3,8 +3,7 @@ (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte) BLACK BLACK = (byte) 0 (const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte*) CIA1_INTERRUPT CIA1_INTERRUPT = (byte*) 56333 @@ -23,8 +22,7 @@ (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed word[$200]) SINUS SINUS = { fill( $200, 0) } (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -190,7 +188,7 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x (signed word) main::x#0 x zp ZP_WORD:32 0.8461538461538461 diff --git a/src/test/ref/bitmap-plot-3.cfg b/src/test/ref/bitmap-plot-3.cfg index 556b0cd54..6ba0e24b1 100644 --- a/src/test/ref/bitmap-plot-3.cfg +++ b/src/test/ref/bitmap-plot-3.cfg @@ -32,7 +32,7 @@ main::@1: scope:[main] from main::@4 main::@7 [12] if((byte) main::i#2!=(byte) 8) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 - [13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + [13] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) to:main::@3 main::@2: scope:[main] from main::@1 [14] (word~) main::$7 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) @@ -208,7 +208,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [100] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [100] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [100] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [100] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [101] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -248,7 +248,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [117] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [118] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [118] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [118] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [119] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [120] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/bitmap-plot-3.log b/src/test/ref/bitmap-plot-3.log index 758cc0ea0..618edc412 100644 --- a/src/test/ref/bitmap-plot-3.log +++ b/src/test/ref/bitmap-plot-3.log @@ -566,8 +566,8 @@ sgn_u16::@return: scope:[sgn_u16] from sgn_u16::@1 sgn_u16::@3 @46: scope:[] from @8 (byte*) bitmap_screen#19 ← phi( @8/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#20 ← phi( @8/(byte*) bitmap_gfx#0 ) - (byte*) BITMAP#0 ← ((byte*)) (number) $2000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) BITMAP ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$180]) SINTAB ← kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} (byte*~) $0 ← (byte[$180]) SINTAB + (number) $40 (byte*) COSTAB#0 ← (byte*~) $0 @@ -578,8 +578,8 @@ main: scope:[main] from @47 (byte*) COSTAB#9 ← phi( @47/(byte*) COSTAB#10 ) (byte*) bitmap_screen#12 ← phi( @47/(byte*) bitmap_screen#14 ) (byte*) bitmap_gfx#13 ← phi( @47/(byte*) bitmap_gfx#15 ) - (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 - (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN call bitmap_init to:main::@14 main::@14: scope:[main] from main @@ -600,8 +600,8 @@ main::@15: scope:[main] from main::@14 (byte~) main::$3 ← (byte~) main::$2 | (byte) VIC_RSEL (number~) main::$4 ← (byte~) main::$3 | (number) 3 *((byte*) D011) ← (number~) main::$4 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@15 (byte*) bitmap_screen#28 ← phi( main::@15/(byte*) bitmap_screen#29 ) @@ -683,7 +683,7 @@ main::@7: scope:[main] from main::@1 main::@8 main::@8: scope:[main] from main::@7 (byte*) bitmap_screen#18 ← phi( main::@7/(byte*) bitmap_screen#13 ) (byte*) bitmap_gfx#19 ← phi( main::@7/(byte*) bitmap_gfx#14 ) - (byte*~) main::$19 ← (byte*) SCREEN#0 + (number) $3e7 + (byte*~) main::$19 ← (byte*) SCREEN + (number) $3e7 *((byte*~) main::$19) ← ++ *((byte*~) main::$19) to:main::@7 main::@return: scope:[main] from main::@7 @@ -716,7 +716,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BITMAP -(byte*) BITMAP#0 (byte) BLACK (byte*) COSTAB (byte*) COSTAB#0 @@ -737,7 +736,6 @@ SYMBOL TABLE SSA (const byte) RADIX::HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL = (number) 8 (byte*) SCREEN -(byte*) SCREEN#0 (byte[$180]) SINTAB (byte) VIC_BMM (byte) VIC_DEN @@ -1309,7 +1307,7 @@ Adding number conversion cast (unumber) main::$12 in (number~) main::$12 ← (wo Adding number conversion cast (unumber) $20 in (number~) main::$13 ← (byte) main::a#2 + (number) $20 Adding number conversion cast (unumber) main::$13 in (number~) main::$13 ← (byte) main::a#2 + (unumber)(number) $20 Adding number conversion cast (unumber) $20 in (byte) main::a#1 ← (byte) main::a#3 + (number) $20 -Adding number conversion cast (unumber) $3e7 in (byte*~) main::$19 ← (byte*) SCREEN#0 + (number) $3e7 +Adding number conversion cast (unumber) $3e7 in (byte*~) main::$19 ← (byte*) SCREEN + (number) $3e7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) D011 ← (byte*)(number) $d011 Inlining cast (byte) VIC_BMM ← (unumber)(number) $20 @@ -1329,8 +1327,8 @@ Inlining cast (byte~) bitmap_line::$13 ← (byte)(word) bitmap_line::y#7 Inlining cast (byte~) bitmap_line::$24 ← (byte)(word) bitmap_line::y#8 Inlining cast (word) sgn_u16::return#2 ← (unumber)(number) -1 Inlining cast (word) sgn_u16::return#3 ← (unumber)(number) 1 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 @@ -1662,18 +1660,18 @@ Constant (const byte) memset::c#1 = 0 Constant (const word) memset::num#1 = $1f40 Constant (const word) sgn_u16::return#2 = -1 Constant (const word) sgn_u16::return#3 = 1 -Constant (const byte*) BITMAP#0 = (byte*) 8192 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) BITMAP = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$180]) SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} Constant (const byte) main::i#0 = 0 Constant (const byte) main::a#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte*) bitmap_init::gfx#0 = BITMAP +Constant (const byte*) bitmap_init::screen#0 = SCREEN Constant (const byte) bitmap_clear::bgcol#0 = BLACK Constant (const byte) bitmap_clear::fgcol#0 = WHITE -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) bitmap_gfx#1 = bitmap_init::gfx#0 Constant (const byte*) bitmap_screen#1 = bitmap_init::screen#0 @@ -1723,7 +1721,7 @@ Successful SSA optimization Pass2ConditionalJumpSequenceImprovement Constant right-side identified [31] (byte) bitmap_clear::col#0 ← (const byte) bitmap_clear::fgcol#0 * (byte) $10 Constant right-side identified [112] (byte*) COSTAB#0 ← (const byte[$180]) SINTAB + (byte) $40 Constant right-side identified [115] (byte~) main::$2 ← (const byte) VIC_BMM | (const byte) VIC_DEN -Constant right-side identified [142] (byte*~) main::$19 ← (const byte*) SCREEN#0 + (word) $3e7 +Constant right-side identified [142] (byte*~) main::$19 ← (const byte*) SCREEN + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) bitmap_clear::col#0 = bitmap_clear::fgcol#0*$10 Constant (const void*) memset::str#0 = (void*)bitmap_screen#1 @@ -1732,7 +1730,7 @@ Constant (const byte*) COSTAB#0 = SINTAB+$40 Constant (const byte) main::$2 = VIC_BMM|VIC_DEN Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 -Constant (const byte*) main::$19 = SCREEN#0+$3e7 +Constant (const byte*) main::$19 = SCREEN+$3e7 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) memset::c#0 = bitmap_clear::col#0 Successful SSA optimization Pass2ConstantIdentification @@ -1784,32 +1782,32 @@ Inlining constant with var siblings (const word) sgn_u16::return#2 Inlining constant with var siblings (const word) sgn_u16::return#3 Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::a#0 -Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 -Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP Constant inlined memset::num#1 = (word) $1f40 Constant inlined memset::num#0 = (word) $3e8 Constant inlined bitmap_init::bits#0 = (byte) $80 Constant inlined bitmap_init::bits#2 = (byte) $80 Constant inlined main::a#0 = (byte) 0 -Constant inlined main::$19 = (const byte*) SCREEN#0+(word) $3e7 +Constant inlined main::$19 = (const byte*) SCREEN+(word) $3e7 Constant inlined sgn_u16::return#3 = (byte) 1 Constant inlined main::i#0 = (byte) 0 Constant inlined sgn_u16::return#2 = (byte) -1 -Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined bitmap_screen#1 = (const byte*) SCREEN Constant inlined main::$2 = (const byte) VIC_BMM|(const byte) VIC_DEN Constant inlined bitmap_init::y#0 = (byte) 0 Constant inlined main::$3 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL @@ -2007,7 +2005,7 @@ main::@1: scope:[main] from main::@4 main::@7 [12] if((byte) main::i#2!=(byte) 8) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 - [13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + [13] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) to:main::@3 main::@2: scope:[main] from main::@1 [14] (word~) main::$7 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) @@ -2183,7 +2181,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [100] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [100] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [100] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [100] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [101] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -2223,7 +2221,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [117] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [118] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [118] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [118] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [119] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [120] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -2247,9 +2245,7 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP (byte*) COSTAB -(byte*) SCREEN (word()) abs_u16((word) abs_u16::w) (byte~) abs_u16::$0 4.0 (byte~) abs_u16::$1 4.0 @@ -2613,7 +2609,7 @@ main: { jmp b3 // main::@3 b3: - // [13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [13] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 jmp b3 // main::@2 @@ -3206,7 +3202,7 @@ bitmap_clear: { // [100] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 lda #col sta.z memset.c - // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -3228,7 +3224,7 @@ bitmap_clear: { // [100] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -3370,7 +3366,7 @@ bitmap_init: { bne b1_from_b2 // [118] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -3844,7 +3840,7 @@ main: { jmp b3 // main::@3 b3: - // [13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [13] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 jmp b3 // main::@2 @@ -4374,7 +4370,7 @@ bitmap_clear: { memset_from_bitmap_clear: // [100] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -4395,7 +4391,7 @@ bitmap_clear: { memset_from_b1: // [100] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -4519,7 +4515,7 @@ bitmap_init: { bne b1_from_b2 // [118] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -4751,8 +4747,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (byte*) COSTAB (const byte*) COSTAB#0 COSTAB = (const byte[$180]) SINTAB+(byte) $40 (const byte*) D011 D011 = (byte*) 53265 @@ -4761,8 +4756,7 @@ FINAL SYMBOL TABLE (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$180]) SINTAB SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -4922,7 +4916,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -5057,7 +5051,7 @@ main: { // main::@3 b3: // (*(SCREEN+999))++; - // [13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [13] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 jmp b3 // main::@2 @@ -5578,7 +5572,7 @@ bitmap_clear: { // [100] phi from bitmap_clear to memset [phi:bitmap_clear->memset] // [100] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -5596,7 +5590,7 @@ bitmap_clear: { // [100] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] // [100] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [100] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -5711,7 +5705,7 @@ bitmap_init: { cpx #0 bne b1 // [118] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [118] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/bitmap-plot-3.sym b/src/test/ref/bitmap-plot-3.sym index fed0cffae..451dab58a 100644 --- a/src/test/ref/bitmap-plot-3.sym +++ b/src/test/ref/bitmap-plot-3.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (byte*) COSTAB (const byte*) COSTAB#0 COSTAB = (const byte[$180]) SINTAB+(byte) $40 (const byte*) D011 D011 = (byte*) 53265 @@ -11,8 +10,7 @@ (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$180]) SINTAB SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -172,7 +170,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 diff --git a/src/test/ref/bitmap-plotter.cfg b/src/test/ref/bitmap-plotter.cfg index 292fa9511..11b9738e6 100644 --- a/src/test/ref/bitmap-plotter.cfg +++ b/src/test/ref/bitmap-plotter.cfg @@ -10,10 +10,10 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) BGCOL#0) ← (byte) 0 - [5] *((const byte*) FGCOL#0) ← (byte) 0 - [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 - [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 + [4] *((const byte*) BGCOL) ← (byte) 0 + [5] *((const byte*) FGCOL) ← (byte) 0 + [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 + [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [8] call init_screen to:main::@3 main::@3: scope:[main] from main @@ -21,14 +21,14 @@ main::@3: scope:[main] from main [10] call init_plot_tables to:main::@1 main::@1: scope:[main] from main::@1 main::@3 main::@4 - [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 + [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [13] call plots to:main::@4 main::@4: scope:[main] from main::@2 - [14] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 (void()) plots() @@ -37,7 +37,7 @@ plots: scope:[plots] from main::@2 to:plots::@1 plots::@1: scope:[plots] from plots plots::@3 [16] (byte) plots::i#2 ← phi( plots/(byte) 0 plots::@3/(byte) plots::i#1 ) - [17] if((byte) plots::i#2<(const byte) plots_cnt#0) goto plots::@2 + [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 to:plots::@return plots::@return: scope:[plots] from plots::@1 [18] return @@ -123,8 +123,8 @@ init_screen::@1: scope:[init_screen] from init_screen init_screen::@2 [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 to:init_screen::@3 init_screen::@3: scope:[init_screen] from init_screen::@1 init_screen::@4 - [63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN#0 init_screen::@4/(byte*) init_screen::c#1 ) - [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 + [63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN init_screen::@4/(byte*) init_screen::c#1 ) + [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 to:init_screen::@return init_screen::@return: scope:[init_screen] from init_screen::@3 [65] return diff --git a/src/test/ref/bitmap-plotter.log b/src/test/ref/bitmap-plotter.log index 3fe264070..63f386b53 100644 --- a/src/test/ref/bitmap-plotter.log +++ b/src/test/ref/bitmap-plotter.log @@ -33,33 +33,33 @@ Culled Empty Block (label) init_screen::@12 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) D011#0 ← ((byte*)) (number) $d011 - (byte) BMM#0 ← (number) $20 - (byte) DEN#0 ← (number) $10 - (byte) RSEL#0 ← (number) 8 - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) D018#0 ← ((byte*)) (number) $d018 - (byte*) BGCOL#0 ← ((byte*)) (number) $d020 - (byte*) FGCOL#0 ← ((byte*)) (number) $d021 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) D011 ← ((byte*)) (number) $d011 + (byte) BMM ← (number) $20 + (byte) DEN ← (number) $10 + (byte) RSEL ← (number) 8 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) D018 ← ((byte*)) (number) $d018 + (byte*) BGCOL ← ((byte*)) (number) $d020 + (byte*) FGCOL ← ((byte*)) (number) $d021 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte*) BITMAP ← ((byte*)) (number) $2000 to:@1 (void()) main() main: scope:[main] from @5 - *((byte*) BGCOL#0) ← (number) 0 - *((byte*) FGCOL#0) ← (number) 0 - (byte~) main::$0 ← (byte) BMM#0 | (byte) DEN#0 - (byte~) main::$1 ← (byte~) main::$0 | (byte) RSEL#0 + *((byte*) BGCOL) ← (number) 0 + *((byte*) FGCOL) ← (number) 0 + (byte~) main::$0 ← (byte) BMM | (byte) DEN + (byte~) main::$1 ← (byte~) main::$0 | (byte) RSEL (number~) main::$2 ← (byte~) main::$1 | (number) 3 - *((byte*) D011#0) ← (number~) main::$2 - (word~) main::$3 ← ((word)) (byte*) SCREEN#0 + *((byte*) D011) ← (number~) main::$2 + (word~) main::$3 ← ((word)) (byte*) SCREEN (number~) main::$4 ← (word~) main::$3 / (number) $40 (word~) main::$5 ← ((word)) (byte*) BITMAP (number~) main::$6 ← (word~) main::$5 / (number) $400 (number~) main::$7 ← (number~) main::$4 | (number~) main::$6 (byte~) main::$8 ← ((byte)) (number~) main::$7 - *((byte*) D018#0) ← (byte~) main::$8 + *((byte*) D018) ← (byte~) main::$8 call init_screen to:main::@5 main::@5: scope:[main] from main @@ -68,15 +68,15 @@ main::@5: scope:[main] from main main::@6: scope:[main] from main::@5 to:main::@2 main::@2: scope:[main] from main::@2 main::@6 main::@7 - (bool~) main::$11 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$11 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$11) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) call plots to:main::@7 main::@7: scope:[main] from main::@3 - *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) + *((byte*) BGCOL) ← -- *((byte*) BGCOL) if(true) goto main::@2 to:main::@return main::@return: scope:[main] from main::@7 @@ -85,7 +85,7 @@ main::@return: scope:[main] from main::@7 @1: scope:[] from @begin (byte[]) plots_x ← { (number) $3c, (number) $50, (number) $6e, (number) $50, (number) $3c, (number) $28, (number) $a, (number) $28 } (byte[]) plots_y ← { (number) $a, (number) $28, (number) $3c, (number) $50, (number) $6e, (number) $50, (number) $3c, (number) $28 } - (byte) plots_cnt#0 ← (number) 8 + (byte) plots_cnt ← (number) 8 to:@2 (void()) plots() @@ -94,7 +94,7 @@ plots: scope:[plots] from main::@3 to:plots::@1 plots::@1: scope:[plots] from plots plots::@7 (byte) plots::i#2 ← phi( plots/(byte) plots::i#0 plots::@7/(byte) plots::i#1 ) - (bool~) plots::$0 ← (byte) plots::i#2 < (byte) plots_cnt#0 + (bool~) plots::$0 ← (byte) plots::i#2 < (byte) plots_cnt if((bool~) plots::$0) goto plots::@2 to:plots::@return plots::@2: scope:[plots] from plots::@1 @@ -222,11 +222,11 @@ init_screen::@2: scope:[init_screen] from init_screen::@1 (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#3 to:init_screen::@1 init_screen::@3: scope:[init_screen] from init_screen::@1 - (byte*) init_screen::c#0 ← (byte*) SCREEN#0 + (byte*) init_screen::c#0 ← (byte*) SCREEN to:init_screen::@7 init_screen::@7: scope:[init_screen] from init_screen::@3 init_screen::@8 (byte*) init_screen::c#2 ← phi( init_screen::@3/(byte*) init_screen::c#0 init_screen::@8/(byte*) init_screen::c#1 ) - (byte*~) init_screen::$2 ← (byte*) SCREEN#0 + (number) $400 + (byte*~) init_screen::$2 ← (byte*) SCREEN + (number) $400 (bool~) init_screen::$3 ← (byte*) init_screen::c#2 != (byte*~) init_screen::$2 if((bool~) init_screen::$3) goto init_screen::@8 to:init_screen::@return @@ -253,24 +253,15 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) BITMAP (byte) BMM -(byte) BMM#0 (byte*) D011 -(byte*) D011#0 (byte*) D018 -(byte*) D018#0 (byte) DEN -(byte) DEN#0 (byte*) FGCOL -(byte*) FGCOL#0 (byte*) RASTER -(byte*) RASTER#0 (byte) RSEL -(byte) RSEL#0 (byte*) SCREEN -(byte*) SCREEN#0 (void()) init_plot_tables() (number~) init_plot_tables::$0 (byte~) init_plot_tables::$1 @@ -399,15 +390,14 @@ SYMBOL TABLE SSA (byte) plots::i#3 (byte) plots::i#4 (byte) plots_cnt -(byte) plots_cnt#0 (byte[]) plots_x (byte[]) plots_y -Adding number conversion cast (unumber) $20 in (byte) BMM#0 ← (number) $20 -Adding number conversion cast (unumber) $10 in (byte) DEN#0 ← (number) $10 -Adding number conversion cast (unumber) 8 in (byte) RSEL#0 ← (number) 8 -Adding number conversion cast (unumber) 0 in *((byte*) BGCOL#0) ← (number) 0 -Adding number conversion cast (unumber) 0 in *((byte*) FGCOL#0) ← (number) 0 +Adding number conversion cast (unumber) $20 in (byte) BMM ← (number) $20 +Adding number conversion cast (unumber) $10 in (byte) DEN ← (number) $10 +Adding number conversion cast (unumber) 8 in (byte) RSEL ← (number) 8 +Adding number conversion cast (unumber) 0 in *((byte*) BGCOL) ← (number) 0 +Adding number conversion cast (unumber) 0 in *((byte*) FGCOL) ← (number) 0 Adding number conversion cast (unumber) 3 in (number~) main::$2 ← (byte~) main::$1 | (number) 3 Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte~) main::$1 | (unumber)(number) 3 Adding number conversion cast (unumber) $40 in (number~) main::$4 ← (word~) main::$3 / (number) $40 @@ -415,8 +405,8 @@ Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (word Adding number conversion cast (unumber) $400 in (number~) main::$6 ← (word~) main::$5 / (number) $400 Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (word~) main::$5 / (unumber)(number) $400 Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (unumber~) main::$4 | (unumber~) main::$6 -Adding number conversion cast (unumber) $ff in (bool~) main::$11 ← *((byte*) RASTER#0) != (number) $ff -Adding number conversion cast (unumber) 8 in (byte) plots_cnt#0 ← (number) 8 +Adding number conversion cast (unumber) $ff in (bool~) main::$11 ← *((byte*) RASTER) != (number) $ff +Adding number conversion cast (unumber) 8 in (byte) plots_cnt ← (number) 8 Adding number conversion cast (unumber) 0 in (byte) plots::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (word) plot::plotter_y#0 ← (number) 0 Adding number conversion cast (unumber) $80 in (byte) init_plot_tables::bits#0 ← (number) $80 @@ -435,28 +425,28 @@ Adding number conversion cast (unumber) 7 in (bool~) init_plot_tables::$11 ← ( Adding number conversion cast (unumber) $28*8 in (byte*~) init_plot_tables::$13 ← (byte*) init_plot_tables::yoffs#3 + (number) $28*(number) 8 Adding number conversion cast (unumber) $2000 in (byte*~) init_screen::$0 ← (byte*) BITMAP + (number) $2000 Adding number conversion cast (unumber) 0 in *((byte*) init_screen::b#3) ← (number) 0 -Adding number conversion cast (unumber) $400 in (byte*~) init_screen::$2 ← (byte*) SCREEN#0 + (number) $400 +Adding number conversion cast (unumber) $400 in (byte*~) init_screen::$2 ← (byte*) SCREEN + (number) $400 Adding number conversion cast (unumber) $14 in *((byte*) init_screen::c#3) ← (number) $14 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) plots_x ← (byte[]){ (byte)(number) $3c, (byte)(number) $50, (byte)(number) $6e, (byte)(number) $50, (byte)(number) $3c, (byte)(number) $28, (byte)(number) $a, (byte)(number) $28 } Added casts to value list in (byte[]) plots_y ← (byte[]){ (byte)(number) $a, (byte)(number) $28, (byte)(number) $3c, (byte)(number) $50, (byte)(number) $6e, (byte)(number) $50, (byte)(number) $3c, (byte)(number) $28 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) D011#0 ← (byte*)(number) $d011 -Inlining cast (byte) BMM#0 ← (unumber)(number) $20 -Inlining cast (byte) DEN#0 ← (unumber)(number) $10 -Inlining cast (byte) RSEL#0 ← (unumber)(number) 8 -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) D018#0 ← (byte*)(number) $d018 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d020 -Inlining cast (byte*) FGCOL#0 ← (byte*)(number) $d021 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) D011 ← (byte*)(number) $d011 +Inlining cast (byte) BMM ← (unumber)(number) $20 +Inlining cast (byte) DEN ← (unumber)(number) $10 +Inlining cast (byte) RSEL ← (unumber)(number) 8 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) D018 ← (byte*)(number) $d018 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d020 +Inlining cast (byte*) FGCOL ← (byte*)(number) $d021 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 0 -Inlining cast *((byte*) FGCOL#0) ← (unumber)(number) 0 -Inlining cast (word~) main::$3 ← (word)(byte*) SCREEN#0 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 0 +Inlining cast *((byte*) FGCOL) ← (unumber)(number) 0 +Inlining cast (word~) main::$3 ← (word)(byte*) SCREEN Inlining cast (word~) main::$5 ← (word)(byte*) BITMAP Inlining cast (byte~) main::$8 ← (byte)(unumber~) main::$7 -Inlining cast (byte) plots_cnt#0 ← (unumber)(number) 8 +Inlining cast (byte) plots_cnt ← (unumber)(number) 8 Inlining cast (byte) plots::i#0 ← (unumber)(number) 0 Inlining cast (byte*) plot::plotter_x#0 ← (byte*)(number) 0 Inlining cast (word) plot::plotter_y#0 ← (unumber)(number) 0 @@ -571,8 +561,8 @@ Identical Phi Values (byte) plot::y#1 (byte) plot::y#0 Successful SSA optimization Pass2IdenticalPhiElimination Identified duplicate assignment right side [95] (byte~) init_plot_tables::$10 ← (byte) init_plot_tables::y#2 & (byte) 7 Successful SSA optimization Pass2DuplicateRValueIdentification -Simple Condition (bool~) main::$11 [26] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@2 -Simple Condition (bool~) plots::$0 [38] if((byte) plots::i#2<(byte) plots_cnt#0) goto plots::@2 +Simple Condition (bool~) main::$11 [26] if(*((byte*) RASTER)!=(byte) $ff) goto main::@2 +Simple Condition (bool~) plots::$0 [38] if((byte) plots::i#2<(byte) plots_cnt) goto plots::@2 Simple Condition (bool~) init_plot_tables::$4 [79] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@2 Simple Condition (bool~) init_plot_tables::$5 [83] if((byte) init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 Simple Condition (bool~) init_plot_tables::$12 [98] if((byte~) init_plot_tables::$10!=(byte) 7) goto init_plot_tables::@6 @@ -589,19 +579,19 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Identified constant from value list (byte[]) { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28 } Identified constant from value list (byte[]) { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) D011#0 = (byte*) 53265 -Constant (const byte) BMM#0 = $20 -Constant (const byte) DEN#0 = $10 -Constant (const byte) RSEL#0 = 8 -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) D018#0 = (byte*) 53272 -Constant (const byte*) BGCOL#0 = (byte*) 53280 -Constant (const byte*) FGCOL#0 = (byte*) 53281 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) D011 = (byte*) 53265 +Constant (const byte) BMM = $20 +Constant (const byte) DEN = $10 +Constant (const byte) RSEL = 8 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) D018 = (byte*) 53272 +Constant (const byte*) BGCOL = (byte*) 53280 +Constant (const byte*) FGCOL = (byte*) 53281 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte*) BITMAP = (byte*) 8192 Constant (const byte[]) plots_x = { $3c, $50, $6e, $50, $3c, $28, $a, $28 } Constant (const byte[]) plots_y = { $a, $28, $3c, $50, $6e, $50, $3c, $28 } -Constant (const byte) plots_cnt#0 = 8 +Constant (const byte) plots_cnt = 8 Constant (const byte) plots::i#0 = 0 Constant (const byte[$100]) plot_xlo = { fill( $100, 0) } Constant (const byte[$100]) plot_xhi = { fill( $100, 0) } @@ -617,9 +607,9 @@ Constant (const byte*) init_plot_tables::yoffs#0 = (byte*) 0 Constant (const byte) init_plot_tables::y#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) init_screen::b#0 = BITMAP -Constant (const byte*) init_screen::c#0 = SCREEN#0 +Constant (const byte*) init_screen::c#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification -Constant value identified (word)SCREEN#0 in [16] (word~) main::$3 ← (word)(const byte*) SCREEN#0 +Constant value identified (word)SCREEN in [16] (word~) main::$3 ← (word)(const byte*) SCREEN Constant value identified (word)BITMAP in [18] (word~) main::$5 ← (word)(const byte*) BITMAP Successful SSA optimization Pass2ConstantValues if() condition always true - replacing block destination [30] if(true) goto main::@2 @@ -641,23 +631,23 @@ Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Alias (byte~) init_plot_tables::$10 = (byte~) init_plot_tables::$6 Successful SSA optimization Pass2AliasElimination -Constant right-side identified [2] (byte~) main::$0 ← (const byte) BMM#0 | (const byte) DEN#0 +Constant right-side identified [2] (byte~) main::$0 ← (const byte) BMM | (const byte) DEN Constant right-side identified [41] (byte~) init_plot_tables::$1 ← > (const byte*) BITMAP Constant right-side identified [64] (byte*~) init_screen::$0 ← (const byte*) BITMAP + (word) $2000 -Constant right-side identified [69] (byte*~) init_screen::$2 ← (const byte*) SCREEN#0 + (word) $400 +Constant right-side identified [69] (byte*~) init_screen::$2 ← (const byte*) SCREEN + (word) $400 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::$0 = BMM#0|DEN#0 -Constant (const word) main::$3 = (word)SCREEN#0 +Constant (const byte) main::$0 = BMM|DEN +Constant (const word) main::$3 = (word)SCREEN Constant (const word) main::$5 = (word)BITMAP Constant (const byte) init_plot_tables::$1 = >BITMAP Constant (const byte*) init_screen::$0 = BITMAP+$2000 -Constant (const byte*) init_screen::$2 = SCREEN#0+$400 +Constant (const byte*) init_screen::$2 = SCREEN+$400 Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [2] (byte~) main::$1 ← (const byte) main::$0 | (const byte) RSEL#0 +Constant right-side identified [2] (byte~) main::$1 ← (const byte) main::$0 | (const byte) RSEL Constant right-side identified [5] (word~) main::$4 ← (const word) main::$3 / (byte) $40 Constant right-side identified [6] (word~) main::$6 ← (const word) main::$5 / (word) $400 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::$1 = main::$0|RSEL#0 +Constant (const byte) main::$1 = main::$0|RSEL Constant (const word) main::$4 = main::$3/$40 Constant (const word) main::$6 = main::$5/$400 Successful SSA optimization Pass2ConstantIdentification @@ -688,23 +678,23 @@ Constant inlined init_plot_tables::bits#2 = (byte) $80 Constant inlined init_plot_tables::bits#0 = (byte) $80 Constant inlined plot::plotter_y#0 = (byte) 0 Constant inlined plot::plotter_x#0 = (byte*) 0 -Constant inlined init_screen::$2 = (const byte*) SCREEN#0+(word) $400 -Constant inlined main::$1 = (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0 +Constant inlined init_screen::$2 = (const byte*) SCREEN+(word) $400 +Constant inlined main::$1 = (const byte) BMM|(const byte) DEN|(const byte) RSEL Constant inlined init_plot_tables::$1 = >(const byte*) BITMAP -Constant inlined main::$2 = (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 -Constant inlined main::$0 = (const byte) BMM#0|(const byte) DEN#0 +Constant inlined main::$2 = (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 +Constant inlined main::$0 = (const byte) BMM|(const byte) DEN Constant inlined main::$5 = (word)(const byte*) BITMAP Constant inlined init_plot_tables::y#0 = (byte) 0 Constant inlined main::$6 = (word)(const byte*) BITMAP/(word) $400 Constant inlined init_plot_tables::yoffs#0 = (byte*) 0 -Constant inlined main::$3 = (word)(const byte*) SCREEN#0 -Constant inlined main::$4 = (word)(const byte*) SCREEN#0/(byte) $40 +Constant inlined main::$3 = (word)(const byte*) SCREEN +Constant inlined main::$4 = (word)(const byte*) SCREEN/(byte) $40 Constant inlined init_plot_tables::x#0 = (byte) 0 -Constant inlined init_screen::c#0 = (const byte*) SCREEN#0 +Constant inlined init_screen::c#0 = (const byte*) SCREEN Constant inlined init_screen::b#0 = (const byte*) BITMAP -Constant inlined main::$7 = (word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 +Constant inlined main::$7 = (word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 Constant inlined init_screen::$0 = (const byte*) BITMAP+(word) $2000 -Constant inlined main::$8 = (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 +Constant inlined main::$8 = (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting init_plot_tables::@9(between init_plot_tables::@2 and init_plot_tables::@1) Added new block during phi lifting init_plot_tables::@10(between init_plot_tables::@1 and init_plot_tables::@2) @@ -785,10 +775,10 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) BGCOL#0) ← (byte) 0 - [5] *((const byte*) FGCOL#0) ← (byte) 0 - [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 - [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 + [4] *((const byte*) BGCOL) ← (byte) 0 + [5] *((const byte*) FGCOL) ← (byte) 0 + [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 + [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [8] call init_screen to:main::@3 main::@3: scope:[main] from main @@ -796,14 +786,14 @@ main::@3: scope:[main] from main [10] call init_plot_tables to:main::@1 main::@1: scope:[main] from main::@1 main::@3 main::@4 - [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 + [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [13] call plots to:main::@4 main::@4: scope:[main] from main::@2 - [14] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 (void()) plots() @@ -812,7 +802,7 @@ plots: scope:[plots] from main::@2 to:plots::@1 plots::@1: scope:[plots] from plots plots::@3 [16] (byte) plots::i#2 ← phi( plots/(byte) 0 plots::@3/(byte) plots::i#1 ) - [17] if((byte) plots::i#2<(const byte) plots_cnt#0) goto plots::@2 + [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 to:plots::@return plots::@return: scope:[plots] from plots::@1 [18] return @@ -898,8 +888,8 @@ init_screen::@1: scope:[init_screen] from init_screen init_screen::@2 [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 to:init_screen::@3 init_screen::@3: scope:[init_screen] from init_screen::@1 init_screen::@4 - [63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN#0 init_screen::@4/(byte*) init_screen::c#1 ) - [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 + [63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN init_screen::@4/(byte*) init_screen::c#1 ) + [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 to:init_screen::@return init_screen::@return: scope:[init_screen] from init_screen::@3 [65] return @@ -915,15 +905,6 @@ init_screen::@2: scope:[init_screen] from init_screen::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte) BMM -(byte*) D011 -(byte*) D018 -(byte) DEN -(byte*) FGCOL -(byte*) RASTER -(byte) RSEL -(byte*) SCREEN (void()) init_plot_tables() (byte~) init_plot_tables::$0 22.0 (byte~) init_plot_tables::$10 5.5 @@ -974,7 +955,6 @@ VARIABLE REGISTER WEIGHTS (byte) plots::i (byte) plots::i#1 202.0 (byte) plots::i#2 101.0 -(byte) plots_cnt Initial phi equivalence classes [ plots::i#2 plots::i#1 ] @@ -1086,16 +1066,16 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL - // [5] *((const byte*) FGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta FGCOL - // [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #BMM|DEN|RSEL|3 sta D011 - // [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|BITMAP/$400 sta D018 // [8] call init_screen @@ -1114,14 +1094,14 @@ main: { jmp b1 // main::@1 b1: - // [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 jmp b2 // main::@2 b2: - // [12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [13] call plots // [15] phi from main::@2 to plots [phi:main::@2->plots] @@ -1130,7 +1110,7 @@ main: { jmp b4 // main::@4 b4: - // [14] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -1145,7 +1125,7 @@ plots: { jmp b1 // plots::@1 b1: - // [17] if((byte) plots::i#2<(const byte) plots_cnt#0) goto plots::@2 -- vbuz1_lt_vbuc1_then_la1 + // [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z i cmp #plots_cnt bcc b2 @@ -1420,7 +1400,7 @@ init_screen: { bne b2 // [63] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3] b3_from_b1: - // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN#0 [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 + // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1428,7 +1408,7 @@ init_screen: { jmp b3 // init_screen::@3 b3: - // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 + // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z c+1 cmp #>SCREEN+$400 bne b4 @@ -1482,11 +1462,11 @@ init_screen: { REGISTER UPLIFT POTENTIAL REGISTERS Equivalence Class zp ZP_BYTE:31 [ init_plot_tables::$7 ] has ALU potential. -Statement [4] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) FGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) FGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ plots::i#2 plots::i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ plot::x#0 ] @@ -1503,14 +1483,14 @@ Statement [40] *((const byte[$100]) plot_bit + (byte) init_plot_tables::x#2) ← Statement [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ init_plot_tables::y#2 init_plot_tables::y#1 ] Statement [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a -Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a +Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a Statement [66] *((byte*) init_screen::c#2) ← (byte) $14 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y Statement [68] *((byte*) init_screen::b#2) ← (byte) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a reg byte y -Statement [4] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) FGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) FGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7 [ plot::x#0 plot::y#0 plot::plotter_x#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 ] ) always clobbers reg byte a Statement [30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ] ) always clobbers reg byte a Statement [31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter#0 ] ) always clobbers reg byte a @@ -1522,7 +1502,7 @@ Statement [40] *((const byte[$100]) plot_bit + (byte) init_plot_tables::x#2) ← Statement [48] (byte~) init_plot_tables::$10 ← (byte) init_plot_tables::y#2 & (byte) 7 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$10 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 init_plot_tables::$10 ] ) always clobbers reg byte a Statement [55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ) always clobbers reg byte a Statement [62] if((byte*) init_screen::b#2!=(const byte*) BITMAP+(word) $2000) goto init_screen::@2 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a -Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a +Statement [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a Statement [66] *((byte*) init_screen::c#2) ← (byte) $14 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) always clobbers reg byte a reg byte y Statement [68] *((byte*) init_screen::b#2) ← (byte) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) always clobbers reg byte a reg byte y Potential registers zp ZP_BYTE:2 [ plots::i#2 plots::i#1 ] : zp ZP_BYTE:2 , reg byte x , @@ -1630,16 +1610,16 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL - // [5] *((const byte*) FGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta FGCOL - // [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #BMM|DEN|RSEL|3 sta D011 - // [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|BITMAP/$400 sta D018 // [8] call init_screen @@ -1658,14 +1638,14 @@ main: { jmp b1 // main::@1 b1: - // [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 jmp b2 // main::@2 b2: - // [12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [13] call plots // [15] phi from main::@2 to plots [phi:main::@2->plots] @@ -1674,7 +1654,7 @@ main: { jmp b4 // main::@4 b4: - // [14] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -1687,7 +1667,7 @@ plots: { jmp b1 // plots::@1 b1: - // [17] if((byte) plots::i#2<(const byte) plots_cnt#0) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 + // [17] if((byte) plots::i#2<(const byte) plots_cnt) goto plots::@2 -- vbuxx_lt_vbuc1_then_la1 cpx #plots_cnt bcc b2 jmp breturn @@ -1912,7 +1892,7 @@ init_screen: { bne b2 // [63] phi from init_screen::@1 to init_screen::@3 [phi:init_screen::@1->init_screen::@3] b3_from_b1: - // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN#0 [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 + // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1920,7 +1900,7 @@ init_screen: { jmp b3 // init_screen::@3 b3: - // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 + // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z c+1 cmp #>SCREEN+$400 bne b4 @@ -2054,25 +2034,16 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) BGCOL BGCOL = (byte*) 53280 (const byte*) BITMAP BITMAP = (byte*) 8192 -(byte) BMM -(const byte) BMM#0 BMM = (byte) $20 -(byte*) D011 -(const byte*) D011#0 D011 = (byte*) 53265 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte) DEN -(const byte) DEN#0 DEN = (byte) $10 -(byte*) FGCOL -(const byte*) FGCOL#0 FGCOL = (byte*) 53281 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte) RSEL -(const byte) RSEL#0 RSEL = (byte) 8 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte) BMM BMM = (byte) $20 +(const byte*) D011 D011 = (byte*) 53265 +(const byte*) D018 D018 = (byte*) 53272 +(const byte) DEN DEN = (byte) $10 +(const byte*) FGCOL FGCOL = (byte*) 53281 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte) RSEL RSEL = (byte) 8 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) init_plot_tables() (byte~) init_plot_tables::$0 reg byte a 22.0 (byte~) init_plot_tables::$10 $10 zp ZP_BYTE:7 5.5 @@ -2149,8 +2120,7 @@ FINAL SYMBOL TABLE (byte) plots::i (byte) plots::i#1 reg byte x 202.0 (byte) plots::i#2 reg byte x 101.0 -(byte) plots_cnt -(const byte) plots_cnt#0 plots_cnt = (byte) 8 +(const byte) plots_cnt plots_cnt = (byte) 8 (const byte[]) plots_x plots_x = { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28 } (const byte[]) plots_y plots_y = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 } @@ -2202,18 +2172,18 @@ Score: 6531 // main main: { // *BGCOL = 0 - // [4] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL // *FGCOL = 0 - // [5] *((const byte*) FGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) FGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 sta FGCOL // *D011 = BMM|DEN|RSEL|3 - // [6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) D011) ← (const byte) BMM|(const byte) DEN|(const byte) RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #BMM|DEN|RSEL|3 sta D011 // *D018 = (byte)(((word)SCREEN/$40)|((word)BITMAP/$400)) - // [7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) BITMAP/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|BITMAP/$400 sta D018 // init_screen() @@ -2229,13 +2199,13 @@ main: { // main::@1 b1: // while (*RASTER!=$ff) - // [11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [11] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 // main::@2 // (*BGCOL)++; - // [12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [12] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // plots() // [13] call plots @@ -2243,7 +2213,7 @@ main: { jsr plots // main::@4 // (*BGCOL)--; - // [14] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [14] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -2255,7 +2225,7 @@ plots: { // plots::@1 b1: // for(byte i=0; iinit_screen::@3] - // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN#0 [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 + // [63] phi (byte*) init_screen::c#2 = (const byte*) SCREEN [phi:init_screen::@1->init_screen::@3#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2482,7 +2452,7 @@ init_screen: { // init_screen::@3 b3: // for(byte* c = SCREEN; c!=SCREEN+$400;c++) - // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 + // [64] if((byte*) init_screen::c#2!=(const byte*) SCREEN+(word) $400) goto init_screen::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z c+1 cmp #>SCREEN+$400 bne b4 diff --git a/src/test/ref/bitmap-plotter.sym b/src/test/ref/bitmap-plotter.sym index d60c4c64a..c5963ffb8 100644 --- a/src/test/ref/bitmap-plotter.sym +++ b/src/test/ref/bitmap-plotter.sym @@ -1,25 +1,16 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) BGCOL BGCOL = (byte*) 53280 (const byte*) BITMAP BITMAP = (byte*) 8192 -(byte) BMM -(const byte) BMM#0 BMM = (byte) $20 -(byte*) D011 -(const byte*) D011#0 D011 = (byte*) 53265 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte) DEN -(const byte) DEN#0 DEN = (byte) $10 -(byte*) FGCOL -(const byte*) FGCOL#0 FGCOL = (byte*) 53281 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte) RSEL -(const byte) RSEL#0 RSEL = (byte) 8 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte) BMM BMM = (byte) $20 +(const byte*) D011 D011 = (byte*) 53265 +(const byte*) D018 D018 = (byte*) 53272 +(const byte) DEN DEN = (byte) $10 +(const byte*) FGCOL FGCOL = (byte*) 53281 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte) RSEL RSEL = (byte) 8 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) init_plot_tables() (byte~) init_plot_tables::$0 reg byte a 22.0 (byte~) init_plot_tables::$10 $10 zp ZP_BYTE:7 5.5 @@ -96,8 +87,7 @@ (byte) plots::i (byte) plots::i#1 reg byte x 202.0 (byte) plots::i#2 reg byte x 101.0 -(byte) plots_cnt -(const byte) plots_cnt#0 plots_cnt = (byte) 8 +(const byte) plots_cnt plots_cnt = (byte) 8 (const byte[]) plots_x plots_x = { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28 } (const byte[]) plots_y plots_y = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 } diff --git a/src/test/ref/bitwise-not.cfg b/src/test/ref/bitwise-not.cfg index 63df5391f..6adff86c2 100644 --- a/src/test/ref/bitwise-not.cfg +++ b/src/test/ref/bitwise-not.cfg @@ -10,12 +10,12 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 + [4] *((const byte*) main::SCREEN) ← ~(byte) 1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::c#2 ← phi( main/(byte) 1 main::@1/(byte) main::c#1 ) [6] (byte~) main::$0 ← ~ (byte) main::c#2 - [7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 + [7] *((const byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 [8] (byte) main::c#1 ← ++ (byte) main::c#2 [9] if((byte) main::c#1!=(byte) $1b) goto main::@1 to:main::@return diff --git a/src/test/ref/bitwise-not.log b/src/test/ref/bitwise-not.log index 1067c2725..e1386d378 100644 --- a/src/test/ref/bitwise-not.log +++ b/src/test/ref/bitwise-not.log @@ -7,14 +7,14 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 - *((byte*) main::SCREEN#0) ← ~(byte) 1 + (byte*) main::SCREEN ← ((byte*)) (number) $400 + *((byte*) main::SCREEN) ← ~(byte) 1 (byte) main::c#0 ← (byte) 1 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::c#2 ← phi( main/(byte) main::c#0 main::@1/(byte) main::c#1 ) (byte~) main::$0 ← ~ (byte) main::c#2 - *((byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 + *((byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 (byte) main::c#1 ← (byte) main::c#2 + rangenext(1,$1a) (bool~) main::$1 ← (byte) main::c#1 != rangelast(1,$1a) if((bool~) main::$1) goto main::@1 @@ -40,19 +40,18 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::c (byte) main::c#0 (byte) main::c#1 (byte) main::c#2 -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$1 [8] if((byte) main::c#1!=rangelast(1,$1a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::c#0 = 1 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [6] main::c#1 ← ++ main::c#2 to ++ @@ -96,12 +95,12 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 + [4] *((const byte*) main::SCREEN) ← ~(byte) 1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::c#2 ← phi( main/(byte) 1 main::@1/(byte) main::c#1 ) [6] (byte~) main::$0 ← ~ (byte) main::c#2 - [7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 + [7] *((const byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 [8] (byte) main::c#1 ← ++ (byte) main::c#2 [9] if((byte) main::c#1!=(byte) $1b) goto main::@1 to:main::@return @@ -113,7 +112,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() (byte~) main::$0 22.0 -(byte*) main::SCREEN (byte) main::c (byte) main::c#1 16.5 (byte) main::c#2 14.666666666666666 @@ -154,7 +152,7 @@ main: { .label SCREEN = $400 .label _0 = 3 .label c = 2 - // [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 lda #1^$ff sta SCREEN // [5] phi from main to main::@1 [phi:main->main::@1] @@ -173,7 +171,7 @@ main: { lda.z c eor #$ff sta.z _0 - // [7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [7] *((const byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _0 ldy.z c sta SCREEN,y @@ -192,10 +190,10 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] (byte~) main::$0 ← ~ (byte) main::c#2 [ main::c#2 main::$0 ] ( main:2 [ main::c#2 main::$0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::c#2 main::c#1 ] -Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] (byte~) main::$0 ← ~ (byte) main::c#2 [ main::c#2 main::$0 ] ( main:2 [ main::c#2 main::$0 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::c#2 main::c#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::$0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -231,7 +229,7 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 lda #1^$ff sta SCREEN // [5] phi from main to main::@1 [phi:main->main::@1] @@ -248,7 +246,7 @@ main: { // [6] (byte~) main::$0 ← ~ (byte) main::c#2 -- vbuaa=_bnot_vbuxx txa eor #$ff - // [7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // [8] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx inx @@ -295,8 +293,7 @@ FINAL SYMBOL TABLE (byte~) main::$0 reg byte a 22.0 (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c (byte) main::c#1 reg byte x 16.5 (byte) main::c#2 reg byte x 14.666666666666666 @@ -324,7 +321,7 @@ Score: 187 main: { .label SCREEN = $400 // *SCREEN = ~1ub - // [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← ~(byte) 1 -- _deref_pbuc1=vbuc2 lda #1^$ff sta SCREEN // [5] phi from main to main::@1 [phi:main->main::@1] @@ -339,7 +336,7 @@ main: { txa eor #$ff // SCREEN[c] = ~c - // [7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) main::SCREEN + (byte) main::c#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // for(byte c : 1..26) // [8] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx diff --git a/src/test/ref/bitwise-not.sym b/src/test/ref/bitwise-not.sym index c968f048c..73811bd64 100644 --- a/src/test/ref/bitwise-not.sym +++ b/src/test/ref/bitwise-not.sym @@ -5,8 +5,7 @@ (byte~) main::$0 reg byte a 22.0 (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c (byte) main::c#1 reg byte x 16.5 (byte) main::c#2 reg byte x 14.666666666666666 diff --git a/src/test/ref/bool-const.log b/src/test/ref/bool-const.log index 077f74612..619215851 100644 --- a/src/test/ref/bool-const.log +++ b/src/test/ref/bool-const.log @@ -34,8 +34,8 @@ main::@return: scope:[main] from main::@3 (void()) bool_const_if() bool_const_if: scope:[bool_const_if] from main - (bool) bool_const_if::b#0 ← true - if((bool) bool_const_if::b#0) goto bool_const_if::@1 + (bool) bool_const_if::b ← true + if((bool) bool_const_if::b) goto bool_const_if::@1 to:bool_const_if::@3 bool_const_if::@1: scope:[bool_const_if] from bool_const_if *((byte*) SCREEN + (number) 0) ← (byte) 't' @@ -49,14 +49,14 @@ bool_const_if::@return: scope:[bool_const_if] from bool_const_if::@1 bool_const (void()) bool_const_vars() bool_const_vars: scope:[bool_const_vars] from main::@1 - (byte) bool_const_vars::a#0 ← (number) $e - (bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a#0 == (number) $f - (bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a#0 + (byte) bool_const_vars::a ← (number) $e + (bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a == (number) $f + (bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a (bool~) bool_const_vars::$2 ← ! (bool~) bool_const_vars::$1 (bool~) bool_const_vars::$3 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2 (bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$3 - (bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a#0 != (number) $2c - (bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a#0 >= (number) -8 + (bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a != (number) $2c + (bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a >= (number) -8 (bool~) bool_const_vars::$6 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5 (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$6 (bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0 @@ -77,13 +77,13 @@ bool_const_vars::@return: scope:[bool_const_vars] from bool_const_vars::@1 bool (void()) bool_const_inline() bool_const_inline: scope:[bool_const_inline] from main::@2 - (byte) bool_const_inline::a#0 ← (number) $17 - (bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a#0 != (number) $2c - (bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a#0 >= (number) -8 - (bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a#0 == (number) $f + (byte) bool_const_inline::a ← (number) $17 + (bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a != (number) $2c + (bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a >= (number) -8 + (bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a == (number) $f (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2 (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3 - (bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a#0 + (bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a (bool~) bool_const_inline::$6 ← ! (bool~) bool_const_inline::$5 (bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6 if((bool~) bool_const_inline::$7) goto bool_const_inline::@1 @@ -115,7 +115,6 @@ SYMBOL TABLE SSA (label) bool_const_if::@3 (label) bool_const_if::@return (bool) bool_const_if::b -(bool) bool_const_if::b#0 (void()) bool_const_inline() (bool~) bool_const_inline::$0 (bool~) bool_const_inline::$1 @@ -129,7 +128,6 @@ SYMBOL TABLE SSA (label) bool_const_inline::@3 (label) bool_const_inline::@return (byte) bool_const_inline::a -(byte) bool_const_inline::a#0 (void()) bool_const_vars() (bool~) bool_const_vars::$0 (bool~) bool_const_vars::$1 @@ -145,7 +143,6 @@ SYMBOL TABLE SSA (label) bool_const_vars::@3 (label) bool_const_vars::@return (byte) bool_const_vars::a -(byte) bool_const_vars::a#0 (bool) bool_const_vars::b (bool) bool_const_vars::b#0 (bool) bool_const_vars::b1 @@ -160,24 +157,24 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) 't' Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) 'f' -Adding number conversion cast (unumber) $e in (byte) bool_const_vars::a#0 ← (number) $e -Adding number conversion cast (unumber) $f in (bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a#0 == (number) $f -Adding number conversion cast (unumber) $15 in (bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a#0 -Adding number conversion cast (unumber) $2c in (bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a#0 != (number) $2c -Adding number conversion cast (unumber) -8 in (bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a#0 >= (number) -8 +Adding number conversion cast (unumber) $e in (byte) bool_const_vars::a ← (number) $e +Adding number conversion cast (unumber) $f in (bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a == (number) $f +Adding number conversion cast (unumber) $15 in (bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a +Adding number conversion cast (unumber) $2c in (bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a != (number) $2c +Adding number conversion cast (unumber) -8 in (bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a >= (number) -8 Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte) 't' Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte) 'f' -Adding number conversion cast (unumber) $17 in (byte) bool_const_inline::a#0 ← (number) $17 -Adding number conversion cast (unumber) $2c in (bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a#0 != (number) $2c -Adding number conversion cast (unumber) -8 in (bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a#0 >= (number) -8 -Adding number conversion cast (unumber) $f in (bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a#0 == (number) $f -Adding number conversion cast (unumber) $15 in (bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a#0 +Adding number conversion cast (unumber) $17 in (byte) bool_const_inline::a ← (number) $17 +Adding number conversion cast (unumber) $2c in (bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a != (number) $2c +Adding number conversion cast (unumber) -8 in (bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a >= (number) -8 +Adding number conversion cast (unumber) $f in (bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a == (number) $f +Adding number conversion cast (unumber) $15 in (bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte) 't' Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte) 'f' Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) SCREEN ← (byte*)(number) $400 -Inlining cast (byte) bool_const_vars::a#0 ← (unumber)(number) $e -Inlining cast (byte) bool_const_inline::a#0 ← (unumber)(number) $17 +Inlining cast (byte) bool_const_vars::a ← (unumber)(number) $e +Inlining cast (byte) bool_const_inline::a ← (unumber)(number) $17 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -214,8 +211,8 @@ Finalized unsigned number type (byte) $15 Finalized unsigned number type (byte) 2 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inversing boolean not [13] (bool~) bool_const_vars::$2 ← (byte) $15 >= (byte) bool_const_vars::a#0 from [12] (bool~) bool_const_vars::$1 ← (byte) $15 < (byte) bool_const_vars::a#0 -Inversing boolean not [35] (bool~) bool_const_inline::$6 ← (byte) $15 >= (byte) bool_const_inline::a#0 from [34] (bool~) bool_const_inline::$5 ← (byte) $15 < (byte) bool_const_inline::a#0 +Inversing boolean not [13] (bool~) bool_const_vars::$2 ← (byte) $15 >= (byte) bool_const_vars::a from [12] (bool~) bool_const_vars::$1 ← (byte) $15 < (byte) bool_const_vars::a +Inversing boolean not [35] (bool~) bool_const_inline::$6 ← (byte) $15 >= (byte) bool_const_inline::a from [34] (bool~) bool_const_inline::$5 ← (byte) $15 < (byte) bool_const_inline::a Successful SSA optimization Pass2UnaryNotSimplification Alias (bool) bool_const_vars::b1#0 = (bool~) bool_const_vars::$3 Alias (bool) bool_const_vars::b2#0 = (bool~) bool_const_vars::$6 @@ -231,42 +228,42 @@ Rewriting || if()-condition to two if()s [18] (bool) bool_const_vars::b2#0 ← ( Rewriting && if()-condition to two if()s [32] (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2 Successful SSA optimization Pass2ConditionalAndOrRewriting Constant (const byte*) SCREEN = (byte*) 1024 -Constant (const bool) bool_const_if::b#0 = true -Constant (const byte) bool_const_vars::a#0 = $e -Constant (const byte) bool_const_inline::a#0 = $17 +Constant (const bool) bool_const_if::b = true +Constant (const byte) bool_const_vars::a = $e +Constant (const byte) bool_const_inline::a = $17 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [6] if((const bool) bool_const_if::b#0) goto bool_const_if::@1 +if() condition always true - replacing block destination [6] if((const bool) bool_const_if::b) goto bool_const_if::@1 if() condition always false - eliminating if(false) goto bool_const_vars::@1 Successful SSA optimization Pass2ConstantIfs Simplifying expression containing zero SCREEN in [7] *((const byte*) SCREEN + (byte) 0) ← (byte) 't' Simplifying expression containing zero SCREEN in [8] *((const byte*) SCREEN + (byte) 0) ← (byte) 'f' Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused constant (const bool) bool_const_if::b#0 +Eliminating unused constant (const bool) bool_const_if::b Successful SSA optimization PassNEliminateUnusedVars Removing unused block bool_const_if::@3 Successful SSA optimization Pass2EliminateUnusedBlocks -Simple Condition (bool~) bool_const_vars::$0 [10] if((const byte) bool_const_vars::a#0==(byte) $f) goto bool_const_vars::@6 -Simple Condition (bool~) bool_const_inline::$0 [18] if((const byte) bool_const_inline::a#0!=(byte) $2c) goto bool_const_inline::@1 -Simple Condition (bool~) bool_const_vars::$4 [23] if((const byte) bool_const_vars::a#0!=(byte) $2c) goto bool_const_vars::@5 -Simple Condition (bool~) bool_const_vars::$2 [24] if((byte) $15>=(const byte) bool_const_vars::a#0) goto bool_const_vars::@6 -Simple Condition (bool~) bool_const_inline::$6 [25] if((byte) $15>=(const byte) bool_const_inline::a#0) goto bool_const_inline::@1 -Simple Condition (bool~) bool_const_inline::$1 [26] if((const byte) bool_const_inline::a#0>=(byte) -8) goto bool_const_inline::@7 -Simple Condition (bool~) bool_const_vars::$5 [27] if((const byte) bool_const_vars::a#0>=(byte) -8) goto bool_const_vars::@5 -Simple Condition (bool~) bool_const_inline::$2 [28] if((const byte) bool_const_inline::a#0==(byte) $f) goto bool_const_inline::@1 +Simple Condition (bool~) bool_const_vars::$0 [10] if((const byte) bool_const_vars::a==(byte) $f) goto bool_const_vars::@6 +Simple Condition (bool~) bool_const_inline::$0 [18] if((const byte) bool_const_inline::a!=(byte) $2c) goto bool_const_inline::@1 +Simple Condition (bool~) bool_const_vars::$4 [23] if((const byte) bool_const_vars::a!=(byte) $2c) goto bool_const_vars::@5 +Simple Condition (bool~) bool_const_vars::$2 [24] if((byte) $15>=(const byte) bool_const_vars::a) goto bool_const_vars::@6 +Simple Condition (bool~) bool_const_inline::$6 [25] if((byte) $15>=(const byte) bool_const_inline::a) goto bool_const_inline::@1 +Simple Condition (bool~) bool_const_inline::$1 [26] if((const byte) bool_const_inline::a>=(byte) -8) goto bool_const_inline::@7 +Simple Condition (bool~) bool_const_vars::$5 [27] if((const byte) bool_const_vars::a>=(byte) -8) goto bool_const_vars::@5 +Simple Condition (bool~) bool_const_inline::$2 [28] if((const byte) bool_const_inline::a==(byte) $f) goto bool_const_inline::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Negating conditional jump and destination [26] if((const byte) bool_const_inline::a#0<(byte) -8) goto bool_const_inline::@5 +Negating conditional jump and destination [26] if((const byte) bool_const_inline::a<(byte) -8) goto bool_const_inline::@5 Successful SSA optimization Pass2ConditionalJumpSequenceImprovement -if() condition always false - eliminating [10] if((const byte) bool_const_vars::a#0==(byte) $f) goto bool_const_vars::@6 -if() condition always true - replacing block destination [18] if((const byte) bool_const_inline::a#0!=(byte) $2c) goto bool_const_inline::@1 -if() condition always true - replacing block destination [23] if((const byte) bool_const_vars::a#0!=(byte) $2c) goto bool_const_vars::@5 -if() condition always true - replacing block destination [24] if((byte) $15>=(const byte) bool_const_vars::a#0) goto bool_const_vars::@6 -if() condition always false - eliminating [25] if((byte) $15>=(const byte) bool_const_inline::a#0) goto bool_const_inline::@1 -if() condition always false - eliminating [26] if((const byte) bool_const_inline::a#0<(byte) -8) goto bool_const_inline::@5 -if() condition always true - replacing block destination [27] if((const byte) bool_const_vars::a#0>=(byte) -8) goto bool_const_vars::@5 -if() condition always false - eliminating [28] if((const byte) bool_const_inline::a#0==(byte) $f) goto bool_const_inline::@1 +if() condition always false - eliminating [10] if((const byte) bool_const_vars::a==(byte) $f) goto bool_const_vars::@6 +if() condition always true - replacing block destination [18] if((const byte) bool_const_inline::a!=(byte) $2c) goto bool_const_inline::@1 +if() condition always true - replacing block destination [23] if((const byte) bool_const_vars::a!=(byte) $2c) goto bool_const_vars::@5 +if() condition always true - replacing block destination [24] if((byte) $15>=(const byte) bool_const_vars::a) goto bool_const_vars::@6 +if() condition always false - eliminating [25] if((byte) $15>=(const byte) bool_const_inline::a) goto bool_const_inline::@1 +if() condition always false - eliminating [26] if((const byte) bool_const_inline::a<(byte) -8) goto bool_const_inline::@5 +if() condition always true - replacing block destination [27] if((const byte) bool_const_vars::a>=(byte) -8) goto bool_const_vars::@5 +if() condition always false - eliminating [28] if((const byte) bool_const_inline::a==(byte) $f) goto bool_const_inline::@1 Successful SSA optimization Pass2ConstantIfs -Eliminating unused constant (const byte) bool_const_vars::a#0 -Eliminating unused constant (const byte) bool_const_inline::a#0 +Eliminating unused constant (const byte) bool_const_vars::a +Eliminating unused constant (const byte) bool_const_inline::a Successful SSA optimization PassNEliminateUnusedVars Removing unused block bool_const_vars::@1 Removing unused block bool_const_inline::@3 @@ -379,11 +376,8 @@ bool_const_if::@return: scope:[bool_const_if] from bool_const_if::@1 VARIABLE REGISTER WEIGHTS (void()) bool_const_if() -(bool) bool_const_if::b (void()) bool_const_inline() -(byte) bool_const_inline::a (void()) bool_const_vars() -(byte) bool_const_vars::a (bool) bool_const_vars::b (bool) bool_const_vars::b1 (bool) bool_const_vars::b2 @@ -663,15 +657,12 @@ FINAL SYMBOL TABLE (void()) bool_const_if() (label) bool_const_if::@1 (label) bool_const_if::@return -(bool) bool_const_if::b (void()) bool_const_inline() (label) bool_const_inline::@1 (label) bool_const_inline::@return -(byte) bool_const_inline::a (void()) bool_const_vars() (label) bool_const_vars::@1 (label) bool_const_vars::@return -(byte) bool_const_vars::a (bool) bool_const_vars::b (bool) bool_const_vars::b1 (bool) bool_const_vars::b2 diff --git a/src/test/ref/bool-const.sym b/src/test/ref/bool-const.sym index 5a7dc07cb..9ba6b6e27 100644 --- a/src/test/ref/bool-const.sym +++ b/src/test/ref/bool-const.sym @@ -5,15 +5,12 @@ (void()) bool_const_if() (label) bool_const_if::@1 (label) bool_const_if::@return -(bool) bool_const_if::b (void()) bool_const_inline() (label) bool_const_inline::@1 (label) bool_const_inline::@return -(byte) bool_const_inline::a (void()) bool_const_vars() (label) bool_const_vars::@1 (label) bool_const_vars::@return -(byte) bool_const_vars::a (bool) bool_const_vars::b (bool) bool_const_vars::b1 (bool) bool_const_vars::b2 diff --git a/src/test/ref/bool-function.cfg b/src/test/ref/bool-function.cfg index f696308b8..aec09f440 100644 --- a/src/test/ref/bool-function.cfg +++ b/src/test/ref/bool-function.cfg @@ -25,7 +25,7 @@ main::@5: scope:[main] from main::@1 [12] if((bool~) main::$2) goto main::@2 to:main::@4 main::@4: scope:[main] from main::@5 - [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' + [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' to:main::@3 main::@3: scope:[main] from main::@2 main::@4 [14] (byte) main::i#1 ← ++ (byte) main::i#2 @@ -35,7 +35,7 @@ main::@return: scope:[main] from main::@3 [16] return to:@return main::@2: scope:[main] from main::@5 - [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' + [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' to:main::@3 (bool()) isSet((byte) isSet::i , (bool) isSet::b) diff --git a/src/test/ref/bool-function.log b/src/test/ref/bool-function.log index 2f4347125..4ec45658d 100644 --- a/src/test/ref/bool-function.log +++ b/src/test/ref/bool-function.log @@ -10,7 +10,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@3 @@ -30,11 +30,11 @@ main::@7: scope:[main] from main::@1 to:main::@4 main::@2: scope:[main] from main::@7 (byte) main::i#3 ← phi( main::@7/(byte) main::i#6 ) - *((byte*) main::screen#0 + (byte) main::i#3) ← (byte) '*' + *((byte*) main::screen + (byte) main::i#3) ← (byte) '*' to:main::@3 main::@4: scope:[main] from main::@7 (byte) main::i#4 ← phi( main::@7/(byte) main::i#6 ) - *((byte*) main::screen#0 + (byte) main::i#4) ← (byte) ' ' + *((byte*) main::screen + (byte) main::i#4) ← (byte) ' ' to:main::@3 main::@3: scope:[main] from main::@2 main::@4 (byte) main::i#5 ← phi( main::@2/(byte) main::i#3 main::@4/(byte) main::i#4 ) @@ -109,7 +109,6 @@ SYMBOL TABLE SSA (byte) main::i#5 (byte) main::i#6 (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 & (number) 1 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 & (unumber)(number) 1 @@ -118,7 +117,7 @@ Adding number conversion cast (unumber) 8 in (number~) isSet::$0 ← (byte) isSe Adding number conversion cast (unumber) isSet::$0 in (number~) isSet::$0 ← (byte) isSet::i#1 & (unumber)(number) 8 Adding number conversion cast (unumber) 0 in (bool~) isSet::$1 ← (unumber~) isSet::$0 != (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -145,7 +144,7 @@ Identical Phi Values (bool) isSet::b#1 (bool) isSet::b#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$3 [19] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [17] main::i#1 ← ++ main::i#2 to ++ @@ -209,7 +208,7 @@ main::@5: scope:[main] from main::@1 [12] if((bool~) main::$2) goto main::@2 to:main::@4 main::@4: scope:[main] from main::@5 - [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' + [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' to:main::@3 main::@3: scope:[main] from main::@2 main::@4 [14] (byte) main::i#1 ← ++ (byte) main::i#2 @@ -219,7 +218,7 @@ main::@return: scope:[main] from main::@3 [16] return to:@return main::@2: scope:[main] from main::@5 - [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' + [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' to:main::@3 (bool()) isSet((byte) isSet::i , (bool) isSet::b) @@ -250,7 +249,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 6.6 -(byte*) main::screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -358,7 +356,7 @@ main: { jmp b4 // main::@4 b4: - // [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2 + // [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2 lda #' ' ldy.z i sta screen,y @@ -378,7 +376,7 @@ main: { rts // main::@2 b2: - // [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 + // [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'*' ldy.z i sta screen,y @@ -421,15 +419,15 @@ isSet: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) 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 [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BOOL:4 [ isSet::b#0 ] Statement [20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) always clobbers reg byte a Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a Statement [20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) 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 , @@ -515,7 +513,7 @@ main: { jmp b4 // main::@4 b4: - // [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2 + // [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2 lda #' ' sta screen,x jmp b3 @@ -533,7 +531,7 @@ main: { rts // main::@2 b2: - // [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta screen,x jmp b3 @@ -621,8 +619,7 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.6 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$0 ] @@ -686,7 +683,7 @@ main: { bne b2 // main::@4 // screen[i] = ' ' - // [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2 + // [13] *((const byte*) main::screen + (byte) main::i#2) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2 lda #' ' sta screen,x // main::@3 @@ -704,7 +701,7 @@ main: { // main::@2 b2: // screen[i] = '*' - // [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [17] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta screen,x jmp b3 diff --git a/src/test/ref/bool-function.sym b/src/test/ref/bool-function.sym index a14aa2bd1..5cf2bf2be 100644 --- a/src/test/ref/bool-function.sym +++ b/src/test/ref/bool-function.sym @@ -24,8 +24,7 @@ (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.6 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$0 ] diff --git a/src/test/ref/bresenham.cfg b/src/test/ref/bresenham.cfg index 76b96faa9..c7c74d715 100644 --- a/src/test/ref/bresenham.cfg +++ b/src/test/ref/bresenham.cfg @@ -13,11 +13,11 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0 main::@2/(byte) main::y#4 ) [5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) - [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 ) - [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0 main::@2/(byte) main::x#1 ) + [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 main::@2/(byte*) main::cursor#5 ) + [6] *((byte*) main::cursor#3) ← (const byte) STAR [7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1 [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 @@ -32,7 +32,7 @@ main::@2: scope:[main] from main::@1 main::@3 [14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 ) [14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) [14] (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 ) - [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 + [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [16] return diff --git a/src/test/ref/bresenham.log b/src/test/ref/bresenham.log index eb0919360..d3555769c 100644 --- a/src/test/ref/bresenham.log +++ b/src/test/ref/bresenham.log @@ -7,22 +7,22 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) STAR#0 ← (number) $51 + (byte) STAR ← (number) $51 (byte[$28*$19]) SCREEN ← ((byte[$28*$19])) (number) $400 to:@1 (void()) main() main: scope:[main] from @1 - (byte) main::x0#0 ← (number) 4 - (byte) main::y0#0 ← (number) 4 - (byte) main::x1#0 ← (number) $27 - (byte) main::y1#0 ← (number) $18 - (byte~) main::$0 ← (byte) main::x1#0 - (byte) main::x0#0 + (byte) main::x0 ← (number) 4 + (byte) main::y0 ← (number) 4 + (byte) main::x1 ← (number) $27 + (byte) main::y1 ← (number) $18 + (byte~) main::$0 ← (byte) main::x1 - (byte) main::x0 (byte) main::xd#0 ← (byte~) main::$0 - (byte~) main::$1 ← (byte) main::y1#0 - (byte) main::y0#0 + (byte~) main::$1 ← (byte) main::y1 - (byte) main::y0 (byte) main::yd#0 ← (byte~) main::$1 - (byte) main::x#0 ← (byte) main::x0#0 - (byte) main::y#0 ← (byte) main::y0#0 + (byte) main::x#0 ← (byte) main::x0 + (byte) main::y#0 ← (byte) main::y0 (number~) main::$2 ← (byte) main::yd#0 / (number) 2 (byte) main::e#0 ← (number~) main::$2 (number~) main::$3 ← (byte) main::y#0 * (number) $28 @@ -37,7 +37,7 @@ main::@1: scope:[main] from main main::@2 (byte) main::e#3 ← phi( main/(byte) main::e#0 main::@2/(byte) main::e#5 ) (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@2/(byte) main::x#3 ) (byte*) main::cursor#3 ← phi( main/(byte*) main::cursor#0 main::@2/(byte*) main::cursor#5 ) - *((byte*) main::cursor#3) ← (byte) STAR#0 + *((byte*) main::cursor#3) ← (byte) STAR (number~) main::$6 ← (byte) main::x#2 + (number) 1 (byte) main::x#1 ← (number~) main::$6 (byte*~) main::$7 ← (byte*) main::cursor#3 + (number) 1 @@ -55,7 +55,7 @@ main::@2: scope:[main] from main::@1 main::@3 (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 ) (byte) main::x#3 ← phi( main::@1/(byte) main::x#1 main::@3/(byte) main::x#4 ) - (number~) main::$14 ← (byte) main::x1#0 + (number) 1 + (number~) main::$14 ← (byte) main::x1 + (number) 1 (bool~) main::$15 ← (byte) main::x#3 < (number~) main::$14 if((bool~) main::$15) goto main::@1 to:main::@return @@ -90,7 +90,6 @@ SYMBOL TABLE SSA (label) @end (byte[$28*$19]) SCREEN (byte) STAR -(byte) STAR#0 (void()) main() (byte~) main::$0 (byte~) main::$1 @@ -133,9 +132,7 @@ SYMBOL TABLE SSA (byte) main::x#3 (byte) main::x#4 (byte) main::x0 -(byte) main::x0#0 (byte) main::x1 -(byte) main::x1#0 (byte) main::xd (byte) main::xd#0 (byte) main::xd#1 @@ -148,20 +145,18 @@ SYMBOL TABLE SSA (byte) main::y#3 (byte) main::y#4 (byte) main::y0 -(byte) main::y0#0 (byte) main::y1 -(byte) main::y1#0 (byte) main::yd (byte) main::yd#0 (byte) main::yd#1 (byte) main::yd#2 (byte) main::yd#3 -Adding number conversion cast (unumber) $51 in (byte) STAR#0 ← (number) $51 -Adding number conversion cast (unumber) 4 in (byte) main::x0#0 ← (number) 4 -Adding number conversion cast (unumber) 4 in (byte) main::y0#0 ← (number) 4 -Adding number conversion cast (unumber) $27 in (byte) main::x1#0 ← (number) $27 -Adding number conversion cast (unumber) $18 in (byte) main::y1#0 ← (number) $18 +Adding number conversion cast (unumber) $51 in (byte) STAR ← (number) $51 +Adding number conversion cast (unumber) 4 in (byte) main::x0 ← (number) 4 +Adding number conversion cast (unumber) 4 in (byte) main::y0 ← (number) 4 +Adding number conversion cast (unumber) $27 in (byte) main::x1 ← (number) $27 +Adding number conversion cast (unumber) $18 in (byte) main::y1 ← (number) $18 Adding number conversion cast (unumber) 2 in (number~) main::$2 ← (byte) main::yd#0 / (number) 2 Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::yd#0 / (unumber)(number) 2 Adding number conversion cast (unumber) $28 in (number~) main::$3 ← (byte) main::y#0 * (number) $28 @@ -169,18 +164,18 @@ Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte) main::x#2 + (number) 1 Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::x#2 + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (byte*~) main::$7 ← (byte*) main::cursor#3 + (number) 1 -Adding number conversion cast (unumber) 1 in (number~) main::$14 ← (byte) main::x1#0 + (number) 1 -Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (byte) main::x1#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) main::$14 ← (byte) main::x1 + (number) 1 +Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (byte) main::x1 + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$11 ← (byte) main::y#2 + (number) 1 Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (byte) main::y#2 + (unumber)(number) 1 Adding number conversion cast (unumber) $28 in (byte*~) main::$12 ← (byte*) main::cursor#4 + (number) $28 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) STAR#0 ← (unumber)(number) $51 +Inlining cast (byte) STAR ← (unumber)(number) $51 Inlining cast (byte[$28*$19]) SCREEN ← (byte[$28*$19])(number) $400 -Inlining cast (byte) main::x0#0 ← (unumber)(number) 4 -Inlining cast (byte) main::y0#0 ← (unumber)(number) 4 -Inlining cast (byte) main::x1#0 ← (unumber)(number) $27 -Inlining cast (byte) main::y1#0 ← (unumber)(number) $18 +Inlining cast (byte) main::x0 ← (unumber)(number) 4 +Inlining cast (byte) main::y0 ← (unumber)(number) 4 +Inlining cast (byte) main::x1 ← (unumber)(number) $27 +Inlining cast (byte) main::y1 ← (unumber)(number) $18 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $51 Simplifying constant pointer cast (byte*) 1024 @@ -212,14 +207,14 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::yd#0 / (byte) 2 Inferred type updated to byte in (unumber~) main::$3 ← (byte) main::y#0 * (byte) $28 Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::x#2 + (byte) 1 -Inferred type updated to byte in (unumber~) main::$14 ← (byte) main::x1#0 + (byte) 1 +Inferred type updated to byte in (unumber~) main::$14 ← (byte) main::x1 + (byte) 1 Inferred type updated to byte in (unumber~) main::$11 ← (byte) main::y#2 + (byte) 1 Inversing boolean not [27] (bool~) main::$10 ← (byte) main::xd#1 > (byte) main::e#1 from [26] (bool~) main::$9 ← (byte) main::xd#1 <= (byte) main::e#1 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::xd#0 = (byte~) main::$0 Alias (byte) main::yd#0 = (byte~) main::$1 -Alias (byte) main::x0#0 = (byte) main::x#0 -Alias (byte) main::y0#0 = (byte) main::y#0 +Alias (byte) main::x0 = (byte) main::x#0 +Alias (byte) main::y0 = (byte) main::y#0 Alias (byte) main::e#0 = (byte~) main::$2 Alias (byte*) main::cursor#0 = (byte*~) main::$5 Alias (byte) main::x#1 = (byte~) main::$6 (byte) main::x#4 @@ -242,22 +237,22 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$10 [28] if((byte) main::xd#0>(byte) main::e#1) goto main::@2 Simple Condition (bool~) main::$15 [32] if((byte) main::x#1<(byte~) main::$14) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) STAR#0 = $51 +Constant (const byte) STAR = $51 Constant (const byte[$28*$19]) SCREEN = (byte*) 1024 -Constant (const byte) main::x0#0 = 4 -Constant (const byte) main::y0#0 = 4 -Constant (const byte) main::x1#0 = $27 -Constant (const byte) main::y1#0 = $18 +Constant (const byte) main::x0 = 4 +Constant (const byte) main::y0 = 4 +Constant (const byte) main::x1 = $27 +Constant (const byte) main::y1 = $18 Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [0] (byte) main::xd#0 ← (const byte) main::x1#0 - (const byte) main::x0#0 -Constant right-side identified [1] (byte) main::yd#0 ← (const byte) main::y1#0 - (const byte) main::y0#0 -Constant right-side identified [3] (byte~) main::$3 ← (const byte) main::y0#0 * (byte) $28 -Constant right-side identified [13] (byte~) main::$14 ← (const byte) main::x1#0 + (byte) 1 +Constant right-side identified [0] (byte) main::xd#0 ← (const byte) main::x1 - (const byte) main::x0 +Constant right-side identified [1] (byte) main::yd#0 ← (const byte) main::y1 - (const byte) main::y0 +Constant right-side identified [3] (byte~) main::$3 ← (const byte) main::y0 * (byte) $28 +Constant right-side identified [13] (byte~) main::$14 ← (const byte) main::x1 + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::xd#0 = main::x1#0-main::x0#0 -Constant (const byte) main::yd#0 = main::y1#0-main::y0#0 -Constant (const byte) main::$3 = main::y0#0*$28 -Constant (const byte) main::$14 = main::x1#0+1 +Constant (const byte) main::xd#0 = main::x1-main::x0 +Constant (const byte) main::yd#0 = main::y1-main::y0 +Constant (const byte) main::$3 = main::y0*$28 +Constant (const byte) main::$14 = main::x1+1 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (byte) main::e#0 ← (const byte) main::yd#0 / (byte) 2 Constant right-side identified [1] (byte*~) main::$4 ← (const byte[$28*$19]) SCREEN + (const byte) main::$3 @@ -265,17 +260,17 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) main::e#0 = main::yd#0/2 Constant (const byte*) main::$4 = SCREEN+main::$3 Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [0] (byte*) main::cursor#0 ← (const byte*) main::$4 + (const byte) main::x0#0 +Constant right-side identified [0] (byte*) main::cursor#0 ← (const byte*) main::$4 + (const byte) main::x0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::cursor#0 = main::$4+main::x0#0 +Constant (const byte*) main::cursor#0 = main::$4+main::x0 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::e#0 Inlining constant with var siblings (const byte*) main::cursor#0 -Constant inlined main::$3 = (const byte) main::y0#0*(byte) $28 -Constant inlined main::$14 = (const byte) main::x1#0+(byte) 1 -Constant inlined main::$4 = (const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28 +Constant inlined main::$3 = (const byte) main::y0*(byte) $28 +Constant inlined main::$14 = (const byte) main::x1+(byte) 1 +Constant inlined main::$4 = (const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28 Constant inlined main::e#0 = (const byte) main::yd#0/(byte) 2 -Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 +Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@2 and main::@1) Added new block during phi lifting main::@6(between main::@1 and main::@2) @@ -323,11 +318,11 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0 main::@2/(byte) main::y#4 ) [5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) - [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 ) - [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0 main::@2/(byte) main::x#1 ) + [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 main::@2/(byte*) main::cursor#5 ) + [6] *((byte*) main::cursor#3) ← (const byte) STAR [7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1 [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 @@ -342,7 +337,7 @@ main::@2: scope:[main] from main::@1 main::@3 [14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 ) [14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) [14] (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 ) - [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 + [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [16] return @@ -350,7 +345,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte) STAR (void()) main() (byte*) main::cursor (byte*) main::cursor#1 8.25 @@ -365,15 +359,11 @@ VARIABLE REGISTER WEIGHTS (byte) main::x (byte) main::x#1 3.666666666666667 (byte) main::x#2 11.0 -(byte) main::x0 -(byte) main::x1 (byte) main::xd (byte) main::y (byte) main::y#1 7.333333333333333 (byte) main::y#2 5.5 (byte) main::y#4 16.5 -(byte) main::y0 -(byte) main::y1 (byte) main::yd Initial phi equivalence classes @@ -431,16 +421,16 @@ main: { .label y = 6 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y // [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1 lda #yd/2 sta.z e - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x - // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 [phi:main->main::@1#3] -- pbuz1=pbuc1 lda #SCREEN+y0*$28+x0 @@ -455,7 +445,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 -- _deref_pbuz1=vbuc1 + // [6] *((byte*) main::cursor#3) ← (const byte) STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (cursor),y @@ -500,7 +490,7 @@ main: { jmp b2 // main::@2 b2: - // [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1_from_b2 @@ -513,7 +503,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y +Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] @@ -525,12 +515,12 @@ Removing always clobbered register reg byte x as potential for zp ZP_BYTE:6 [ ma Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ) always clobbers reg byte a reg byte x -Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a -Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y +Statement [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a +Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y Statement [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ) always clobbers reg byte a reg byte x Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ) always clobbers reg byte a reg byte x -Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a +Statement [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] : zp ZP_WORD:2 , Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 , Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x , @@ -586,15 +576,15 @@ main: { .label y = 5 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y // [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #yd/2 - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x - // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 [phi:main->main::@1#3] -- pbuz1=pbuc1 lda #SCREEN+y0*$28+x0 @@ -609,7 +599,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 -- _deref_pbuz1=vbuc1 + // [6] *((byte*) main::cursor#3) ← (const byte) STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (cursor),y @@ -651,7 +641,7 @@ main: { jmp b2 // main::@2 b2: - // [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1_from_b2 @@ -699,8 +689,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte[$28*$19]) SCREEN SCREEN = (byte*) 1024 -(byte) STAR -(const byte) STAR#0 STAR = (byte) $51 +(const byte) STAR STAR = (byte) $51 (void()) main() (label) main::@1 (label) main::@2 @@ -719,22 +708,18 @@ FINAL SYMBOL TABLE (byte) main::x (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 11.0 -(byte) main::x0 -(const byte) main::x0#0 x0 = (byte) 4 -(byte) main::x1 -(const byte) main::x1#0 x1 = (byte) $27 +(const byte) main::x0 x0 = (byte) 4 +(const byte) main::x1 x1 = (byte) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 +(const byte) main::xd#0 xd = (const byte) main::x1-(const byte) main::x0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 5.5 (byte) main::y#4 y zp ZP_BYTE:5 16.5 -(byte) main::y0 -(const byte) main::y0#0 y0 = (byte) 4 -(byte) main::y1 -(const byte) main::y1#0 y1 = (byte) $18 +(const byte) main::y0 y0 = (byte) 4 +(const byte) main::y1 y1 = (byte) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 +(const byte) main::yd#0 yd = (const byte) main::y1-(const byte) main::y0 zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ] @@ -772,15 +757,15 @@ main: { .label cursor = 2 .label y = 5 // [5] phi from main to main::@1 [phi:main->main::@1] - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y // [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #yd/2 - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x - // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN+(const byte) main::y0*(byte) $28+(const byte) main::x0 [phi:main->main::@1#3] -- pbuz1=pbuc1 lda #SCREEN+y0*$28+x0 @@ -793,7 +778,7 @@ main: { // main::@1 b1: // *cursor = STAR - // [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 -- _deref_pbuz1=vbuc1 + // [6] *((byte*) main::cursor#3) ← (const byte) STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (cursor),y @@ -838,7 +823,7 @@ main: { // main::@2 b2: // while (x<(x1+1)) - // [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [15] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1 diff --git a/src/test/ref/bresenham.sym b/src/test/ref/bresenham.sym index 8bac1a461..9925f6903 100644 --- a/src/test/ref/bresenham.sym +++ b/src/test/ref/bresenham.sym @@ -2,8 +2,7 @@ (label) @begin (label) @end (const byte[$28*$19]) SCREEN SCREEN = (byte*) 1024 -(byte) STAR -(const byte) STAR#0 STAR = (byte) $51 +(const byte) STAR STAR = (byte) $51 (void()) main() (label) main::@1 (label) main::@2 @@ -22,22 +21,18 @@ (byte) main::x (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 11.0 -(byte) main::x0 -(const byte) main::x0#0 x0 = (byte) 4 -(byte) main::x1 -(const byte) main::x1#0 x1 = (byte) $27 +(const byte) main::x0 x0 = (byte) 4 +(const byte) main::x1 x1 = (byte) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 +(const byte) main::xd#0 xd = (const byte) main::x1-(const byte) main::x0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 5.5 (byte) main::y#4 y zp ZP_BYTE:5 16.5 -(byte) main::y0 -(const byte) main::y0#0 y0 = (byte) 4 -(byte) main::y1 -(const byte) main::y1#0 y1 = (byte) $18 +(const byte) main::y0 y0 = (byte) 4 +(const byte) main::y1 y1 = (byte) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 +(const byte) main::yd#0 yd = (const byte) main::y1-(const byte) main::y0 zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ] diff --git a/src/test/ref/bresenhamarr.cfg b/src/test/ref/bresenhamarr.cfg index 4c97d516c..5046fb95d 100644 --- a/src/test/ref/bresenhamarr.cfg +++ b/src/test/ref/bresenhamarr.cfg @@ -13,27 +13,27 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) - [5] (byte) main::e#3 ← phi( main/(const byte) main::y1#0/(byte) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0 main::@2/(byte) main::y#4 ) + [5] (byte) main::e#3 ← phi( main/(const byte) main::y1/(byte) 2 main::@2/(byte) main::e#5 ) + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0 main::@2/(byte) main::x#1 ) [5] (word) main::idx#3 ← phi( main/(byte) 0 main::@2/(word) main::idx#5 ) [6] (byte*~) main::$15 ← (const byte[$28*$19]) main::screen + (word) main::idx#3 - [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 + [7] *((byte*~) main::$15) ← (const byte) main::STAR [8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1 - [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 - [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 + [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 + [11] if((const byte) main::x1>=(byte) main::e#1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 - [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 + [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 [15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 ) [15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) [15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 ) - [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 + [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [17] return diff --git a/src/test/ref/bresenhamarr.log b/src/test/ref/bresenhamarr.log index 238bef5b8..1a17d23e1 100644 --- a/src/test/ref/bresenhamarr.log +++ b/src/test/ref/bresenhamarr.log @@ -11,18 +11,18 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::STAR#0 ← (number) $51 + (byte) main::STAR ← (number) $51 (byte[$28*$19]) main::screen ← ((byte[$28*$19])) (number) $400 - (byte) main::x0#0 ← (number) 0 - (byte) main::y0#0 ← (number) 0 - (byte) main::x1#0 ← (number) $27 - (byte) main::y1#0 ← (number) $18 - (byte~) main::$0 ← (byte) main::x1#0 - (byte) main::x0#0 + (byte) main::x0 ← (number) 0 + (byte) main::y0 ← (number) 0 + (byte) main::x1 ← (number) $27 + (byte) main::y1 ← (number) $18 + (byte~) main::$0 ← (byte) main::x1 - (byte) main::x0 (byte) main::xd#0 ← (byte~) main::$0 - (byte~) main::$1 ← (byte) main::y1#0 - (byte) main::y0#0 + (byte~) main::$1 ← (byte) main::y1 - (byte) main::y0 (byte) main::yd#0 ← (byte~) main::$1 - (byte) main::x#0 ← (byte) main::x0#0 - (byte) main::y#0 ← (byte) main::y0#0 + (byte) main::x#0 ← (byte) main::x0 + (byte) main::y#0 ← (byte) main::y0 (number~) main::$2 ← (byte) main::yd#0 / (number) 2 (byte) main::e#0 ← (number~) main::$2 (number~) main::$3 ← (byte) main::y#0 * (number) $28 @@ -36,7 +36,7 @@ main::@1: scope:[main] from main main::@2 (byte) main::e#3 ← phi( main/(byte) main::e#0 main::@2/(byte) main::e#5 ) (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@2/(byte) main::x#3 ) (word) main::idx#3 ← phi( main/(word) main::idx#0 main::@2/(word) main::idx#5 ) - *((byte[$28*$19]) main::screen + (word) main::idx#3) ← (byte) main::STAR#0 + *((byte[$28*$19]) main::screen + (word) main::idx#3) ← (byte) main::STAR (number~) main::$5 ← (byte) main::x#2 + (number) 1 (byte) main::x#1 ← (number~) main::$5 (number~) main::$6 ← (word) main::idx#3 + (number) 1 @@ -54,7 +54,7 @@ main::@2: scope:[main] from main::@1 main::@3 (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 ) (byte) main::x#3 ← phi( main::@1/(byte) main::x#1 main::@3/(byte) main::x#4 ) - (number~) main::$13 ← (byte) main::x1#0 + (number) 1 + (number~) main::$13 ← (byte) main::x1 + (number) 1 (bool~) main::$14 ← (byte) main::x#3 < (number~) main::$13 if((bool~) main::$14) goto main::@1 to:main::@return @@ -108,7 +108,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte) main::STAR -(byte) main::STAR#0 (byte) main::e (byte) main::e#0 (byte) main::e#1 @@ -131,9 +130,7 @@ SYMBOL TABLE SSA (byte) main::x#3 (byte) main::x#4 (byte) main::x0 -(byte) main::x0#0 (byte) main::x1 -(byte) main::x1#0 (byte) main::xd (byte) main::xd#0 (byte) main::xd#1 @@ -146,20 +143,18 @@ SYMBOL TABLE SSA (byte) main::y#3 (byte) main::y#4 (byte) main::y0 -(byte) main::y0#0 (byte) main::y1 -(byte) main::y1#0 (byte) main::yd (byte) main::yd#0 (byte) main::yd#1 (byte) main::yd#2 (byte) main::yd#3 -Adding number conversion cast (unumber) $51 in (byte) main::STAR#0 ← (number) $51 -Adding number conversion cast (unumber) 0 in (byte) main::x0#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in (byte) main::y0#0 ← (number) 0 -Adding number conversion cast (unumber) $27 in (byte) main::x1#0 ← (number) $27 -Adding number conversion cast (unumber) $18 in (byte) main::y1#0 ← (number) $18 +Adding number conversion cast (unumber) $51 in (byte) main::STAR ← (number) $51 +Adding number conversion cast (unumber) 0 in (byte) main::x0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) main::y0 ← (number) 0 +Adding number conversion cast (unumber) $27 in (byte) main::x1 ← (number) $27 +Adding number conversion cast (unumber) $18 in (byte) main::y1 ← (number) $18 Adding number conversion cast (unumber) 2 in (number~) main::$2 ← (byte) main::yd#0 / (number) 2 Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::yd#0 / (unumber)(number) 2 Adding number conversion cast (unumber) $28 in (number~) main::$3 ← (byte) main::y#0 * (number) $28 @@ -169,19 +164,19 @@ Adding number conversion cast (unumber) 1 in (number~) main::$5 ← (byte) main: Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (byte) main::x#2 + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (word) main::idx#3 + (number) 1 Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (word) main::idx#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) 1 in (number~) main::$13 ← (byte) main::x1#0 + (number) 1 -Adding number conversion cast (unumber) main::$13 in (number~) main::$13 ← (byte) main::x1#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) main::$13 ← (byte) main::x1 + (number) 1 +Adding number conversion cast (unumber) main::$13 in (number~) main::$13 ← (byte) main::x1 + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$10 ← (byte) main::y#2 + (number) 1 Adding number conversion cast (unumber) main::$10 in (number~) main::$10 ← (byte) main::y#2 + (unumber)(number) 1 Adding number conversion cast (unumber) $28 in (number~) main::$11 ← (word) main::idx#4 + (number) $28 Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (word) main::idx#4 + (unumber)(number) $28 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::STAR#0 ← (unumber)(number) $51 +Inlining cast (byte) main::STAR ← (unumber)(number) $51 Inlining cast (byte[$28*$19]) main::screen ← (byte[$28*$19])(number) $400 -Inlining cast (byte) main::x0#0 ← (unumber)(number) 0 -Inlining cast (byte) main::y0#0 ← (unumber)(number) 0 -Inlining cast (byte) main::x1#0 ← (unumber)(number) $27 -Inlining cast (byte) main::y1#0 ← (unumber)(number) $18 +Inlining cast (byte) main::x0 ← (unumber)(number) 0 +Inlining cast (byte) main::y0 ← (unumber)(number) 0 +Inlining cast (byte) main::x1 ← (unumber)(number) $27 +Inlining cast (byte) main::y1 ← (unumber)(number) $18 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $51 Simplifying constant pointer cast (byte*) 1024 @@ -215,15 +210,15 @@ Inferred type updated to byte in (unumber~) main::$3 ← (byte) main::y#0 * (byt Inferred type updated to byte in (unumber~) main::$4 ← (byte) main::x#0 + (byte~) main::$3 Inferred type updated to byte in (unumber~) main::$5 ← (byte) main::x#2 + (byte) 1 Inferred type updated to word in (unumber~) main::$6 ← (word) main::idx#3 + (byte) 1 -Inferred type updated to byte in (unumber~) main::$13 ← (byte) main::x1#0 + (byte) 1 +Inferred type updated to byte in (unumber~) main::$13 ← (byte) main::x1 + (byte) 1 Inferred type updated to byte in (unumber~) main::$10 ← (byte) main::y#2 + (byte) 1 Inferred type updated to word in (unumber~) main::$11 ← (word) main::idx#4 + (byte) $28 Inversing boolean not [26] (bool~) main::$9 ← (byte) main::xd#1 >= (byte) main::e#1 from [25] (bool~) main::$8 ← (byte) main::xd#1 < (byte) main::e#1 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::xd#0 = (byte~) main::$0 Alias (byte) main::yd#0 = (byte~) main::$1 -Alias (byte) main::x0#0 = (byte) main::x#0 -Alias (byte) main::y0#0 = (byte) main::y#0 +Alias (byte) main::x0 = (byte) main::x#0 +Alias (byte) main::y0 = (byte) main::y#0 Alias (byte) main::e#0 = (byte~) main::$2 Alias (word) main::idx#0 = (byte~) main::$4 Alias (byte) main::x#1 = (byte~) main::$5 (byte) main::x#4 @@ -246,30 +241,30 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$9 [27] if((byte) main::xd#0>=(byte) main::e#1) goto main::@2 Simple Condition (bool~) main::$14 [31] if((byte) main::x#1<(byte~) main::$13) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) main::STAR#0 = $51 +Constant (const byte) main::STAR = $51 Constant (const byte[$28*$19]) main::screen = (byte*) 1024 -Constant (const byte) main::x0#0 = 0 -Constant (const byte) main::y0#0 = 0 -Constant (const byte) main::x1#0 = $27 -Constant (const byte) main::y1#0 = $18 +Constant (const byte) main::x0 = 0 +Constant (const byte) main::y0 = 0 +Constant (const byte) main::x1 = $27 +Constant (const byte) main::y1 = $18 Successful SSA optimization Pass2ConstantIdentification -De-inlining pointer[w] to *(pointer+w) [18] *((const byte[$28*$19]) main::screen + (word) main::idx#3) ← (const byte) main::STAR#0 +De-inlining pointer[w] to *(pointer+w) [18] *((const byte[$28*$19]) main::screen + (word) main::idx#3) ← (const byte) main::STAR Successful SSA optimization Pass2DeInlineWordDerefIdx -Simplifying expression containing zero main::x1#0 in [6] (byte) main::xd#0 ← (const byte) main::x1#0 - (const byte) main::x0#0 -Simplifying expression containing zero main::y1#0 in [8] (byte) main::yd#0 ← (const byte) main::y1#0 - (const byte) main::y0#0 -Simplifying expression containing zero main::$3 in [15] (word) main::idx#0 ← (const byte) main::x0#0 + (byte~) main::$3 +Simplifying expression containing zero main::x1 in [6] (byte) main::xd#0 ← (const byte) main::x1 - (const byte) main::x0 +Simplifying expression containing zero main::y1 in [8] (byte) main::yd#0 ← (const byte) main::y1 - (const byte) main::y0 +Simplifying expression containing zero main::$3 in [15] (word) main::idx#0 ← (const byte) main::x0 + (byte~) main::$3 Successful SSA optimization PassNSimplifyExpressionWithZero Alias (word) main::idx#0 = (byte~) main::$3 Successful SSA optimization Pass2AliasElimination -Constant right-side identified [3] (word) main::idx#0 ← (const byte) main::y0#0 * (byte) $28 -Constant right-side identified [13] (byte~) main::$13 ← (const byte) main::x1#0 + (byte) 1 +Constant right-side identified [3] (word) main::idx#0 ← (const byte) main::y0 * (byte) $28 +Constant right-side identified [13] (byte~) main::$13 ← (const byte) main::x1 + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::xd#0 = main::x1#0 -Constant (const byte) main::yd#0 = main::y1#0 -Constant (const word) main::idx#0 = main::y0#0*$28 -Constant (const byte) main::$13 = main::x1#0+1 +Constant (const byte) main::xd#0 = main::x1 +Constant (const byte) main::yd#0 = main::y1 +Constant (const word) main::idx#0 = main::y0*$28 +Constant (const byte) main::$13 = main::x1+1 Successful SSA optimization Pass2ConstantIdentification -Simplifying constant evaluating to zero (const byte) main::y0#0*(byte) $28 in +Simplifying constant evaluating to zero (const byte) main::y0*(byte) $28 in Successful SSA optimization PassNSimplifyConstantZero Constant right-side identified [0] (byte) main::e#0 ← (const byte) main::yd#0 / (byte) 2 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -277,11 +272,11 @@ Constant (const byte) main::e#0 = main::yd#0/2 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const word) main::idx#0 Inlining constant with var siblings (const byte) main::e#0 -Constant inlined main::$13 = (const byte) main::x1#0+(byte) 1 +Constant inlined main::$13 = (const byte) main::x1+(byte) 1 Constant inlined main::idx#0 = (byte) 0 -Constant inlined main::xd#0 = (const byte) main::x1#0 -Constant inlined main::e#0 = (const byte) main::y1#0/(byte) 2 -Constant inlined main::yd#0 = (const byte) main::y1#0 +Constant inlined main::xd#0 = (const byte) main::x1 +Constant inlined main::e#0 = (const byte) main::y1/(byte) 2 +Constant inlined main::yd#0 = (const byte) main::y1 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@2 and main::@1) Added new block during phi lifting main::@6(between main::@1 and main::@2) @@ -329,27 +324,27 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) - [5] (byte) main::e#3 ← phi( main/(const byte) main::y1#0/(byte) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0 main::@2/(byte) main::y#4 ) + [5] (byte) main::e#3 ← phi( main/(const byte) main::y1/(byte) 2 main::@2/(byte) main::e#5 ) + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0 main::@2/(byte) main::x#1 ) [5] (word) main::idx#3 ← phi( main/(byte) 0 main::@2/(word) main::idx#5 ) [6] (byte*~) main::$15 ← (const byte[$28*$19]) main::screen + (word) main::idx#3 - [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 + [7] *((byte*~) main::$15) ← (const byte) main::STAR [8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1 - [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 - [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 + [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 + [11] if((const byte) main::x1>=(byte) main::e#1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 - [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 + [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 [15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 ) [15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) [15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 ) - [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 + [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [17] return @@ -359,7 +354,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS (void()) main() (byte*~) main::$15 22.0 -(byte) main::STAR (byte) main::e (byte) main::e#1 11.0 (byte) main::e#2 22.0 @@ -373,15 +367,11 @@ VARIABLE REGISTER WEIGHTS (byte) main::x (byte) main::x#1 3.666666666666667 (byte) main::x#2 7.333333333333333 -(byte) main::x0 -(byte) main::x1 (byte) main::xd (byte) main::y (byte) main::y#1 7.333333333333333 (byte) main::y#2 4.714285714285714 (byte) main::y#4 16.5 -(byte) main::y0 -(byte) main::y1 (byte) main::yd Initial phi equivalence classes @@ -441,13 +431,13 @@ main: { .label _15 = 7 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y - // [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1 + // [5] phi (byte) main::e#3 = (const byte) main::y1/(byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1 lda #y1/2 sta.z e - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x // [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 @@ -473,7 +463,7 @@ main: { lda.z idx+1 adc #>screen sta.z _15+1 - // [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1 + // [7] *((byte*~) main::$15) ← (const byte) main::STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (_15),y @@ -484,11 +474,11 @@ main: { bne !+ inc.z idx+1 !: - // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuz1=vbuz1_plus_vbuc1 + // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 -- vbuz1=vbuz1_plus_vbuc1 lax.z e axs #-[y1] stx.z e - // [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1 + // [11] if((const byte) main::x1>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1 lda #x1 cmp.z e bcs b2_from_b1 @@ -505,7 +495,7 @@ main: { bcc !+ inc.z idx+1 !: - // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuz1=vbuz1_minus_vbuc1 + // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 -- vbuz1=vbuz1_minus_vbuc1 lax.z e axs #x1 stx.z e @@ -518,7 +508,7 @@ main: { jmp b2 // main::@2 b2: - // [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1_from_b2 @@ -535,22 +525,22 @@ Statement [6] (byte*~) main::$15 ← (const byte[$28*$19]) main::screen + (word) Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] -Statement [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y +Statement [7] *((byte*~) main::$15) ← (const byte) main::STAR [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] -Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x +Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x Removing always clobbered register reg byte x as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ] Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a -Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x -Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a +Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x +Statement [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a Statement [6] (byte*~) main::$15 ← (const byte[$28*$19]) main::screen + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$15 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$15 ] ) always clobbers reg byte a -Statement [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y -Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x +Statement [7] *((byte*~) main::$15) ← (const byte) main::STAR [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y +Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a -Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x -Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a +Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x +Statement [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] : zp ZP_WORD:2 , Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 , Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x , @@ -607,12 +597,12 @@ main: { .label _15 = 6 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y - // [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 + // [5] phi (byte) main::e#3 = (const byte) main::y1/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #y1/2 - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x // [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 @@ -638,7 +628,7 @@ main: { lda.z idx+1 adc #>screen sta.z _15+1 - // [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1 + // [7] *((byte*~) main::$15) ← (const byte) main::STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (_15),y @@ -649,10 +639,10 @@ main: { bne !+ inc.z idx+1 !: - // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuxx=vbuxx_plus_vbuc1 + // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 -- vbuxx=vbuxx_plus_vbuc1 txa axs #-[y1] - // [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1 + // [11] if((const byte) main::x1>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1 cpx #x1 bcc b2_from_b1 beq b2_from_b1 @@ -669,7 +659,7 @@ main: { bcc !+ inc.z idx+1 !: - // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuxx=vbuxx_minus_vbuc1 + // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 -- vbuxx=vbuxx_minus_vbuc1 txa axs #x1 // [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2] @@ -681,7 +671,7 @@ main: { jmp b2 // main::@2 b2: - // [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1_from_b2 @@ -737,8 +727,7 @@ FINAL SYMBOL TABLE (label) main::@2 (label) main::@3 (label) main::@return -(byte) main::STAR -(const byte) main::STAR#0 STAR = (byte) $51 +(const byte) main::STAR STAR = (byte) $51 (byte) main::e (byte) main::e#1 reg byte x 11.0 (byte) main::e#2 reg byte x 22.0 @@ -753,19 +742,15 @@ FINAL SYMBOL TABLE (byte) main::x (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333 -(byte) main::x0 -(const byte) main::x0#0 x0 = (byte) 0 -(byte) main::x1 -(const byte) main::x1#0 x1 = (byte) $27 +(const byte) main::x0 x0 = (byte) 0 +(const byte) main::x1 x1 = (byte) $27 (byte) main::xd (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714 (byte) main::y#4 y zp ZP_BYTE:5 16.5 -(byte) main::y0 -(const byte) main::y0#0 y0 = (byte) 0 -(byte) main::y1 -(const byte) main::y1#0 y1 = (byte) $18 +(const byte) main::y0 y0 = (byte) 0 +(const byte) main::y1 y1 = (byte) $18 (byte) main::yd zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] @@ -804,12 +789,12 @@ main: { .label y = 5 .label _15 = 6 // [5] phi from main to main::@1 [phi:main->main::@1] - // [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + // [5] phi (byte) main::y#2 = (const byte) main::y0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #y0 sta.z y - // [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 + // [5] phi (byte) main::e#3 = (const byte) main::y1/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #y1/2 - // [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + // [5] phi (byte) main::x#2 = (const byte) main::x0 [phi:main->main::@1#2] -- vbuz1=vbuc1 lda #x0 sta.z x // [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 @@ -832,7 +817,7 @@ main: { lda.z idx+1 adc #>screen sta.z _15+1 - // [7] *((byte*~) main::$15) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1 + // [7] *((byte*~) main::$15) ← (const byte) main::STAR -- _deref_pbuz1=vbuc1 lda #STAR ldy #0 sta (_15),y @@ -846,11 +831,11 @@ main: { inc.z idx+1 !: // e = e+yd - // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuxx=vbuxx_plus_vbuc1 + // [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1 -- vbuxx=vbuxx_plus_vbuc1 txa axs #-[y1] // if(xd=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1 + // [11] if((const byte) main::x1>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1 cpx #x1 bcc b2 beq b2 @@ -868,7 +853,7 @@ main: { inc.z idx+1 !: // e = e - xd - // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuxx=vbuxx_minus_vbuc1 + // [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1 -- vbuxx=vbuxx_minus_vbuc1 txa axs #x1 // [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2] @@ -878,7 +863,7 @@ main: { // main::@2 b2: // while (x<(x1+1)) - // [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 + // [16] if((byte) main::x#1<(const byte) main::x1+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z x cmp #x1+1 bcc b1 diff --git a/src/test/ref/bresenhamarr.sym b/src/test/ref/bresenhamarr.sym index c11d90656..beff9161a 100644 --- a/src/test/ref/bresenhamarr.sym +++ b/src/test/ref/bresenhamarr.sym @@ -7,8 +7,7 @@ (label) main::@2 (label) main::@3 (label) main::@return -(byte) main::STAR -(const byte) main::STAR#0 STAR = (byte) $51 +(const byte) main::STAR STAR = (byte) $51 (byte) main::e (byte) main::e#1 reg byte x 11.0 (byte) main::e#2 reg byte x 22.0 @@ -23,19 +22,15 @@ (byte) main::x (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333 -(byte) main::x0 -(const byte) main::x0#0 x0 = (byte) 0 -(byte) main::x1 -(const byte) main::x1#0 x1 = (byte) $27 +(const byte) main::x0 x0 = (byte) 0 +(const byte) main::x1 x1 = (byte) $27 (byte) main::xd (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714 (byte) main::y#4 y zp ZP_BYTE:5 16.5 -(byte) main::y0 -(const byte) main::y0#0 y0 = (byte) 0 -(byte) main::y1 -(const byte) main::y1#0 y1 = (byte) $18 +(const byte) main::y0 y0 = (byte) 0 +(const byte) main::y1 y1 = (byte) $18 (byte) main::yd zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] diff --git a/src/test/ref/c-types.cfg b/src/test/ref/c-types.cfg index 6538fae98..8c3fb0be8 100644 --- a/src/test/ref/c-types.cfg +++ b/src/test/ref/c-types.cfg @@ -81,7 +81,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@1 (void()) print_sdword((signed dword) print_sdword::dw) print_sdword: scope:[print_sdword] from testLong::@3 testLong::@5 - [35] (signed dword) print_sdword::dw#3 ← phi( testLong::@3/(const signed dword) testLong::n#0 testLong::@5/(const signed dword) testLong::s#0 ) + [35] (signed dword) print_sdword::dw#3 ← phi( testLong::@3/(const signed dword) testLong::n testLong::@5/(const signed dword) testLong::s ) [36] if((signed dword) print_sdword::dw#3<(signed byte) 0) goto print_sdword::@1 to:print_sdword::@3 print_sdword::@3: scope:[print_sdword] from print_sdword @@ -118,7 +118,7 @@ print_char::@return: scope:[print_char] from print_char (void()) print_dword((dword) print_dword::dw) print_dword: scope:[print_dword] from print_sdword::@2 testLong::@1 [50] (byte*) print_char_cursor#145 ← phi( print_sdword::@2/(byte*) print_char_cursor#26 testLong::@1/(byte*) print_char_cursor#136 ) - [50] (dword) print_dword::dw#2 ← phi( print_sdword::@2/(dword) print_dword::dw#0 testLong::@1/(const dword) testLong::u#0 ) + [50] (dword) print_dword::dw#2 ← phi( print_sdword::@2/(dword) print_dword::dw#0 testLong::@1/(const dword) testLong::u ) [51] (word) print_word::w#1 ← > (dword) print_dword::dw#2 [52] call print_word to:print_dword::@1 @@ -133,7 +133,7 @@ print_dword::@return: scope:[print_dword] from print_dword::@1 (void()) print_word((word) print_word::w) print_word: scope:[print_word] from print_dword print_dword::@1 print_sword::@2 testInt::@1 testShort::@1 [56] (byte*) print_char_cursor#144 ← phi( print_dword/(byte*) print_char_cursor#145 print_dword::@1/(byte*) print_char_cursor#26 print_sword::@2/(byte*) print_char_cursor#26 testInt::@1/(byte*) print_char_cursor#136 testShort::@1/(byte*) print_char_cursor#136 ) - [56] (word) print_word::w#5 ← phi( print_dword/(word) print_word::w#1 print_dword::@1/(word) print_word::w#2 print_sword::@2/(word) print_word::w#0 testInt::@1/(const word) testInt::u#0 testShort::@1/(const word) testShort::u#0 ) + [56] (word) print_word::w#5 ← phi( print_dword/(word) print_word::w#1 print_dword::@1/(word) print_word::w#2 print_sword::@2/(word) print_word::w#0 testInt::@1/(const word) testInt::u testShort::@1/(const word) testShort::u ) [57] (byte) print_byte::b#1 ← > (word) print_word::w#5 [58] call print_byte to:print_word::@1 @@ -148,7 +148,7 @@ print_word::@return: scope:[print_word] from print_word::@1 (void()) print_byte((byte) print_byte::b) print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 testChar::@1 testChar::@3 [62] (byte*) print_char_cursor#149 ← phi( print_sbyte::@2/(byte*) print_char_cursor#26 print_word/(byte*) print_char_cursor#144 print_word::@1/(byte*) print_char_cursor#26 testChar::@1/(byte*) print_char_cursor#136 testChar::@3/(byte*) print_char_cursor#26 ) - [62] (byte) print_byte::b#5 ← phi( print_sbyte::@2/(byte)(const signed byte) print_sbyte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(const byte) testChar::u#0 testChar::@3/(const byte) testChar::n#0 ) + [62] (byte) print_byte::b#5 ← phi( print_sbyte::@2/(byte)(const signed byte) print_sbyte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(const byte) testChar::u testChar::@3/(const byte) testChar::n ) [63] (byte~) print_byte::$0 ← (byte) print_byte::b#5 >> (byte) 4 [64] (byte) print_char::ch#6 ← *((const byte[]) print_hextab + (byte~) print_byte::$0) [65] call print_char @@ -216,7 +216,7 @@ testInt::@return: scope:[testInt] from testInt::@6 (void()) print_sword((signed word) print_sword::w) print_sword: scope:[print_sword] from testInt::@3 testInt::@5 testShort::@3 testShort::@5 - [92] (signed word) print_sword::w#10 ← phi( testInt::@3/(const signed word) testInt::n#0 testInt::@5/(const signed word) testInt::s#0 testShort::@3/(const signed word) testShort::n#0 testShort::@5/(const signed word) testShort::s#0 ) + [92] (signed word) print_sword::w#10 ← phi( testInt::@3/(const signed word) testInt::n testInt::@5/(const signed word) testInt::s testShort::@3/(const signed word) testShort::n testShort::@5/(const signed word) testShort::s ) [93] if((signed word) print_sword::w#10<(signed byte) 0) goto print_sword::@1 to:print_sword::@3 print_sword::@3: scope:[print_sword] from print_sword diff --git a/src/test/ref/c-types.log b/src/test/ref/c-types.log index 8f49b12a6..657643408 100644 --- a/src/test/ref/c-types.log +++ b/src/test/ref/c-types.log @@ -491,9 +491,9 @@ main::@return: scope:[main] from main::@5 testChar: scope:[testChar] from main::@1 (byte*) print_line_cursor#67 ← phi( main::@1/(byte*) print_line_cursor#5 ) (byte*) print_char_cursor#151 ← phi( main::@1/(byte*) print_char_cursor#30 ) - (byte) testChar::u#0 ← (number) $e - (byte) testChar::n#0 ← (number) $e - (signed byte) testChar::s#0 ← (number) -$e + (byte) testChar::u ← (number) $e + (byte) testChar::n ← (number) $e + (signed byte) testChar::s ← (number) -$e (byte*) print_str::str#1 ← (const string) testChar::str call print_str to:testChar::@1 @@ -501,7 +501,7 @@ testChar::@1: scope:[testChar] from testChar (byte*) print_line_cursor#63 ← phi( testChar/(byte*) print_line_cursor#67 ) (byte*) print_char_cursor#103 ← phi( testChar/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#36 ← (byte*) print_char_cursor#103 - (byte) print_byte::b#3 ← (byte) testChar::u#0 + (byte) print_byte::b#3 ← (byte) testChar::u call print_byte to:testChar::@2 testChar::@2: scope:[testChar] from testChar::@1 @@ -515,7 +515,7 @@ testChar::@3: scope:[testChar] from testChar::@2 (byte*) print_line_cursor#55 ← phi( testChar::@2/(byte*) print_line_cursor#59 ) (byte*) print_char_cursor#105 ← phi( testChar::@2/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#38 ← (byte*) print_char_cursor#105 - (byte) print_byte::b#4 ← (byte) testChar::n#0 + (byte) print_byte::b#4 ← (byte) testChar::n call print_byte to:testChar::@4 testChar::@4: scope:[testChar] from testChar::@3 @@ -529,7 +529,7 @@ testChar::@5: scope:[testChar] from testChar::@4 (byte*) print_line_cursor#46 ← phi( testChar::@4/(byte*) print_line_cursor#51 ) (byte*) print_char_cursor#107 ← phi( testChar::@4/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#40 ← (byte*) print_char_cursor#107 - (signed byte) print_sbyte::b#1 ← (signed byte) testChar::s#0 + (signed byte) print_sbyte::b#1 ← (signed byte) testChar::s call print_sbyte to:testChar::@6 testChar::@6: scope:[testChar] from testChar::@5 @@ -556,9 +556,9 @@ testChar::@return: scope:[testChar] from testChar::@7 testShort: scope:[testShort] from main::@2 (byte*) print_line_cursor#68 ← phi( main::@2/(byte*) print_line_cursor#6 ) (byte*) print_char_cursor#152 ← phi( main::@2/(byte*) print_char_cursor#31 ) - (word) testShort::u#0 ← (number) $578 - (signed word) testShort::n#0 ← (number) -$578 - (signed word) testShort::s#0 ← (number) -$578 + (word) testShort::u ← (number) $578 + (signed word) testShort::n ← (number) -$578 + (signed word) testShort::s ← (number) -$578 (byte*) print_str::str#2 ← (const string) testShort::str call print_str to:testShort::@1 @@ -566,7 +566,7 @@ testShort::@1: scope:[testShort] from testShort (byte*) print_line_cursor#64 ← phi( testShort/(byte*) print_line_cursor#68 ) (byte*) print_char_cursor#111 ← phi( testShort/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#44 ← (byte*) print_char_cursor#111 - (word) print_word::w#3 ← (word) testShort::u#0 + (word) print_word::w#3 ← (word) testShort::u call print_word to:testShort::@2 testShort::@2: scope:[testShort] from testShort::@1 @@ -580,7 +580,7 @@ testShort::@3: scope:[testShort] from testShort::@2 (byte*) print_line_cursor#56 ← phi( testShort::@2/(byte*) print_line_cursor#60 ) (byte*) print_char_cursor#113 ← phi( testShort::@2/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#46 ← (byte*) print_char_cursor#113 - (signed word) print_sword::w#1 ← (signed word) testShort::n#0 + (signed word) print_sword::w#1 ← (signed word) testShort::n call print_sword to:testShort::@4 testShort::@4: scope:[testShort] from testShort::@3 @@ -594,7 +594,7 @@ testShort::@5: scope:[testShort] from testShort::@4 (byte*) print_line_cursor#47 ← phi( testShort::@4/(byte*) print_line_cursor#52 ) (byte*) print_char_cursor#115 ← phi( testShort::@4/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#48 ← (byte*) print_char_cursor#115 - (signed word) print_sword::w#2 ← (signed word) testShort::s#0 + (signed word) print_sword::w#2 ← (signed word) testShort::s call print_sword to:testShort::@6 testShort::@6: scope:[testShort] from testShort::@5 @@ -621,9 +621,9 @@ testShort::@return: scope:[testShort] from testShort::@7 testInt: scope:[testInt] from main::@3 (byte*) print_line_cursor#69 ← phi( main::@3/(byte*) print_line_cursor#7 ) (byte*) print_char_cursor#153 ← phi( main::@3/(byte*) print_char_cursor#32 ) - (word) testInt::u#0 ← (number) $578 - (signed word) testInt::n#0 ← (number) -$578 - (signed word) testInt::s#0 ← (number) -$578 + (word) testInt::u ← (number) $578 + (signed word) testInt::n ← (number) -$578 + (signed word) testInt::s ← (number) -$578 (byte*) print_str::str#3 ← (const string) testInt::str call print_str to:testInt::@1 @@ -631,7 +631,7 @@ testInt::@1: scope:[testInt] from testInt (byte*) print_line_cursor#65 ← phi( testInt/(byte*) print_line_cursor#69 ) (byte*) print_char_cursor#119 ← phi( testInt/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#52 ← (byte*) print_char_cursor#119 - (word) print_word::w#4 ← (word) testInt::u#0 + (word) print_word::w#4 ← (word) testInt::u call print_word to:testInt::@2 testInt::@2: scope:[testInt] from testInt::@1 @@ -645,7 +645,7 @@ testInt::@3: scope:[testInt] from testInt::@2 (byte*) print_line_cursor#57 ← phi( testInt::@2/(byte*) print_line_cursor#61 ) (byte*) print_char_cursor#121 ← phi( testInt::@2/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#54 ← (byte*) print_char_cursor#121 - (signed word) print_sword::w#3 ← (signed word) testInt::n#0 + (signed word) print_sword::w#3 ← (signed word) testInt::n call print_sword to:testInt::@4 testInt::@4: scope:[testInt] from testInt::@3 @@ -659,7 +659,7 @@ testInt::@5: scope:[testInt] from testInt::@4 (byte*) print_line_cursor#48 ← phi( testInt::@4/(byte*) print_line_cursor#53 ) (byte*) print_char_cursor#123 ← phi( testInt::@4/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#56 ← (byte*) print_char_cursor#123 - (signed word) print_sword::w#4 ← (signed word) testInt::s#0 + (signed word) print_sword::w#4 ← (signed word) testInt::s call print_sword to:testInt::@6 testInt::@6: scope:[testInt] from testInt::@5 @@ -686,9 +686,9 @@ testInt::@return: scope:[testInt] from testInt::@7 testLong: scope:[testLong] from main::@4 (byte*) print_line_cursor#70 ← phi( main::@4/(byte*) print_line_cursor#8 ) (byte*) print_char_cursor#154 ← phi( main::@4/(byte*) print_char_cursor#33 ) - (dword) testLong::u#0 ← (number) $222e0 - (signed dword) testLong::n#0 ← (number) -$222e0 - (signed dword) testLong::s#0 ← (number) -$222e0 + (dword) testLong::u ← (number) $222e0 + (signed dword) testLong::n ← (number) -$222e0 + (signed dword) testLong::s ← (number) -$222e0 (byte*) print_str::str#4 ← (const string) testLong::str call print_str to:testLong::@1 @@ -696,7 +696,7 @@ testLong::@1: scope:[testLong] from testLong (byte*) print_line_cursor#66 ← phi( testLong/(byte*) print_line_cursor#70 ) (byte*) print_char_cursor#127 ← phi( testLong/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#60 ← (byte*) print_char_cursor#127 - (dword) print_dword::dw#1 ← (dword) testLong::u#0 + (dword) print_dword::dw#1 ← (dword) testLong::u call print_dword to:testLong::@2 testLong::@2: scope:[testLong] from testLong::@1 @@ -710,7 +710,7 @@ testLong::@3: scope:[testLong] from testLong::@2 (byte*) print_line_cursor#58 ← phi( testLong::@2/(byte*) print_line_cursor#62 ) (byte*) print_char_cursor#129 ← phi( testLong::@2/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#62 ← (byte*) print_char_cursor#129 - (signed dword) print_sdword::dw#1 ← (signed dword) testLong::n#0 + (signed dword) print_sdword::dw#1 ← (signed dword) testLong::n call print_sdword to:testLong::@4 testLong::@4: scope:[testLong] from testLong::@3 @@ -724,7 +724,7 @@ testLong::@5: scope:[testLong] from testLong::@4 (byte*) print_line_cursor#49 ← phi( testLong::@4/(byte*) print_line_cursor#54 ) (byte*) print_char_cursor#131 ← phi( testLong::@4/(byte*) print_char_cursor#27 ) (byte*) print_char_cursor#64 ← (byte*) print_char_cursor#131 - (signed dword) print_sdword::dw#2 ← (signed dword) testLong::s#0 + (signed dword) print_sdword::dw#2 ← (signed dword) testLong::s call print_sdword to:testLong::@6 testLong::@6: scope:[testLong] from testLong::@5 @@ -1219,12 +1219,9 @@ SYMBOL TABLE SSA (label) testChar::@7 (label) testChar::@return (byte) testChar::n -(byte) testChar::n#0 (signed byte) testChar::s -(signed byte) testChar::s#0 (const string) testChar::str = (string) "char: " (byte) testChar::u -(byte) testChar::u#0 (void()) testInt() (label) testInt::@1 (label) testInt::@2 @@ -1235,12 +1232,9 @@ SYMBOL TABLE SSA (label) testInt::@7 (label) testInt::@return (signed word) testInt::n -(signed word) testInt::n#0 (signed word) testInt::s -(signed word) testInt::s#0 (const string) testInt::str = (string) "int: " (word) testInt::u -(word) testInt::u#0 (void()) testLong() (label) testLong::@1 (label) testLong::@2 @@ -1251,12 +1245,9 @@ SYMBOL TABLE SSA (label) testLong::@7 (label) testLong::@return (signed dword) testLong::n -(signed dword) testLong::n#0 (signed dword) testLong::s -(signed dword) testLong::s#0 (const string) testLong::str = (string) "long: " (dword) testLong::u -(dword) testLong::u#0 (void()) testShort() (label) testShort::@1 (label) testShort::@2 @@ -1267,12 +1258,9 @@ SYMBOL TABLE SSA (label) testShort::@7 (label) testShort::@return (signed word) testShort::n -(signed word) testShort::n#0 (signed word) testShort::s -(signed word) testShort::s#0 (const string) testShort::str = (string) "short: " (word) testShort::u -(word) testShort::u#0 Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 Adding number conversion cast (unumber) 0 in (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#5) @@ -1284,18 +1272,18 @@ Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) p Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#6 & (number) $f Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#6 & (unumber)(number) $f Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 -Adding number conversion cast (unumber) $e in (byte) testChar::u#0 ← (number) $e -Adding number conversion cast (unumber) $e in (byte) testChar::n#0 ← (number) $e -Adding number conversion cast (snumber) -$e in (signed byte) testChar::s#0 ← (number) -$e -Adding number conversion cast (unumber) $578 in (word) testShort::u#0 ← (number) $578 -Adding number conversion cast (snumber) -$578 in (signed word) testShort::n#0 ← (number) -$578 -Adding number conversion cast (snumber) -$578 in (signed word) testShort::s#0 ← (number) -$578 -Adding number conversion cast (unumber) $578 in (word) testInt::u#0 ← (number) $578 -Adding number conversion cast (snumber) -$578 in (signed word) testInt::n#0 ← (number) -$578 -Adding number conversion cast (snumber) -$578 in (signed word) testInt::s#0 ← (number) -$578 -Adding number conversion cast (unumber) $222e0 in (dword) testLong::u#0 ← (number) $222e0 -Adding number conversion cast (snumber) -$222e0 in (signed dword) testLong::n#0 ← (number) -$222e0 -Adding number conversion cast (snumber) -$222e0 in (signed dword) testLong::s#0 ← (number) -$222e0 +Adding number conversion cast (unumber) $e in (byte) testChar::u ← (number) $e +Adding number conversion cast (unumber) $e in (byte) testChar::n ← (number) $e +Adding number conversion cast (snumber) -$e in (signed byte) testChar::s ← (number) -$e +Adding number conversion cast (unumber) $578 in (word) testShort::u ← (number) $578 +Adding number conversion cast (snumber) -$578 in (signed word) testShort::n ← (number) -$578 +Adding number conversion cast (snumber) -$578 in (signed word) testShort::s ← (number) -$578 +Adding number conversion cast (unumber) $578 in (word) testInt::u ← (number) $578 +Adding number conversion cast (snumber) -$578 in (signed word) testInt::n ← (number) -$578 +Adding number conversion cast (snumber) -$578 in (signed word) testInt::s ← (number) -$578 +Adding number conversion cast (unumber) $222e0 in (dword) testLong::u ← (number) $222e0 +Adding number conversion cast (snumber) -$222e0 in (signed dword) testLong::n ← (number) -$222e0 +Adding number conversion cast (snumber) -$222e0 in (signed dword) testLong::s ← (number) -$222e0 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 @@ -1304,18 +1292,18 @@ Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#7 Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#4 Inlining cast (dword~) print_sdword::$1 ← (dword)(signed dword) print_sdword::dw#5 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (byte) testChar::u#0 ← (unumber)(number) $e -Inlining cast (byte) testChar::n#0 ← (unumber)(number) $e -Inlining cast (signed byte) testChar::s#0 ← (snumber)(number) -$e -Inlining cast (word) testShort::u#0 ← (unumber)(number) $578 -Inlining cast (signed word) testShort::n#0 ← (snumber)(number) -$578 -Inlining cast (signed word) testShort::s#0 ← (snumber)(number) -$578 -Inlining cast (word) testInt::u#0 ← (unumber)(number) $578 -Inlining cast (signed word) testInt::n#0 ← (snumber)(number) -$578 -Inlining cast (signed word) testInt::s#0 ← (snumber)(number) -$578 -Inlining cast (dword) testLong::u#0 ← (unumber)(number) $222e0 -Inlining cast (signed dword) testLong::n#0 ← (snumber)(number) -$222e0 -Inlining cast (signed dword) testLong::s#0 ← (snumber)(number) -$222e0 +Inlining cast (byte) testChar::u ← (unumber)(number) $e +Inlining cast (byte) testChar::n ← (unumber)(number) $e +Inlining cast (signed byte) testChar::s ← (snumber)(number) -$e +Inlining cast (word) testShort::u ← (unumber)(number) $578 +Inlining cast (signed word) testShort::n ← (snumber)(number) -$578 +Inlining cast (signed word) testShort::s ← (snumber)(number) -$578 +Inlining cast (word) testInt::u ← (unumber)(number) $578 +Inlining cast (signed word) testInt::n ← (snumber)(number) -$578 +Inlining cast (signed word) testInt::s ← (snumber)(number) -$578 +Inlining cast (dword) testLong::u ← (unumber)(number) $222e0 +Inlining cast (signed dword) testLong::n ← (snumber)(number) -$222e0 +Inlining cast (signed dword) testLong::s ← (snumber)(number) -$222e0 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant pointer cast (byte*) 1024 @@ -1570,43 +1558,43 @@ Constant (const byte) print_char::ch#5 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const byte) testChar::u#0 = $e -Constant (const byte) testChar::n#0 = $e -Constant (const signed byte) testChar::s#0 = -$e +Constant (const byte) testChar::u = $e +Constant (const byte) testChar::n = $e +Constant (const signed byte) testChar::s = -$e Constant (const byte*) print_str::str#1 = testChar::str Constant (const byte) print_char::ch#8 = ' ' Constant (const byte) print_char::ch#9 = ' ' -Constant (const word) testShort::u#0 = $578 -Constant (const signed word) testShort::n#0 = -$578 -Constant (const signed word) testShort::s#0 = -$578 +Constant (const word) testShort::u = $578 +Constant (const signed word) testShort::n = -$578 +Constant (const signed word) testShort::s = -$578 Constant (const byte*) print_str::str#2 = testShort::str Constant (const byte) print_char::ch#10 = ' ' Constant (const byte) print_char::ch#11 = ' ' -Constant (const word) testInt::u#0 = $578 -Constant (const signed word) testInt::n#0 = -$578 -Constant (const signed word) testInt::s#0 = -$578 +Constant (const word) testInt::u = $578 +Constant (const signed word) testInt::n = -$578 +Constant (const signed word) testInt::s = -$578 Constant (const byte*) print_str::str#3 = testInt::str Constant (const byte) print_char::ch#12 = ' ' Constant (const byte) print_char::ch#13 = ' ' -Constant (const dword) testLong::u#0 = $222e0 -Constant (const signed dword) testLong::n#0 = -$222e0 -Constant (const signed dword) testLong::s#0 = -$222e0 +Constant (const dword) testLong::u = $222e0 +Constant (const signed dword) testLong::n = -$222e0 +Constant (const signed dword) testLong::s = -$222e0 Constant (const byte*) print_str::str#4 = testLong::str Constant (const byte) print_char::ch#14 = ' ' Constant (const byte) print_char::ch#15 = ' ' Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) print_byte::b#3 = testChar::u#0 -Constant (const byte) print_byte::b#4 = testChar::n#0 -Constant (const signed byte) print_sbyte::b#1 = testChar::s#0 -Constant (const word) print_word::w#3 = testShort::u#0 -Constant (const signed word) print_sword::w#1 = testShort::n#0 -Constant (const signed word) print_sword::w#2 = testShort::s#0 -Constant (const word) print_word::w#4 = testInt::u#0 -Constant (const signed word) print_sword::w#3 = testInt::n#0 -Constant (const signed word) print_sword::w#4 = testInt::s#0 -Constant (const dword) print_dword::dw#1 = testLong::u#0 -Constant (const signed dword) print_sdword::dw#1 = testLong::n#0 -Constant (const signed dword) print_sdword::dw#2 = testLong::s#0 +Constant (const byte) print_byte::b#3 = testChar::u +Constant (const byte) print_byte::b#4 = testChar::n +Constant (const signed byte) print_sbyte::b#1 = testChar::s +Constant (const word) print_word::w#3 = testShort::u +Constant (const signed word) print_sword::w#1 = testShort::n +Constant (const signed word) print_sword::w#2 = testShort::s +Constant (const word) print_word::w#4 = testInt::u +Constant (const signed word) print_sword::w#3 = testInt::n +Constant (const signed word) print_sword::w#4 = testInt::s +Constant (const dword) print_dword::dw#1 = testLong::u +Constant (const signed dword) print_sdword::dw#1 = testLong::n +Constant (const signed dword) print_sdword::dw#2 = testLong::s Successful SSA optimization Pass2ConstantIdentification Constant value identified (void*)print_line_cursor#0 in [169] (void*) memset::str#0 ← (void*)(const byte*) print_line_cursor#0 Successful SSA optimization Pass2ConstantValues @@ -1677,27 +1665,27 @@ Inlining constant with var siblings (const byte*) print_line_cursor#0 Constant inlined print_char::ch#13 = (byte) ' ' Constant inlined print_char::ch#14 = (byte) ' ' Constant inlined print_char::ch#15 = (byte) ' ' -Constant inlined print_sbyte::b#1 = (const signed byte) testChar::s#0 +Constant inlined print_sbyte::b#1 = (const signed byte) testChar::s Constant inlined print_char::ch#10 = (byte) ' ' -Constant inlined print_sword::w#1 = (const signed word) testShort::n#0 +Constant inlined print_sword::w#1 = (const signed word) testShort::n Constant inlined print_char::ch#11 = (byte) ' ' -Constant inlined print_sword::w#2 = (const signed word) testShort::s#0 +Constant inlined print_sword::w#2 = (const signed word) testShort::s Constant inlined print_char::ch#12 = (byte) ' ' -Constant inlined print_sword::w#3 = (const signed word) testInt::n#0 +Constant inlined print_sword::w#3 = (const signed word) testInt::n Constant inlined $0 = (const byte[]) print_hextab -Constant inlined print_sword::w#4 = (const signed word) testInt::s#0 -Constant inlined print_dword::dw#1 = (const dword) testLong::u#0 +Constant inlined print_sword::w#4 = (const signed word) testInt::s +Constant inlined print_dword::dw#1 = (const dword) testLong::u Constant inlined print_char::ch#9 = (byte) ' ' Constant inlined print_char::ch#8 = (byte) ' ' Constant inlined memset::$2 = (byte*)(const void*) memset::str#0 -Constant inlined print_sdword::dw#2 = (const signed dword) testLong::s#0 -Constant inlined print_sdword::dw#1 = (const signed dword) testLong::n#0 +Constant inlined print_sdword::dw#2 = (const signed dword) testLong::s +Constant inlined print_sdword::dw#1 = (const signed dword) testLong::n Constant inlined print_byte::b#0 = (byte)(const signed byte) print_sbyte::b#0 Constant inlined print_line_cursor#0 = (byte*) 1024 -Constant inlined print_byte::b#4 = (const byte) testChar::n#0 -Constant inlined print_byte::b#3 = (const byte) testChar::u#0 -Constant inlined print_word::w#3 = (const word) testShort::u#0 -Constant inlined print_word::w#4 = (const word) testInt::u#0 +Constant inlined print_byte::b#4 = (const byte) testChar::n +Constant inlined print_byte::b#3 = (const byte) testChar::u +Constant inlined print_word::w#3 = (const word) testShort::u +Constant inlined print_word::w#4 = (const word) testInt::u Constant inlined print_char::ch#2 = (byte) '-' Constant inlined print_char::ch#5 = (byte) ' ' Constant inlined print_char::ch#4 = (byte) '-' @@ -1972,7 +1960,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@1 (void()) print_sdword((signed dword) print_sdword::dw) print_sdword: scope:[print_sdword] from testLong::@3 testLong::@5 - [35] (signed dword) print_sdword::dw#3 ← phi( testLong::@3/(const signed dword) testLong::n#0 testLong::@5/(const signed dword) testLong::s#0 ) + [35] (signed dword) print_sdword::dw#3 ← phi( testLong::@3/(const signed dword) testLong::n testLong::@5/(const signed dword) testLong::s ) [36] if((signed dword) print_sdword::dw#3<(signed byte) 0) goto print_sdword::@1 to:print_sdword::@3 print_sdword::@3: scope:[print_sdword] from print_sdword @@ -2009,7 +1997,7 @@ print_char::@return: scope:[print_char] from print_char (void()) print_dword((dword) print_dword::dw) print_dword: scope:[print_dword] from print_sdword::@2 testLong::@1 [50] (byte*) print_char_cursor#145 ← phi( print_sdword::@2/(byte*) print_char_cursor#26 testLong::@1/(byte*) print_char_cursor#136 ) - [50] (dword) print_dword::dw#2 ← phi( print_sdword::@2/(dword) print_dword::dw#0 testLong::@1/(const dword) testLong::u#0 ) + [50] (dword) print_dword::dw#2 ← phi( print_sdword::@2/(dword) print_dword::dw#0 testLong::@1/(const dword) testLong::u ) [51] (word) print_word::w#1 ← > (dword) print_dword::dw#2 [52] call print_word to:print_dword::@1 @@ -2024,7 +2012,7 @@ print_dword::@return: scope:[print_dword] from print_dword::@1 (void()) print_word((word) print_word::w) print_word: scope:[print_word] from print_dword print_dword::@1 print_sword::@2 testInt::@1 testShort::@1 [56] (byte*) print_char_cursor#144 ← phi( print_dword/(byte*) print_char_cursor#145 print_dword::@1/(byte*) print_char_cursor#26 print_sword::@2/(byte*) print_char_cursor#26 testInt::@1/(byte*) print_char_cursor#136 testShort::@1/(byte*) print_char_cursor#136 ) - [56] (word) print_word::w#5 ← phi( print_dword/(word) print_word::w#1 print_dword::@1/(word) print_word::w#2 print_sword::@2/(word) print_word::w#0 testInt::@1/(const word) testInt::u#0 testShort::@1/(const word) testShort::u#0 ) + [56] (word) print_word::w#5 ← phi( print_dword/(word) print_word::w#1 print_dword::@1/(word) print_word::w#2 print_sword::@2/(word) print_word::w#0 testInt::@1/(const word) testInt::u testShort::@1/(const word) testShort::u ) [57] (byte) print_byte::b#1 ← > (word) print_word::w#5 [58] call print_byte to:print_word::@1 @@ -2039,7 +2027,7 @@ print_word::@return: scope:[print_word] from print_word::@1 (void()) print_byte((byte) print_byte::b) print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 testChar::@1 testChar::@3 [62] (byte*) print_char_cursor#149 ← phi( print_sbyte::@2/(byte*) print_char_cursor#26 print_word/(byte*) print_char_cursor#144 print_word::@1/(byte*) print_char_cursor#26 testChar::@1/(byte*) print_char_cursor#136 testChar::@3/(byte*) print_char_cursor#26 ) - [62] (byte) print_byte::b#5 ← phi( print_sbyte::@2/(byte)(const signed byte) print_sbyte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(const byte) testChar::u#0 testChar::@3/(const byte) testChar::n#0 ) + [62] (byte) print_byte::b#5 ← phi( print_sbyte::@2/(byte)(const signed byte) print_sbyte::b#0 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(const byte) testChar::u testChar::@3/(const byte) testChar::n ) [63] (byte~) print_byte::$0 ← (byte) print_byte::b#5 >> (byte) 4 [64] (byte) print_char::ch#6 ← *((const byte[]) print_hextab + (byte~) print_byte::$0) [65] call print_char @@ -2107,7 +2095,7 @@ testInt::@return: scope:[testInt] from testInt::@6 (void()) print_sword((signed word) print_sword::w) print_sword: scope:[print_sword] from testInt::@3 testInt::@5 testShort::@3 testShort::@5 - [92] (signed word) print_sword::w#10 ← phi( testInt::@3/(const signed word) testInt::n#0 testInt::@5/(const signed word) testInt::s#0 testShort::@3/(const signed word) testShort::n#0 testShort::@5/(const signed word) testShort::s#0 ) + [92] (signed word) print_sword::w#10 ← phi( testInt::@3/(const signed word) testInt::n testInt::@5/(const signed word) testInt::s testShort::@3/(const signed word) testShort::n testShort::@5/(const signed word) testShort::s ) [93] if((signed word) print_sword::w#10<(signed byte) 0) goto print_sword::@1 to:print_sword::@3 print_sword::@3: scope:[print_sword] from print_sword @@ -2308,21 +2296,9 @@ VARIABLE REGISTER WEIGHTS (word) print_word::w#2 4.0 (word) print_word::w#5 3.333333333333333 (void()) testChar() -(byte) testChar::n -(signed byte) testChar::s -(byte) testChar::u (void()) testInt() -(signed word) testInt::n -(signed word) testInt::s -(word) testInt::u (void()) testLong() -(signed dword) testLong::n -(signed dword) testLong::s -(dword) testLong::u (void()) testShort() -(signed word) testShort::n -(signed word) testShort::s -(word) testShort::u Initial phi equivalence classes [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] @@ -2461,7 +2437,7 @@ testLong: { // [50] phi from testLong::@1 to print_dword [phi:testLong::@1->print_dword] print_dword_from_b1: // [50] phi (byte*) print_char_cursor#145 = (byte*) print_char_cursor#136 [phi:testLong::@1->print_dword#0] -- register_copy - // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u#0 [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 + // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 lda #u @@ -2492,7 +2468,7 @@ testLong: { // [22] call print_sdword // [35] phi from testLong::@3 to print_sdword [phi:testLong::@3->print_sdword] print_sdword_from_b3: - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n#0 [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 lda #n @@ -2523,7 +2499,7 @@ testLong: { // [26] call print_sdword // [35] phi from testLong::@5 to print_sdword [phi:testLong::@5->print_sdword] print_sdword_from_b5: - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s#0 [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 lda #s @@ -2874,7 +2850,7 @@ testInt: { // [56] phi from testInt::@1 to print_word [phi:testInt::@1->print_word] print_word_from_b1: // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testInt::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testInt::u#0 [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testInt::u [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -2901,7 +2877,7 @@ testInt: { // [84] call print_sword // [92] phi from testInt::@3 to print_sword [phi:testInt::@3->print_sword] print_sword_from_b3: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n#0 [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -2928,7 +2904,7 @@ testInt: { // [88] call print_sword // [92] phi from testInt::@5 to print_sword [phi:testInt::@5->print_sword] print_sword_from_b5: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s#0 [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -3051,7 +3027,7 @@ testShort: { // [56] phi from testShort::@1 to print_word [phi:testShort::@1->print_word] print_word_from_b1: // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testShort::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testShort::u#0 [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testShort::u [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -3078,7 +3054,7 @@ testShort: { // [110] call print_sword // [92] phi from testShort::@3 to print_sword [phi:testShort::@3->print_sword] print_sword_from_b3: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n#0 [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -3105,7 +3081,7 @@ testShort: { // [114] call print_sword // [92] phi from testShort::@5 to print_sword [phi:testShort::@5->print_sword] print_sword_from_b5: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s#0 [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -3157,7 +3133,7 @@ testChar: { // [62] phi from testChar::@1 to print_byte [phi:testChar::@1->print_byte] print_byte_from_b1: // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#136 [phi:testChar::@1->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u#0 [phi:testChar::@1->print_byte#1] -- vbuz1=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u [phi:testChar::@1->print_byte#1] -- vbuz1=vbuc1 lda #u sta.z print_byte.b jsr print_byte @@ -3183,7 +3159,7 @@ testChar: { // [62] phi from testChar::@3 to print_byte [phi:testChar::@3->print_byte] print_byte_from_b3: // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#26 [phi:testChar::@3->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n#0 [phi:testChar::@3->print_byte#1] -- vbuz1=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n [phi:testChar::@3->print_byte#1] -- vbuz1=vbuc1 lda #n sta.z print_byte.b jsr print_byte @@ -3533,7 +3509,7 @@ testLong: { // [50] phi from testLong::@1 to print_dword [phi:testLong::@1->print_dword] print_dword_from_b1: // [50] phi (byte*) print_char_cursor#145 = (byte*) print_char_cursor#136 [phi:testLong::@1->print_dword#0] -- register_copy - // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u#0 [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 + // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 lda #u @@ -3563,7 +3539,7 @@ testLong: { // [22] call print_sdword // [35] phi from testLong::@3 to print_sdword [phi:testLong::@3->print_sdword] print_sdword_from_b3: - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n#0 [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 lda #n @@ -3593,7 +3569,7 @@ testLong: { // [26] call print_sdword // [35] phi from testLong::@5 to print_sdword [phi:testLong::@5->print_sdword] print_sdword_from_b5: - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s#0 [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 lda #s @@ -3924,7 +3900,7 @@ testInt: { // [56] phi from testInt::@1 to print_word [phi:testInt::@1->print_word] print_word_from_b1: // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testInt::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testInt::u#0 [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testInt::u [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -3950,7 +3926,7 @@ testInt: { // [84] call print_sword // [92] phi from testInt::@3 to print_sword [phi:testInt::@3->print_sword] print_sword_from_b3: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n#0 [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -3976,7 +3952,7 @@ testInt: { // [88] call print_sword // [92] phi from testInt::@5 to print_sword [phi:testInt::@5->print_sword] print_sword_from_b5: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s#0 [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -4093,7 +4069,7 @@ testShort: { // [56] phi from testShort::@1 to print_word [phi:testShort::@1->print_word] print_word_from_b1: // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testShort::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testShort::u#0 [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testShort::u [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -4119,7 +4095,7 @@ testShort: { // [110] call print_sword // [92] phi from testShort::@3 to print_sword [phi:testShort::@3->print_sword] print_sword_from_b3: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n#0 [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -4145,7 +4121,7 @@ testShort: { // [114] call print_sword // [92] phi from testShort::@5 to print_sword [phi:testShort::@5->print_sword] print_sword_from_b5: - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s#0 [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -4197,7 +4173,7 @@ testChar: { // [62] phi from testChar::@1 to print_byte [phi:testChar::@1->print_byte] print_byte_from_b1: // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#136 [phi:testChar::@1->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u#0 [phi:testChar::@1->print_byte#1] -- vbuxx=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u [phi:testChar::@1->print_byte#1] -- vbuxx=vbuc1 ldx #u jsr print_byte // [122] phi from testChar::@1 to testChar::@2 [phi:testChar::@1->testChar::@2] @@ -4221,7 +4197,7 @@ testChar: { // [62] phi from testChar::@3 to print_byte [phi:testChar::@3->print_byte] print_byte_from_b3: // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#26 [phi:testChar::@3->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n#0 [phi:testChar::@3->print_byte#1] -- vbuxx=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n [phi:testChar::@3->print_byte#1] -- vbuxx=vbuc1 ldx #n jsr print_byte // [126] phi from testChar::@3 to testChar::@4 [phi:testChar::@3->testChar::@4] @@ -4669,7 +4645,7 @@ FINAL SYMBOL TABLE (label) print_sbyte::@2 (label) print_sbyte::@return (signed byte) print_sbyte::b -(const signed byte) print_sbyte::b#0 b = -(const signed byte) testChar::s#0 +(const signed byte) print_sbyte::b#0 b = -(const signed byte) testChar::s (byte*) print_screen (void()) print_sdword((signed dword) print_sdword::dw) (label) print_sdword::@1 @@ -4715,13 +4691,10 @@ FINAL SYMBOL TABLE (label) testChar::@5 (label) testChar::@6 (label) testChar::@return -(byte) testChar::n -(const byte) testChar::n#0 n = (byte) $e -(signed byte) testChar::s -(const signed byte) testChar::s#0 s = (signed byte) -$e +(const byte) testChar::n n = (byte) $e +(const signed byte) testChar::s s = (signed byte) -$e (const string) testChar::str str = (string) "char: " -(byte) testChar::u -(const byte) testChar::u#0 u = (byte) $e +(const byte) testChar::u u = (byte) $e (void()) testInt() (label) testInt::@1 (label) testInt::@2 @@ -4730,13 +4703,10 @@ FINAL SYMBOL TABLE (label) testInt::@5 (label) testInt::@6 (label) testInt::@return -(signed word) testInt::n -(const signed word) testInt::n#0 n = (signed word) -$578 -(signed word) testInt::s -(const signed word) testInt::s#0 s = (signed word) -$578 +(const signed word) testInt::n n = (signed word) -$578 +(const signed word) testInt::s s = (signed word) -$578 (const string) testInt::str str = (string) "int: " -(word) testInt::u -(const word) testInt::u#0 u = (word) $578 +(const word) testInt::u u = (word) $578 (void()) testLong() (label) testLong::@1 (label) testLong::@2 @@ -4745,13 +4715,10 @@ FINAL SYMBOL TABLE (label) testLong::@5 (label) testLong::@6 (label) testLong::@return -(signed dword) testLong::n -(const signed dword) testLong::n#0 n = (signed dword) -$222e0 -(signed dword) testLong::s -(const signed dword) testLong::s#0 s = (signed dword) -$222e0 +(const signed dword) testLong::n n = (signed dword) -$222e0 +(const signed dword) testLong::s s = (signed dword) -$222e0 (const string) testLong::str str = (string) "long: " -(dword) testLong::u -(const dword) testLong::u#0 u = (dword) $222e0 +(const dword) testLong::u u = (dword) $222e0 (void()) testShort() (label) testShort::@1 (label) testShort::@2 @@ -4760,13 +4727,10 @@ FINAL SYMBOL TABLE (label) testShort::@5 (label) testShort::@6 (label) testShort::@return -(signed word) testShort::n -(const signed word) testShort::n#0 n = (signed word) -$578 -(signed word) testShort::s -(const signed word) testShort::s#0 s = (signed word) -$578 +(const signed word) testShort::n n = (signed word) -$578 +(const signed word) testShort::s s = (signed word) -$578 (const string) testShort::str str = (string) "short: " -(word) testShort::u -(const word) testShort::u#0 u = (word) $578 +(const word) testShort::u u = (word) $578 zp ZP_DWORD:2 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 print_dword::dw#2 print_dword::dw#0 ] reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ] @@ -4855,7 +4819,7 @@ testLong: { // [18] call print_dword // [50] phi from testLong::@1 to print_dword [phi:testLong::@1->print_dword] // [50] phi (byte*) print_char_cursor#145 = (byte*) print_char_cursor#136 [phi:testLong::@1->print_dword#0] -- register_copy - // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u#0 [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 + // [50] phi (dword) print_dword::dw#2 = (const dword) testLong::u [phi:testLong::@1->print_dword#1] -- vduz1=vduc1 lda #u @@ -4879,7 +4843,7 @@ testLong: { // print_sdword(n) // [22] call print_sdword // [35] phi from testLong::@3 to print_sdword [phi:testLong::@3->print_sdword] - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n#0 [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::n [phi:testLong::@3->print_sdword#0] -- vdsz1=vdsc1 lda #n @@ -4903,7 +4867,7 @@ testLong: { // print_sdword(s) // [26] call print_sdword // [35] phi from testLong::@5 to print_sdword [phi:testLong::@5->print_sdword] - // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s#0 [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 + // [35] phi (signed dword) print_sdword::dw#3 = (const signed dword) testLong::s [phi:testLong::@5->print_sdword#0] -- vdsz1=vdsc1 lda #s @@ -5208,7 +5172,7 @@ testInt: { // [80] call print_word // [56] phi from testInt::@1 to print_word [phi:testInt::@1->print_word] // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testInt::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testInt::u#0 [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testInt::u [phi:testInt::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -5228,7 +5192,7 @@ testInt: { // print_sword(n) // [84] call print_sword // [92] phi from testInt::@3 to print_sword [phi:testInt::@3->print_sword] - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n#0 [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::n [phi:testInt::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -5248,7 +5212,7 @@ testInt: { // print_sword(s) // [88] call print_sword // [92] phi from testInt::@5 to print_sword [phi:testInt::@5->print_sword] - // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s#0 [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testInt::s [phi:testInt::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -5349,7 +5313,7 @@ testShort: { // [106] call print_word // [56] phi from testShort::@1 to print_word [phi:testShort::@1->print_word] // [56] phi (byte*) print_char_cursor#144 = (byte*) print_char_cursor#136 [phi:testShort::@1->print_word#0] -- register_copy - // [56] phi (word) print_word::w#5 = (const word) testShort::u#0 [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 + // [56] phi (word) print_word::w#5 = (const word) testShort::u [phi:testShort::@1->print_word#1] -- vwuz1=vwuc1 lda #u @@ -5369,7 +5333,7 @@ testShort: { // print_sword(n) // [110] call print_sword // [92] phi from testShort::@3 to print_sword [phi:testShort::@3->print_sword] - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n#0 [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::n [phi:testShort::@3->print_sword#0] -- vwsz1=vwsc1 lda #n @@ -5389,7 +5353,7 @@ testShort: { // print_sword(s) // [114] call print_sword // [92] phi from testShort::@5 to print_sword [phi:testShort::@5->print_sword] - // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s#0 [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 + // [92] phi (signed word) print_sword::w#10 = (const signed word) testShort::s [phi:testShort::@5->print_sword#0] -- vwsz1=vwsc1 lda #s @@ -5434,7 +5398,7 @@ testChar: { // [121] call print_byte // [62] phi from testChar::@1 to print_byte [phi:testChar::@1->print_byte] // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#136 [phi:testChar::@1->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u#0 [phi:testChar::@1->print_byte#1] -- vbuxx=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::u [phi:testChar::@1->print_byte#1] -- vbuxx=vbuc1 ldx #u jsr print_byte // [122] phi from testChar::@1 to testChar::@2 [phi:testChar::@1->testChar::@2] @@ -5452,7 +5416,7 @@ testChar: { // [125] call print_byte // [62] phi from testChar::@3 to print_byte [phi:testChar::@3->print_byte] // [62] phi (byte*) print_char_cursor#149 = (byte*) print_char_cursor#26 [phi:testChar::@3->print_byte#0] -- register_copy - // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n#0 [phi:testChar::@3->print_byte#1] -- vbuxx=vbuc1 + // [62] phi (byte) print_byte::b#5 = (const byte) testChar::n [phi:testChar::@3->print_byte#1] -- vbuxx=vbuc1 ldx #n jsr print_byte // [126] phi from testChar::@3 to testChar::@4 [phi:testChar::@3->testChar::@4] diff --git a/src/test/ref/c-types.sym b/src/test/ref/c-types.sym index be2ca2e61..c4a9f6ce1 100644 --- a/src/test/ref/c-types.sym +++ b/src/test/ref/c-types.sym @@ -75,7 +75,7 @@ (label) print_sbyte::@2 (label) print_sbyte::@return (signed byte) print_sbyte::b -(const signed byte) print_sbyte::b#0 b = -(const signed byte) testChar::s#0 +(const signed byte) print_sbyte::b#0 b = -(const signed byte) testChar::s (byte*) print_screen (void()) print_sdword((signed dword) print_sdword::dw) (label) print_sdword::@1 @@ -121,13 +121,10 @@ (label) testChar::@5 (label) testChar::@6 (label) testChar::@return -(byte) testChar::n -(const byte) testChar::n#0 n = (byte) $e -(signed byte) testChar::s -(const signed byte) testChar::s#0 s = (signed byte) -$e +(const byte) testChar::n n = (byte) $e +(const signed byte) testChar::s s = (signed byte) -$e (const string) testChar::str str = (string) "char: " -(byte) testChar::u -(const byte) testChar::u#0 u = (byte) $e +(const byte) testChar::u u = (byte) $e (void()) testInt() (label) testInt::@1 (label) testInt::@2 @@ -136,13 +133,10 @@ (label) testInt::@5 (label) testInt::@6 (label) testInt::@return -(signed word) testInt::n -(const signed word) testInt::n#0 n = (signed word) -$578 -(signed word) testInt::s -(const signed word) testInt::s#0 s = (signed word) -$578 +(const signed word) testInt::n n = (signed word) -$578 +(const signed word) testInt::s s = (signed word) -$578 (const string) testInt::str str = (string) "int: " -(word) testInt::u -(const word) testInt::u#0 u = (word) $578 +(const word) testInt::u u = (word) $578 (void()) testLong() (label) testLong::@1 (label) testLong::@2 @@ -151,13 +145,10 @@ (label) testLong::@5 (label) testLong::@6 (label) testLong::@return -(signed dword) testLong::n -(const signed dword) testLong::n#0 n = (signed dword) -$222e0 -(signed dword) testLong::s -(const signed dword) testLong::s#0 s = (signed dword) -$222e0 +(const signed dword) testLong::n n = (signed dword) -$222e0 +(const signed dword) testLong::s s = (signed dword) -$222e0 (const string) testLong::str str = (string) "long: " -(dword) testLong::u -(const dword) testLong::u#0 u = (dword) $222e0 +(const dword) testLong::u u = (dword) $222e0 (void()) testShort() (label) testShort::@1 (label) testShort::@2 @@ -166,13 +157,10 @@ (label) testShort::@5 (label) testShort::@6 (label) testShort::@return -(signed word) testShort::n -(const signed word) testShort::n#0 n = (signed word) -$578 -(signed word) testShort::s -(const signed word) testShort::s#0 s = (signed word) -$578 +(const signed word) testShort::n n = (signed word) -$578 +(const signed word) testShort::s s = (signed word) -$578 (const string) testShort::str str = (string) "short: " -(word) testShort::u -(const word) testShort::u#0 u = (word) $578 +(const word) testShort::u u = (word) $578 zp ZP_DWORD:2 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 print_dword::dw#2 print_dword::dw#0 ] reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ] diff --git a/src/test/ref/c64dtv-8bppcharstretch.cfg b/src/test/ref/c64dtv-8bppcharstretch.cfg index fa581a185..f267f9a2a 100644 --- a/src/test/ref/c64dtv-8bppcharstretch.cfg +++ b/src/test/ref/c64dtv-8bppcharstretch.cfg @@ -138,7 +138,7 @@ gfx_init_plane_charset8::@return: scope:[gfx_init_plane_charset8] from gfx_init (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charset8 gfx_init_plane_charset8::@8 [74] (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/(byte)(number) $4000/(number) $4000 ) - [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 + [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 diff --git a/src/test/ref/c64dtv-8bppcharstretch.log b/src/test/ref/c64dtv-8bppcharstretch.log index bb964ab79..441e894a0 100644 --- a/src/test/ref/c64dtv-8bppcharstretch.log +++ b/src/test/ref/c64dtv-8bppcharstretch.log @@ -66,8 +66,8 @@ CONTROL FLOW GRAPH SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charset8 gfx_init_plane_charset8::@8 (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_plane_charset8::@8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ) - (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (number) $ff - *((byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 + (byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (number) $ff + *((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -390,7 +390,6 @@ SYMBOL TABLE SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return (byte*) dtvSetCpuBankSegment1::cpuBank -(byte*) dtvSetCpuBankSegment1::cpuBank#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 @@ -680,7 +679,7 @@ Inlining cast (byte*) DTV_PLANEB_START_HI ← (byte*)(number) $d04b Inlining cast (byte*) DTV_PLANEB_STEP ← (byte*)(number) $d04c Inlining cast (byte*) DTV_PLANEB_MODULO_LO ← (byte*)(number) $d047 Inlining cast (byte*) DTV_PLANEB_MODULO_HI ← (byte*)(number) $d048 -Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← (byte*)(number) $ff +Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank ← (byte*)(number) $ff Inlining cast (byte*) SCREEN ← (byte*)(number) $7c00 Inlining cast (byte*) CHARSET8 ← (byte*)(number) $8000 Inlining cast *((byte*) DTV_PLANEA_START_HI) ← (unumber)(number) 0 @@ -938,7 +937,7 @@ Constant (const byte*) DTV_PLANEB_START_HI = (byte*) 53323 Constant (const byte*) DTV_PLANEB_STEP = (byte*) 53324 Constant (const byte*) DTV_PLANEB_MODULO_LO = (byte*) 53319 Constant (const byte*) DTV_PLANEB_MODULO_HI = (byte*) 53320 -Constant (const byte*) dtvSetCpuBankSegment1::cpuBank#0 = (byte*) 255 +Constant (const byte*) dtvSetCpuBankSegment1::cpuBank = (byte*) 255 Constant (const byte*) SCREEN = (byte*) 31744 Constant (const byte*) CHARSET8 = (byte*) 32768 Constant (const byte) main::j#0 = 0 @@ -1373,7 +1372,7 @@ gfx_init_plane_charset8::@return: scope:[gfx_init_plane_charset8] from gfx_init (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charset8 gfx_init_plane_charset8::@8 [74] (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/(byte)(number) $4000/(number) $4000 ) - [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 + [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -1411,7 +1410,6 @@ gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3 VARIABLE REGISTER WEIGHTS (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) -(byte*) dtvSetCpuBankSegment1::cpuBank (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 2.0 (void()) gfx_init() @@ -2069,7 +2067,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff .label cpuBankIdx = $d - // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuz1 + // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuz1 lda.z cpuBankIdx sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } @@ -2823,7 +2821,7 @@ gfx_init_plane_charset8: { dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff - // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuaa + // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuaa sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } .byte $32, $dd @@ -3055,8 +3053,7 @@ FINAL SYMBOL TABLE (const byte) VIC_RSEL VIC_RSEL = (byte) 8 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 reg byte a 2.0 (void()) gfx_init() @@ -3657,7 +3654,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff // *cpuBank = cpuBankIdx - // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuaa + // [75] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 -- _deref_pbuc1=vbuaa sta cpuBank // asm // asm { .byte$32,$dd lda$ff .byte$32,$00 } diff --git a/src/test/ref/c64dtv-8bppcharstretch.sym b/src/test/ref/c64dtv-8bppcharstretch.sym index 9d7163f50..58052c946 100644 --- a/src/test/ref/c64dtv-8bppcharstretch.sym +++ b/src/test/ref/c64dtv-8bppcharstretch.sym @@ -43,8 +43,7 @@ (const byte) VIC_RSEL VIC_RSEL = (byte) 8 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 reg byte a 2.0 (void()) gfx_init() diff --git a/src/test/ref/c64dtv-8bppchunkystretch.cfg b/src/test/ref/c64dtv-8bppchunkystretch.cfg index 6b7a888dc..e32f2acd4 100644 --- a/src/test/ref/c64dtv-8bppchunkystretch.cfg +++ b/src/test/ref/c64dtv-8bppchunkystretch.cfg @@ -106,7 +106,7 @@ gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@6 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6 [58] (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte)(const byte*) CHUNKY/(word) $4000 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte)(number) $4000/(number) $4000 ) - [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 + [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 diff --git a/src/test/ref/c64dtv-8bppchunkystretch.log b/src/test/ref/c64dtv-8bppchunkystretch.log index 3f12e6835..cad047731 100644 --- a/src/test/ref/c64dtv-8bppchunkystretch.log +++ b/src/test/ref/c64dtv-8bppchunkystretch.log @@ -56,8 +56,8 @@ CONTROL FLOW GRAPH SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6 (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ) - (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (number) $ff - *((byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 + (byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (number) $ff + *((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -281,7 +281,6 @@ SYMBOL TABLE SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return (byte*) dtvSetCpuBankSegment1::cpuBank -(byte*) dtvSetCpuBankSegment1::cpuBank#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 @@ -474,7 +473,7 @@ Inlining cast (byte*) DTV_PLANEB_START_HI ← (byte*)(number) $d04b Inlining cast (byte*) DTV_PLANEB_STEP ← (byte*)(number) $d04c Inlining cast (byte*) DTV_PLANEB_MODULO_LO ← (byte*)(number) $d047 Inlining cast (byte*) DTV_PLANEB_MODULO_HI ← (byte*)(number) $d048 -Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← (byte*)(number) $ff +Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank ← (byte*)(number) $ff Inlining cast (byte*) CHUNKY ← (byte*)(number) $8000 Inlining cast *((byte*) DTV_PLANEB_START_HI) ← (unumber)(number) 0 Inlining cast *((byte*) DTV_PLANEB_STEP) ← (unumber)(number) 8 @@ -655,7 +654,7 @@ Constant (const byte*) DTV_PLANEB_START_HI = (byte*) 53323 Constant (const byte*) DTV_PLANEB_STEP = (byte*) 53324 Constant (const byte*) DTV_PLANEB_MODULO_LO = (byte*) 53319 Constant (const byte*) DTV_PLANEB_MODULO_HI = (byte*) 53320 -Constant (const byte*) dtvSetCpuBankSegment1::cpuBank#0 = (byte*) 255 +Constant (const byte*) dtvSetCpuBankSegment1::cpuBank = (byte*) 255 Constant (const byte*) CHUNKY = (byte*) 32768 Constant (const byte) main::j#0 = 0 Constant (const byte) main::rst#0 = $42 @@ -998,7 +997,7 @@ gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@6 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6 [58] (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte)(const byte*) CHUNKY/(word) $4000 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte)(number) $4000/(number) $4000 ) - [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 + [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -1008,7 +1007,6 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan VARIABLE REGISTER WEIGHTS (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) -(byte*) dtvSetCpuBankSegment1::cpuBank (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 202.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 103.0 @@ -1528,7 +1526,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff .label cpuBankIdx = 9 - // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuz1 + // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuz1 lda.z cpuBankIdx sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } @@ -2058,7 +2056,7 @@ gfx_init_chunky: { dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff - // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa + // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } .byte $32, $dd @@ -2177,8 +2175,7 @@ FINAL SYMBOL TABLE (const byte) VIC_RSEL VIC_RSEL = (byte) 8 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 202.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 reg byte a 103.0 @@ -2660,7 +2657,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff // *cpuBank = cpuBankIdx - // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa + // [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa sta cpuBank // asm // asm { .byte$32,$dd lda$ff .byte$32,$00 } diff --git a/src/test/ref/c64dtv-8bppchunkystretch.sym b/src/test/ref/c64dtv-8bppchunkystretch.sym index acaae0952..e1dd2366e 100644 --- a/src/test/ref/c64dtv-8bppchunkystretch.sym +++ b/src/test/ref/c64dtv-8bppchunkystretch.sym @@ -35,8 +35,7 @@ (const byte) VIC_RSEL VIC_RSEL = (byte) 8 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 202.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 reg byte a 103.0 diff --git a/src/test/ref/c64dtv-blitter-box.cfg b/src/test/ref/c64dtv-blitter-box.cfg index 643145225..a07d8cba5 100644 --- a/src/test/ref/c64dtv-blitter-box.cfg +++ b/src/test/ref/c64dtv-blitter-box.cfg @@ -38,7 +38,7 @@ main: scope:[main] from @1 [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [30] *((const byte*) DTV_BLITTER_LEN_LO) ← <(byte) $14*(word) $a [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 - [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD + [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT diff --git a/src/test/ref/c64dtv-blitter-box.log b/src/test/ref/c64dtv-blitter-box.log index f09b8c089..0ed4bca2a 100644 --- a/src/test/ref/c64dtv-blitter-box.log +++ b/src/test/ref/c64dtv-blitter-box.log @@ -47,7 +47,7 @@ CONTROL FLOW GRAPH SSA (byte) DTV_BLIT_DEST_FWD ← (number) 8 (byte*) DTV_BLITTER_TRANSPARANCY ← ((byte*)) (number) $d33b (byte) DTV_BLIT_TRANSPARANCY_NONE ← (number) 0 - (byte*) DTV_BLITTER_ALU#0 ← ((byte*)) (number) $d33e + (byte*) DTV_BLITTER_ALU ← ((byte*)) (number) $d33e (byte) DTV_BLIT_ADD ← (number) $30 (byte*) DTV_BLITTER_CONTROL2 ← ((byte*)) (number) $d33f (byte) DTV_BLIT_CLEAR_IRQ ← (number) 1 @@ -98,7 +98,7 @@ main: scope:[main] from @6 *((byte*) DTV_BLITTER_DEST_STEP) ← (number) $10 *((byte*) DTV_BLITTER_LEN_LO) ← <(number) $14*(word) $a *((byte*) DTV_BLITTER_LEN_HI) ← >(number) $14*(word) $a - *((byte*) DTV_BLITTER_ALU#0) ← (byte) DTV_BLIT_ADD + *((byte*) DTV_BLITTER_ALU) ← (byte) DTV_BLIT_ADD *((byte*) DTV_BLITTER_TRANSPARANCY) ← (byte) DTV_BLIT_TRANSPARANCY_NONE (byte~) main::$10 ← (byte) DTV_BLIT_FORCE_START | (byte) DTV_BLIT_SRCA_FWD (byte~) main::$11 ← (byte~) main::$10 | (byte) DTV_BLIT_SRCB_FWD @@ -130,7 +130,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) DTV_BLITTER_ALU -(byte*) DTV_BLITTER_ALU#0 (byte*) DTV_BLITTER_CONTROL (byte*) DTV_BLITTER_CONTROL2 (byte*) DTV_BLITTER_DEST_HI @@ -260,7 +259,7 @@ Inlining cast (byte) DTV_BLIT_SRCB_FWD ← (unumber)(number) 4 Inlining cast (byte) DTV_BLIT_DEST_FWD ← (unumber)(number) 8 Inlining cast (byte*) DTV_BLITTER_TRANSPARANCY ← (byte*)(number) $d33b Inlining cast (byte) DTV_BLIT_TRANSPARANCY_NONE ← (unumber)(number) 0 -Inlining cast (byte*) DTV_BLITTER_ALU#0 ← (byte*)(number) $d33e +Inlining cast (byte*) DTV_BLITTER_ALU ← (byte*)(number) $d33e Inlining cast (byte) DTV_BLIT_ADD ← (unumber)(number) $30 Inlining cast (byte*) DTV_BLITTER_CONTROL2 ← (byte*)(number) $d33f Inlining cast (byte) DTV_BLIT_CLEAR_IRQ ← (unumber)(number) 1 @@ -410,7 +409,7 @@ Constant (const byte) DTV_BLIT_SRCB_FWD = 4 Constant (const byte) DTV_BLIT_DEST_FWD = 8 Constant (const byte*) DTV_BLITTER_TRANSPARANCY = (byte*) 54075 Constant (const byte) DTV_BLIT_TRANSPARANCY_NONE = 0 -Constant (const byte*) DTV_BLITTER_ALU#0 = (byte*) 54078 +Constant (const byte*) DTV_BLITTER_ALU = (byte*) 54078 Constant (const byte) DTV_BLIT_ADD = $30 Constant (const byte*) DTV_BLITTER_CONTROL2 = (byte*) 54079 Constant (const byte) DTV_BLIT_CLEAR_IRQ = 1 @@ -533,7 +532,7 @@ main: scope:[main] from @1 [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [30] *((const byte*) DTV_BLITTER_LEN_LO) ← <(byte) $14*(word) $a [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 - [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD + [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT @@ -548,7 +547,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) DTV_BLITTER_ALU (void()) main() (byte~) main::$13 22.0 @@ -741,7 +739,7 @@ main: { // [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta DTV_BLITTER_LEN_HI - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE -- _deref_pbuc1=vbuc2 @@ -807,7 +805,7 @@ Statement [28] *((const byte*) DTV_BLITTER_DEST_LIN_HI) ← (byte) 0 [ ] ( main: Statement [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [30] *((const byte*) DTV_BLITTER_LEN_LO) ← <(byte) $14*(word) $a [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -1002,7 +1000,7 @@ main: { // [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta DTV_BLITTER_LEN_HI - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE -- _deref_pbuc1=vbuc2 @@ -1067,8 +1065,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) DTV_BLITTER_ALU -(const byte*) DTV_BLITTER_ALU#0 DTV_BLITTER_ALU = (byte*) 54078 +(const byte*) DTV_BLITTER_ALU DTV_BLITTER_ALU = (byte*) 54078 (const byte*) DTV_BLITTER_CONTROL DTV_BLITTER_CONTROL = (byte*) 54074 (const byte*) DTV_BLITTER_CONTROL2 DTV_BLITTER_CONTROL2 = (byte*) 54079 (const byte*) DTV_BLITTER_DEST_HI DTV_BLITTER_DEST_HI = (byte*) 54066 @@ -1318,7 +1315,7 @@ main: { lda #0 sta DTV_BLITTER_LEN_HI // *DTV_BLITTER_ALU = DTV_BLIT_ADD - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // *DTV_BLITTER_TRANSPARANCY = DTV_BLIT_TRANSPARANCY_NONE diff --git a/src/test/ref/c64dtv-blitter-box.sym b/src/test/ref/c64dtv-blitter-box.sym index 1b830a6fd..5caf81369 100644 --- a/src/test/ref/c64dtv-blitter-box.sym +++ b/src/test/ref/c64dtv-blitter-box.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) DTV_BLITTER_ALU -(const byte*) DTV_BLITTER_ALU#0 DTV_BLITTER_ALU = (byte*) 54078 +(const byte*) DTV_BLITTER_ALU DTV_BLITTER_ALU = (byte*) 54078 (const byte*) DTV_BLITTER_CONTROL DTV_BLITTER_CONTROL = (byte*) 54074 (const byte*) DTV_BLITTER_CONTROL2 DTV_BLITTER_CONTROL2 = (byte*) 54079 (const byte*) DTV_BLITTER_DEST_HI DTV_BLITTER_DEST_HI = (byte*) 54066 diff --git a/src/test/ref/c64dtv-blittermin.cfg b/src/test/ref/c64dtv-blittermin.cfg index 0d40c2a57..20c32ade7 100644 --- a/src/test/ref/c64dtv-blittermin.cfg +++ b/src/test/ref/c64dtv-blittermin.cfg @@ -38,7 +38,7 @@ main: scope:[main] from @1 [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [30] *((const byte*) DTV_BLITTER_LEN_LO) ← (const byte) SRCA_LEN [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 - [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD + [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT diff --git a/src/test/ref/c64dtv-blittermin.log b/src/test/ref/c64dtv-blittermin.log index 1410ed84f..bab2e5576 100644 --- a/src/test/ref/c64dtv-blittermin.log +++ b/src/test/ref/c64dtv-blittermin.log @@ -48,7 +48,7 @@ CONTROL FLOW GRAPH SSA (byte) DTV_BLIT_DEST_FWD ← (number) 8 (byte*) DTV_BLITTER_TRANSPARANCY ← ((byte*)) (number) $d33b (byte) DTV_BLIT_TRANSPARANCY_NONE ← (number) 0 - (byte*) DTV_BLITTER_ALU#0 ← ((byte*)) (number) $d33e + (byte*) DTV_BLITTER_ALU ← ((byte*)) (number) $d33e (byte) DTV_BLIT_ADD ← (number) $30 (byte*) DTV_BLITTER_CONTROL2 ← ((byte*)) (number) $d33f (byte) DTV_BLIT_CLEAR_IRQ ← (number) 1 @@ -96,7 +96,7 @@ main: scope:[main] from @6 *((byte*) DTV_BLITTER_DEST_STEP) ← (number) $10 *((byte*) DTV_BLITTER_LEN_LO) ← (byte) SRCA_LEN *((byte*) DTV_BLITTER_LEN_HI) ← (number) 0 - *((byte*) DTV_BLITTER_ALU#0) ← (byte) DTV_BLIT_ADD + *((byte*) DTV_BLITTER_ALU) ← (byte) DTV_BLIT_ADD *((byte*) DTV_BLITTER_TRANSPARANCY) ← (byte) DTV_BLIT_TRANSPARANCY_NONE (byte~) main::$6 ← (byte) DTV_BLIT_FORCE_START | (byte) DTV_BLIT_SRCA_FWD (byte~) main::$7 ← (byte~) main::$6 | (byte) DTV_BLIT_SRCB_FWD @@ -139,7 +139,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) DTV_BLITTER_ALU -(byte*) DTV_BLITTER_ALU#0 (byte*) DTV_BLITTER_CONTROL (byte*) DTV_BLITTER_CONTROL2 (byte*) DTV_BLITTER_DEST_HI @@ -272,7 +271,7 @@ Inlining cast (byte) DTV_BLIT_SRCB_FWD ← (unumber)(number) 4 Inlining cast (byte) DTV_BLIT_DEST_FWD ← (unumber)(number) 8 Inlining cast (byte*) DTV_BLITTER_TRANSPARANCY ← (byte*)(number) $d33b Inlining cast (byte) DTV_BLIT_TRANSPARANCY_NONE ← (unumber)(number) 0 -Inlining cast (byte*) DTV_BLITTER_ALU#0 ← (byte*)(number) $d33e +Inlining cast (byte*) DTV_BLITTER_ALU ← (byte*)(number) $d33e Inlining cast (byte) DTV_BLIT_ADD ← (unumber)(number) $30 Inlining cast (byte*) DTV_BLITTER_CONTROL2 ← (byte*)(number) $d33f Inlining cast (byte) DTV_BLIT_CLEAR_IRQ ← (unumber)(number) 1 @@ -422,7 +421,7 @@ Constant (const byte) DTV_BLIT_SRCB_FWD = 4 Constant (const byte) DTV_BLIT_DEST_FWD = 8 Constant (const byte*) DTV_BLITTER_TRANSPARANCY = (byte*) 54075 Constant (const byte) DTV_BLIT_TRANSPARANCY_NONE = 0 -Constant (const byte*) DTV_BLITTER_ALU#0 = (byte*) 54078 +Constant (const byte*) DTV_BLITTER_ALU = (byte*) 54078 Constant (const byte) DTV_BLIT_ADD = $30 Constant (const byte*) DTV_BLITTER_CONTROL2 = (byte*) 54079 Constant (const byte) DTV_BLIT_CLEAR_IRQ = 1 @@ -561,7 +560,7 @@ main: scope:[main] from @1 [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [30] *((const byte*) DTV_BLITTER_LEN_LO) ← (const byte) SRCA_LEN [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 - [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD + [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT @@ -582,7 +581,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) DTV_BLITTER_ALU (void()) main() (byte~) main::$9 202.0 (byte) main::r @@ -782,7 +780,7 @@ main: { // [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta DTV_BLITTER_LEN_HI - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE -- _deref_pbuc1=vbuc2 @@ -870,7 +868,7 @@ Statement [28] *((const byte*) DTV_BLITTER_DEST_LIN_HI) ← >(word) $100 [ ] ( m Statement [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [30] *((const byte*) DTV_BLITTER_LEN_LO) ← (const byte) SRCA_LEN [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -905,7 +903,7 @@ Statement [28] *((const byte*) DTV_BLITTER_DEST_LIN_HI) ← >(word) $100 [ ] ( m Statement [29] *((const byte*) DTV_BLITTER_DEST_STEP) ← (byte) $10 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [30] *((const byte*) DTV_BLITTER_LEN_LO) ← (const byte) SRCA_LEN [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [34] *((const byte*) DTV_BLITTER_CONTROL) ← (const byte) DTV_BLIT_FORCE_START|(const byte) DTV_BLIT_SRCA_FWD|(const byte) DTV_BLIT_SRCB_FWD|(const byte) DTV_BLIT_DEST_FWD [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [35] *((const byte*) DTV_BLITTER_CONTROL2) ← (const byte) DTV_BLIT_DEST_CONT [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -1102,7 +1100,7 @@ main: { // [31] *((const byte*) DTV_BLITTER_LEN_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta DTV_BLITTER_LEN_HI - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // [33] *((const byte*) DTV_BLITTER_TRANSPARANCY) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE -- _deref_pbuc1=vbuc2 @@ -1200,8 +1198,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) DTV_BLITTER_ALU -(const byte*) DTV_BLITTER_ALU#0 DTV_BLITTER_ALU = (byte*) 54078 +(const byte*) DTV_BLITTER_ALU DTV_BLITTER_ALU = (byte*) 54078 (const byte*) DTV_BLITTER_CONTROL DTV_BLITTER_CONTROL = (byte*) 54074 (const byte*) DTV_BLITTER_CONTROL2 DTV_BLITTER_CONTROL2 = (byte*) 54079 (const byte*) DTV_BLITTER_DEST_HI DTV_BLITTER_DEST_HI = (byte*) 54066 @@ -1453,7 +1450,7 @@ main: { lda #0 sta DTV_BLITTER_LEN_HI // *DTV_BLITTER_ALU = DTV_BLIT_ADD - // [32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 + // [32] *((const byte*) DTV_BLITTER_ALU) ← (const byte) DTV_BLIT_ADD -- _deref_pbuc1=vbuc2 lda #DTV_BLIT_ADD sta DTV_BLITTER_ALU // *DTV_BLITTER_TRANSPARANCY = DTV_BLIT_TRANSPARANCY_NONE diff --git a/src/test/ref/c64dtv-blittermin.sym b/src/test/ref/c64dtv-blittermin.sym index d2e897212..15cc2b0a6 100644 --- a/src/test/ref/c64dtv-blittermin.sym +++ b/src/test/ref/c64dtv-blittermin.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) DTV_BLITTER_ALU -(const byte*) DTV_BLITTER_ALU#0 DTV_BLITTER_ALU = (byte*) 54078 +(const byte*) DTV_BLITTER_ALU DTV_BLITTER_ALU = (byte*) 54078 (const byte*) DTV_BLITTER_CONTROL DTV_BLITTER_CONTROL = (byte*) 54074 (const byte*) DTV_BLITTER_CONTROL2 DTV_BLITTER_CONTROL2 = (byte*) 54079 (const byte*) DTV_BLITTER_DEST_HI DTV_BLITTER_DEST_HI = (byte*) 54066 diff --git a/src/test/ref/c64dtv-gfxexplorer.cfg b/src/test/ref/c64dtv-gfxexplorer.cfg index 1bcb57d77..3a5068869 100644 --- a/src/test/ref/c64dtv-gfxexplorer.cfg +++ b/src/test/ref/c64dtv-gfxexplorer.cfg @@ -654,7 +654,7 @@ form_render_values: scope:[form_render_values] from form_mode::@14 form_mode::@ to:form_render_values::@1 form_render_values::@1: scope:[form_render_values] from form_render_values form_render_values::@3 [329] (byte) form_render_values::idx#2 ← phi( form_render_values/(byte) 0 form_render_values::@3/(byte) form_render_values::idx#1 ) - [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt#0) goto form_render_values::@2 + [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt) goto form_render_values::@2 to:form_render_values::@return form_render_values::@return: scope:[form_render_values] from form_render_values::@1 [331] return @@ -721,7 +721,7 @@ apply_preset::@2: scope:[apply_preset] from apply_preset apply_preset::@1 apply to:apply_preset::@13 apply_preset::@13: scope:[apply_preset] from apply_preset::@14 apply_preset::@2 [354] (byte) apply_preset::i#2 ← phi( apply_preset::@2/(byte) 0 apply_preset::@14/(byte) apply_preset::i#1 ) - [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt#0) goto apply_preset::@14 + [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt) goto apply_preset::@14 to:apply_preset::@return apply_preset::@return: scope:[apply_preset] from apply_preset::@13 [356] return @@ -778,7 +778,7 @@ form_control::@22: scope:[form_control] from form_control::@9 [381] phi() to:form_control::@14 form_control::@14: scope:[form_control] from form_control::@13 form_control::@22 form_control::@23 form_control::@9 - [382] (byte) form_field_idx#31 ← phi( form_control::@22/(byte) form_field_idx#6 form_control::@9/(const byte) form_fields_cnt#0-(byte) 1 form_control::@23/(byte) form_field_idx#5 form_control::@13/(byte) 0 ) + [382] (byte) form_field_idx#31 ← phi( form_control::@22/(byte) form_field_idx#6 form_control::@9/(const byte) form_fields_cnt-(byte) 1 form_control::@23/(byte) form_field_idx#5 form_control::@13/(byte) 0 ) to:form_control::@return form_control::@return: scope:[form_control] from form_control::@14 form_control::@16 form_control::@5 form_control::@6 [383] (byte) form_field_idx#18 ← phi( form_control::@5/(byte) form_field_idx#28 form_control::@14/(byte) form_field_idx#31 form_control::@16/(byte) form_field_idx#28 form_control::@6/(byte) form_field_idx#28 ) @@ -788,7 +788,7 @@ form_control::@return: scope:[form_control] from form_control::@14 form_control to:@return form_control::@13: scope:[form_control] from form_control::@8 [385] (byte) form_field_idx#5 ← ++ (byte) form_field_idx#28 - [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt#0) goto form_control::@23 + [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt) goto form_control::@23 to:form_control::@14 form_control::@23: scope:[form_control] from form_control::@13 [387] phi() @@ -1051,7 +1051,7 @@ gfx_init_plane_fill::@return: scope:[gfx_init_plane_fill] from gfx_init_plane_f (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_8bppchunky gfx_init_plane_8bppchunky::@4 gfx_init_plane_8bppchunky::@6 gfx_init_plane_charset8 gfx_init_plane_charset8::@8 gfx_init_plane_fill gfx_init_plane_fill::@4 gfx_init_plane_horisontal gfx_init_plane_horisontal2 gfx_init_plane_horisontal2::@4 gfx_init_plane_horisontal::@7 gfx_init_plane_vertical gfx_init_plane_vertical::@4 [501] (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 ← phi( gfx_init_plane_8bppchunky/(byte)(const dword) PLANE_8BPP_CHUNKY/(word) $4000 gfx_init_plane_8bppchunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_plane_8bppchunky::@6/(byte)(number) $4000/(number) $4000 gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/(byte)(number) $4000/(number) $4000 gfx_init_plane_fill/(byte) dtvSetCpuBankSegment1::cpuBankIdx#11 gfx_init_plane_fill::@4/(byte)(number) $4000/(number) $4000 gfx_init_plane_horisontal/(const byte) gfx_init_plane_horisontal::gfxbCpuBank#0 gfx_init_plane_horisontal2/(const byte) gfx_init_plane_horisontal2::gfxbCpuBank#0 gfx_init_plane_horisontal2::@4/(byte)(number) $4000/(number) $4000 gfx_init_plane_horisontal::@7/(byte)(number) $4000/(number) $4000 gfx_init_plane_vertical/(const byte) gfx_init_plane_vertical::gfxbCpuBank#0 gfx_init_plane_vertical::@4/(byte)(number) $4000/(number) $4000 ) - [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 + [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -1290,7 +1290,7 @@ gfx_init_vic_bitmap::@3: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap to:gfx_init_vic_bitmap::@1 gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@3 gfx_init_vic_bitmap::@4 [606] (byte) gfx_init_vic_bitmap::l#2 ← phi( gfx_init_vic_bitmap::@3/(byte) 0 gfx_init_vic_bitmap::@4/(byte) gfx_init_vic_bitmap::l#1 ) - [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2 + [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt) goto gfx_init_vic_bitmap::@2 to:gfx_init_vic_bitmap::@return gfx_init_vic_bitmap::@return: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1 [608] return diff --git a/src/test/ref/c64dtv-gfxexplorer.log b/src/test/ref/c64dtv-gfxexplorer.log index 1f67cfa31..5864a8a98 100644 --- a/src/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/ref/c64dtv-gfxexplorer.log @@ -366,8 +366,8 @@ CONTROL FLOW GRAPH SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_8bppchunky gfx_init_plane_8bppchunky::@4 gfx_init_plane_8bppchunky::@6 gfx_init_plane_charset8 gfx_init_plane_charset8::@8 gfx_init_plane_fill gfx_init_plane_fill::@4 gfx_init_plane_horisontal gfx_init_plane_horisontal2 gfx_init_plane_horisontal2::@4 gfx_init_plane_horisontal::@8 gfx_init_plane_vertical gfx_init_plane_vertical::@4 (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 ← phi( gfx_init_plane_8bppchunky/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_plane_8bppchunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_plane_8bppchunky::@6/(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 gfx_init_plane_charset8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#9 gfx_init_plane_charset8::@8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#10 gfx_init_plane_fill/(byte) dtvSetCpuBankSegment1::cpuBankIdx#11 gfx_init_plane_fill::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#12 gfx_init_plane_horisontal/(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 gfx_init_plane_horisontal2/(byte) dtvSetCpuBankSegment1::cpuBankIdx#5 gfx_init_plane_horisontal2::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#6 gfx_init_plane_horisontal::@8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#4 gfx_init_plane_vertical/(byte) dtvSetCpuBankSegment1::cpuBankIdx#7 gfx_init_plane_vertical::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#8 ) - (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (number) $ff - *((byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 + (byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (number) $ff + *((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -1796,7 +1796,7 @@ get_vic_charset::@3: scope:[get_vic_charset] from get_vic_charset::@4 (byte*) FORM_CHARSET ← ((byte*)) (number) $1800 (byte[]) FORM_TEXT ← (const string) $39 (byte[]) FORM_COLS ← (const string) $40 - (byte) form_fields_cnt#0 ← (number) $24 + (byte) form_fields_cnt ← (number) $24 (byte[]) form_fields_x ← { (number) 8, (number) $c, (number) $c, (number) $c, (number) $c, (number) $c, (number) $c, (number) $c, (number) $c, (number) $c, (number) $19, (number) $18, (number) $19, (number) $18, (number) $19, (number) $18, (number) $19, (number) $19, (number) $18, (number) $19, (number) $18, (number) $19, (number) $18, (number) $19, (number) $25, (number) $25, (number) $25, (number) $25, (number) $24, (number) $25, (number) $24, (number) $25, (number) $24, (number) $25, (number) $24, (number) $25 } (byte[]) form_fields_y ← { (number) 2, (number) 5, (number) 6, (number) 7, (number) 8, (number) 9, (number) $a, (number) $b, (number) $c, (number) $d, (number) 5, (number) 6, (number) 6, (number) 7, (number) 7, (number) 8, (number) 8, (number) $b, (number) $c, (number) $c, (number) $d, (number) $d, (number) $e, (number) $e, (number) 5, (number) 6, (number) 7, (number) $a, (number) $b, (number) $b, (number) $c, (number) $c, (number) $d, (number) $d, (number) $e, (number) $e } (byte[]) form_fields_max ← { (number) $a, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) 1, (number) $d, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $d, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) 3, (number) 1, (number) 4, (number) 1, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f, (number) $f } @@ -1914,7 +1914,7 @@ apply_preset::@22: scope:[apply_preset] from apply_preset::@1 apply_preset::@10 apply_preset::@45: scope:[apply_preset] from apply_preset::@22 apply_preset::@46 (byte*) apply_preset::preset#14 ← phi( apply_preset::@22/(byte*) apply_preset::preset#15 apply_preset::@46/(byte*) apply_preset::preset#13 ) (byte) apply_preset::i#2 ← phi( apply_preset::@22/(byte) apply_preset::i#0 apply_preset::@46/(byte) apply_preset::i#1 ) - (bool~) apply_preset::$11 ← (byte) apply_preset::i#2 != (byte) form_fields_cnt#0 + (bool~) apply_preset::$11 ← (byte) apply_preset::i#2 != (byte) form_fields_cnt if((bool~) apply_preset::$11) goto apply_preset::@46 to:apply_preset::@return apply_preset::@46: scope:[apply_preset] from apply_preset::@45 @@ -2766,12 +2766,12 @@ gfx_init_vic_bitmap::@7: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap gfx_init_vic_bitmap::@8: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@7 (byte[]) gfx_init_vic_bitmap::lines_x ← { (number) 0, (number) $ff, (number) $ff, (number) 0, (number) 0, (number) $80, (number) $ff, (number) $80, (number) 0, (number) $80 } (byte[]) gfx_init_vic_bitmap::lines_y ← { (number) 0, (number) 0, (number) $c7, (number) $c7, (number) 0, (number) 0, (number) $64, (number) $c7, (number) $64, (number) 0 } - (byte) gfx_init_vic_bitmap::lines_cnt#0 ← (number) 9 + (byte) gfx_init_vic_bitmap::lines_cnt ← (number) 9 (byte) gfx_init_vic_bitmap::l#0 ← (number) 0 to:gfx_init_vic_bitmap::@1 gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@8 gfx_init_vic_bitmap::@9 (byte) gfx_init_vic_bitmap::l#2 ← phi( gfx_init_vic_bitmap::@8/(byte) gfx_init_vic_bitmap::l#0 gfx_init_vic_bitmap::@9/(byte) gfx_init_vic_bitmap::l#1 ) - (bool~) gfx_init_vic_bitmap::$2 ← (byte) gfx_init_vic_bitmap::l#2 < (byte) gfx_init_vic_bitmap::lines_cnt#0 + (bool~) gfx_init_vic_bitmap::$2 ← (byte) gfx_init_vic_bitmap::l#2 < (byte) gfx_init_vic_bitmap::lines_cnt if((bool~) gfx_init_vic_bitmap::$2) goto gfx_init_vic_bitmap::@2 to:gfx_init_vic_bitmap::@return gfx_init_vic_bitmap::@2: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1 @@ -3614,7 +3614,7 @@ form_render_values: scope:[form_render_values] from form_mode::@27 form_mode::@ to:form_render_values::@1 form_render_values::@1: scope:[form_render_values] from form_render_values form_render_values::@7 (byte) form_render_values::idx#2 ← phi( form_render_values/(byte) form_render_values::idx#0 form_render_values::@7/(byte) form_render_values::idx#1 ) - (bool~) form_render_values::$0 ← (byte) form_render_values::idx#2 < (byte) form_fields_cnt#0 + (bool~) form_render_values::$0 ← (byte) form_render_values::idx#2 < (byte) form_fields_cnt if((bool~) form_render_values::$0) goto form_render_values::@2 to:form_render_values::@return form_render_values::@2: scope:[form_render_values] from form_render_values::@1 @@ -3753,7 +3753,7 @@ form_control::@19: scope:[form_control] from form_control::@10 (byte) keyboard_events_size#69 ← phi( form_control::@10/(byte) keyboard_events_size#87 ) (byte) form_field_idx#16 ← phi( form_control::@10/(byte) form_field_idx#29 ) (byte) form_field_idx#5 ← ++ (byte) form_field_idx#16 - (bool~) form_control::$21 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#0 + (bool~) form_control::$21 ← (byte) form_field_idx#5 == (byte) form_fields_cnt (bool~) form_control::$22 ← ! (bool~) form_control::$21 if((bool~) form_control::$22) goto form_control::@22 to:form_control::@24 @@ -3769,7 +3769,7 @@ form_control::@11: scope:[form_control] from form_control::@10 form_control::@12: scope:[form_control] from form_control::@11 (byte) keyboard_modifiers#67 ← phi( form_control::@11/(byte) keyboard_modifiers#66 ) (byte) keyboard_events_size#68 ← phi( form_control::@11/(byte) keyboard_events_size#67 ) - (number~) form_control::$20 ← (byte) form_fields_cnt#0 - (number) 1 + (number~) form_control::$20 ← (byte) form_fields_cnt - (number) 1 (byte) form_field_idx#7 ← (number~) form_control::$20 to:form_control::@22 form_control::@22: scope:[form_control] from form_control::@11 form_control::@12 form_control::@19 form_control::@24 @@ -4617,7 +4617,6 @@ SYMBOL TABLE SSA (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return (byte*) dtvSetCpuBankSegment1::cpuBank -(byte*) dtvSetCpuBankSegment1::cpuBank#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 @@ -4897,7 +4896,6 @@ SYMBOL TABLE SSA (byte) form_field_ptr::y (byte) form_field_ptr::y#0 (byte) form_fields_cnt -(byte) form_fields_cnt#0 (byte[]) form_fields_max (byte[]) form_fields_val (byte[]) form_fields_x @@ -5709,7 +5707,6 @@ SYMBOL TABLE SSA (byte) gfx_init_vic_bitmap::l#3 (byte) gfx_init_vic_bitmap::l#4 (byte) gfx_init_vic_bitmap::lines_cnt -(byte) gfx_init_vic_bitmap::lines_cnt#0 (byte[]) gfx_init_vic_bitmap::lines_x (byte[]) gfx_init_vic_bitmap::lines_y (void()) gfx_mode() @@ -6885,7 +6882,7 @@ Adding number conversion cast (unumber) 3 in (bool~) get_vic_screen::$3 ← (byt Adding number conversion cast (unumber) 4 in (bool~) get_vic_screen::$4 ← (byte) get_vic_screen::idx#6 == (number) 4 Adding number conversion cast (unumber) 0 in (bool~) get_vic_charset::$0 ← (byte) get_vic_charset::idx#1 == (number) 0 Adding number conversion cast (unumber) 1 in (bool~) get_vic_charset::$1 ← (byte) get_vic_charset::idx#2 == (number) 1 -Adding number conversion cast (unumber) $24 in (byte) form_fields_cnt#0 ← (number) $24 +Adding number conversion cast (unumber) $24 in (byte) form_fields_cnt ← (number) $24 Adding number conversion cast (unumber) 0 in (bool~) apply_preset::$0 ← (byte) apply_preset::idx#1 == (number) 0 Adding number conversion cast (unumber) 1 in (bool~) apply_preset::$1 ← (byte) apply_preset::idx#2 == (number) 1 Adding number conversion cast (unumber) 2 in (bool~) apply_preset::$2 ← (byte) apply_preset::idx#3 == (number) 2 @@ -7035,7 +7032,7 @@ Adding number conversion cast (unumber) 3 in (number~) gfx_init_screen3::$2 ← Adding number conversion cast (unumber) gfx_init_screen3::$2 in (number~) gfx_init_screen3::$2 ← (byte) gfx_init_screen3::cy#2 & (unumber)(number) 3 Adding number conversion cast (unumber) gfx_init_screen3::$3 in (number~) gfx_init_screen3::$3 ← (unumber~) gfx_init_screen3::$1 | (unumber~) gfx_init_screen3::$2 Adding number conversion cast (unumber) 0 in *((byte*) gfx_init_screen4::ch#2) ← (number) 0 -Adding number conversion cast (unumber) 9 in (byte) gfx_init_vic_bitmap::lines_cnt#0 ← (number) 9 +Adding number conversion cast (unumber) 9 in (byte) gfx_init_vic_bitmap::lines_cnt ← (number) 9 Adding number conversion cast (unumber) 0 in (byte) gfx_init_vic_bitmap::l#0 ← (number) 0 Adding number conversion cast (unumber) 1 in (number~) gfx_init_vic_bitmap::$3 ← (byte) gfx_init_vic_bitmap::l#3 + (number) 1 Adding number conversion cast (unumber) gfx_init_vic_bitmap::$3 in (number~) gfx_init_vic_bitmap::$3 ← (byte) gfx_init_vic_bitmap::l#3 + (unumber)(number) 1 @@ -7141,8 +7138,8 @@ Adding number conversion cast (unumber) $7f in (number~) form_control::$15 ← * Adding number conversion cast (unumber) form_control::$15 in (number~) form_control::$15 ← *((byte*) form_control::field#3) & (unumber)(number) $7f Adding number conversion cast (unumber) 0 in (bool~) form_control::$17 ← (byte~) form_control::$16 == (number) 0 Adding number conversion cast (unumber) $ff in (bool~) form_control::$18 ← (byte) form_field_idx#6 == (number) $ff -Adding number conversion cast (unumber) 1 in (number~) form_control::$20 ← (byte) form_fields_cnt#0 - (number) 1 -Adding number conversion cast (unumber) form_control::$20 in (number~) form_control::$20 ← (byte) form_fields_cnt#0 - (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) form_control::$20 ← (byte) form_fields_cnt - (number) 1 +Adding number conversion cast (unumber) form_control::$20 in (number~) form_control::$20 ← (byte) form_fields_cnt - (unumber)(number) 1 Adding number conversion cast (snumber) 2 in (number~) form_control::$23 ← (signed byte) FORM_CURSOR_BLINK / (number) 2 Adding number conversion cast (snumber) form_control::$23 in (number~) form_control::$23 ← (signed byte) FORM_CURSOR_BLINK / (snumber)(number) 2 Adding number conversion cast (unumber) 0 in (byte) form_control::return#1 ← (number) 0 @@ -7231,7 +7228,7 @@ Inlining cast (byte*) DTV_COLOR_BANK_LO ← (byte*)(number) $d036 Inlining cast (byte*) DTV_COLOR_BANK_HI ← (byte*)(number) $d037 Inlining cast (dword) DTV_COLOR_BANK_DEFAULT ← (unumber)(number) $1d800 Inlining cast (byte*) DTV_GRAPHICS_VIC_BANK ← (byte*)(number) $d03d -Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank#0 ← (byte*)(number) $ff +Inlining cast (byte*) dtvSetCpuBankSegment1::cpuBank ← (byte*)(number) $ff Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 @@ -7291,7 +7288,7 @@ Inlining cast (dword~) get_plane::$16 ← (dword)(dword) PLANE_FULL Inlining cast (dword~) get_plane::$15 ← (dword)(byte*) VIC_SCREEN0 Inlining cast (byte*) FORM_SCREEN ← (byte*)(number) $400 Inlining cast (byte*) FORM_CHARSET ← (byte*)(number) $1800 -Inlining cast (byte) form_fields_cnt#0 ← (unumber)(number) $24 +Inlining cast (byte) form_fields_cnt ← (unumber)(number) $24 Inlining cast (byte) apply_preset::i#0 ← (unumber)(number) 0 Inlining cast (byte) gfx_mode::dtv_control#0 ← (unumber)(number) 0 Inlining cast *((byte*) DTV_PLANEA_MODULO_HI) ← (unumber)(number) 0 @@ -7306,7 +7303,7 @@ Inlining cast *((byte*) BORDERCOL) ← (unumber)(number) 0 Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $32 Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $37 Inlining cast *((byte*) gfx_init_screen4::ch#2) ← (unumber)(number) 0 -Inlining cast (byte) gfx_init_vic_bitmap::lines_cnt#0 ← (unumber)(number) 9 +Inlining cast (byte) gfx_init_vic_bitmap::lines_cnt ← (unumber)(number) 9 Inlining cast (byte) gfx_init_vic_bitmap::l#0 ← (unumber)(number) 0 Inlining cast (byte~) gfx_init_plane_8bppchunky::$1 ← (byte)(unumber~) gfx_init_plane_8bppchunky::$0 Inlining cast (byte*) gfx_init_plane_8bppchunky::gfxb#0 ← (byte*)(number) $4000 @@ -8687,7 +8684,7 @@ Inferred type updated to signed byte in (snumber~) form_control::$3 ← (signed Inferred type updated to byte in (unumber~) form_control::$14 ← *((byte*) form_control::field#1) | (byte) $80 Inferred type updated to byte in (unumber~) form_control::$13 ← *((byte*) form_control::field#2) & (byte) $7f Inferred type updated to byte in (unumber~) form_control::$15 ← *((byte*) form_control::field#3) & (byte) $7f -Inferred type updated to byte in (unumber~) form_control::$20 ← (byte) form_fields_cnt#0 - (byte) 1 +Inferred type updated to byte in (unumber~) form_control::$20 ← (byte) form_fields_cnt - (byte) 1 Inferred type updated to signed byte in (snumber~) form_control::$23 ← (signed byte) FORM_CURSOR_BLINK / (signed byte) 2 Adding pointer type conversion cast (byte*) bitmap_clear::$0 in (byte*~) bitmap_clear::$0 ← (word~) bitmap_clear::$3 Adding pointer type conversion cast (byte*) form_field_ptr::$0 in (byte*~) form_field_ptr::$0 ← (word~) form_field_ptr::$2 @@ -8726,7 +8723,7 @@ Inversing boolean not [1635] (bool~) form_mode::$40 ← (byte) form_mode::preset Inversing boolean not [1712] (bool~) form_control::$2 ← (signed byte) form_cursor_count#5 >= (signed byte) 0 from [1711] (bool~) form_control::$1 ← (signed byte) form_cursor_count#5 < (signed byte) 0 Inversing boolean not [1738] (bool~) form_control::$8 ← (byte) form_control::key_event#0 != (byte) KEY_CRSR_DOWN from [1737] (bool~) form_control::$7 ← (byte) form_control::key_event#0 == (byte) KEY_CRSR_DOWN Inversing boolean not [1742] (bool~) form_control::$10 ← (byte) form_control::key_event#1 != (byte) KEY_CRSR_RIGHT from [1741] (bool~) form_control::$9 ← (byte) form_control::key_event#1 == (byte) KEY_CRSR_RIGHT -Inversing boolean not [1753] (bool~) form_control::$22 ← (byte) form_field_idx#5 != (byte) form_fields_cnt#0 from [1752] (bool~) form_control::$21 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#0 +Inversing boolean not [1753] (bool~) form_control::$22 ← (byte) form_field_idx#5 != (byte) form_fields_cnt from [1752] (bool~) form_control::$21 ← (byte) form_field_idx#5 == (byte) form_fields_cnt Inversing boolean not [1758] (bool~) form_control::$19 ← (byte) form_field_idx#6 != (byte) $ff from [1757] (bool~) form_control::$18 ← (byte) form_field_idx#6 == (byte) $ff Inversing boolean not [1778] (bool~) form_control::$12 ← (byte) form_control::key_event#2 != (byte) KEY_SPACE from [1777] (bool~) form_control::$11 ← (byte) form_control::key_event#2 == (byte) KEY_SPACE Inversing boolean not [1787] (bool~) form_control::$29 ← *((byte[]) form_fields_val + (byte) form_field_idx#19) <= *((byte[]) form_fields_max + (byte) form_field_idx#19) from [1786] (bool~) form_control::$28 ← *((byte[]) form_fields_val + (byte) form_field_idx#19) > *((byte[]) form_fields_max + (byte) form_field_idx#19) @@ -9444,7 +9441,7 @@ Simple Condition (bool~) apply_preset::$7 [785] if((byte) apply_preset::idx#0==( Simple Condition (bool~) apply_preset::$8 [789] if((byte) apply_preset::idx#0==(byte) 8) goto apply_preset::@9 Simple Condition (bool~) apply_preset::$9 [793] if((byte) apply_preset::idx#0==(byte) 9) goto apply_preset::@10 Simple Condition (bool~) apply_preset::$10 [797] if((byte) apply_preset::idx#0==(byte) $a) goto apply_preset::@11 -Simple Condition (bool~) apply_preset::$11 [804] if((byte) apply_preset::i#2!=(byte) form_fields_cnt#0) goto apply_preset::@46 +Simple Condition (bool~) apply_preset::$11 [804] if((byte) apply_preset::i#2!=(byte) form_fields_cnt) goto apply_preset::@46 Simple Condition (bool~) render_preset_name::$0 [812] if((byte) render_preset_name::idx#10==(byte) 0) goto render_preset_name::@1 Simple Condition (bool~) render_preset_name::$1 [816] if((byte) render_preset_name::idx#10==(byte) 1) goto render_preset_name::@2 Simple Condition (bool~) render_preset_name::$2 [820] if((byte) render_preset_name::idx#10==(byte) 2) goto render_preset_name::@3 @@ -9484,7 +9481,7 @@ Simple Condition (bool~) gfx_init_screen3::$4 [1265] if((byte) gfx_init_screen3: Simple Condition (bool~) gfx_init_screen3::$5 [1269] if((byte) gfx_init_screen3::cy#1!=rangelast(0,$18)) goto gfx_init_screen3::@1 Simple Condition (bool~) gfx_init_screen4::$0 [1280] if((byte) gfx_init_screen4::cx#1!=rangelast(0,$27)) goto gfx_init_screen4::@2 Simple Condition (bool~) gfx_init_screen4::$1 [1284] if((byte) gfx_init_screen4::cy#1!=rangelast(0,$18)) goto gfx_init_screen4::@1 -Simple Condition (bool~) gfx_init_vic_bitmap::$2 [1295] if((byte) gfx_init_vic_bitmap::l#2<(byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2 +Simple Condition (bool~) gfx_init_vic_bitmap::$2 [1295] if((byte) gfx_init_vic_bitmap::l#2<(byte) gfx_init_vic_bitmap::lines_cnt) goto gfx_init_vic_bitmap::@2 Simple Condition (bool~) gfx_init_plane_8bppchunky::$6 [1321] if((byte*) gfx_init_plane_8bppchunky::gfxb#3!=(word) $8000) goto gfx_init_plane_8bppchunky::@3 Simple Condition (bool~) gfx_init_plane_8bppchunky::$10 [1330] if((word) gfx_init_plane_8bppchunky::x#1!=rangelast(0,$13f)) goto gfx_init_plane_8bppchunky::@2 Simple Condition (bool~) gfx_init_plane_8bppchunky::$11 [1340] if((byte) gfx_init_plane_8bppchunky::y#1!=rangelast(0,$c7)) goto gfx_init_plane_8bppchunky::@1 @@ -9506,13 +9503,13 @@ Simple Condition (bool~) form_mode::$35 [1620] if(*((byte*) RASTER)!=(byte) $ff) Simple Condition (bool~) form_mode::$38 [1632] if((byte~) form_mode::$36==(byte) 0) goto form_mode::@14 Simple Condition (bool~) form_mode::$40 [1636] if((byte) form_mode::preset_current#6==*((byte*) form_preset)) goto form_mode::@3 Simple Condition (bool~) form_set_screen::$3 [1675] if((byte) form_set_screen::y#1!=rangelast(0,$18)) goto form_set_screen::@1 -Simple Condition (bool~) form_render_values::$0 [1692] if((byte) form_render_values::idx#2<(byte) form_fields_cnt#0) goto form_render_values::@2 +Simple Condition (bool~) form_render_values::$0 [1692] if((byte) form_render_values::idx#2<(byte) form_fields_cnt) goto form_render_values::@2 Simple Condition (bool~) form_control::$2 [1713] if((signed byte) form_cursor_count#5>=(signed byte) 0) goto form_control::@1 Simple Condition (bool~) form_control::$4 [1717] if((signed byte) form_cursor_count#15<(signed byte~) form_control::$3) goto form_control::@2 Simple Condition (bool~) form_control::$8 [1739] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_DOWN) goto form_control::@4 Simple Condition (bool~) form_control::$10 [1743] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_RIGHT) goto form_control::@5 Simple Condition (bool~) form_control::$17 [1749] if((byte~) form_control::$16==(byte) 0) goto form_control::@19 -Simple Condition (bool~) form_control::$22 [1754] if((byte) form_field_idx#5!=(byte) form_fields_cnt#0) goto form_control::@22 +Simple Condition (bool~) form_control::$22 [1754] if((byte) form_field_idx#5!=(byte) form_fields_cnt) goto form_control::@22 Simple Condition (bool~) form_control::$19 [1759] if((byte) form_field_idx#6!=(byte) $ff) goto form_control::@22 Simple Condition (bool~) form_control::$12 [1779] if((byte) form_control::key_event#0!=(byte) KEY_SPACE) goto form_control::@6 Simple Condition (bool~) form_control::$25 [1783] if((byte~) form_control::$24==(byte) 0) goto form_control::@26 @@ -9615,7 +9612,7 @@ Constant (const byte*) DTV_COLOR_BANK_LO = (byte*) 53302 Constant (const byte*) DTV_COLOR_BANK_HI = (byte*) 53303 Constant (const dword) DTV_COLOR_BANK_DEFAULT = $1d800 Constant (const byte*) DTV_GRAPHICS_VIC_BANK = (byte*) 53309 -Constant (const byte*) dtvSetCpuBankSegment1::cpuBank#0 = (byte*) 255 +Constant (const byte*) dtvSetCpuBankSegment1::cpuBank = (byte*) 255 Constant (const byte*) print_screen#0 = (byte*) 1024 Constant (const byte[]) print_hextab = $38 Constant (const byte) memset::c#0 = ' ' @@ -9675,7 +9672,7 @@ Constant (const byte*) FORM_SCREEN = (byte*) 1024 Constant (const byte*) FORM_CHARSET = (byte*) 6144 Constant (const byte[]) FORM_TEXT = $39 Constant (const byte[]) FORM_COLS = $40 -Constant (const byte) form_fields_cnt#0 = $24 +Constant (const byte) form_fields_cnt = $24 Constant (const byte[]) form_fields_x = { 8, $c, $c, $c, $c, $c, $c, $c, $c, $c, $19, $18, $19, $18, $19, $18, $19, $19, $18, $19, $18, $19, $18, $19, $25, $25, $25, $25, $24, $25, $24, $25, $24, $25, $24, $25 } Constant (const byte[]) form_fields_y = { 2, 5, 6, 7, 8, 9, $a, $b, $c, $d, 5, 6, 6, 7, 7, 8, 8, $b, $c, $c, $d, $d, $e, $e, 5, 6, 7, $a, $b, $b, $c, $c, $d, $d, $e, $e } Constant (const byte[]) form_fields_max = { $a, 1, 1, 1, 1, 1, 1, 1, 1, 1, $d, $f, $f, $f, $f, $f, $f, $d, $f, $f, $f, $f, $f, $f, 3, 1, 4, 1, $f, $f, $f, $f, $f, $f, $f, $f } @@ -9725,7 +9722,7 @@ Constant (const byte) gfx_init_screen4::cy#0 = 0 Constant (const byte) gfx_init_screen4::cx#0 = 0 Constant (const byte[]) gfx_init_vic_bitmap::lines_x = { 0, $ff, $ff, 0, 0, $80, $ff, $80, 0, $80 } Constant (const byte[]) gfx_init_vic_bitmap::lines_y = { 0, 0, $c7, $c7, 0, 0, $64, $c7, $64, 0 } -Constant (const byte) gfx_init_vic_bitmap::lines_cnt#0 = 9 +Constant (const byte) gfx_init_vic_bitmap::lines_cnt = 9 Constant (const byte) gfx_init_vic_bitmap::l#0 = 0 Constant (const byte*) gfx_init_plane_8bppchunky::gfxb#0 = (byte*) 16384 Constant (const byte) gfx_init_plane_8bppchunky::y#0 = 0 @@ -10184,7 +10181,7 @@ Constant right-side identified [783] (byte~) form_mode::$32 ← < (const byte*) Constant right-side identified [785] (byte~) form_mode::$33 ← > (const byte*) FORM_SCREEN Constant right-side identified [810] (signed byte) form_cursor_count#26 ← (const signed byte) FORM_CURSOR_BLINK / (signed byte) 2 Constant right-side identified [838] (signed byte~) form_control::$3 ← (const signed byte) FORM_CURSOR_BLINK / (signed byte) 2 -Constant right-side identified [858] (byte) form_field_idx#7 ← (const byte) form_fields_cnt#0 - (byte) 1 +Constant right-side identified [858] (byte) form_field_idx#7 ← (const byte) form_fields_cnt - (byte) 1 Constant right-side identified [860] (signed byte) form_cursor_count#7 ← (const signed byte) FORM_CURSOR_BLINK / (signed byte) 2 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT @@ -10222,7 +10219,7 @@ Constant (const byte) form_mode::$32 = FORM_SCREEN Constant (const signed byte) form_cursor_count#26 = FORM_CURSOR_BLINK/2 Constant (const signed byte) form_control::$3 = FORM_CURSOR_BLINK/2 -Constant (const byte) form_field_idx#7 = form_fields_cnt#0-1 +Constant (const byte) form_field_idx#7 = form_fields_cnt-1 Constant (const signed byte) form_cursor_count#7 = FORM_CURSOR_BLINK/2 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte)gfx_init_plane_8bppchunky::$0 in [607] (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#0 ← (byte)(const dword) gfx_init_plane_8bppchunky::$0 @@ -10696,7 +10693,7 @@ Constant inlined $38 = (const byte[]) print_hextab Constant inlined form_field_idx#8 = (byte) 0 Constant inlined get_plane::return#8 = (const dword) PLANE_VERTICAL Constant inlined $39 = (const byte[]) FORM_TEXT -Constant inlined form_field_idx#7 = (const byte) form_fields_cnt#0-(byte) 1 +Constant inlined form_field_idx#7 = (const byte) form_fields_cnt-(byte) 1 Constant inlined get_plane::return#9 = (const dword) PLANE_HORISONTAL2 Constant inlined gfx_init_plane_8bppchunky::gfxb#0 = (byte*) 16384 Constant inlined gfx_init_plane_8bppchunky::gfxb#2 = (byte*) 16384 @@ -12419,7 +12416,7 @@ form_render_values: scope:[form_render_values] from form_mode::@14 form_mode::@ to:form_render_values::@1 form_render_values::@1: scope:[form_render_values] from form_render_values form_render_values::@3 [329] (byte) form_render_values::idx#2 ← phi( form_render_values/(byte) 0 form_render_values::@3/(byte) form_render_values::idx#1 ) - [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt#0) goto form_render_values::@2 + [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt) goto form_render_values::@2 to:form_render_values::@return form_render_values::@return: scope:[form_render_values] from form_render_values::@1 [331] return @@ -12486,7 +12483,7 @@ apply_preset::@2: scope:[apply_preset] from apply_preset apply_preset::@1 apply to:apply_preset::@13 apply_preset::@13: scope:[apply_preset] from apply_preset::@14 apply_preset::@2 [354] (byte) apply_preset::i#2 ← phi( apply_preset::@2/(byte) 0 apply_preset::@14/(byte) apply_preset::i#1 ) - [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt#0) goto apply_preset::@14 + [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt) goto apply_preset::@14 to:apply_preset::@return apply_preset::@return: scope:[apply_preset] from apply_preset::@13 [356] return @@ -12543,7 +12540,7 @@ form_control::@22: scope:[form_control] from form_control::@9 [381] phi() to:form_control::@14 form_control::@14: scope:[form_control] from form_control::@13 form_control::@22 form_control::@23 form_control::@9 - [382] (byte) form_field_idx#31 ← phi( form_control::@22/(byte) form_field_idx#6 form_control::@9/(const byte) form_fields_cnt#0-(byte) 1 form_control::@23/(byte) form_field_idx#5 form_control::@13/(byte) 0 ) + [382] (byte) form_field_idx#31 ← phi( form_control::@22/(byte) form_field_idx#6 form_control::@9/(const byte) form_fields_cnt-(byte) 1 form_control::@23/(byte) form_field_idx#5 form_control::@13/(byte) 0 ) to:form_control::@return form_control::@return: scope:[form_control] from form_control::@14 form_control::@16 form_control::@5 form_control::@6 [383] (byte) form_field_idx#18 ← phi( form_control::@5/(byte) form_field_idx#28 form_control::@14/(byte) form_field_idx#31 form_control::@16/(byte) form_field_idx#28 form_control::@6/(byte) form_field_idx#28 ) @@ -12553,7 +12550,7 @@ form_control::@return: scope:[form_control] from form_control::@14 form_control to:@return form_control::@13: scope:[form_control] from form_control::@8 [385] (byte) form_field_idx#5 ← ++ (byte) form_field_idx#28 - [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt#0) goto form_control::@23 + [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt) goto form_control::@23 to:form_control::@14 form_control::@23: scope:[form_control] from form_control::@13 [387] phi() @@ -12816,7 +12813,7 @@ gfx_init_plane_fill::@return: scope:[gfx_init_plane_fill] from gfx_init_plane_f (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_8bppchunky gfx_init_plane_8bppchunky::@4 gfx_init_plane_8bppchunky::@6 gfx_init_plane_charset8 gfx_init_plane_charset8::@8 gfx_init_plane_fill gfx_init_plane_fill::@4 gfx_init_plane_horisontal gfx_init_plane_horisontal2 gfx_init_plane_horisontal2::@4 gfx_init_plane_horisontal::@7 gfx_init_plane_vertical gfx_init_plane_vertical::@4 [501] (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 ← phi( gfx_init_plane_8bppchunky/(byte)(const dword) PLANE_8BPP_CHUNKY/(word) $4000 gfx_init_plane_8bppchunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_plane_8bppchunky::@6/(byte)(number) $4000/(number) $4000 gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/(byte)(number) $4000/(number) $4000 gfx_init_plane_fill/(byte) dtvSetCpuBankSegment1::cpuBankIdx#11 gfx_init_plane_fill::@4/(byte)(number) $4000/(number) $4000 gfx_init_plane_horisontal/(const byte) gfx_init_plane_horisontal::gfxbCpuBank#0 gfx_init_plane_horisontal2/(const byte) gfx_init_plane_horisontal2::gfxbCpuBank#0 gfx_init_plane_horisontal2::@4/(byte)(number) $4000/(number) $4000 gfx_init_plane_horisontal::@7/(byte)(number) $4000/(number) $4000 gfx_init_plane_vertical/(const byte) gfx_init_plane_vertical::gfxbCpuBank#0 gfx_init_plane_vertical::@4/(byte)(number) $4000/(number) $4000 ) - [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 + [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 asm { .byte$32,$dd lda$ff .byte$32,$00 } to:dtvSetCpuBankSegment1::@return dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 @@ -13055,7 +13052,7 @@ gfx_init_vic_bitmap::@3: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap to:gfx_init_vic_bitmap::@1 gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@3 gfx_init_vic_bitmap::@4 [606] (byte) gfx_init_vic_bitmap::l#2 ← phi( gfx_init_vic_bitmap::@3/(byte) 0 gfx_init_vic_bitmap::@4/(byte) gfx_init_vic_bitmap::l#1 ) - [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2 + [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt) goto gfx_init_vic_bitmap::@2 to:gfx_init_vic_bitmap::@return gfx_init_vic_bitmap::@return: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1 [608] return @@ -13783,7 +13780,6 @@ VARIABLE REGISTER WEIGHTS (byte) bitmap_plot::y#3 202.0 (byte) bitmap_plot::y#4 204.0 (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) -(byte*) dtvSetCpuBankSegment1::cpuBank (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 202.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#11 4.0 @@ -13826,7 +13822,6 @@ VARIABLE REGISTER WEIGHTS (byte) form_field_ptr::x#0 33.90000000000003 (byte) form_field_ptr::y (byte) form_field_ptr::y#0 6.0 -(byte) form_fields_cnt (void()) form_mode() (byte~) form_mode::$36 2002.0 (byte) form_mode::i @@ -14088,7 +14083,6 @@ VARIABLE REGISTER WEIGHTS (byte) gfx_init_vic_bitmap::l (byte) gfx_init_vic_bitmap::l#1 22.0 (byte) gfx_init_vic_bitmap::l#2 11.0 -(byte) gfx_init_vic_bitmap::lines_cnt (void()) gfx_mode() (byte~) gfx_mode::$20 4.0 (dword~) gfx_mode::$22 4.0 @@ -17515,7 +17509,7 @@ form_render_values: { jmp b1 // form_render_values::@1 b1: - // [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt#0) goto form_render_values::@2 -- vbuz1_lt_vbuc1_then_la1 + // [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt) goto form_render_values::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z idx cmp #form_fields_cnt bcc b2 @@ -17766,7 +17760,7 @@ apply_preset: { // Copy preset values into the fields // apply_preset::@13 b13: - // [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt#0) goto apply_preset::@14 -- vbuz1_neq_vbuc1_then_la1 + // [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt) goto apply_preset::@14 -- vbuz1_neq_vbuc1_then_la1 lda #form_fields_cnt cmp.z i bne b14 @@ -17917,7 +17911,7 @@ form_control: { bne b22_from_b9 // [382] phi from form_control::@9 to form_control::@14 [phi:form_control::@9->form_control::@14] b14_from_b9: - // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt#0-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 + // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 lda #form_fields_cnt-1 sta.z form_field_idx jmp b14 @@ -17951,7 +17945,7 @@ form_control: { b13: // [385] (byte) form_field_idx#5 ← ++ (byte) form_field_idx#28 -- vbuz1=_inc_vbuz1 inc.z form_field_idx - // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt#0) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 + // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 lda #form_fields_cnt cmp.z form_field_idx bne b23_from_b13 @@ -18665,7 +18659,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff .label cpuBankIdx = $43 - // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuz1 + // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuz1 lda.z cpuBankIdx sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } @@ -19394,7 +19388,7 @@ gfx_init_vic_bitmap: { jmp b1 // gfx_init_vic_bitmap::@1 b1: - // [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2 -- vbuz1_lt_vbuc1_then_la1 + // [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt) goto gfx_init_vic_bitmap::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b2 @@ -24635,7 +24629,7 @@ form_render_values: { jmp b1 // form_render_values::@1 b1: - // [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt#0) goto form_render_values::@2 -- vbuxx_lt_vbuc1_then_la1 + // [330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt) goto form_render_values::@2 -- vbuxx_lt_vbuc1_then_la1 cpx #form_fields_cnt bcc b2 jmp breturn @@ -24863,7 +24857,7 @@ apply_preset: { // Copy preset values into the fields // apply_preset::@13 b13: - // [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt#0) goto apply_preset::@14 -- vbuyy_neq_vbuc1_then_la1 + // [355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt) goto apply_preset::@14 -- vbuyy_neq_vbuc1_then_la1 cpy #form_fields_cnt bne b14 jmp breturn @@ -24992,7 +24986,7 @@ form_control: { bne b22_from_b9 // [382] phi from form_control::@9 to form_control::@14 [phi:form_control::@9->form_control::@14] b14_from_b9: - // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt#0-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 + // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 lda #form_fields_cnt-1 sta.z form_field_idx jmp b14 @@ -25025,7 +25019,7 @@ form_control: { b13: // [385] (byte) form_field_idx#5 ← ++ (byte) form_field_idx#28 -- vbuz1=_inc_vbuz1 inc.z form_field_idx - // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt#0) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 + // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 lda #form_fields_cnt cmp.z form_field_idx bne b23_from_b13 @@ -25694,7 +25688,7 @@ gfx_init_plane_fill: { dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff - // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuaa + // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuaa sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } .byte $32, $dd @@ -26379,7 +26373,7 @@ gfx_init_vic_bitmap: { jmp b1 // gfx_init_vic_bitmap::@1 b1: - // [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2 -- vbuz1_lt_vbuc1_then_la1 + // [607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt) goto gfx_init_vic_bitmap::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b2 @@ -29202,8 +29196,7 @@ FINAL SYMBOL TABLE (const byte[$100]) bitmap_plot_ylo bitmap_plot_ylo = { fill( $100, 0) } (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 202.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#11 reg byte a 4.0 @@ -29271,8 +29264,7 @@ FINAL SYMBOL TABLE (byte) form_field_ptr::x#0 x zp ZP_BYTE:30 33.90000000000003 (byte) form_field_ptr::y (byte) form_field_ptr::y#0 reg byte a 6.0 -(byte) form_fields_cnt -(const byte) form_fields_cnt#0 form_fields_cnt = (byte) $24 +(const byte) form_fields_cnt form_fields_cnt = (byte) $24 (const byte[]) form_fields_max form_fields_max = { (byte) $a, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) $d, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $d, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) 3, (byte) 1, (byte) 4, (byte) 1, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f, (byte) $f } (const byte[]) form_fields_val form_fields_val = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (const byte[]) form_fields_x form_fields_x = { (byte) 8, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $c, (byte) $19, (byte) $18, (byte) $19, (byte) $18, (byte) $19, (byte) $18, (byte) $19, (byte) $19, (byte) $18, (byte) $19, (byte) $18, (byte) $19, (byte) $18, (byte) $19, (byte) $25, (byte) $25, (byte) $25, (byte) $25, (byte) $24, (byte) $25, (byte) $24, (byte) $25, (byte) $24, (byte) $25, (byte) $24, (byte) $25 } @@ -29685,8 +29677,7 @@ FINAL SYMBOL TABLE (byte) gfx_init_vic_bitmap::l (byte) gfx_init_vic_bitmap::l#1 l zp ZP_BYTE:8 22.0 (byte) gfx_init_vic_bitmap::l#2 l zp ZP_BYTE:8 11.0 -(byte) gfx_init_vic_bitmap::lines_cnt -(const byte) gfx_init_vic_bitmap::lines_cnt#0 lines_cnt = (byte) 9 +(const byte) gfx_init_vic_bitmap::lines_cnt lines_cnt = (byte) 9 (const byte[]) gfx_init_vic_bitmap::lines_x lines_x = { (byte) 0, (byte) $ff, (byte) $ff, (byte) 0, (byte) 0, (byte) $80, (byte) $ff, (byte) $80, (byte) 0, (byte) $80 } (const byte[]) gfx_init_vic_bitmap::lines_y lines_y = { (byte) 0, (byte) 0, (byte) $c7, (byte) $c7, (byte) 0, (byte) 0, (byte) $64, (byte) $c7, (byte) $64, (byte) 0 } (void()) gfx_mode() @@ -32215,7 +32206,7 @@ form_render_values: { // form_render_values::@1 b1: // for( byte idx=0; idxform_control::@14] - // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt#0-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 + // [382] phi (byte) form_field_idx#31 = (const byte) form_fields_cnt-(byte) 1 [phi:form_control::@9->form_control::@14#0] -- vbuz1=vbuc1 lda #form_fields_cnt-1 sta.z form_field_idx // [381] phi from form_control::@9 to form_control::@22 [phi:form_control::@9->form_control::@22] @@ -32570,7 +32561,7 @@ form_control: { // if(++form_field_idx==form_fields_cnt) // [385] (byte) form_field_idx#5 ← ++ (byte) form_field_idx#28 -- vbuz1=_inc_vbuz1 inc.z form_field_idx - // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt#0) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 + // [386] if((byte) form_field_idx#5!=(const byte) form_fields_cnt) goto form_control::@23 -- vbuz1_neq_vbuc1_then_la1 lda #form_fields_cnt cmp.z form_field_idx bne b14 @@ -33163,7 +33154,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff // *cpuBank = cpuBankIdx - // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuaa + // [502] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#13 -- _deref_pbuc1=vbuaa sta cpuBank // asm // asm { .byte$32,$dd lda$ff .byte$32,$00 } @@ -33785,7 +33776,7 @@ gfx_init_vic_bitmap: { // gfx_init_vic_bitmap::@1 b1: // for(byte l=0; lPLANEB sta.z gfxb+1 - // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 + // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 lda #CHARGEN @@ -17520,7 +17514,7 @@ mode_stdbitmap: { jmp b7 // mode_stdbitmap::@7 b7: - // [582] if((byte) mode_stdbitmap::l#2<(const byte) mode_stdbitmap::lines_cnt#0) goto mode_stdbitmap::@8 -- vbuz1_lt_vbuc1_then_la1 + // [582] if((byte) mode_stdbitmap::l#2<(const byte) mode_stdbitmap::lines_cnt) goto mode_stdbitmap::@8 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b8 @@ -22067,7 +22061,7 @@ keyboard_matrix_read: { dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff - // [224] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa + // [224] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa sta cpuBank // asm { .byte$32,$dd lda$ff .byte$32,$00 } .byte $32, $dd @@ -22263,7 +22257,7 @@ mode_8bpppixelcell: { sta.z gfxb lda #>PLANEB sta.z gfxb+1 - // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 + // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 lda #CHARGEN @@ -24061,7 +24055,7 @@ mode_stdbitmap: { jmp b7 // mode_stdbitmap::@7 b7: - // [582] if((byte) mode_stdbitmap::l#2<(const byte) mode_stdbitmap::lines_cnt#0) goto mode_stdbitmap::@8 -- vbuz1_lt_vbuc1_then_la1 + // [582] if((byte) mode_stdbitmap::l#2<(const byte) mode_stdbitmap::lines_cnt) goto mode_stdbitmap::@8 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b8 @@ -26952,8 +26946,7 @@ FINAL SYMBOL TABLE (const byte[$100]) bitmap_plot_ylo bitmap_plot_ylo = { fill( $100, 0) } (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) (label) dtvSetCpuBankSegment1::@return -(byte*) dtvSetCpuBankSegment1::cpuBank -(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = (byte*) 255 +(const byte*) dtvSetCpuBankSegment1::cpuBank cpuBank = (byte*) 255 (byte) dtvSetCpuBankSegment1::cpuBankIdx (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 2002.0 (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 reg byte a 1003.0 @@ -27140,8 +27133,7 @@ FINAL SYMBOL TABLE (label) mode_8bpppixelcell::@8 (label) mode_8bpppixelcell::@9 (label) mode_8bpppixelcell::@return -(byte*) mode_8bpppixelcell::CHARGEN -(const byte*) mode_8bpppixelcell::CHARGEN#0 CHARGEN = (byte*) 53248 +(const byte*) mode_8bpppixelcell::CHARGEN CHARGEN = (byte*) 53248 (const byte*) mode_8bpppixelcell::PLANEA PLANEA = (byte*) 15360 (const byte*) mode_8bpppixelcell::PLANEB PLANEB = (byte*) 16384 (byte) mode_8bpppixelcell::ax @@ -27558,8 +27550,7 @@ FINAL SYMBOL TABLE (byte) mode_stdbitmap::l (byte) mode_stdbitmap::l#1 l zp ZP_BYTE:14 202.0 (byte) mode_stdbitmap::l#2 l zp ZP_BYTE:14 101.0 -(byte) mode_stdbitmap::lines_cnt -(const byte) mode_stdbitmap::lines_cnt#0 lines_cnt = (byte) 9 +(const byte) mode_stdbitmap::lines_cnt lines_cnt = (byte) 9 (const byte[]) mode_stdbitmap::lines_x lines_x = { (byte) 0, (byte) $ff, (byte) $ff, (byte) 0, (byte) 0, (byte) $80, (byte) $ff, (byte) $80, (byte) 0, (byte) $80 } (const byte[]) mode_stdbitmap::lines_y lines_y = { (byte) 0, (byte) 0, (byte) $c7, (byte) $c7, (byte) 0, (byte) 0, (byte) $64, (byte) $c7, (byte) $64, (byte) 0 } (void()) mode_stdchar() @@ -28902,7 +28893,7 @@ dtvSetCpuBankSegment1: { // Move CPU BANK 1 SEGMENT ($4000-$7fff) .label cpuBank = $ff // *cpuBank = cpuBankIdx - // [224] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa + // [224] *((const byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa sta cpuBank // asm // asm { .byte$32,$dd lda$ff .byte$32,$00 } @@ -29101,7 +29092,7 @@ mode_8bpppixelcell: { sta.z gfxb lda #>PLANEB sta.z gfxb+1 - // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 + // [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN [phi:mode_8bpppixelcell::@5->mode_8bpppixelcell::@6#3] -- pbuz1=pbuc1 lda #CHARGEN @@ -30879,7 +30870,7 @@ mode_stdbitmap: { // mode_stdbitmap::@7 b7: // for(byte l=0; lprint] print_from_b1: - // [11] phi (word) print::w#3 = (const word) main::w#0 [phi:main::@1->print#0] -- vwuz1=vwuc1 + // [11] phi (word) print::w#3 = (const word) main::w [phi:main::@1->print#0] -- vwuz1=vwuc1 lda #w @@ -435,7 +433,7 @@ main: { // [7] call print // [11] phi from main::@1 to print [phi:main::@1->print] print_from_b1: - // [11] phi (word) print::w#3 = (const word) main::w#0 [phi:main::@1->print#0] -- vwuz1=vwuc1 + // [11] phi (word) print::w#3 = (const word) main::w [phi:main::@1->print#0] -- vwuz1=vwuc1 lda #w @@ -528,8 +526,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(word) main::w -(const word) main::w#0 w = (word) $1234 +(const word) main::w w = (word) $1234 (void()) print((word) print::w) (byte~) print::$0 reg byte a 4.0 (label) print::@return @@ -578,7 +575,7 @@ main: { // print(w) // [7] call print // [11] phi from main::@1 to print [phi:main::@1->print] - // [11] phi (word) print::w#3 = (const word) main::w#0 [phi:main::@1->print#0] -- vwuz1=vwuc1 + // [11] phi (word) print::w#3 = (const word) main::w [phi:main::@1->print#0] -- vwuz1=vwuc1 lda #w diff --git a/src/test/ref/call-parameter-autocast.sym b/src/test/ref/call-parameter-autocast.sym index 46927766d..55636df55 100644 --- a/src/test/ref/call-parameter-autocast.sym +++ b/src/test/ref/call-parameter-autocast.sym @@ -9,8 +9,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(word) main::w -(const word) main::w#0 w = (word) $1234 +(const word) main::w w = (word) $1234 (void()) print((word) print::w) (byte~) print::$0 reg byte a 4.0 (label) print::@return diff --git a/src/test/ref/cast-deref.cfg b/src/test/ref/cast-deref.cfg index 8089f5880..f6bb7b4ec 100644 --- a/src/test/ref/cast-deref.cfg +++ b/src/test/ref/cast-deref.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return diff --git a/src/test/ref/cast-deref.log b/src/test/ref/cast-deref.log index a67e69496..af1fb3bb9 100644 --- a/src/test/ref/cast-deref.log +++ b/src/test/ref/cast-deref.log @@ -8,13 +8,13 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (signed byte[]) main::sbs ← { (number) -1, (number) -2, (number) -3, (number) -4 } - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) (byte~) main::$0 ← ((byte)) *((signed byte[]) main::sbs + (byte) main::i#2) - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 + *((byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$1) goto main::@1 @@ -40,7 +40,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -49,7 +48,7 @@ SYMBOL TABLE SSA Added casts to value list in (signed byte[]) main::sbs ← (signed byte[]){ (signed byte)(number) -1, (signed byte)(number) -2, (signed byte)(number) -3, (signed byte)(number) -4 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Inlining cast (byte~) main::$0 ← (byte)*((signed byte[]) main::sbs + (byte) main::i#2) Successful SSA optimization Pass2InlineCast Simplifying constant integer cast -1 @@ -63,7 +62,7 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (signed byte[]) { (signed byte) -1, (signed byte) -2, (signed byte) -3, (signed byte) -4 } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const signed byte[]) main::sbs = { -1, -2, -3, -4 } -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [6] main::i#1 ← ++ main::i#2 to ++ @@ -115,7 +114,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return @@ -126,7 +125,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 16.5 @@ -178,7 +176,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda sbs,y sta SCREEN,y @@ -198,9 +196,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (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 [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -248,7 +246,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda sbs,x sta SCREEN,x // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -297,8 +295,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 16.5 @@ -335,7 +332,7 @@ main: { // main::@1 b1: // SCREEN[i] = (byte) sbs[i] - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda sbs,x sta SCREEN,x // for(byte i : 0..3) diff --git a/src/test/ref/cast-deref.sym b/src/test/ref/cast-deref.sym index c98d903eb..542b56fb7 100644 --- a/src/test/ref/cast-deref.sym +++ b/src/test/ref/cast-deref.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 16.5 diff --git a/src/test/ref/cast-not-needed-3.cfg b/src/test/ref/cast-not-needed-3.cfg index add2a6e17..8b2db74ab 100644 --- a/src/test/ref/cast-not-needed-3.cfg +++ b/src/test/ref/cast-not-needed-3.cfg @@ -20,7 +20,7 @@ main::spritePtr1: scope:[main] from main::getScreen1 [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0) to:main::@1 main::@1: scope:[main] from main::spritePtr1 - [8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0 + [8] *((const byte*) main::DSP) ← (byte) main::spritePtr1_return#0 to:main::@return main::@return: scope:[main] from main::@1 [9] return diff --git a/src/test/ref/cast-not-needed-3.log b/src/test/ref/cast-not-needed-3.log index a6694e5be..74302bf99 100644 --- a/src/test/ref/cast-not-needed-3.log +++ b/src/test/ref/cast-not-needed-3.log @@ -16,7 +16,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @3 - (byte*) main::DSP#0 ← ((byte*)) (number) $400 + (byte*) main::DSP ← ((byte*)) (number) $400 (byte) main::getScreen1_id#0 ← (number) 0 to:main::getScreen1 main::getScreen1: scope:[main] from main @@ -46,7 +46,7 @@ main::spritePtr1_@return: scope:[main] from main::spritePtr1 main::@2: scope:[main] from main::spritePtr1_@return (byte) main::spritePtr1_return#3 ← phi( main::spritePtr1_@return/(byte) main::spritePtr1_return#1 ) (byte~) main::$1 ← (byte) main::spritePtr1_return#3 - *((byte*) main::DSP#0 + (number) 0) ← (byte~) main::$1 + *((byte*) main::DSP + (number) 0) ← (byte~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 return @@ -73,7 +73,6 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte*) main::DSP -(byte*) main::DSP#0 (label) main::getScreen1 (byte~) main::getScreen1_$0 (label) main::getScreen1_@return @@ -101,11 +100,11 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::getScreen1_id#0 ← (number) 0 Adding number conversion cast (unumber) $378 in (byte*~) main::spritePtr1_$0 ← (byte*) main::spritePtr1_screen#1 + (number) $378 -Adding number conversion cast (unumber) 0 in *((byte*) main::DSP#0 + (number) 0) ← (byte~) main::$1 +Adding number conversion cast (unumber) 0 in *((byte*) main::DSP + (number) 0) ← (byte~) main::$1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*~) $0 ← (byte*)(number) $400 Inlining cast (byte*~) $1 ← (byte*)(number) $1400 -Inlining cast (byte*) main::DSP#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::DSP ← (byte*)(number) $400 Inlining cast (byte) main::getScreen1_id#0 ← (unumber)(number) 0 Inlining cast (byte~) main::spritePtr1_$1 ← (byte)*((byte*~) main::spritePtr1_$0) Successful SSA optimization Pass2InlineCast @@ -127,10 +126,10 @@ Alias (byte) main::spritePtr1_return#0 = (byte~) main::spritePtr1_$1 (byte) main Successful SSA optimization Pass2AliasElimination Constant (const byte*) $0 = (byte*) 1024 Constant (const byte*) $1 = (byte*) 5120 -Constant (const byte*) main::DSP#0 = (byte*) 1024 +Constant (const byte*) main::DSP = (byte*) 1024 Constant (const byte) main::getScreen1_id#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::DSP#0 in [21] *((const byte*) main::DSP#0 + (byte) 0) ← (byte) main::spritePtr1_return#0 +Simplifying expression containing zero main::DSP in [21] *((const byte*) main::DSP + (byte) 0) ← (byte) main::spritePtr1_return#0 Successful SSA optimization PassNSimplifyExpressionWithZero Constant right-side identified [1] (byte~) main::getScreen1_$0 ← (const byte) main::getScreen1_id#0 * (const byte) SIZEOF_POINTER Successful SSA optimization Pass2ConstantRValueConsolidation @@ -197,7 +196,7 @@ main::spritePtr1: scope:[main] from main::getScreen1 [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0) to:main::@1 main::@1: scope:[main] from main::spritePtr1 - [8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0 + [8] *((const byte*) main::DSP) ← (byte) main::spritePtr1_return#0 to:main::@return main::@return: scope:[main] from main::@1 [9] return @@ -206,7 +205,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::DSP (byte) main::getScreen1_id (byte*) main::getScreen1_return (byte*) main::getScreen1_return#0 4.0 @@ -284,7 +282,7 @@ main: { jmp b1 // main::@1 b1: - // [8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuz1 + // [8] *((const byte*) main::DSP) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuz1 lda.z spritePtr1_return sta DSP jmp breturn @@ -366,7 +364,7 @@ main: { jmp b1 // main::@1 b1: - // [8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::DSP) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuaa sta DSP jmp breturn // main::@return @@ -409,8 +407,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::DSP -(const byte*) main::DSP#0 DSP = (byte*) 1024 +(const byte*) main::DSP DSP = (byte*) 1024 (label) main::getScreen1 (byte) main::getScreen1_id (byte*) main::getScreen1_return @@ -471,7 +468,7 @@ main: { lda (spritePtr1__0),y // main::@1 // DSP[0] = spritePtr(getScreen(0)) - // [8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::DSP) ← (byte) main::spritePtr1_return#0 -- _deref_pbuc1=vbuaa sta DSP // main::@return // } diff --git a/src/test/ref/cast-not-needed-3.sym b/src/test/ref/cast-not-needed-3.sym index 12fa825f8..2c5119d54 100644 --- a/src/test/ref/cast-not-needed-3.sym +++ b/src/test/ref/cast-not-needed-3.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::DSP -(const byte*) main::DSP#0 DSP = (byte*) 1024 +(const byte*) main::DSP DSP = (byte*) 1024 (label) main::getScreen1 (byte) main::getScreen1_id (byte*) main::getScreen1_return diff --git a/src/test/ref/cast-not-needed.cfg b/src/test/ref/cast-not-needed.cfg index 6e1fbb155..10a9c2dee 100644 --- a/src/test/ref/cast-not-needed.cfg +++ b/src/test/ref/cast-not-needed.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 + [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/cast-not-needed.log b/src/test/ref/cast-not-needed.log index 8de31acb1..e0d18e98b 100644 --- a/src/test/ref/cast-not-needed.log +++ b/src/test/ref/cast-not-needed.log @@ -3,15 +3,15 @@ Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) sprite#0 ← ((byte*)) (number) $5000 - (byte*) SCREEN#0 ← ((byte*)) (number) $4400 + (byte*) sprite ← ((byte*)) (number) $5000 + (byte*) SCREEN ← ((byte*)) (number) $4400 to:@1 (void()) main() main: scope:[main] from @1 - (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) $378 + (byte*~) main::$0 ← (byte*) SCREEN + (number) $378 (byte*) main::sprite_ptr#0 ← (byte*~) main::$0 - (byte*~) main::$1 ← (byte*) sprite#0 / (number) $40 + (byte*~) main::$1 ← (byte*) sprite / (number) $40 (byte~) main::$2 ← ((byte)) (byte*~) main::$1 *((byte*) main::sprite_ptr#0 + (number) 0) ← (byte~) main::$2 to:main::@return @@ -31,7 +31,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$0 (byte*~) main::$1 @@ -40,14 +39,13 @@ SYMBOL TABLE SSA (byte*) main::sprite_ptr (byte*) main::sprite_ptr#0 (byte*) sprite -(byte*) sprite#0 -Adding number conversion cast (unumber) $378 in (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) $378 -Adding number conversion cast (unumber) $40 in (byte*~) main::$1 ← (byte*) sprite#0 / (number) $40 +Adding number conversion cast (unumber) $378 in (byte*~) main::$0 ← (byte*) SCREEN + (number) $378 +Adding number conversion cast (unumber) $40 in (byte*~) main::$1 ← (byte*) sprite / (number) $40 Adding number conversion cast (unumber) 0 in *((byte*) main::sprite_ptr#0 + (number) 0) ← (byte~) main::$2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) sprite#0 ← (byte*)(number) $5000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $4400 +Inlining cast (byte*) sprite ← (byte*)(number) $5000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $4400 Inlining cast (byte~) main::$2 ← (byte)(byte*~) main::$1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 20480 @@ -62,23 +60,23 @@ Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Alias (byte*) main::sprite_ptr#0 = (byte*~) main::$0 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) sprite#0 = (byte*) 20480 -Constant (const byte*) SCREEN#0 = (byte*) 17408 +Constant (const byte*) sprite = (byte*) 20480 +Constant (const byte*) SCREEN = (byte*) 17408 Successful SSA optimization Pass2ConstantIdentification Simplifying expression containing zero main::sprite_ptr#0 in [6] *((byte*) main::sprite_ptr#0 + (byte) 0) ← (byte~) main::$2 Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (byte*) main::sprite_ptr#0 ← (const byte*) SCREEN#0 + (word) $378 -Constant right-side identified [1] (byte*~) main::$1 ← (const byte*) sprite#0 / (byte) $40 +Constant right-side identified [0] (byte*) main::sprite_ptr#0 ← (const byte*) SCREEN + (word) $378 +Constant right-side identified [1] (byte*~) main::$1 ← (const byte*) sprite / (byte) $40 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::sprite_ptr#0 = SCREEN#0+$378 -Constant (const byte*) main::$1 = sprite#0/$40 +Constant (const byte*) main::sprite_ptr#0 = SCREEN+$378 +Constant (const byte*) main::$1 = sprite/$40 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte)main::$1 in [2] (byte~) main::$2 ← (byte)(const byte*) main::$1 Successful SSA optimization Pass2ConstantValues Constant (const byte) main::$2 = (byte)main::$1 Successful SSA optimization Pass2ConstantIdentification -Constant inlined main::$1 = (const byte*) sprite#0/(byte) $40 -Constant inlined main::$2 = (byte)(const byte*) sprite#0/(byte) $40 +Constant inlined main::$1 = (const byte*) sprite/(byte) $40 +Constant inlined main::$2 = (byte)(const byte*) sprite/(byte) $40 Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -107,7 +105,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 + [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 to:main::@return main::@return: scope:[main] from main [5] return @@ -115,10 +113,8 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte*) main::sprite_ptr -(byte*) sprite Initial phi equivalence classes Complete equivalence classes @@ -151,7 +147,7 @@ bend: // main main: { .label sprite_ptr = SCREEN+$378 - // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 -- _deref_pbuc1=vbuc2 lda #$ff&sprite/$40 sta sprite_ptr jmp breturn @@ -163,7 +159,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -199,7 +195,7 @@ bend: // main main: { .label sprite_ptr = SCREEN+$378 - // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 -- _deref_pbuc1=vbuc2 lda #$ff&sprite/$40 sta sprite_ptr jmp breturn @@ -232,14 +228,12 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 17408 +(const byte*) SCREEN SCREEN = (byte*) 17408 (void()) main() (label) main::@return (byte*) main::sprite_ptr -(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN#0+(word) $378 -(byte*) sprite -(const byte*) sprite#0 sprite = (byte*) 20480 +(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN+(word) $378 +(const byte*) sprite sprite = (byte*) 20480 @@ -265,7 +259,7 @@ Score: 12 main: { .label sprite_ptr = SCREEN+$378 // sprite_ptr[0] = (byte)(sprite/$40) - // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite/(byte) $40 -- _deref_pbuc1=vbuc2 lda #$ff&sprite/$40 sta sprite_ptr // main::@return diff --git a/src/test/ref/cast-not-needed.sym b/src/test/ref/cast-not-needed.sym index a8cae1705..fe6401689 100644 --- a/src/test/ref/cast-not-needed.sym +++ b/src/test/ref/cast-not-needed.sym @@ -1,12 +1,10 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 17408 +(const byte*) SCREEN SCREEN = (byte*) 17408 (void()) main() (label) main::@return (byte*) main::sprite_ptr -(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN#0+(word) $378 -(byte*) sprite -(const byte*) sprite#0 sprite = (byte*) 20480 +(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN+(word) $378 +(const byte*) sprite sprite = (byte*) 20480 diff --git a/src/test/ref/cast-precedence-problem.cfg b/src/test/ref/cast-precedence-problem.cfg index 2d79ce406..1744dd524 100644 --- a/src/test/ref/cast-precedence-problem.cfg +++ b/src/test/ref/cast-precedence-problem.cfg @@ -10,16 +10,16 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 - [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 + [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 + [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 to:main::@2 main::@2: scope:[main] from main - [7] *((const byte*) main::BGCOL#0) ← (byte) 2 + [7] *((const byte*) main::BGCOL) ← (byte) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@2 [8] return to:@return main::@1: scope:[main] from main - [9] *((const byte*) main::BGCOL#0) ← (byte) 5 + [9] *((const byte*) main::BGCOL) ← (byte) 5 to:main::@return diff --git a/src/test/ref/cast-precedence-problem.log b/src/test/ref/cast-precedence-problem.log index 064e0cf24..cff76ee14 100644 --- a/src/test/ref/cast-precedence-problem.log +++ b/src/test/ref/cast-precedence-problem.log @@ -11,31 +11,31 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 - (byte) main::min#0 ← (number) $a - (byte) main::max#0 ← (number) $c8 - (byte~) main::$0 ← (byte) main::min#0 + (byte) main::max#0 + (byte*) main::SCREEN ← ((byte*)) (number) $400 + (byte) main::min ← (number) $a + (byte) main::max ← (number) $c8 + (byte~) main::$0 ← (byte) main::min + (byte) main::max (word) main::sumw#0 ← (byte~) main::$0 (word~) main::$1 ← (word) main::sumw#0 >> (number) 1 (byte~) main::$2 ← ((byte)) (word~) main::$1 (number~) main::$3 ← (byte~) main::$2 + (number) 1 (byte) main::midw#0 ← (number~) main::$3 - *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::midw#0 - (byte~) main::$4 ← (byte) main::min#0 + (byte) main::max#0 + *((byte*) main::SCREEN + (number) 0) ← (byte) main::midw#0 + (byte~) main::$4 ← (byte) main::min + (byte) main::max (byte) main::sumb#0 ← (byte~) main::$4 (byte~) main::$5 ← (byte) main::sumb#0 >> (number) 1 (number~) main::$6 ← (byte~) main::$5 + (number) 1 (byte) main::midb#0 ← (number~) main::$6 - *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::midb#0 - (byte*) main::BGCOL#0 ← ((byte*)) (number) $d021 - (bool~) main::$7 ← *((byte*) main::SCREEN#0 + (number) 0) == *((byte*) main::SCREEN#0 + (number) 1) + *((byte*) main::SCREEN + (number) 1) ← (byte) main::midb#0 + (byte*) main::BGCOL ← ((byte*)) (number) $d021 + (bool~) main::$7 ← *((byte*) main::SCREEN + (number) 0) == *((byte*) main::SCREEN + (number) 1) if((bool~) main::$7) goto main::@1 to:main::@3 main::@1: scope:[main] from main - *((byte*) main::BGCOL#0) ← (number) 5 + *((byte*) main::BGCOL) ← (number) 5 to:main::@return main::@3: scope:[main] from main - *((byte*) main::BGCOL#0) ← (number) 2 + *((byte*) main::BGCOL) ← (number) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -65,44 +65,40 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::BGCOL -(byte*) main::BGCOL#0 (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::max -(byte) main::max#0 (byte) main::midb (byte) main::midb#0 (byte) main::midw (byte) main::midw#0 (byte) main::min -(byte) main::min#0 (byte) main::sumb (byte) main::sumb#0 (word) main::sumw (word) main::sumw#0 -Adding number conversion cast (unumber) $a in (byte) main::min#0 ← (number) $a -Adding number conversion cast (unumber) $c8 in (byte) main::max#0 ← (number) $c8 +Adding number conversion cast (unumber) $a in (byte) main::min ← (number) $a +Adding number conversion cast (unumber) $c8 in (byte) main::max ← (number) $c8 Adding number conversion cast (unumber) 1 in (word~) main::$1 ← (word) main::sumw#0 >> (number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (byte~) main::$2 + (number) 1 Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte~) main::$2 + (unumber)(number) 1 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::midw#0 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::midw#0 Adding number conversion cast (unumber) 1 in (byte~) main::$5 ← (byte) main::sumb#0 >> (number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte~) main::$5 + (number) 1 Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte~) main::$5 + (unumber)(number) 1 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::midb#0 -Adding number conversion cast (unumber) 0 in (bool~) main::$7 ← *((byte*) main::SCREEN#0 + (number) 0) == *((byte*) main::SCREEN#0 + (number) 1) -Adding number conversion cast (unumber) 1 in (bool~) main::$7 ← *((byte*) main::SCREEN#0 + (unumber)(number) 0) == *((byte*) main::SCREEN#0 + (number) 1) -Adding number conversion cast (unumber) 5 in *((byte*) main::BGCOL#0) ← (number) 5 -Adding number conversion cast (unumber) 2 in *((byte*) main::BGCOL#0) ← (number) 2 +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::midb#0 +Adding number conversion cast (unumber) 0 in (bool~) main::$7 ← *((byte*) main::SCREEN + (number) 0) == *((byte*) main::SCREEN + (number) 1) +Adding number conversion cast (unumber) 1 in (bool~) main::$7 ← *((byte*) main::SCREEN + (unumber)(number) 0) == *((byte*) main::SCREEN + (number) 1) +Adding number conversion cast (unumber) 5 in *((byte*) main::BGCOL) ← (number) 5 +Adding number conversion cast (unumber) 2 in *((byte*) main::BGCOL) ← (number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte) main::min#0 ← (unumber)(number) $a -Inlining cast (byte) main::max#0 ← (unumber)(number) $c8 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 +Inlining cast (byte) main::min ← (unumber)(number) $a +Inlining cast (byte) main::max ← (unumber)(number) $c8 Inlining cast (byte~) main::$2 ← (byte)(word~) main::$1 -Inlining cast (byte*) main::BGCOL#0 ← (byte*)(number) $d021 -Inlining cast *((byte*) main::BGCOL#0) ← (unumber)(number) 5 -Inlining cast *((byte*) main::BGCOL#0) ← (unumber)(number) 2 +Inlining cast (byte*) main::BGCOL ← (byte*)(number) $d021 +Inlining cast *((byte*) main::BGCOL) ← (unumber)(number) 5 +Inlining cast *((byte*) main::BGCOL) ← (unumber)(number) 2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $a @@ -139,21 +135,21 @@ Alias (byte) main::midw#0 = (byte~) main::$3 Alias (byte) main::sumb#0 = (byte~) main::$4 Alias (byte) main::midb#0 = (byte~) main::$6 Successful SSA optimization Pass2AliasElimination -Simple Condition (bool~) main::$7 [18] if(*((byte*) main::SCREEN#0 + (byte) 0)==*((byte*) main::SCREEN#0 + (byte) 1)) goto main::@1 +Simple Condition (bool~) main::$7 [18] if(*((byte*) main::SCREEN + (byte) 0)==*((byte*) main::SCREEN + (byte) 1)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 -Constant (const byte) main::min#0 = $a -Constant (const byte) main::max#0 = $c8 -Constant (const byte*) main::BGCOL#0 = (byte*) 53281 +Constant (const byte*) main::SCREEN = (byte*) 1024 +Constant (const byte) main::min = $a +Constant (const byte) main::max = $c8 +Constant (const byte*) main::BGCOL = (byte*) 53281 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN#0 in [9] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte) main::midw#0 -Simplifying expression containing zero main::SCREEN#0 in [18] if(*((const byte*) main::SCREEN#0 + (byte) 0)==*((const byte*) main::SCREEN#0 + (byte) 1)) goto main::@1 +Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::midw#0 +Simplifying expression containing zero main::SCREEN in [18] if(*((const byte*) main::SCREEN + (byte) 0)==*((const byte*) main::SCREEN + (byte) 1)) goto main::@1 Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (word) main::sumw#0 ← (const byte) main::min#0 + (const byte) main::max#0 -Constant right-side identified [5] (byte) main::sumb#0 ← (const byte) main::min#0 + (const byte) main::max#0 +Constant right-side identified [0] (word) main::sumw#0 ← (const byte) main::min + (const byte) main::max +Constant right-side identified [5] (byte) main::sumb#0 ← (const byte) main::min + (const byte) main::max Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word) main::sumw#0 = main::min#0+main::max#0 -Constant (const byte) main::sumb#0 = main::min#0+main::max#0 +Constant (const word) main::sumw#0 = main::min+main::max +Constant (const byte) main::sumb#0 = main::min+main::max Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (word~) main::$1 ← (const word) main::sumw#0 >> (byte) 1 Constant right-side identified [4] (byte~) main::$5 ← (const byte) main::sumb#0 >> (byte) 1 @@ -176,8 +172,8 @@ Constant inlined main::$5 = (const byte) main::sumb#0>>(byte) 1 Constant inlined main::$1 = (const word) main::sumw#0>>(byte) 1 Constant inlined main::$2 = (byte)(const word) main::sumw#0>>(byte) 1 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+1) -Consolidated array index constant in *(main::SCREEN#0+1) +Consolidated array index constant in *(main::SCREEN+1) +Consolidated array index constant in *(main::SCREEN+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -207,29 +203,25 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 - [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 + [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 + [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 to:main::@2 main::@2: scope:[main] from main - [7] *((const byte*) main::BGCOL#0) ← (byte) 2 + [7] *((const byte*) main::BGCOL) ← (byte) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@2 [8] return to:@return main::@1: scope:[main] from main - [9] *((const byte*) main::BGCOL#0) ← (byte) 5 + [9] *((const byte*) main::BGCOL) ← (byte) 5 to:main::@return VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::BGCOL -(byte*) main::SCREEN -(byte) main::max (byte) main::midb (byte) main::midw -(byte) main::min (byte) main::sumb (word) main::sumw @@ -269,20 +261,20 @@ main: { .const sumb = min+max .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 - // [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 lda #midw sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 - // [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + // [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 lda SCREEN cmp SCREEN+1 beq b1 jmp b2 // main::@2 b2: - // [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL jmp breturn @@ -292,7 +284,7 @@ main: { rts // main::@1 b1: - // [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL jmp breturn @@ -300,11 +292,11 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -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) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::BGCOL#0) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::BGCOL#0) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::BGCOL) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::BGCOL) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -345,20 +337,20 @@ main: { .const sumb = min+max .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 - // [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 lda #midw sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 - // [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + // [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 lda SCREEN cmp SCREEN+1 beq b1 jmp b2 // main::@2 b2: - // [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL jmp breturn @@ -368,7 +360,7 @@ main: { rts // main::@1 b1: - // [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL jmp breturn @@ -405,22 +397,18 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::BGCOL -(const byte*) main::BGCOL#0 BGCOL = (byte*) 53281 -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 -(byte) main::max -(const byte) main::max#0 max = (byte) $c8 +(const byte*) main::BGCOL BGCOL = (byte*) 53281 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 +(const byte) main::max max = (byte) $c8 (byte) main::midb (const byte) main::midb#0 midb = (const byte) main::sumb#0>>(byte) 1+(byte) 1 (byte) main::midw (const byte) main::midw#0 midw = (byte)(const word) main::sumw#0>>(byte) 1+(byte) 1 -(byte) main::min -(const byte) main::min#0 min = (byte) $a +(const byte) main::min min = (byte) $a (byte) main::sumb -(const byte) main::sumb#0 sumb = (const byte) main::min#0+(const byte) main::max#0 +(const byte) main::sumb#0 sumb = (const byte) main::min+(const byte) main::max (word) main::sumw -(const word) main::sumw#0 sumw = (const byte) main::min#0+(const byte) main::max#0 +(const word) main::sumw#0 sumw = (const byte) main::min+(const byte) main::max @@ -451,21 +439,21 @@ main: { .const midb = (sumb>>1)+1 .const midw = (sumw>>1)+1 // SCREEN[0] = midw - // [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2 lda #midw sta SCREEN // SCREEN[1] = midb - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2 lda #midb sta SCREEN+1 // if(SCREEN[0]==SCREEN[1]) - // [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 + // [6] if(*((const byte*) main::SCREEN)==*((const byte*) main::SCREEN+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1 lda SCREEN cmp SCREEN+1 beq b1 // main::@2 // *BGCOL = 2 - // [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // main::@return @@ -475,7 +463,7 @@ main: { // main::@1 b1: // *BGCOL = 5 - // [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL rts diff --git a/src/test/ref/cast-precedence-problem.sym b/src/test/ref/cast-precedence-problem.sym index ef3bc6594..3f3f594e5 100644 --- a/src/test/ref/cast-precedence-problem.sym +++ b/src/test/ref/cast-precedence-problem.sym @@ -5,20 +5,16 @@ (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::BGCOL -(const byte*) main::BGCOL#0 BGCOL = (byte*) 53281 -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 -(byte) main::max -(const byte) main::max#0 max = (byte) $c8 +(const byte*) main::BGCOL BGCOL = (byte*) 53281 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 +(const byte) main::max max = (byte) $c8 (byte) main::midb (const byte) main::midb#0 midb = (const byte) main::sumb#0>>(byte) 1+(byte) 1 (byte) main::midw (const byte) main::midw#0 midw = (byte)(const word) main::sumw#0>>(byte) 1+(byte) 1 -(byte) main::min -(const byte) main::min#0 min = (byte) $a +(const byte) main::min min = (byte) $a (byte) main::sumb -(const byte) main::sumb#0 sumb = (const byte) main::min#0+(const byte) main::max#0 +(const byte) main::sumb#0 sumb = (const byte) main::min+(const byte) main::max (word) main::sumw -(const word) main::sumw#0 sumw = (const byte) main::min#0+(const byte) main::max#0 +(const word) main::sumw#0 sumw = (const byte) main::min+(const byte) main::max diff --git a/src/test/ref/casting.cfg b/src/test/ref/casting.cfg index b0804e0ba..62d3dd06a 100644 --- a/src/test/ref/casting.cfg +++ b/src/test/ref/casting.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 ) [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 - [7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 + [7] *((const byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 [9] *((const byte*) SCREEN2#0 + (byte) main::b#2) ← (byte)(signed byte) main::sb#0 [10] (byte) main::b#1 ← ++ (byte) main::b#2 diff --git a/src/test/ref/casting.log b/src/test/ref/casting.log index 6c6a494dd..715e077a7 100644 --- a/src/test/ref/casting.log +++ b/src/test/ref/casting.log @@ -6,12 +6,12 @@ Culled Empty Block (label) w::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*~) $0 ← (byte*) SCREEN#0 + (number) $28*(number) 3 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*~) $0 ← (byte*) SCREEN + (number) $28*(number) 3 (byte*) SCREEN2#0 ← (byte*~) $0 - (byte*~) $1 ← (byte*) SCREEN#0 + (number) $28*(number) 6 + (byte*~) $1 ← (byte*) SCREEN + (number) $28*(number) 6 (byte*) SCREEN3#0 ← (byte*~) $1 - (byte*~) $2 ← (byte*) SCREEN#0 + (number) $28*(number) 9 + (byte*~) $2 ← (byte*) SCREEN + (number) $28*(number) 9 (byte*) SCREEN4#0 ← (byte*~) $2 to:@2 @@ -29,7 +29,7 @@ main::@1: scope:[main] from main main::@1 (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) (number~) main::$1 ← (number) $c8 - (byte) main::b#2 (byte) main::b2#0 ← (number~) main::$1 - *((byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 + *((byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 (signed byte~) main::$2 ← ((signed byte)) (byte) main::b#2 (signed byte~) main::$3 ← - (signed byte~) main::$2 (signed byte) main::sb#0 ← (signed byte~) main::$3 @@ -60,9 +60,9 @@ w::@1: scope:[w] from w w::@1 (byte*) SCREEN4#1 ← phi( w/(byte*) SCREEN4#2 w::@1/(byte*) SCREEN4#1 ) (byte*) SCREEN3#1 ← phi( w/(byte*) SCREEN3#2 w::@1/(byte*) SCREEN3#1 ) (byte) w::i#2 ← phi( w/(byte) w::i#0 w::@1/(byte) w::i#1 ) - (word) w::w1#0 ← (number) $514 - (word) w::w2#0 ← (number) $4e2 - (word~) w::$0 ← (word) w::w1#0 - (word) w::w2#0 + (word) w::w1 ← (number) $514 + (word) w::w2 ← (number) $4e2 + (word~) w::$0 ← (word) w::w1 - (word) w::w2 (byte~) w::$1 ← ((byte)) (word~) w::$0 (byte) w::b#0 ← (byte~) w::$1 (number~) w::$2 ← (number) $578-(number) $546 + (byte) w::i#2 @@ -95,7 +95,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte*) SCREEN2 (byte*) SCREEN2#0 (byte*) SCREEN2#1 @@ -151,25 +150,23 @@ SYMBOL TABLE SSA (byte) w::i#1 (byte) w::i#2 (word) w::w1 -(word) w::w1#0 (word) w::w2 -(word) w::w2#0 -Adding number conversion cast (unumber) $28*3 in (byte*~) $0 ← (byte*) SCREEN#0 + (number) $28*(number) 3 -Adding number conversion cast (unumber) $28*6 in (byte*~) $1 ← (byte*) SCREEN#0 + (number) $28*(number) 6 -Adding number conversion cast (unumber) $28*9 in (byte*~) $2 ← (byte*) SCREEN#0 + (number) $28*(number) 9 +Adding number conversion cast (unumber) $28*3 in (byte*~) $0 ← (byte*) SCREEN + (number) $28*(number) 3 +Adding number conversion cast (unumber) $28*6 in (byte*~) $1 ← (byte*) SCREEN + (number) $28*(number) 6 +Adding number conversion cast (unumber) $28*9 in (byte*~) $2 ← (byte*) SCREEN + (number) $28*(number) 9 Adding number conversion cast (unumber) $c8 in (number~) main::$1 ← (number) $c8 - (byte) main::b#2 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unumber)(number) $c8 - (byte) main::b#2 -Adding number conversion cast (unumber) $514 in (word) w::w1#0 ← (number) $514 -Adding number conversion cast (unumber) $4e2 in (word) w::w2#0 ← (number) $4e2 +Adding number conversion cast (unumber) $514 in (word) w::w1 ← (number) $514 +Adding number conversion cast (unumber) $4e2 in (word) w::w2 ← (number) $4e2 Adding number conversion cast (unumber) $578-$546 in (number~) w::$2 ← (number) $578-(number) $546 + (byte) w::i#2 Adding number conversion cast (unumber) w::$2 in (number~) w::$2 ← (unumber)(number) $578-(number) $546 + (byte) w::i#2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (signed byte~) main::$2 ← (signed byte)(byte) main::b#2 Inlining cast (byte~) main::$4 ← (byte)(signed byte) main::sb#0 -Inlining cast (word) w::w1#0 ← (unumber)(number) $514 -Inlining cast (word) w::w2#0 ← (unumber)(number) $4e2 +Inlining cast (word) w::w1 ← (unumber)(number) $514 +Inlining cast (word) w::w2 ← (unumber)(number) $4e2 Inlining cast (byte~) w::$1 ← (byte)(word~) w::$0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -207,11 +204,11 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$5 [20] if((byte) main::b#1!=rangelast(0,$64)) goto main::@1 Simple Condition (bool~) w::$3 [38] if((byte) w::i#1!=rangelast(0,$a)) goto w::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::b#0 = 0 Constant (const byte) w::i#0 = 0 -Constant (const word) w::w1#0 = $514 -Constant (const word) w::w2#0 = $4e2 +Constant (const word) w::w1 = $514 +Constant (const word) w::w2 = $4e2 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [18] main::b#1 ← ++ main::b#2 to ++ Resolved ranged comparison value [20] if(main::b#1!=rangelast(0,$64)) goto main::@1 to (number) $65 @@ -226,15 +223,15 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $65 Finalized unsigned number type (byte) $b Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*) SCREEN2#0 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 3 -Constant right-side identified [1] (byte*) SCREEN3#0 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 6 -Constant right-side identified [2] (byte*) SCREEN4#0 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) 9 -Constant right-side identified [15] (word~) w::$0 ← (const word) w::w1#0 - (const word) w::w2#0 +Constant right-side identified [0] (byte*) SCREEN2#0 ← (const byte*) SCREEN + (byte)(number) $28*(number) 3 +Constant right-side identified [1] (byte*) SCREEN3#0 ← (const byte*) SCREEN + (byte)(number) $28*(number) 6 +Constant right-side identified [2] (byte*) SCREEN4#0 ← (const byte*) SCREEN + (word)(number) $28*(number) 9 +Constant right-side identified [15] (word~) w::$0 ← (const word) w::w1 - (const word) w::w2 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) SCREEN2#0 = SCREEN#0+(byte)$28*3 -Constant (const byte*) SCREEN3#0 = SCREEN#0+(byte)$28*6 -Constant (const byte*) SCREEN4#0 = SCREEN#0+(word)$28*9 -Constant (const word) w::$0 = w::w1#0-w::w2#0 +Constant (const byte*) SCREEN2#0 = SCREEN+(byte)$28*3 +Constant (const byte*) SCREEN3#0 = SCREEN+(byte)$28*6 +Constant (const byte*) SCREEN4#0 = SCREEN+(word)$28*9 +Constant (const word) w::$0 = w::w1-w::w2 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte)w::$0 in [16] (byte) w::b#0 ← (byte)(const word) w::$0 Successful SSA optimization Pass2ConstantValues @@ -246,7 +243,7 @@ Successful SSA optimization Pass2NopCastInlining Inlining constant with var siblings (const byte) main::b#0 Inlining constant with var siblings (const byte) w::i#0 Constant inlined w::i#0 = (byte) 0 -Constant inlined w::$0 = (const word) w::w1#0-(const word) w::w2#0 +Constant inlined w::$0 = (const word) w::w1-(const word) w::w2 Constant inlined main::b#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@4(between main::@1 and main::@1) @@ -297,7 +294,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 ) [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 - [7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 + [7] *((const byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 [9] *((const byte*) SCREEN2#0 + (byte) main::b#2) ← (byte)(signed byte) main::sb#0 [10] (byte) main::b#1 ← ++ (byte) main::b#2 @@ -329,7 +326,6 @@ w::@return: scope:[w] from w::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (byte*) SCREEN2 (byte*) SCREEN3 (byte*) SCREEN4 @@ -348,8 +344,6 @@ VARIABLE REGISTER WEIGHTS (byte) w::i (byte) w::i#1 16.5 (byte) w::i#2 13.75 -(word) w::w1 -(word) w::w2 Initial phi equivalence classes [ main::b#2 main::b#1 ] @@ -419,7 +413,7 @@ main: { sec sbc.z b sta.z b2 - // [7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [7] *((const byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z b2 ldy.z b sta SCREEN,y @@ -572,7 +566,7 @@ main: { eor #$ff clc adc #$c8+1 - // [7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 -- vbsaa=_neg_vbsxx txa @@ -680,14 +674,13 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 3 +(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN+(byte)(number) $28*(number) 3 (byte*) SCREEN3 -(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 6 +(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN+(byte)(number) $28*(number) 6 (byte*) SCREEN4 -(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN#0+(word)(number) $28*(number) 9 +(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN+(word)(number) $28*(number) 9 (void()) main() (label) main::@1 (label) main::@2 @@ -703,16 +696,14 @@ FINAL SYMBOL TABLE (label) w::@1 (label) w::@return (byte) w::b -(const byte) w::b#0 b = (byte)(const word) w::w1#0-(const word) w::w2#0 +(const byte) w::b#0 b = (byte)(const word) w::w1-(const word) w::w2 (byte) w::b2 (byte) w::b2#0 reg byte x 11.0 (byte) w::i (byte) w::i#1 reg byte y 16.5 (byte) w::i#2 reg byte y 13.75 -(word) w::w1 -(const word) w::w1#0 w1 = (word) $514 -(word) w::w2 -(const word) w::w2#0 w2 = (word) $4e2 +(const word) w::w1 w1 = (word) $514 +(const word) w::w2 w2 = (word) $4e2 reg byte x [ main::b#2 main::b#1 ] reg byte y [ w::i#2 w::i#1 ] @@ -757,7 +748,7 @@ main: { clc adc #$c8+1 // SCREEN[b] = b2 - // [7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) SCREEN + (byte) main::b#2) ← (byte) main::b2#0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // sb = - (signed byte)b // [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 -- vbsaa=_neg_vbsxx diff --git a/src/test/ref/casting.sym b/src/test/ref/casting.sym index 92ae08e49..1018a8afb 100644 --- a/src/test/ref/casting.sym +++ b/src/test/ref/casting.sym @@ -1,14 +1,13 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 3 +(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN+(byte)(number) $28*(number) 3 (byte*) SCREEN3 -(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 6 +(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN+(byte)(number) $28*(number) 6 (byte*) SCREEN4 -(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN#0+(word)(number) $28*(number) 9 +(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN+(word)(number) $28*(number) 9 (void()) main() (label) main::@1 (label) main::@2 @@ -24,16 +23,14 @@ (label) w::@1 (label) w::@return (byte) w::b -(const byte) w::b#0 b = (byte)(const word) w::w1#0-(const word) w::w2#0 +(const byte) w::b#0 b = (byte)(const word) w::w1-(const word) w::w2 (byte) w::b2 (byte) w::b2#0 reg byte x 11.0 (byte) w::i (byte) w::i#1 reg byte y 16.5 (byte) w::i#2 reg byte y 13.75 -(word) w::w1 -(const word) w::w1#0 w1 = (word) $514 -(word) w::w2 -(const word) w::w2#0 w2 = (word) $4e2 +(const word) w::w1 w1 = (word) $514 +(const word) w::w2 w2 = (word) $4e2 reg byte x [ main::b#2 main::b#1 ] reg byte y [ w::i#2 w::i#1 ] diff --git a/src/test/ref/chargen.cfg b/src/test/ref/chargen.cfg index 5db827c89..8a267cfa7 100644 --- a/src/test/ref/chargen.cfg +++ b/src/test/ref/chargen.cfg @@ -11,10 +11,10 @@ (void()) main() main: scope:[main] from @1 asm { sei } - [5] *((const byte*) PROCPORT#0) ← (byte) $32 + [5] *((const byte*) PROCPORT) ← (byte) $32 to:main::@1 main::@1: scope:[main] from main main::@5 - [6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN#0 main::@5/(byte*) main::sc#2 ) + [6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN main::@5/(byte*) main::sc#2 ) [6] (byte) main::y#2 ← phi( main/(byte) 0 main::@5/(byte) main::y#1 ) [7] (byte) main::bits#0 ← *((const byte*) main::CHAR_A#0 + (byte) main::y#2) to:main::@2 @@ -42,7 +42,7 @@ main::@5: scope:[main] from main::@3 [20] if((byte) main::y#1!=(byte) 8) goto main::@1 to:main::@6 main::@6: scope:[main] from main::@5 - [21] *((const byte*) PROCPORT#0) ← (byte) $37 + [21] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:main::@return main::@return: scope:[main] from main::@6 diff --git a/src/test/ref/chargen.log b/src/test/ref/chargen.log index fc0182127..442e122fc 100644 --- a/src/test/ref/chargen.log +++ b/src/test/ref/chargen.log @@ -4,18 +4,18 @@ Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) PROCPORT#0 ← ((byte*)) (number) 1 - (byte*) CHARGEN#0 ← ((byte*)) (number) $d000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) PROCPORT ← ((byte*)) (number) 1 + (byte*) CHARGEN ← ((byte*)) (number) $d000 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() main: scope:[main] from @1 asm { sei } - (byte*~) main::$0 ← (byte*) CHARGEN#0 + (number) 8 + (byte*~) main::$0 ← (byte*) CHARGEN + (number) 8 (byte*) main::CHAR_A#0 ← (byte*~) main::$0 - *((byte*) PROCPORT#0) ← (number) $32 - (byte*) main::sc#0 ← (byte*) SCREEN#0 + *((byte*) PROCPORT) ← (number) $32 + (byte*) main::sc#0 ← (byte*) SCREEN (byte) main::y#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@5 @@ -71,7 +71,7 @@ main::@5: scope:[main] from main::@3 if((bool~) main::$7) goto main::@1 to:main::@6 main::@6: scope:[main] from main::@5 - *((byte*) PROCPORT#0) ← (number) $37 + *((byte*) PROCPORT) ← (number) $37 asm { cli } to:main::@return main::@return: scope:[main] from main::@6 @@ -90,11 +90,8 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) CHARGEN -(byte*) CHARGEN#0 (byte*) PROCPORT -(byte*) PROCPORT#0 (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$0 (number~) main::$1 @@ -152,21 +149,21 @@ SYMBOL TABLE SSA (byte) main::y#5 (byte) main::y#6 -Adding number conversion cast (unumber) 8 in (byte*~) main::$0 ← (byte*) CHARGEN#0 + (number) 8 -Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT#0) ← (number) $32 +Adding number conversion cast (unumber) 8 in (byte*~) main::$0 ← (byte*) CHARGEN + (number) 8 +Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT) ← (number) $32 Adding number conversion cast (unumber) $80 in (number~) main::$1 ← (byte) main::bits#2 & (number) $80 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::bits#2 & (unumber)(number) $80 Adding number conversion cast (unumber) 0 in (bool~) main::$2 ← (unumber~) main::$1 != (number) 0 Adding number conversion cast (unumber) 2 in (number~) main::$4 ← (byte) main::bits#3 * (number) 2 Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte) main::bits#3 * (unumber)(number) 2 Adding number conversion cast (unumber) $20 in (byte*~) main::$6 ← (byte*) main::sc#4 + (number) $20 -Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT#0) ← (number) $37 +Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT) ← (number) $37 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) PROCPORT#0 ← (byte*)(number) 1 -Inlining cast (byte*) CHARGEN#0 ← (byte*)(number) $d000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $32 -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $37 +Inlining cast (byte*) PROCPORT ← (byte*)(number) 1 +Inlining cast (byte*) CHARGEN ← (byte*)(number) $d000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $32 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $37 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1 Simplifying constant pointer cast (byte*) 53248 @@ -218,15 +215,15 @@ Simple Condition (bool~) main::$3 [17] if((byte~) main::$1==(byte) 0) goto main: Simple Condition (bool~) main::$5 [25] if((byte) main::x#1!=rangelast(0,7)) goto main::@2 Simple Condition (bool~) main::$7 [33] if((byte) main::y#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) PROCPORT#0 = (byte*) 1 -Constant (const byte*) CHARGEN#0 = (byte*) 53248 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) PROCPORT = (byte*) 1 +Constant (const byte*) CHARGEN = (byte*) 53248 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::y#0 = 0 Constant (const byte) main::x#0 = 0 Constant (const byte) main::c#0 = '.' Constant (const byte) main::c#1 = '*' Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::sc#0 = SCREEN#0 +Constant (const byte*) main::sc#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [23] main::x#1 ← ++ main::x#2 to ++ Resolved ranged comparison value [25] if(main::x#1!=rangelast(0,7)) goto main::@2 to (number) 8 @@ -241,9 +238,9 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 8 Finalized unsigned number type (byte) 8 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [1] (byte*) main::CHAR_A#0 ← (const byte*) CHARGEN#0 + (byte) 8 +Constant right-side identified [1] (byte*) main::CHAR_A#0 ← (const byte*) CHARGEN + (byte) 8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::CHAR_A#0 = CHARGEN#0+8 +Constant (const byte*) main::CHAR_A#0 = CHARGEN+8 Successful SSA optimization Pass2ConstantIdentification Rewriting multiplication to use shift [10] (byte) main::bits#1 ← (byte) main::bits#2 * (byte) 2 Successful SSA optimization Pass2MultiplyToShiftRewriting @@ -252,7 +249,7 @@ Inlining constant with var siblings (const byte) main::x#0 Inlining constant with var siblings (const byte) main::c#0 Inlining constant with var siblings (const byte) main::c#1 Inlining constant with var siblings (const byte*) main::sc#0 -Constant inlined main::sc#0 = (const byte*) SCREEN#0 +Constant inlined main::sc#0 = (const byte*) SCREEN Constant inlined main::c#0 = (byte) '.' Constant inlined main::x#0 = (byte) 0 Constant inlined main::y#0 = (byte) 0 @@ -299,10 +296,10 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 asm { sei } - [5] *((const byte*) PROCPORT#0) ← (byte) $32 + [5] *((const byte*) PROCPORT) ← (byte) $32 to:main::@1 main::@1: scope:[main] from main main::@5 - [6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN#0 main::@5/(byte*) main::sc#2 ) + [6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN main::@5/(byte*) main::sc#2 ) [6] (byte) main::y#2 ← phi( main/(byte) 0 main::@5/(byte) main::y#1 ) [7] (byte) main::bits#0 ← *((const byte*) main::CHAR_A#0 + (byte) main::y#2) to:main::@2 @@ -330,7 +327,7 @@ main::@5: scope:[main] from main::@3 [20] if((byte) main::y#1!=(byte) 8) goto main::@1 to:main::@6 main::@6: scope:[main] from main::@5 - [21] *((const byte*) PROCPORT#0) ← (byte) $37 + [21] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:main::@return main::@return: scope:[main] from main::@6 @@ -339,9 +336,6 @@ main::@return: scope:[main] from main::@6 VARIABLE REGISTER WEIGHTS -(byte*) CHARGEN -(byte*) PROCPORT -(byte*) SCREEN (void()) main() (byte~) main::$1 202.0 (byte*) main::CHAR_A @@ -420,12 +414,12 @@ main: { .label c = 7 // asm { sei } sei - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -525,7 +519,7 @@ main: { jmp b6 // main::@6 b6: - // [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [21] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -539,18 +533,18 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) PROCPORT) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [13] *((byte*) main::sc#3) ← (byte) main::c#2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ( main:2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::y#2 main::y#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ main::bits#2 main::bits#0 main::bits#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::x#2 main::x#1 ] Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::y#2 main::y#1 ] -Statement [21] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [21] *((const byte*) PROCPORT) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) PROCPORT) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [13] *((byte*) main::sc#3) ← (byte) main::c#2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ( main:2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ) always clobbers reg byte y Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a -Statement [21] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [21] *((const byte*) PROCPORT) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::y#2 main::y#1 ] : zp ZP_BYTE:2 , reg byte x , Potential registers zp ZP_BYTE:3 [ main::bits#2 main::bits#0 main::bits#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , Potential registers zp ZP_WORD:4 [ main::sc#3 main::sc#7 main::sc#2 main::sc#1 ] : zp ZP_WORD:4 , @@ -602,12 +596,12 @@ main: { .label y = 2 // asm { sei } sei - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -700,7 +694,7 @@ main: { jmp b6 // main::@6 b6: - // [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [21] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -757,12 +751,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (byte~) main::$1 reg byte a 202.0 (label) main::@1 @@ -773,7 +764,7 @@ FINAL SYMBOL TABLE (label) main::@6 (label) main::@return (byte*) main::CHAR_A -(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN#0+(byte) 8 +(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN+(byte) 8 (byte) main::bits (byte) main::bits#0 bits zp ZP_BYTE:3 22.0 (byte) main::bits#1 bits zp ZP_BYTE:3 67.33333333333333 @@ -828,11 +819,11 @@ main: { // asm { sei } sei // *PROCPORT = $32 - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] - // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sc#7 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -919,7 +910,7 @@ main: { bne b1 // main::@6 // *PROCPORT = $37 - // [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [21] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm diff --git a/src/test/ref/chargen.sym b/src/test/ref/chargen.sym index 872bb521d..d3b6ba6a7 100644 --- a/src/test/ref/chargen.sym +++ b/src/test/ref/chargen.sym @@ -1,12 +1,9 @@ (label) @1 (label) @begin (label) @end -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (byte~) main::$1 reg byte a 202.0 (label) main::@1 @@ -17,7 +14,7 @@ (label) main::@6 (label) main::@return (byte*) main::CHAR_A -(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN#0+(byte) 8 +(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN+(byte) 8 (byte) main::bits (byte) main::bits#0 bits zp ZP_BYTE:3 22.0 (byte) main::bits#1 bits zp ZP_BYTE:3 67.33333333333333 diff --git a/src/test/ref/clobber-a-problem.cfg b/src/test/ref/clobber-a-problem.cfg index 1a502e71c..207a92c4c 100644 --- a/src/test/ref/clobber-a-problem.cfg +++ b/src/test/ref/clobber-a-problem.cfg @@ -21,7 +21,7 @@ main::@return: scope:[main] from main interrupt(HARDWARE_CLOBBER)(void()) irq() irq: scope:[irq] from - [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 + [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7 @@ -32,8 +32,8 @@ irq::@2: scope:[irq] from irq to:irq::@1 irq::@1: scope:[irq] from irq irq::@2 [13] (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 ) - [14] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2 - [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 + [14] *((const byte*) RASTER) ← (byte) irq::raster_next#2 + [15] *((const byte*) BORDERCOL) ← (const byte) BLACK to:irq::@return irq::@return: scope:[irq] from irq::@1 [16] return diff --git a/src/test/ref/clobber-a-problem.log b/src/test/ref/clobber-a-problem.log index 49d3aefb7..d90729971 100644 --- a/src/test/ref/clobber-a-problem.log +++ b/src/test/ref/clobber-a-problem.log @@ -6,10 +6,10 @@ Identified constant variable (byte) BLACK CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020 - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte) DARK_GREY#0 ← (number) $b - (byte) BLACK#0 ← (number) 0 + (byte*) BORDERCOL ← ((byte*)) (number) $d020 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte) DARK_GREY ← (number) $b + (byte) BLACK ← (number) 0 (void()**) KERNEL_IRQ ← ((void()**)) (number) $314 to:@1 @@ -28,7 +28,7 @@ main::@return: scope:[main] from main interrupt(HARDWARE_CLOBBER)(void()) irq() irq: scope:[irq] from (byte) irq_raster_next#3 ← phi( @2/(byte) irq_raster_next#5 ) - *((byte*) BORDERCOL#0) ← (byte) DARK_GREY#0 + *((byte*) BORDERCOL) ← (byte) DARK_GREY (byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (number) $15 (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 (number~) irq::$0 ← (byte) irq::raster_next#0 & (number) 7 @@ -39,8 +39,8 @@ irq: scope:[irq] from irq::@1: scope:[irq] from irq irq::@2 (byte) irq_raster_next#6 ← phi( irq/(byte) irq_raster_next#1 irq::@2/(byte) irq_raster_next#7 ) (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 ) - *((byte*) RASTER#0) ← (byte) irq::raster_next#2 - *((byte*) BORDERCOL#0) ← (byte) BLACK#0 + *((byte*) RASTER) ← (byte) irq::raster_next#2 + *((byte*) BORDERCOL) ← (byte) BLACK to:irq::@return irq::@2: scope:[irq] from irq (byte) irq_raster_next#7 ← phi( irq/(byte) irq_raster_next#1 ) @@ -67,14 +67,10 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) BLACK -(byte) BLACK#0 (byte*) BORDERCOL -(byte*) BORDERCOL#0 (byte) DARK_GREY -(byte) DARK_GREY#0 (void()**) KERNEL_IRQ (byte*) RASTER -(byte*) RASTER#0 interrupt(HARDWARE_CLOBBER)(void()) irq() (number~) irq::$0 (bool~) irq::$1 @@ -100,8 +96,8 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (void()*~) main::$0 (label) main::@return -Adding number conversion cast (unumber) $b in (byte) DARK_GREY#0 ← (number) $b -Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0 +Adding number conversion cast (unumber) $b in (byte) DARK_GREY ← (number) $b +Adding number conversion cast (unumber) 0 in (byte) BLACK ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) irq_raster_next#0 ← (number) 0 Adding number conversion cast (unumber) $15 in (byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (number) $15 Adding number conversion cast (unumber) 7 in (number~) irq::$0 ← (byte) irq::raster_next#0 & (number) 7 @@ -109,10 +105,10 @@ Adding number conversion cast (unumber) irq::$0 in (number~) irq::$0 ← (byte) Adding number conversion cast (unumber) 0 in (bool~) irq::$1 ← (unumber~) irq::$0 == (number) 0 Adding number conversion cast (unumber) 1 in (byte) irq::raster_next#1 ← (byte) irq::raster_next#3 - (number) 1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020 -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte) DARK_GREY#0 ← (unumber)(number) $b -Inlining cast (byte) BLACK#0 ← (unumber)(number) 0 +Inlining cast (byte*) BORDERCOL ← (byte*)(number) $d020 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte) DARK_GREY ← (unumber)(number) $b +Inlining cast (byte) BLACK ← (unumber)(number) 0 Inlining cast (void()**) KERNEL_IRQ ← (void()**)(number) $314 Inlining cast (byte) irq_raster_next#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -151,10 +147,10 @@ Simple Condition (bool~) irq::$2 [16] if((byte~) irq::$0!=(byte) 0) goto irq::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [5] (void()*~) main::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) irq() Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) BORDERCOL#0 = (byte*) 53280 -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte) DARK_GREY#0 = $b -Constant (const byte) BLACK#0 = 0 +Constant (const byte*) BORDERCOL = (byte*) 53280 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte) DARK_GREY = $b +Constant (const byte) BLACK = 0 Constant (const void()**) KERNEL_IRQ = (void()**) 788 Constant (const void()*) main::$0 = &irq Successful SSA optimization Pass2ConstantIdentification @@ -202,7 +198,7 @@ main::@return: scope:[main] from main interrupt(HARDWARE_CLOBBER)(void()) irq() irq: scope:[irq] from - [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 + [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7 @@ -213,8 +209,8 @@ irq::@2: scope:[irq] from irq to:irq::@1 irq::@1: scope:[irq] from irq irq::@2 [13] (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 ) - [14] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2 - [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 + [14] *((const byte*) RASTER) ← (byte) irq::raster_next#2 + [15] *((const byte*) BORDERCOL) ← (const byte) BLACK to:irq::@return irq::@return: scope:[irq] from irq::@1 [16] return @@ -222,10 +218,6 @@ irq::@return: scope:[irq] from irq::@1 VARIABLE REGISTER WEIGHTS -(byte) BLACK -(byte*) BORDERCOL -(byte) DARK_GREY -(byte*) RASTER interrupt(HARDWARE_CLOBBER)(void()) irq() (byte~) irq::$0 4.0 (byte) irq::raster_next @@ -304,7 +296,7 @@ irq: { sta rega+1 stx regx+1 sty regy+1 - // [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY -- _deref_pbuc1=vbuc2 lda #DARK_GREY sta BORDERCOL // [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 @@ -335,10 +327,10 @@ irq: { jmp b1 // irq::@1 b1: - // [14] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) RASTER) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuz1 lda.z raster_next sta RASTER - // [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + // [15] *((const byte*) BORDERCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta BORDERCOL jmp breturn @@ -358,9 +350,9 @@ irq: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] (byte) irq_raster_next#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a Statement [5] *((const void()**) KERNEL_IRQ) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 [ irq_raster_next#0 ] ( [ irq_raster_next#0 ] ) always clobbers reg byte a +Statement [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY [ irq_raster_next#0 ] ( [ irq_raster_next#0 ] ) always clobbers reg byte a Statement [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_raster_next#1 ] ( [ irq_raster_next#1 ] ) always clobbers reg byte a reg byte x -Statement [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a +Statement [15] *((const byte*) BORDERCOL) ← (const byte) BLACK [ ] ( [ ] ) always clobbers reg byte a Statement [16] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y Potential registers zp ZP_BYTE:2 [ irq::raster_next#2 irq::raster_next#0 irq::raster_next#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ irq_raster_next#0 irq_raster_next#1 ] : zp ZP_BYTE:3 , @@ -433,7 +425,7 @@ irq: { // entry interrupt(HARDWARE_CLOBBER) sta rega+1 stx regx+1 - // [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY -- _deref_pbuc1=vbuc2 lda #DARK_GREY sta BORDERCOL // [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1 @@ -461,9 +453,9 @@ irq: { jmp b1 // irq::@1 b1: - // [14] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuxx + // [14] *((const byte*) RASTER) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuxx stx RASTER - // [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + // [15] *((const byte*) BORDERCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta BORDERCOL jmp breturn @@ -510,15 +502,11 @@ FINAL SYMBOL TABLE (label) @2 (label) @begin (label) @end -(byte) BLACK -(const byte) BLACK#0 BLACK = (byte) 0 -(byte*) BORDERCOL -(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 -(byte) DARK_GREY -(const byte) DARK_GREY#0 DARK_GREY = (byte) $b +(const byte) BLACK BLACK = (byte) 0 +(const byte*) BORDERCOL BORDERCOL = (byte*) 53280 +(const byte) DARK_GREY DARK_GREY = (byte) $b (const void()**) KERNEL_IRQ KERNEL_IRQ = (void()**) 788 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 +(const byte*) RASTER RASTER = (byte*) 53266 interrupt(HARDWARE_CLOBBER)(void()) irq() (byte~) irq::$0 reg byte a 4.0 (label) irq::@1 @@ -587,7 +575,7 @@ irq: { sta rega+1 stx regx+1 // *BORDERCOL = DARK_GREY - // [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) BORDERCOL) ← (const byte) DARK_GREY -- _deref_pbuc1=vbuc2 lda #DARK_GREY sta BORDERCOL // irq_raster_next += 21 @@ -615,10 +603,10 @@ irq: { // irq::@1 b1: // *RASTER = raster_next - // [14] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuxx + // [14] *((const byte*) RASTER) ← (byte) irq::raster_next#2 -- _deref_pbuc1=vbuxx stx RASTER // *BORDERCOL = BLACK - // [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + // [15] *((const byte*) BORDERCOL) ← (const byte) BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta BORDERCOL // irq::@return diff --git a/src/test/ref/clobber-a-problem.sym b/src/test/ref/clobber-a-problem.sym index 13cfe8cb0..3943c56f7 100644 --- a/src/test/ref/clobber-a-problem.sym +++ b/src/test/ref/clobber-a-problem.sym @@ -2,15 +2,11 @@ (label) @2 (label) @begin (label) @end -(byte) BLACK -(const byte) BLACK#0 BLACK = (byte) 0 -(byte*) BORDERCOL -(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 -(byte) DARK_GREY -(const byte) DARK_GREY#0 DARK_GREY = (byte) $b +(const byte) BLACK BLACK = (byte) 0 +(const byte*) BORDERCOL BORDERCOL = (byte*) 53280 +(const byte) DARK_GREY DARK_GREY = (byte) $b (const void()**) KERNEL_IRQ KERNEL_IRQ = (void()**) 788 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 +(const byte*) RASTER RASTER = (byte*) 53266 interrupt(HARDWARE_CLOBBER)(void()) irq() (byte~) irq::$0 reg byte a 4.0 (label) irq::@1 diff --git a/src/test/ref/comma-decl.cfg b/src/test/ref/comma-decl.cfg index cce8912d3..34cb1106f 100644 --- a/src/test/ref/comma-decl.cfg +++ b/src/test/ref/comma-decl.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::b [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c#0 [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::d#0 to:main::@return diff --git a/src/test/ref/comma-decl.log b/src/test/ref/comma-decl.log index 20140f382..91239caf6 100644 --- a/src/test/ref/comma-decl.log +++ b/src/test/ref/comma-decl.log @@ -7,12 +7,12 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte*) main::SCREEN ← ((byte*)) (number) $400 - (byte) main::b#0 ← (byte) 'c' - (number~) main::$0 ← (byte) main::b#0 + (number) 1 + (byte) main::b ← (byte) 'c' + (number~) main::$0 ← (byte) main::b + (number) 1 (byte) main::c#0 ← (number~) main::$0 (number~) main::$1 ← (byte) main::c#0 + (number) 1 (byte) main::d#0 ← (number~) main::$1 - *((byte*) main::SCREEN + (number) 0) ← (byte) main::b#0 + *((byte*) main::SCREEN + (number) 0) ← (byte) main::b *((byte*) main::SCREEN + (number) 1) ← (byte) main::c#0 *((byte*) main::SCREEN + (number) 2) ← (byte) main::d#0 to:main::@return @@ -37,17 +37,16 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte) main::b -(byte) main::b#0 (byte) main::c (byte) main::c#0 (byte) main::d (byte) main::d#0 -Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::b#0 + (number) 1 -Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::b + (number) 1 +Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (byte) main::c#0 + (number) 1 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::c#0 + (unumber)(number) 1 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::b#0 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::b Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::c#0 Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::d#0 Successful SSA optimization PassNAddNumberTypeConversions @@ -66,19 +65,19 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b#0 + (byte) 1 +Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b + (byte) 1 Inferred type updated to byte in (unumber~) main::$1 ← (byte) main::c#0 + (byte) 1 Alias (byte) main::c#0 = (byte~) main::$0 Alias (byte) main::d#0 = (byte~) main::$1 Successful SSA optimization Pass2AliasElimination Constant (const byte*) main::SCREEN = (byte*) 1024 -Constant (const byte) main::b#0 = 'c' +Constant (const byte) main::b = 'c' Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::b#0 +Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::b Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (byte) main::c#0 ← (const byte) main::b#0 + (byte) 1 +Constant right-side identified [0] (byte) main::c#0 ← (const byte) main::b + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::c#0 = main::b#0+1 +Constant (const byte) main::c#0 = main::b+1 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (byte) main::d#0 ← (const byte) main::c#0 + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -114,7 +113,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::b [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c#0 [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::d#0 to:main::@return @@ -125,7 +124,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b (byte) main::c (byte) main::d @@ -161,7 +159,7 @@ main: { .const b = 'c' .const c = b+1 .const d = c+1 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c#0 -- _deref_pbuc1=vbuc2 @@ -179,7 +177,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::b [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::d#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -218,7 +216,7 @@ main: { .const b = 'c' .const c = b+1 .const d = c+1 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c#0 -- _deref_pbuc1=vbuc2 @@ -260,10 +258,9 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::b -(const byte) main::b#0 b = (byte) 'c' +(const byte) main::b b = (byte) 'c' (byte) main::c -(const byte) main::c#0 c = (const byte) main::b#0+(byte) 1 +(const byte) main::c#0 c = (const byte) main::b+(byte) 1 (byte) main::d (const byte) main::d#0 d = (const byte) main::c#0+(byte) 1 @@ -292,7 +289,7 @@ main: { .const c = b+1 .const d = c+1 // SCREEN[0] = b - // [4] *((const byte*) main::SCREEN) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // SCREEN[1] = c diff --git a/src/test/ref/comma-decl.sym b/src/test/ref/comma-decl.sym index baf7f58cf..bda7a54fa 100644 --- a/src/test/ref/comma-decl.sym +++ b/src/test/ref/comma-decl.sym @@ -4,10 +4,9 @@ (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::b -(const byte) main::b#0 b = (byte) 'c' +(const byte) main::b b = (byte) 'c' (byte) main::c -(const byte) main::c#0 c = (const byte) main::b#0+(byte) 1 +(const byte) main::c#0 c = (const byte) main::b+(byte) 1 (byte) main::d (const byte) main::d#0 d = (const byte) main::c#0+(byte) 1 diff --git a/src/test/ref/comma-expr-1.log b/src/test/ref/comma-expr-1.log index 00bfa277e..784e546cb 100644 --- a/src/test/ref/comma-expr-1.log +++ b/src/test/ref/comma-expr-1.log @@ -7,8 +7,8 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte*) main::SCREEN ← ((byte*)) (number) $400 - (byte) main::b#0 ← (number) 3 - (number~) main::$0 ← (byte) main::b#0 + (number) 1 + (byte) main::b ← (number) 3 + (number~) main::$0 ← (byte) main::b + (number) 1 (byte) main::c#0 ← (number~) main::$0 *((byte*) main::SCREEN + (number) 0) ← (byte) main::c#0 to:main::@return @@ -32,17 +32,16 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte) main::b -(byte) main::b#0 (byte) main::c (byte) main::c#0 -Adding number conversion cast (unumber) 3 in (byte) main::b#0 ← (number) 3 -Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::b#0 + (number) 1 -Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 3 in (byte) main::b ← (number) 3 +Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::b + (number) 1 +Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b + (unumber)(number) 1 Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::c#0 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 -Inlining cast (byte) main::b#0 ← (unumber)(number) 3 +Inlining cast (byte) main::b ← (unumber)(number) 3 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 3 @@ -53,17 +52,17 @@ Finalized unsigned number type (byte) 3 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b#0 + (byte) 1 +Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b + (byte) 1 Alias (byte) main::c#0 = (byte~) main::$0 Successful SSA optimization Pass2AliasElimination Constant (const byte*) main::SCREEN = (byte*) 1024 -Constant (const byte) main::b#0 = 3 +Constant (const byte) main::b = 3 Successful SSA optimization Pass2ConstantIdentification Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::c#0 Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (byte) main::c#0 ← (const byte) main::b#0 + (byte) 1 +Constant right-side identified [0] (byte) main::c#0 ← (const byte) main::b + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::c#0 = main::b#0+1 +Constant (const byte) main::c#0 = main::b+1 Successful SSA optimization Pass2ConstantIdentification Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -101,7 +100,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b (byte) main::c Initial phi equivalence classes @@ -219,10 +217,9 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::b -(const byte) main::b#0 b = (byte) 3 +(const byte) main::b b = (byte) 3 (byte) main::c -(const byte) main::c#0 c = (const byte) main::b#0+(byte) 1 +(const byte) main::c#0 c = (const byte) main::b+(byte) 1 diff --git a/src/test/ref/comma-expr-1.sym b/src/test/ref/comma-expr-1.sym index 5981697e3..0364e7ed9 100644 --- a/src/test/ref/comma-expr-1.sym +++ b/src/test/ref/comma-expr-1.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::b -(const byte) main::b#0 b = (byte) 3 +(const byte) main::b b = (byte) 3 (byte) main::c -(const byte) main::c#0 c = (const byte) main::b#0+(byte) 1 +(const byte) main::c#0 c = (const byte) main::b+(byte) 1 diff --git a/src/test/ref/complex/clearscreen/clearscreen.cfg b/src/test/ref/complex/clearscreen/clearscreen.cfg index 9f0511b1d..c85566354 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.cfg +++ b/src/test/ref/complex/clearscreen/clearscreen.cfg @@ -447,7 +447,7 @@ atan2_16::@1: scope:[atan2_16] from atan2_16 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @3 - [243] (byte*) heap_head#5 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 ) + [243] (byte*) heap_head#5 ← phi( @1/(const byte*) HEAP_TOP @3/(byte*) heap_head#1 ) [244] (byte*) malloc::mem#0 ← (byte*) heap_head#5 - (word) $3e8 [245] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return diff --git a/src/test/ref/complex/clearscreen/clearscreen.log b/src/test/ref/complex/clearscreen/clearscreen.log index 8d2d305bc..a15a7912c 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.log +++ b/src/test/ref/complex/clearscreen/clearscreen.log @@ -188,8 +188,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@15 (void*()) malloc((word) malloc::size) @@ -1381,7 +1381,6 @@ SYMBOL TABLE SSA (bool) DEBUG (void()**) HARDWARE_IRQ (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (byte*) IRQ_ENABLE (byte) IRQ_RASTER (byte*) IRQ_STATUS @@ -2465,7 +2464,7 @@ Adding number conversion cast (unumber) $80 in *((byte*) VIC_CONTROL) ← *((byt Adding number conversion cast (unumber) $30 in (byte) RASTER_IRQ_TOP ← (number) $30 Adding number conversion cast (unumber) $ff in (byte) RASTER_IRQ_MIDDLE ← (number) $ff Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (byte) CORDIC_ITERATIONS_16 ← (unumber)(number) $f Inlining cast (word) atan2_16::angle#0 ← (unumber)(number) 0 @@ -2843,7 +2842,7 @@ Inversing boolean not [290] (bool~) startProcessing::$26 ← *((byte*) startProc Inversing boolean not [397] (bool~) processChars::$5 ← *((byte*) processChars::$41) == (const byte) STATUS_FREE from [396] (bool~) processChars::$4 ← *((byte*) processChars::$41) != (const byte) STATUS_FREE Inversing boolean not [406] (bool~) processChars::$7 ← *((byte*) processChars::$42) != (const byte) STATUS_NEW from [405] (bool~) processChars::$6 ← *((byte*) processChars::$42) == (const byte) STATUS_NEW Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#11 (byte*) heap_head#10 (byte*) heap_head#9 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#11 (byte*) heap_head#10 (byte*) heap_head#9 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#4 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#6 (byte*) heap_head#2 @@ -3121,7 +3120,7 @@ Constant right-side identified [195] (void()*) setupRasterIrq::irqRoutine#0 ← Constant right-side identified [590] (void()*~) irqTop::$1 ← & interrupt(HARDWARE_ALL)(void()) irqBottom() Constant right-side identified [623] (void()*~) irqBottom::$3 ← & interrupt(HARDWARE_ALL)(void()) irqTop() Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const byte) CORDIC_ITERATIONS_16 = $f Constant (const word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; imalloc] malloc_from_b1: - // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#0] -- pbuz1=pbuc1 + // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP [phi:@1->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -8308,7 +8306,7 @@ b1: // [2] call malloc // [243] phi from @1 to malloc [phi:@1->malloc] malloc_from_b1: - // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#0] -- pbuz1=pbuc1 + // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP [phi:@1->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -10522,8 +10520,7 @@ FINAL SYMBOL TABLE }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const void()**) HARDWARE_IRQ HARDWARE_IRQ = (void()**) 65534 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte*) IRQ_ENABLE IRQ_ENABLE = (byte*) 53274 (const byte) IRQ_RASTER IRQ_RASTER = (byte) 1 (const byte*) IRQ_STATUS IRQ_STATUS = (byte*) 53273 @@ -11146,7 +11143,7 @@ bbegin: // malloc(1000) // [2] call malloc // [243] phi from @1 to malloc [phi:@1->malloc] - // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#0] -- pbuz1=pbuc1 + // [243] phi (byte*) heap_head#5 = (const byte*) HEAP_TOP [phi:@1->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP diff --git a/src/test/ref/complex/clearscreen/clearscreen.sym b/src/test/ref/complex/clearscreen/clearscreen.sym index 131124279..a12dac505 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.sym +++ b/src/test/ref/complex/clearscreen/clearscreen.sym @@ -17,8 +17,7 @@ }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const void()**) HARDWARE_IRQ HARDWARE_IRQ = (void()**) 65534 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte*) IRQ_ENABLE IRQ_ENABLE = (byte*) 53274 (const byte) IRQ_RASTER IRQ_RASTER = (byte) 1 (const byte*) IRQ_STATUS IRQ_STATUS = (byte*) 53273 diff --git a/src/test/ref/complex/medusa/medusa.cfg b/src/test/ref/complex/medusa/medusa.cfg index 062c3ead1..517748f55 100644 --- a/src/test/ref/complex/medusa/medusa.cfg +++ b/src/test/ref/complex/medusa/medusa.cfg @@ -18,12 +18,12 @@ main::@2: scope:[main] from main [7] call memcpy to:main::@1 main::@1: scope:[main] from main::@1 main::@2 - [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e + [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e to:main::@1 (void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) memcpy: scope:[memcpy] from main main::@2 - [9] (void*) memcpy::destination#2 ← phi( main/(void*)(const byte*) SCREEN#0 main::@2/(void*)(const byte*) COLS ) + [9] (void*) memcpy::destination#2 ← phi( main/(void*)(const byte*) SCREEN main::@2/(void*)(const byte*) COLS ) [9] (void*) memcpy::source#2 ← phi( main/(void*)(const byte[$3e8]) MEDUSA_SCREEN main::@2/(void*)(const byte[]) MEDUSA_COLORS ) [10] (byte*) memcpy::src_end#0 ← (byte*)(void*) memcpy::source#2 + (word) $3e8 [11] (byte*~) memcpy::src#4 ← (byte*)(void*) memcpy::source#2 diff --git a/src/test/ref/complex/medusa/medusa.log b/src/test/ref/complex/medusa/medusa.log index a530650ae..a59770af5 100644 --- a/src/test/ref/complex/medusa/medusa.log +++ b/src/test/ref/complex/medusa/medusa.log @@ -68,13 +68,13 @@ memcpy::@return: scope:[memcpy] from memcpy::@3 (byte[]) MEDUSA_COLORS ← kickasm {{ .var fileCols = LoadBinary("medusac.prg", BF_C64FILE) .fill fileCols.getSize(), fileCols.get(i) }} - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@9 (void()) main() main: scope:[main] from @9 *((byte*) BGCOL) ← (byte) BLACK - (void*) memcpy::destination#0 ← (void*)(byte*) SCREEN#0 + (void*) memcpy::destination#0 ← (void*)(byte*) SCREEN (void*) memcpy::source#0 ← (void*)(byte[$3e8]) MEDUSA_SCREEN (word) memcpy::num#0 ← (number) $3e8 call memcpy @@ -93,7 +93,7 @@ main::@1: scope:[main] from main::@2 main::@8 if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*~) main::$2 ← (byte*) SCREEN#0 + (number) $3e7 + (byte*~) main::$2 ← (byte*) SCREEN + (number) $3e7 *((byte*~) main::$2) ← *((byte*~) main::$2) ^ (number) $e to:main::@1 main::@return: scope:[main] from main::@1 @@ -118,7 +118,6 @@ SYMBOL TABLE SSA (byte[]) MEDUSA_COLORS (byte[$3e8]) MEDUSA_SCREEN (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$2 (label) main::@1 @@ -173,7 +172,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) BLACK ← (number) 0 Adding number conversion cast (unumber) $3e8 in (word) memcpy::num#0 ← (number) $3e8 Adding number conversion cast (unumber) $3e8 in (word) memcpy::num#1 ← (number) $3e8 -Adding number conversion cast (unumber) $3e7 in (byte*~) main::$2 ← (byte*) SCREEN#0 + (number) $3e7 +Adding number conversion cast (unumber) $3e7 in (byte*~) main::$2 ← (byte*) SCREEN + (number) $3e7 Adding number conversion cast (unumber) $e in *((byte*~) main::$2) ← *((byte*~) main::$2) ^ (number) $e Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 @@ -182,7 +181,7 @@ Inlining cast (byte) BLACK ← (unumber)(number) 0 Inlining cast (byte*) memcpy::src#0 ← (byte*)(void*) memcpy::source#2 Inlining cast (byte*) memcpy::dst#0 ← (byte*)(void*) memcpy::destination#2 Inlining cast (byte*~) memcpy::$0 ← (byte*)(void*) memcpy::source#2 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) memcpy::num#0 ← (unumber)(number) $3e8 Inlining cast (word) memcpy::num#1 ← (unumber)(number) $3e8 Successful SSA optimization Pass2InlineCast @@ -221,11 +220,11 @@ Constant (const byte[$3e8]) MEDUSA_SCREEN = kickasm {{ .var fileScreen = LoadBin Constant (const byte[]) MEDUSA_COLORS = kickasm {{ .var fileCols = LoadBinary("medusac.prg", BF_C64FILE) .fill fileCols.getSize(), fileCols.get(i) }} -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const word) memcpy::num#0 = $3e8 Constant (const word) memcpy::num#1 = $3e8 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (void*)SCREEN#0 in [25] (void*) memcpy::destination#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)SCREEN in [25] (void*) memcpy::destination#0 ← (void*)(const byte*) SCREEN Constant value identified (void*)MEDUSA_SCREEN in [26] (void*) memcpy::source#0 ← (void*)(const byte[$3e8]) MEDUSA_SCREEN Constant value identified (void*)COLS in [30] (void*) memcpy::destination#1 ← (void*)(const byte*) COLS Constant value identified (void*)MEDUSA_COLORS in [31] (void*) memcpy::source#1 ← (void*)(const byte[]) MEDUSA_COLORS @@ -237,13 +236,13 @@ Eliminating unused variable (void*) memcpy::return#3 and assignment [19] (void*) Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [18] (byte*~) main::$2 ← (const byte*) SCREEN#0 + (word) $3e7 +Constant right-side identified [18] (byte*~) main::$2 ← (const byte*) SCREEN + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const void*) memcpy::destination#0 = (void*)SCREEN#0 +Constant (const void*) memcpy::destination#0 = (void*)SCREEN Constant (const void*) memcpy::source#0 = (void*)MEDUSA_SCREEN Constant (const void*) memcpy::destination#1 = (void*)COLS Constant (const void*) memcpy::source#1 = (void*)MEDUSA_COLORS -Constant (const byte*) main::$2 = SCREEN#0+$3e7 +Constant (const byte*) main::$2 = SCREEN+$3e7 Successful SSA optimization Pass2ConstantIdentification Inlining Noop Cast [1] (byte*) memcpy::src#0 ← (byte*)(void*) memcpy::source#2 keeping memcpy::source#2 Inlining Noop Cast [2] (byte*) memcpy::dst#0 ← (byte*)(void*) memcpy::destination#2 keeping memcpy::destination#2 @@ -258,8 +257,8 @@ Inlining constant with var siblings (const void*) memcpy::source#1 Constant inlined memcpy::num#1 = (word) $3e8 Constant inlined memcpy::num#0 = (word) $3e8 Constant inlined memcpy::source#1 = (void*)(const byte[]) MEDUSA_COLORS -Constant inlined main::$2 = (const byte*) SCREEN#0+(word) $3e7 -Constant inlined memcpy::destination#0 = (void*)(const byte*) SCREEN#0 +Constant inlined main::$2 = (const byte*) SCREEN+(word) $3e7 +Constant inlined memcpy::destination#0 = (void*)(const byte*) SCREEN Constant inlined memcpy::destination#1 = (void*)(const byte*) COLS Constant inlined memcpy::source#0 = (void*)(const byte[$3e8]) MEDUSA_SCREEN Successful SSA optimization Pass2ConstantInlining @@ -316,12 +315,12 @@ main::@2: scope:[main] from main [7] call memcpy to:main::@1 main::@1: scope:[main] from main::@1 main::@2 - [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e + [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e to:main::@1 (void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) memcpy: scope:[memcpy] from main main::@2 - [9] (void*) memcpy::destination#2 ← phi( main/(void*)(const byte*) SCREEN#0 main::@2/(void*)(const byte*) COLS ) + [9] (void*) memcpy::destination#2 ← phi( main/(void*)(const byte*) SCREEN main::@2/(void*)(const byte*) COLS ) [9] (void*) memcpy::source#2 ← phi( main/(void*)(const byte[$3e8]) MEDUSA_SCREEN main::@2/(void*)(const byte[]) MEDUSA_COLORS ) [10] (byte*) memcpy::src_end#0 ← (byte*)(void*) memcpy::source#2 + (word) $3e8 [11] (byte*~) memcpy::src#4 ← (byte*)(void*) memcpy::source#2 @@ -343,7 +342,6 @@ memcpy::@2: scope:[memcpy] from memcpy::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num) (void*) memcpy::destination @@ -419,7 +417,7 @@ main: { // [5] call memcpy // [9] phi from main to memcpy [phi:main->memcpy] memcpy_from_main: - // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN#0 [phi:main->memcpy#0] -- pvoz1=pvoc1 + // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN [phi:main->memcpy#0] -- pvoz1=pvoc1 lda #SCREEN @@ -452,7 +450,7 @@ main: { jmp b1 // main::@1 b1: - // [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 + // [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 lda #$e eor SCREEN+$3e7 sta SCREEN+$3e7 @@ -537,7 +535,7 @@ MEDUSA_COLORS: REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) BGCOL) ← (const byte) BLACK [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [10] (byte*) memcpy::src_end#0 ← (byte*)(void*) memcpy::source#2 + (word) $3e8 [ memcpy::source#2 memcpy::destination#2 memcpy::src_end#0 ] ( main:2::memcpy:5 [ memcpy::source#2 memcpy::destination#2 memcpy::src_end#0 ] main:2::memcpy:7 [ memcpy::source#2 memcpy::destination#2 memcpy::src_end#0 ] ) always clobbers reg byte a Statement [11] (byte*~) memcpy::src#4 ← (byte*)(void*) memcpy::source#2 [ memcpy::destination#2 memcpy::src_end#0 memcpy::src#4 ] ( main:2::memcpy:5 [ memcpy::destination#2 memcpy::src_end#0 memcpy::src#4 ] main:2::memcpy:7 [ memcpy::destination#2 memcpy::src_end#0 memcpy::src#4 ] ) always clobbers reg byte a Statement [12] (byte*~) memcpy::dst#4 ← (byte*)(void*) memcpy::destination#2 [ memcpy::src_end#0 memcpy::src#4 memcpy::dst#4 ] ( main:2::memcpy:5 [ memcpy::src_end#0 memcpy::src#4 memcpy::dst#4 ] main:2::memcpy:7 [ memcpy::src_end#0 memcpy::src#4 memcpy::dst#4 ] ) always clobbers reg byte a @@ -598,7 +596,7 @@ main: { // [5] call memcpy // [9] phi from main to memcpy [phi:main->memcpy] memcpy_from_main: - // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN#0 [phi:main->memcpy#0] -- pvoz1=pvoc1 + // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN [phi:main->memcpy#0] -- pvoz1=pvoc1 lda #SCREEN @@ -631,7 +629,7 @@ main: { jmp b1 // main::@1 b1: - // [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 + // [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 lda #$e eor SCREEN+$3e7 sta SCREEN+$3e7 @@ -749,8 +747,7 @@ FINAL SYMBOL TABLE (const byte[$3e8]) MEDUSA_SCREEN MEDUSA_SCREEN = kickasm {{ .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE) .fill fileScreen.getSize(), fileScreen.get(i) }} -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -812,7 +809,7 @@ main: { // memcpy(SCREEN, MEDUSA_SCREEN, 1000) // [5] call memcpy // [9] phi from main to memcpy [phi:main->memcpy] - // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN#0 [phi:main->memcpy#0] -- pvoz1=pvoc1 + // [9] phi (void*) memcpy::destination#2 = (void*)(const byte*) SCREEN [phi:main->memcpy#0] -- pvoz1=pvoc1 lda #SCREEN @@ -842,7 +839,7 @@ main: { // main::@1 b1: // (*(SCREEN+999)) ^= 0x0e - // [8] *((const byte*) SCREEN#0+(word) $3e7) ← *((const byte*) SCREEN#0+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 + // [8] *((const byte*) SCREEN+(word) $3e7) ← *((const byte*) SCREEN+(word) $3e7) ^ (byte) $e -- _deref_pbuc1=_deref_pbuc1_bxor_vbuc2 lda #$e eor SCREEN+$3e7 sta SCREEN+$3e7 diff --git a/src/test/ref/complex/medusa/medusa.sym b/src/test/ref/complex/medusa/medusa.sym index 1961e1b30..07e7991b0 100644 --- a/src/test/ref/complex/medusa/medusa.sym +++ b/src/test/ref/complex/medusa/medusa.sym @@ -10,8 +10,7 @@ (const byte[$3e8]) MEDUSA_SCREEN MEDUSA_SCREEN = kickasm {{ .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE) .fill fileScreen.getSize(), fileScreen.get(i) }} -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/complex/tetris/test-sprites.cfg b/src/test/ref/complex/tetris/test-sprites.cfg index 3e7cc0686..8eaee7ad4 100644 --- a/src/test/ref/complex/tetris/test-sprites.cfg +++ b/src/test/ref/complex/tetris/test-sprites.cfg @@ -31,7 +31,7 @@ toSpritePtr1: scope:[] from @2 [7] (byte) irq_cnt#0 ← (byte) 0 to:@3 @3: scope:[] from @5 - kickasm(location (const byte*) SIN_SPRITE#0) {{ .fill $40, $ff + kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff }} to:@4 @4: scope:[] from @3 diff --git a/src/test/ref/complex/tetris/test-sprites.log b/src/test/ref/complex/tetris/test-sprites.log index 9a34141df..db8610e5d 100644 --- a/src/test/ref/complex/tetris/test-sprites.log +++ b/src/test/ref/complex/tetris/test-sprites.log @@ -333,8 +333,8 @@ sprites_irq::@return: scope:[sprites_irq] from sprites_irq::@6 .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2 } }} - (byte*) SIN_SPRITE#0 ← ((byte*)) (number) $2800 - kickasm(location (byte*) SIN_SPRITE#0) {{ .fill $40, $ff + (byte*) SIN_SPRITE ← ((byte*)) (number) $2800 + kickasm(location (byte*) SIN_SPRITE) {{ .fill $40, $ff }} (byte) sin_idx#0 ← (number) 0 to:@9 @@ -420,7 +420,7 @@ main::@1: scope:[main] from main::@5 main::@6 *((byte*) SPRITES_YPOS + (byte) main::s2#0) ← (byte) main::ypos#2 (number~) main::$6 ← (byte) main::s#2 - (number) 3 *((byte*) SPRITES_COLS + (byte) main::s#2) ← (number~) main::$6 - (byte*) main::toSpritePtr2_sprite#0 ← (byte*) SIN_SPRITE#0 + (byte*) main::toSpritePtr2_sprite#0 ← (byte*) SIN_SPRITE to:main::toSpritePtr2 main::toSpritePtr2: scope:[main] from main::@1 (byte) sin_idx#21 ← phi( main::@1/(byte) sin_idx#22 ) @@ -565,7 +565,6 @@ SYMBOL TABLE SSA (byte*) RASTER (byte[$100]) SIN (byte*) SIN_SPRITE -(byte*) SIN_SPRITE#0 (byte*) SPRITES_COLS (byte*) SPRITES_ENABLE (byte*) SPRITES_EXPAND_X @@ -1022,7 +1021,7 @@ Inlining cast (byte) irq_cnt#0 ← (unumber)(number) 0 Inlining cast (word~) sprites_irq::toSpritePtr2_$0 ← (word)(byte*) sprites_irq::toSpritePtr2_sprite#1 Inlining cast (byte~) sprites_irq::toSpritePtr2_$2 ← (byte)(unumber~) sprites_irq::toSpritePtr2_$1 Inlining cast (byte) irq_cnt#2 ← (unumber)(number) 0 -Inlining cast (byte*) SIN_SPRITE#0 ← (byte*)(number) $2800 +Inlining cast (byte*) SIN_SPRITE ← (byte*)(number) $2800 Inlining cast (byte) sin_idx#0 ← (unumber)(number) 0 Inlining cast *((byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3 Inlining cast (word~) main::vicSelectGfxBank1_toDd001_$0 ← (word)(byte*) main::vicSelectGfxBank1_toDd001_gfx#1 @@ -1348,7 +1347,7 @@ Constant (const byte[$100]) SIN = kickasm {{ .var AMPL = 200-21 .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2 } }} -Constant (const byte*) SIN_SPRITE#0 = (byte*) 10240 +Constant (const byte*) SIN_SPRITE = (byte*) 10240 Constant (const byte) sin_idx#0 = 0 Constant (const byte) main::xpos#0 = $18 Constant (const byte) main::ypos#0 = $32 @@ -1359,7 +1358,7 @@ Constant (const byte*) sprites_irq::toSpritePtr2_sprite#0 = PLAYFIELD_SPRITES Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = PLAYFIELD_SCREEN_1 Constant (const byte*) main::toD0181_screen#0 = PLAYFIELD_SCREEN_1 Constant (const byte*) main::toD0181_gfx#0 = PLAYFIELD_CHARSET -Constant (const byte*) main::toSpritePtr2_sprite#0 = SIN_SPRITE#0 +Constant (const byte*) main::toSpritePtr2_sprite#0 = SIN_SPRITE Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)PLAYFIELD_SPRITES in [60] (word~) toSpritePtr1_$0 ← (word)(const byte*) PLAYFIELD_SPRITES Constant value identified (word)sprites_irq::toSpritePtr2_sprite#0 in [123] (word~) sprites_irq::toSpritePtr2_$0 ← (word)(const byte*) sprites_irq::toSpritePtr2_sprite#0 @@ -1505,7 +1504,7 @@ Constant inlined sprites_irq::toSpritePtr2_$2 = (byte)(word)(const byte*) PLAYFI Constant inlined sprites_irq::$5 = (const byte) sprites_irq::toSpritePtr2_return#0 Constant inlined sprites_irq::toSpritePtr2_$1 = (word)(const byte*) PLAYFIELD_SPRITES/(byte) $40 Constant inlined sprites_init::xpos#0 = (byte)(number) $18+(number) $f*(number) 8 -Constant inlined main::toSpritePtr2_sprite#0 = (const byte*) SIN_SPRITE#0 +Constant inlined main::toSpritePtr2_sprite#0 = (const byte*) SIN_SPRITE Constant inlined sprites_irq::toSpritePtr2_$0 = (word)(const byte*) PLAYFIELD_SPRITES Constant inlined $3 = (const byte) SPRITES_FIRST_YPOS+(byte) $13 Constant inlined $4 = (const byte) SPRITES_FIRST_YPOS+(byte) $15 @@ -1517,9 +1516,9 @@ Constant inlined sprites_init::s#0 = (byte) 0 Constant inlined main::xpos#0 = (byte) $18 Constant inlined main::s#0 = (byte) 4 Constant inlined main::toD0181_$7 = >(word)(const byte*) PLAYFIELD_CHARSET/(byte) 4&(byte) $f -Constant inlined main::toSpritePtr2_$1 = (word)(const byte*) SIN_SPRITE#0/(byte) $40 +Constant inlined main::toSpritePtr2_$1 = (word)(const byte*) SIN_SPRITE/(byte) $40 Constant inlined sprites_irq_init::$0 = &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() -Constant inlined main::toSpritePtr2_$0 = (word)(const byte*) SIN_SPRITE#0 +Constant inlined main::toSpritePtr2_$0 = (word)(const byte*) SIN_SPRITE Constant inlined main::toD0181_$2 = (word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff*(byte) 4 Constant inlined main::toD0181_$1 = (word)(const byte*) PLAYFIELD_SCREEN_1&(word) $3fff Constant inlined main::toD0181_$0 = (word)(const byte*) PLAYFIELD_SCREEN_1 @@ -1671,7 +1670,7 @@ toSpritePtr1: scope:[] from @2 [7] (byte) irq_cnt#0 ← (byte) 0 to:@3 @3: scope:[] from @5 - kickasm(location (const byte*) SIN_SPRITE#0) {{ .fill $40, $ff + kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff }} to:@4 @4: scope:[] from @3 @@ -1877,7 +1876,6 @@ sprites_irq::@1: scope:[sprites_irq] from sprites_irq::@9 VARIABLE REGISTER WEIGHTS -(byte*) SIN_SPRITE (byte) irq_cnt (byte) irq_cnt#0 0.17391304347826086 (byte) irq_cnt#1 1.0 @@ -2153,7 +2151,7 @@ b5: jmp b3 // @3 b3: - // kickasm(location (const byte*) SIN_SPRITE#0) {{ .fill $40, $ff }} + // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff }} // [9] phi from @3 to @4 [phi:@3->@4] b4_from_b3: jmp b4 @@ -3031,7 +3029,7 @@ b5: jmp b3 // @3 b3: - // kickasm(location (const byte*) SIN_SPRITE#0) {{ .fill $40, $ff }} + // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff }} // [9] phi from @3 to @4 [phi:@3->@4] b4_from_b3: jmp b4 @@ -3686,8 +3684,7 @@ FINAL SYMBOL TABLE .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2 } }} -(byte*) SIN_SPRITE -(const byte*) SIN_SPRITE#0 SIN_SPRITE = (byte*) 10240 +(const byte*) SIN_SPRITE SIN_SPRITE = (byte*) 10240 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_EXPAND_X SPRITES_EXPAND_X = (byte*) 53277 @@ -3756,7 +3753,7 @@ FINAL SYMBOL TABLE (byte*) main::toD0181_screen (label) main::toSpritePtr2 (byte) main::toSpritePtr2_return -(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) SIN_SPRITE#0/(byte) $40 +(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) SIN_SPRITE/(byte) $40 (byte*) main::toSpritePtr2_sprite (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 @@ -3953,7 +3950,7 @@ bbegin: sta.z irq_cnt // @3 // kickasm - // kickasm(location (const byte*) SIN_SPRITE#0) {{ .fill $40, $ff }} + // kickasm(location (const byte*) SIN_SPRITE) {{ .fill $40, $ff }} // [9] phi from @3 to @4 [phi:@3->@4] // @4 // [10] call main diff --git a/src/test/ref/complex/tetris/test-sprites.sym b/src/test/ref/complex/tetris/test-sprites.sym index 94dcf61b6..600e1c7a0 100644 --- a/src/test/ref/complex/tetris/test-sprites.sym +++ b/src/test/ref/complex/tetris/test-sprites.sym @@ -32,8 +32,7 @@ .byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2 } }} -(byte*) SIN_SPRITE -(const byte*) SIN_SPRITE#0 SIN_SPRITE = (byte*) 10240 +(const byte*) SIN_SPRITE SIN_SPRITE = (byte*) 10240 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_EXPAND_X SPRITES_EXPAND_X = (byte*) 53277 @@ -102,7 +101,7 @@ (byte*) main::toD0181_screen (label) main::toSpritePtr2 (byte) main::toSpritePtr2_return -(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) SIN_SPRITE#0/(byte) $40 +(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = (byte)(word)(const byte*) SIN_SPRITE/(byte) $40 (byte*) main::toSpritePtr2_sprite (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 diff --git a/src/test/ref/complex/tetris/tetris.cfg b/src/test/ref/complex/tetris/tetris.cfg index dc87a13e0..b5c0358ec 100644 --- a/src/test/ref/complex/tetris/tetris.cfg +++ b/src/test/ref/complex/tetris/tetris.cfg @@ -237,7 +237,7 @@ render_score::@return: scope:[render_score] from render_score::@7 render_bcd: scope:[render_bcd] from render_score::@2 render_score::@3 render_score::@4 render_score::@5 render_score::@6 render_score::@7 [97] (byte) render_bcd::bcd#6 ← phi( render_score::@2/(byte) render_bcd::bcd#0 render_score::@3/(byte) render_bcd::bcd#1 render_score::@4/(byte) render_bcd::bcd#2 render_score::@5/(byte) render_bcd::bcd#3 render_score::@6/(byte) render_bcd::bcd#4 render_score::@7/(byte) render_bcd::bcd#5 ) [97] (byte) render_bcd::only_low#6 ← phi( render_score::@2/(byte) 0 render_score::@3/(byte) 0 render_score::@4/(byte) 0 render_score::@5/(byte) 1 render_score::@6/(byte) 0 render_score::@7/(byte) 0 ) - [97] (word) render_bcd::offset#6 ← phi( render_score::@2/(const word) render_score::score_offset#0 render_score::@3/(const word) render_score::score_offset#0+(byte) 2 render_score::@4/(const word) render_score::score_offset#0+(byte) 4 render_score::@5/(const word) render_score::lines_offset#0 render_score::@6/(const word) render_score::lines_offset#0+(byte) 1 render_score::@7/(const word) render_score::level_offset#0 ) + [97] (word) render_bcd::offset#6 ← phi( render_score::@2/(const word) render_score::score_offset render_score::@3/(const word) render_score::score_offset+(byte) 2 render_score::@4/(const word) render_score::score_offset+(byte) 4 render_score::@5/(const word) render_score::lines_offset render_score::@6/(const word) render_score::lines_offset+(byte) 1 render_score::@7/(const word) render_score::level_offset ) [97] (byte*) render_bcd::screen#6 ← phi( render_score::@2/(byte*) render_bcd::screen#0 render_score::@3/(byte*) render_bcd::screen#1 render_score::@4/(byte*) render_bcd::screen#2 render_score::@5/(byte*) render_bcd::screen#3 render_score::@6/(byte*) render_bcd::screen#4 render_score::@7/(byte*) render_bcd::screen#5 ) [98] (byte*) render_bcd::screen_pos#0 ← (byte*) render_bcd::screen#6 + (word) render_bcd::offset#6 [99] if((byte) render_bcd::only_low#6!=(byte) 0) goto render_bcd::@1 @@ -268,7 +268,7 @@ render_next::@1: scope:[render_next] from render_next [111] phi() to:render_next::@2 render_next::@2: scope:[render_next] from render_next render_next::@1 - [112] (byte*) render_next::screen_next_area#11 ← phi( render_next::@1/(const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 render_next/(const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 ) + [112] (byte*) render_next::screen_next_area#11 ← phi( render_next::@1/(const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset render_next/(const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset ) [113] (byte~) render_next::$6 ← (byte) next_piece_idx#12 << (byte) 1 [114] (byte) render_next::next_piece_char#0 ← *((const byte[]) PIECES_NEXT_CHARS + (byte) next_piece_idx#12) [115] (byte*~) render_next::next_piece_gfx#9 ← (byte*)*((const word[]) PIECES + (byte~) render_next::$6) @@ -1156,7 +1156,7 @@ render_screen_original::@2: scope:[render_screen_original] from render_screen_o [522] (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) 0 render_screen_original::@2/(byte) render_screen_original::x#1 ) [522] (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 ) [522] (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 ) - [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 + [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE [524] (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5 [525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK [526] (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4 @@ -1182,7 +1182,7 @@ render_screen_original::@4: scope:[render_screen_original] from render_screen_o [538] (byte) render_screen_original::x#6 ← phi( render_screen_original::@3/(byte) render_screen_original::x#2 render_screen_original::@4/(byte) render_screen_original::x#3 ) [538] (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@3/(byte*) render_screen_original::cols#2 render_screen_original::@4/(byte*) render_screen_original::cols#3 ) [538] (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@3/(byte*) render_screen_original::screen#3 render_screen_original::@4/(byte*) render_screen_original::screen#10 ) - [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 + [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE [540] (byte*) render_screen_original::screen#10 ← ++ (byte*) render_screen_original::screen#7 [541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK [542] (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6 diff --git a/src/test/ref/complex/tetris/tetris.log b/src/test/ref/complex/tetris/tetris.log index aa182e567..b1801ee5a 100644 --- a/src/test/ref/complex/tetris/tetris.log +++ b/src/test/ref/complex/tetris/tetris.log @@ -774,9 +774,9 @@ render_score::@2: scope:[render_score] from render_score::@1 render_score::@3 (dword*~) render_score::$1 ← & (dword) score_bcd#10 (byte*~) render_score::$2 ← ((byte*)) (dword*~) render_score::$1 (byte*) render_score::score_bytes#0 ← (byte*~) render_score::$2 - (word) render_score::score_offset#0 ← (number) $28*(number) 5+(number) $1c + (word) render_score::score_offset ← (number) $28*(number) 5+(number) $1c (byte*) render_bcd::screen#0 ← (byte*) render_score::screen#3 - (word) render_bcd::offset#0 ← (word) render_score::score_offset#0 + (word) render_bcd::offset#0 ← (word) render_score::score_offset (byte) render_bcd::bcd#0 ← *((byte*) render_score::score_bytes#0 + (number) 2) (byte) render_bcd::only_low#0 ← (number) 0 call render_bcd @@ -786,7 +786,7 @@ render_score::@5: scope:[render_score] from render_score::@2 (word) lines_bcd#33 ← phi( render_score::@2/(word) lines_bcd#45 ) (byte*) render_score::score_bytes#1 ← phi( render_score::@2/(byte*) render_score::score_bytes#0 ) (byte*) render_score::screen#4 ← phi( render_score::@2/(byte*) render_score::screen#3 ) - (number~) render_score::$4 ← (word) render_score::score_offset#0 + (number) 2 + (number~) render_score::$4 ← (word) render_score::score_offset + (number) 2 (byte*) render_bcd::screen#1 ← (byte*) render_score::screen#4 (word) render_bcd::offset#1 ← (number~) render_score::$4 (byte) render_bcd::bcd#1 ← *((byte*) render_score::score_bytes#1 + (number) 1) @@ -798,7 +798,7 @@ render_score::@6: scope:[render_score] from render_score::@5 (word) lines_bcd#21 ← phi( render_score::@5/(word) lines_bcd#33 ) (byte*) render_score::score_bytes#2 ← phi( render_score::@5/(byte*) render_score::score_bytes#1 ) (byte*) render_score::screen#5 ← phi( render_score::@5/(byte*) render_score::screen#4 ) - (number~) render_score::$6 ← (word) render_score::score_offset#0 + (number) 4 + (number~) render_score::$6 ← (word) render_score::score_offset + (number) 4 (byte*) render_bcd::screen#2 ← (byte*) render_score::screen#5 (word) render_bcd::offset#2 ← (number~) render_score::$6 (byte) render_bcd::bcd#2 ← *((byte*) render_score::score_bytes#2 + (number) 0) @@ -809,10 +809,10 @@ render_score::@7: scope:[render_score] from render_score::@6 (byte) level_bcd#42 ← phi( render_score::@6/(byte) level_bcd#55 ) (byte*) render_score::screen#6 ← phi( render_score::@6/(byte*) render_score::screen#5 ) (word) lines_bcd#10 ← phi( render_score::@6/(word) lines_bcd#21 ) - (word) render_score::lines_offset#0 ← (number) $28*(number) 1+(number) $16 + (word) render_score::lines_offset ← (number) $28*(number) 1+(number) $16 (byte~) render_score::$8 ← > (word) lines_bcd#10 (byte*) render_bcd::screen#3 ← (byte*) render_score::screen#6 - (word) render_bcd::offset#3 ← (word) render_score::lines_offset#0 + (word) render_bcd::offset#3 ← (word) render_score::lines_offset (byte) render_bcd::bcd#3 ← (byte~) render_score::$8 (byte) render_bcd::only_low#3 ← (number) 1 call render_bcd @@ -821,7 +821,7 @@ render_score::@8: scope:[render_score] from render_score::@7 (byte) level_bcd#26 ← phi( render_score::@7/(byte) level_bcd#42 ) (byte*) render_score::screen#7 ← phi( render_score::@7/(byte*) render_score::screen#6 ) (word) lines_bcd#11 ← phi( render_score::@7/(word) lines_bcd#10 ) - (number~) render_score::$10 ← (word) render_score::lines_offset#0 + (number) 1 + (number~) render_score::$10 ← (word) render_score::lines_offset + (number) 1 (byte~) render_score::$11 ← < (word) lines_bcd#11 (byte*) render_bcd::screen#4 ← (byte*) render_score::screen#7 (word) render_bcd::offset#4 ← (number~) render_score::$10 @@ -832,9 +832,9 @@ render_score::@8: scope:[render_score] from render_score::@7 render_score::@9: scope:[render_score] from render_score::@8 (byte) level_bcd#13 ← phi( render_score::@8/(byte) level_bcd#26 ) (byte*) render_score::screen#8 ← phi( render_score::@8/(byte*) render_score::screen#7 ) - (word) render_score::level_offset#0 ← (number) $28*(number) $13+(number) $1f + (word) render_score::level_offset ← (number) $28*(number) $13+(number) $1f (byte*) render_bcd::screen#5 ← (byte*) render_score::screen#8 - (word) render_bcd::offset#5 ← (word) render_score::level_offset#0 + (word) render_bcd::offset#5 ← (word) render_score::level_offset (byte) render_bcd::bcd#5 ← (byte) level_bcd#13 (byte) render_bcd::only_low#5 ← (number) 0 call render_bcd @@ -881,7 +881,7 @@ render_bcd::@return: scope:[render_bcd] from render_bcd::@1 (void()) render_screen_original((byte*) render_screen_original::screen) render_screen_original: scope:[render_screen_original] from render_init::@3 render_init::@4 (byte*) render_screen_original::screen#9 ← phi( render_init::@3/(byte*) render_screen_original::screen#0 render_init::@4/(byte*) render_screen_original::screen#1 ) - (byte) render_screen_original::SPACE#0 ← (number) 0 + (byte) render_screen_original::SPACE ← (number) 0 (byte*~) render_screen_original::$0 ← (byte*) PLAYFIELD_SCREEN_ORIGINAL + (number) $20*(number) 2 (byte*) render_screen_original::oscr#0 ← (byte*~) render_screen_original::$0 (byte*~) render_screen_original::$1 ← (byte*) PLAYFIELD_COLORS_ORIGINAL + (number) $20*(number) 2 @@ -904,7 +904,7 @@ render_screen_original::@2: scope:[render_screen_original] from render_screen_o (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) render_screen_original::x#0 render_screen_original::@2/(byte) render_screen_original::x#1 ) (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 ) (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 ) - *((byte*) render_screen_original::screen#5) ← (byte) render_screen_original::SPACE#0 + *((byte*) render_screen_original::screen#5) ← (byte) render_screen_original::SPACE (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5 *((byte*) render_screen_original::cols#4) ← (byte) BLACK (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4 @@ -936,7 +936,7 @@ render_screen_original::@6: scope:[render_screen_original] from render_screen_o (byte) render_screen_original::x#6 ← phi( render_screen_original::@4/(byte) render_screen_original::x#2 render_screen_original::@6/(byte) render_screen_original::x#3 ) (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@4/(byte*) render_screen_original::cols#2 render_screen_original::@6/(byte*) render_screen_original::cols#3 ) (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@4/(byte*) render_screen_original::screen#3 render_screen_original::@6/(byte*) render_screen_original::screen#4 ) - *((byte*) render_screen_original::screen#7) ← (byte) render_screen_original::SPACE#0 + *((byte*) render_screen_original::screen#7) ← (byte) render_screen_original::SPACE (byte*) render_screen_original::screen#4 ← ++ (byte*) render_screen_original::screen#7 *((byte*) render_screen_original::cols#6) ← (byte) BLACK (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6 @@ -1114,19 +1114,19 @@ render_moving::@return: scope:[render_moving] from render_moving::@3 render_next: scope:[render_next] from main::@33 main::@40 (byte) next_piece_idx#36 ← phi( main::@33/(byte) next_piece_idx#47 main::@40/(byte) next_piece_idx#48 ) (byte) render_screen_render#15 ← phi( main::@33/(byte) render_screen_render#25 main::@40/(byte) render_screen_render#26 ) - (word) render_next::next_area_offset#0 ← (number) $28*(number) $c+(number) $18+(number) 4 + (word) render_next::next_area_offset ← (number) $28*(number) $c+(number) $18+(number) 4 (byte*) render_next::screen_next_area#0 ← (byte*) 0 (bool~) render_next::$0 ← (byte) render_screen_render#15 == (number) 0 if((bool~) render_next::$0) goto render_next::@1 to:render_next::@3 render_next::@1: scope:[render_next] from render_next (byte) next_piece_idx#24 ← phi( render_next/(byte) next_piece_idx#36 ) - (byte*~) render_next::$2 ← (byte*) PLAYFIELD_SCREEN_1 + (word) render_next::next_area_offset#0 + (byte*~) render_next::$2 ← (byte*) PLAYFIELD_SCREEN_1 + (word) render_next::next_area_offset (byte*) render_next::screen_next_area#1 ← (byte*~) render_next::$2 to:render_next::@2 render_next::@3: scope:[render_next] from render_next (byte) next_piece_idx#25 ← phi( render_next/(byte) next_piece_idx#36 ) - (byte*~) render_next::$1 ← (byte*) PLAYFIELD_SCREEN_2 + (word) render_next::next_area_offset#0 + (byte*~) render_next::$1 ← (byte*) PLAYFIELD_SCREEN_2 + (word) render_next::next_area_offset (byte*) render_next::screen_next_area#2 ← (byte*~) render_next::$1 to:render_next::@2 render_next::@2: scope:[render_next] from render_next::@1 render_next::@3 @@ -6339,7 +6339,6 @@ SYMBOL TABLE SSA (byte) render_next::l#6 (byte) render_next::l#7 (word) render_next::next_area_offset -(word) render_next::next_area_offset#0 (byte) render_next::next_piece_char (byte) render_next::next_piece_char#0 (byte) render_next::next_piece_char#1 @@ -6422,15 +6421,12 @@ SYMBOL TABLE SSA (label) render_score::@9 (label) render_score::@return (word) render_score::level_offset -(word) render_score::level_offset#0 (word) render_score::lines_offset -(word) render_score::lines_offset#0 (byte*) render_score::score_bytes (byte*) render_score::score_bytes#0 (byte*) render_score::score_bytes#1 (byte*) render_score::score_bytes#2 (word) render_score::score_offset -(word) render_score::score_offset#0 (byte*) render_score::screen (byte*) render_score::screen#0 (byte*) render_score::screen#1 @@ -6455,7 +6451,6 @@ SYMBOL TABLE SSA (label) render_screen_original::@7 (label) render_screen_original::@return (byte) render_screen_original::SPACE -(byte) render_screen_original::SPACE#0 (byte*) render_screen_original::cols (byte*) render_screen_original::cols#0 (byte*) render_screen_original::cols#1 @@ -7023,23 +7018,23 @@ Adding number conversion cast (unumber) render_show::toD0182_$8 in (number~) ren Adding number conversion cast (unumber) $20 in (byte) render_screen_render#3 ← (byte) render_screen_render#10 ^ (number) $20 Adding number conversion cast (unumber) $20 in (byte) render_screen_show#3 ← (byte) render_screen_show#12 ^ (number) $20 Adding number conversion cast (unumber) 0 in (bool~) render_score::$0 ← (byte) render_screen_render#12 == (number) 0 -Adding number conversion cast (unumber) $28*5+$1c in (word) render_score::score_offset#0 ← (number) $28*(number) 5+(number) $1c +Adding number conversion cast (unumber) $28*5+$1c in (word) render_score::score_offset ← (number) $28*(number) 5+(number) $1c Adding number conversion cast (unumber) 2 in (byte) render_bcd::bcd#0 ← *((byte*) render_score::score_bytes#0 + (number) 2) Adding number conversion cast (unumber) 0 in (byte) render_bcd::only_low#0 ← (number) 0 -Adding number conversion cast (unumber) 2 in (number~) render_score::$4 ← (word) render_score::score_offset#0 + (number) 2 -Adding number conversion cast (unumber) render_score::$4 in (number~) render_score::$4 ← (word) render_score::score_offset#0 + (unumber)(number) 2 +Adding number conversion cast (unumber) 2 in (number~) render_score::$4 ← (word) render_score::score_offset + (number) 2 +Adding number conversion cast (unumber) render_score::$4 in (number~) render_score::$4 ← (word) render_score::score_offset + (unumber)(number) 2 Adding number conversion cast (unumber) 1 in (byte) render_bcd::bcd#1 ← *((byte*) render_score::score_bytes#1 + (number) 1) Adding number conversion cast (unumber) 0 in (byte) render_bcd::only_low#1 ← (number) 0 -Adding number conversion cast (unumber) 4 in (number~) render_score::$6 ← (word) render_score::score_offset#0 + (number) 4 -Adding number conversion cast (unumber) render_score::$6 in (number~) render_score::$6 ← (word) render_score::score_offset#0 + (unumber)(number) 4 +Adding number conversion cast (unumber) 4 in (number~) render_score::$6 ← (word) render_score::score_offset + (number) 4 +Adding number conversion cast (unumber) render_score::$6 in (number~) render_score::$6 ← (word) render_score::score_offset + (unumber)(number) 4 Adding number conversion cast (unumber) 0 in (byte) render_bcd::bcd#2 ← *((byte*) render_score::score_bytes#2 + (number) 0) Adding number conversion cast (unumber) 0 in (byte) render_bcd::only_low#2 ← (number) 0 -Adding number conversion cast (unumber) $28*1+$16 in (word) render_score::lines_offset#0 ← (number) $28*(number) 1+(number) $16 +Adding number conversion cast (unumber) $28*1+$16 in (word) render_score::lines_offset ← (number) $28*(number) 1+(number) $16 Adding number conversion cast (unumber) 1 in (byte) render_bcd::only_low#3 ← (number) 1 -Adding number conversion cast (unumber) 1 in (number~) render_score::$10 ← (word) render_score::lines_offset#0 + (number) 1 -Adding number conversion cast (unumber) render_score::$10 in (number~) render_score::$10 ← (word) render_score::lines_offset#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) render_score::$10 ← (word) render_score::lines_offset + (number) 1 +Adding number conversion cast (unumber) render_score::$10 in (number~) render_score::$10 ← (word) render_score::lines_offset + (unumber)(number) 1 Adding number conversion cast (unumber) 0 in (byte) render_bcd::only_low#4 ← (number) 0 -Adding number conversion cast (unumber) $28*$13+$1f in (word) render_score::level_offset#0 ← (number) $28*(number) $13+(number) $1f +Adding number conversion cast (unumber) $28*$13+$1f in (word) render_score::level_offset ← (number) $28*(number) $13+(number) $1f Adding number conversion cast (unumber) 0 in (byte) render_bcd::only_low#5 ← (number) 0 Adding number conversion cast (unumber) $35 in (byte) render_bcd::ZERO_CHAR ← (number) $35 Adding number conversion cast (unumber) 0 in (bool~) render_bcd::$1 ← (byte) render_bcd::only_low#6 == (number) 0 @@ -7047,7 +7042,7 @@ Adding number conversion cast (unumber) $f in (number~) render_bcd::$3 ← (byte Adding number conversion cast (unumber) render_bcd::$3 in (number~) render_bcd::$3 ← (byte) render_bcd::bcd#6 & (unumber)(number) $f Adding number conversion cast (unumber) render_bcd::$4 in (number~) render_bcd::$4 ← (byte) render_bcd::ZERO_CHAR + (unumber~) render_bcd::$3 Adding number conversion cast (unumber) 4 in (byte~) render_bcd::$5 ← (byte) render_bcd::bcd#7 >> (number) 4 -Adding number conversion cast (unumber) 0 in (byte) render_screen_original::SPACE#0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) render_screen_original::SPACE ← (number) 0 Adding number conversion cast (unumber) $20*2 in (byte*~) render_screen_original::$0 ← (byte*) PLAYFIELD_SCREEN_ORIGINAL + (number) $20*(number) 2 Adding number conversion cast (unumber) $20*2 in (byte*~) render_screen_original::$1 ← (byte*) PLAYFIELD_COLORS_ORIGINAL + (number) $20*(number) 2 Adding number conversion cast (unumber) 0 in (byte) render_screen_original::x#0 ← (number) 0 @@ -7064,7 +7059,7 @@ Adding number conversion cast (unumber) 0 in (byte) render_moving::i#0 ← (numb Adding number conversion cast (unumber) 1 in (bool~) render_moving::$0 ← (byte) render_moving::ypos#2 > (number) 1 Adding number conversion cast (unumber) 4 in (byte) render_moving::i#1 ← (byte) render_moving::i#3 + (number) 4 Adding number conversion cast (unumber) 0 in (bool~) render_moving::$2 ← (byte) render_moving::current_cell#0 != (number) 0 -Adding number conversion cast (unumber) $28*$c+$18+4 in (word) render_next::next_area_offset#0 ← (number) $28*(number) $c+(number) $18+(number) 4 +Adding number conversion cast (unumber) $28*$c+$18+4 in (word) render_next::next_area_offset ← (number) $28*(number) $c+(number) $18+(number) 4 Adding number conversion cast (unumber) 0 in (bool~) render_next::$0 ← (byte) render_screen_render#15 == (number) 0 Adding number conversion cast (unumber) 0 in (bool~) render_next::$3 ← (byte) render_next::cell#0 != (number) 0 Adding number conversion cast (unumber) 0 in *((byte*) render_next::screen_next_area#6) ← (number) 0 @@ -7314,20 +7309,20 @@ Inlining cast (word~) render_show::toD0181_$4 ← (word)(byte*) render_show::toD Inlining cast (word~) render_show::toD0182_$0 ← (word)(byte*) render_show::toD0182_screen#1 Inlining cast (word~) render_show::toD0182_$4 ← (word)(byte*) render_show::toD0182_gfx#1 Inlining cast (byte*~) render_score::$2 ← (byte*)(dword*~) render_score::$1 -Inlining cast (word) render_score::score_offset#0 ← (unumber)(number) $28*(number) 5+(number) $1c +Inlining cast (word) render_score::score_offset ← (unumber)(number) $28*(number) 5+(number) $1c Inlining cast (byte) render_bcd::only_low#0 ← (unumber)(number) 0 Inlining cast (byte) render_bcd::only_low#1 ← (unumber)(number) 0 Inlining cast (byte) render_bcd::only_low#2 ← (unumber)(number) 0 -Inlining cast (word) render_score::lines_offset#0 ← (unumber)(number) $28*(number) 1+(number) $16 +Inlining cast (word) render_score::lines_offset ← (unumber)(number) $28*(number) 1+(number) $16 Inlining cast (byte) render_bcd::only_low#3 ← (unumber)(number) 1 Inlining cast (byte) render_bcd::only_low#4 ← (unumber)(number) 0 -Inlining cast (word) render_score::level_offset#0 ← (unumber)(number) $28*(number) $13+(number) $1f +Inlining cast (word) render_score::level_offset ← (unumber)(number) $28*(number) $13+(number) $1f Inlining cast (byte) render_bcd::only_low#5 ← (unumber)(number) 0 Inlining cast (byte) render_bcd::ZERO_CHAR ← (unumber)(number) $35 -Inlining cast (byte) render_screen_original::SPACE#0 ← (unumber)(number) 0 +Inlining cast (byte) render_screen_original::SPACE ← (unumber)(number) 0 Inlining cast (byte) render_screen_original::x#0 ← (unumber)(number) 0 Inlining cast (byte) render_moving::i#0 ← (unumber)(number) 0 -Inlining cast (word) render_next::next_area_offset#0 ← (unumber)(number) $28*(number) $c+(number) $18+(number) 4 +Inlining cast (word) render_next::next_area_offset ← (unumber)(number) $28*(number) $c+(number) $18+(number) 4 Inlining cast (byte*) render_next::next_piece_gfx#0 ← (byte*)*((word[]) PIECES + (byte~) render_next::$6) Inlining cast *((byte*) render_next::screen_next_area#6) ← (unumber)(number) 0 Inlining cast *((byte*) SPRITES_ENABLE) ← (unumber)(number) $f @@ -8419,9 +8414,9 @@ Inferred type updated to byte in (unumber~) render_show::toD0182_$3 ← > (word~ Inferred type updated to byte in (unumber~) render_show::toD0182_$6 ← (byte~) render_show::toD0182_$5 / (byte) 4 Inferred type updated to byte in (unumber~) render_show::toD0182_$7 ← (byte~) render_show::toD0182_$6 & (byte) $f Inferred type updated to byte in (unumber~) render_show::toD0182_$8 ← (byte~) render_show::toD0182_$3 | (byte~) render_show::toD0182_$7 -Inferred type updated to word in (unumber~) render_score::$4 ← (word) render_score::score_offset#0 + (byte) 2 -Inferred type updated to word in (unumber~) render_score::$6 ← (word) render_score::score_offset#0 + (byte) 4 -Inferred type updated to word in (unumber~) render_score::$10 ← (word) render_score::lines_offset#0 + (byte) 1 +Inferred type updated to word in (unumber~) render_score::$4 ← (word) render_score::score_offset + (byte) 2 +Inferred type updated to word in (unumber~) render_score::$6 ← (word) render_score::score_offset + (byte) 4 +Inferred type updated to word in (unumber~) render_score::$10 ← (word) render_score::lines_offset + (byte) 1 Inferred type updated to byte in (unumber~) render_bcd::$3 ← (byte) render_bcd::bcd#6 & (byte) $f Inferred type updated to byte in (unumber~) render_bcd::$4 ← (byte) render_bcd::ZERO_CHAR + (byte~) render_bcd::$3 Inferred type updated to byte in (unumber~) render_playfield::$0 ← (byte) PLAYFIELD_COLS * (byte) 2 @@ -9561,10 +9556,10 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [66] (byte[8]) keyboard_events ← { fill( 8, 0) } Constant right-side identified [73] (byte[8]) keyboard_scan_values ← { fill( 8, 0) } Constant right-side identified [358] (dword*~) render_score::$1 ← & (dword) score_bcd#40 -Constant right-side identified [361] (word) render_score::score_offset#0 ← (unumber)(number) $28*(number) 5+(number) $1c -Constant right-side identified [382] (word) render_score::lines_offset#0 ← (unumber)(number) $28*(number) 1+(number) $16 -Constant right-side identified [398] (word) render_score::level_offset#0 ← (unumber)(number) $28*(number) $13+(number) $1f -Constant right-side identified [522] (word) render_next::next_area_offset#0 ← (unumber)(number) $28*(number) $c+(number) $18+(number) 4 +Constant right-side identified [361] (word) render_score::score_offset ← (unumber)(number) $28*(number) 5+(number) $1c +Constant right-side identified [382] (word) render_score::lines_offset ← (unumber)(number) $28*(number) 1+(number) $16 +Constant right-side identified [398] (word) render_score::level_offset ← (unumber)(number) $28*(number) $13+(number) $1f +Constant right-side identified [522] (word) render_next::next_area_offset ← (unumber)(number) $28*(number) $c+(number) $18+(number) 4 Constant right-side identified [565] (byte) sprites_init::xpos#0 ← (unumber)(number) $18+(number) $f*(number) 8 Constant right-side identified [607] (void()*~) sprites_irq_init::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() Constant right-side identified [711] (dword[5]) score_add_bcd ← { fill( 5, 0) } @@ -9684,17 +9679,17 @@ Constant (const byte) render_screen_render#1 = $20 Constant (const byte) render_show::d018val#0 = 0 Constant (const byte*) render_score::screen#0 = (byte*) 0 Constant (const dword*) render_score::$1 = &score_bcd#40 -Constant (const word) render_score::score_offset#0 = (unumber)$28*5+$1c +Constant (const word) render_score::score_offset = (unumber)$28*5+$1c Constant (const byte) render_bcd::only_low#0 = 0 Constant (const byte) render_bcd::only_low#1 = 0 Constant (const byte) render_bcd::only_low#2 = 0 -Constant (const word) render_score::lines_offset#0 = (unumber)$28*1+$16 +Constant (const word) render_score::lines_offset = (unumber)$28*1+$16 Constant (const byte) render_bcd::only_low#3 = 1 Constant (const byte) render_bcd::only_low#4 = 0 -Constant (const word) render_score::level_offset#0 = (unumber)$28*$13+$1f +Constant (const word) render_score::level_offset = (unumber)$28*$13+$1f Constant (const byte) render_bcd::only_low#5 = 0 Constant (const byte) render_bcd::ZERO_CHAR = $35 -Constant (const byte) render_screen_original::SPACE#0 = 0 +Constant (const byte) render_screen_original::SPACE = 0 Constant (const byte) render_screen_original::y#0 = 0 Constant (const byte) render_screen_original::x#0 = 0 Constant (const byte) render_playfield::l#0 = 2 @@ -9702,7 +9697,7 @@ Constant (const byte) render_playfield::c#0 = 0 Constant (const byte) render_moving::i#0 = 0 Constant (const byte) render_moving::l#0 = 0 Constant (const byte) render_moving::c#0 = 0 -Constant (const word) render_next::next_area_offset#0 = (unumber)$28*$c+$18+4 +Constant (const word) render_next::next_area_offset = (unumber)$28*$c+$18+4 Constant (const byte*) render_next::screen_next_area#0 = (byte*) 0 Constant (const byte) render_next::l#0 = 0 Constant (const byte) render_next::c#0 = 0 @@ -9781,9 +9776,9 @@ Constant (const byte*) render_show::toD0182_screen#0 = PLAYFIELD_SCREEN_2 Constant (const byte*) render_show::toD0182_gfx#0 = PLAYFIELD_CHARSET Constant (const byte*) render_score::screen#1 = PLAYFIELD_SCREEN_1 Constant (const byte*) render_score::screen#2 = PLAYFIELD_SCREEN_2 -Constant (const word) render_bcd::offset#0 = render_score::score_offset#0 -Constant (const word) render_bcd::offset#3 = render_score::lines_offset#0 -Constant (const word) render_bcd::offset#5 = render_score::level_offset#0 +Constant (const word) render_bcd::offset#0 = render_score::score_offset +Constant (const word) render_bcd::offset#3 = render_score::lines_offset +Constant (const word) render_bcd::offset#5 = render_score::level_offset Constant (const byte*) render_screen_original::cols#0 = COLS Constant (const byte*) sprites_irq::toSpritePtr2_sprite#0 = PLAYFIELD_SPRITES Constant (const byte) keyboard_event_pressed::keycode#4 = KEY_SPACE @@ -10009,16 +10004,16 @@ Constant right-side identified [84] (byte~) render_init::$1 ← (const byte) VIC Constant right-side identified [95] (byte*~) render_init::$6 ← (const byte*) PLAYFIELD_SCREEN_1 + (byte)(number) 2*(number) $28 Constant right-side identified [97] (byte*~) render_init::$8 ← (const byte*) PLAYFIELD_SCREEN_2 + (byte)(number) 2*(number) $28 Constant right-side identified [99] (byte~) render_init::$10 ← (const byte) PLAYFIELD_LINES - (byte) 1 -Constant right-side identified [145] (word) render_bcd::offset#1 ← (const word) render_score::score_offset#0 + (byte) 2 -Constant right-side identified [149] (word) render_bcd::offset#2 ← (const word) render_score::score_offset#0 + (byte) 4 -Constant right-side identified [156] (word) render_bcd::offset#4 ← (const word) render_score::lines_offset#0 + (byte) 1 +Constant right-side identified [145] (word) render_bcd::offset#1 ← (const word) render_score::score_offset + (byte) 2 +Constant right-side identified [149] (word) render_bcd::offset#2 ← (const word) render_score::score_offset + (byte) 4 +Constant right-side identified [156] (word) render_bcd::offset#4 ← (const word) render_score::lines_offset + (byte) 1 Constant right-side identified [177] (byte*) render_screen_original::oscr#0 ← (const byte*) PLAYFIELD_SCREEN_ORIGINAL + (byte)(number) $20*(number) 2 Constant right-side identified [178] (byte*) render_screen_original::ocols#0 ← (const byte*) PLAYFIELD_COLORS_ORIGINAL + (byte)(number) $20*(number) 2 Constant right-side identified [207] (byte) render_playfield::i#0 ← (const byte) PLAYFIELD_COLS * (byte) 2 Constant right-side identified [208] (byte~) render_playfield::$1 ← (const byte) PLAYFIELD_LINES - (byte) 1 Constant right-side identified [213] (byte~) render_playfield::$3 ← (const byte) PLAYFIELD_COLS - (byte) 1 -Constant right-side identified [247] (byte*) render_next::screen_next_area#1 ← (const byte*) PLAYFIELD_SCREEN_1 + (const word) render_next::next_area_offset#0 -Constant right-side identified [248] (byte*) render_next::screen_next_area#2 ← (const byte*) PLAYFIELD_SCREEN_2 + (const word) render_next::next_area_offset#0 +Constant right-side identified [247] (byte*) render_next::screen_next_area#1 ← (const byte*) PLAYFIELD_SCREEN_1 + (const word) render_next::next_area_offset +Constant right-side identified [248] (byte*) render_next::screen_next_area#2 ← (const byte*) PLAYFIELD_SCREEN_2 + (const word) render_next::next_area_offset Constant right-side identified [280] (byte~) $4 ← (const byte) SPRITES_FIRST_YPOS + (byte) $13 Constant right-side identified [283] (byte~) $5 ← (const byte) SPRITES_FIRST_YPOS + (byte) $15 Constant right-side identified [358] (byte~) $15 ← (const byte) PLAYFIELD_LINES + (byte) 1 @@ -10049,16 +10044,16 @@ Constant (const word) render_show::toD0181_$4 = (word)render_show::toD0181_gfx#0 Constant (const word) render_show::toD0182_$0 = (word)render_show::toD0182_screen#0 Constant (const word) render_show::toD0182_$4 = (word)render_show::toD0182_gfx#0 Constant (const byte*) render_score::score_bytes#0 = (byte*)render_score::$1 -Constant (const word) render_bcd::offset#1 = render_score::score_offset#0+2 -Constant (const word) render_bcd::offset#2 = render_score::score_offset#0+4 -Constant (const word) render_bcd::offset#4 = render_score::lines_offset#0+1 +Constant (const word) render_bcd::offset#1 = render_score::score_offset+2 +Constant (const word) render_bcd::offset#2 = render_score::score_offset+4 +Constant (const word) render_bcd::offset#4 = render_score::lines_offset+1 Constant (const byte*) render_screen_original::oscr#0 = PLAYFIELD_SCREEN_ORIGINAL+(byte)$20*2 Constant (const byte*) render_screen_original::ocols#0 = PLAYFIELD_COLORS_ORIGINAL+(byte)$20*2 Constant (const byte) render_playfield::i#0 = PLAYFIELD_COLS*2 Constant (const byte) render_playfield::$1 = PLAYFIELD_LINES-1 Constant (const byte) render_playfield::$3 = PLAYFIELD_COLS-1 -Constant (const byte*) render_next::screen_next_area#1 = PLAYFIELD_SCREEN_1+render_next::next_area_offset#0 -Constant (const byte*) render_next::screen_next_area#2 = PLAYFIELD_SCREEN_2+render_next::next_area_offset#0 +Constant (const byte*) render_next::screen_next_area#1 = PLAYFIELD_SCREEN_1+render_next::next_area_offset +Constant (const byte*) render_next::screen_next_area#2 = PLAYFIELD_SCREEN_2+render_next::next_area_offset Constant (const byte) $4 = SPRITES_FIRST_YPOS+$13 Constant (const byte) $5 = SPRITES_FIRST_YPOS+$15 Constant (const word) toSpritePtr1_$0 = (word)PLAYFIELD_SPRITES @@ -10364,20 +10359,20 @@ Constant inlined render_init::$10 = (const byte) PLAYFIELD_LINES-(byte) 1 Constant inlined play_remove_lines::$2 = (const byte) PLAYFIELD_LINES*(const byte) PLAYFIELD_COLS Constant inlined play_collision::i#0 = (byte) 0 Constant inlined play_remove_lines::$4 = (const byte) PLAYFIELD_LINES-(byte) 1 -Constant inlined render_bcd::offset#0 = (const word) render_score::score_offset#0 +Constant inlined render_bcd::offset#0 = (const word) render_score::score_offset Constant inlined current_orientation#69 = (byte) 0 -Constant inlined render_bcd::offset#1 = (const word) render_score::score_offset#0+(byte) 2 -Constant inlined render_bcd::offset#4 = (const word) render_score::lines_offset#0+(byte) 1 -Constant inlined render_bcd::offset#5 = (const word) render_score::level_offset#0 -Constant inlined render_bcd::offset#2 = (const word) render_score::score_offset#0+(byte) 4 -Constant inlined render_bcd::offset#3 = (const word) render_score::lines_offset#0 +Constant inlined render_bcd::offset#1 = (const word) render_score::score_offset+(byte) 2 +Constant inlined render_bcd::offset#4 = (const word) render_score::lines_offset+(byte) 1 +Constant inlined render_bcd::offset#5 = (const word) render_score::level_offset +Constant inlined render_bcd::offset#2 = (const word) render_score::score_offset+(byte) 4 +Constant inlined render_bcd::offset#3 = (const word) render_score::lines_offset Constant inlined render_show::toD0182_gfx#0 = (const byte*) PLAYFIELD_CHARSET Constant inlined play_lock_current::i#0 = (byte) 0 Constant inlined play_remove_lines::y#0 = (byte) 0 -Constant inlined render_next::screen_next_area#1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 +Constant inlined render_next::screen_next_area#1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset Constant inlined render_init::$8 = (const byte*) PLAYFIELD_SCREEN_2+(byte)(number) 2*(number) $28 Constant inlined $10 = (word)(const byte[4*4*4]) PIECE_Z -Constant inlined render_next::screen_next_area#2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 +Constant inlined render_next::screen_next_area#2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset Constant inlined $11 = (word)(const byte[4*4*4]) PIECE_J Constant inlined render_init::$6 = (const byte*) PLAYFIELD_SCREEN_1+(byte)(number) 2*(number) $28 Constant inlined $12 = (word)(const byte[4*4*4]) PIECE_O @@ -11433,7 +11428,7 @@ render_score::@return: scope:[render_score] from render_score::@7 render_bcd: scope:[render_bcd] from render_score::@2 render_score::@3 render_score::@4 render_score::@5 render_score::@6 render_score::@7 [97] (byte) render_bcd::bcd#6 ← phi( render_score::@2/(byte) render_bcd::bcd#0 render_score::@3/(byte) render_bcd::bcd#1 render_score::@4/(byte) render_bcd::bcd#2 render_score::@5/(byte) render_bcd::bcd#3 render_score::@6/(byte) render_bcd::bcd#4 render_score::@7/(byte) render_bcd::bcd#5 ) [97] (byte) render_bcd::only_low#6 ← phi( render_score::@2/(byte) 0 render_score::@3/(byte) 0 render_score::@4/(byte) 0 render_score::@5/(byte) 1 render_score::@6/(byte) 0 render_score::@7/(byte) 0 ) - [97] (word) render_bcd::offset#6 ← phi( render_score::@2/(const word) render_score::score_offset#0 render_score::@3/(const word) render_score::score_offset#0+(byte) 2 render_score::@4/(const word) render_score::score_offset#0+(byte) 4 render_score::@5/(const word) render_score::lines_offset#0 render_score::@6/(const word) render_score::lines_offset#0+(byte) 1 render_score::@7/(const word) render_score::level_offset#0 ) + [97] (word) render_bcd::offset#6 ← phi( render_score::@2/(const word) render_score::score_offset render_score::@3/(const word) render_score::score_offset+(byte) 2 render_score::@4/(const word) render_score::score_offset+(byte) 4 render_score::@5/(const word) render_score::lines_offset render_score::@6/(const word) render_score::lines_offset+(byte) 1 render_score::@7/(const word) render_score::level_offset ) [97] (byte*) render_bcd::screen#6 ← phi( render_score::@2/(byte*) render_bcd::screen#0 render_score::@3/(byte*) render_bcd::screen#1 render_score::@4/(byte*) render_bcd::screen#2 render_score::@5/(byte*) render_bcd::screen#3 render_score::@6/(byte*) render_bcd::screen#4 render_score::@7/(byte*) render_bcd::screen#5 ) [98] (byte*) render_bcd::screen_pos#0 ← (byte*) render_bcd::screen#6 + (word) render_bcd::offset#6 [99] if((byte) render_bcd::only_low#6!=(byte) 0) goto render_bcd::@1 @@ -11464,7 +11459,7 @@ render_next::@1: scope:[render_next] from render_next [111] phi() to:render_next::@2 render_next::@2: scope:[render_next] from render_next render_next::@1 - [112] (byte*) render_next::screen_next_area#11 ← phi( render_next::@1/(const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 render_next/(const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 ) + [112] (byte*) render_next::screen_next_area#11 ← phi( render_next::@1/(const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset render_next/(const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset ) [113] (byte~) render_next::$6 ← (byte) next_piece_idx#12 << (byte) 1 [114] (byte) render_next::next_piece_char#0 ← *((const byte[]) PIECES_NEXT_CHARS + (byte) next_piece_idx#12) [115] (byte*~) render_next::next_piece_gfx#9 ← (byte*)*((const word[]) PIECES + (byte~) render_next::$6) @@ -12352,7 +12347,7 @@ render_screen_original::@2: scope:[render_screen_original] from render_screen_o [522] (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) 0 render_screen_original::@2/(byte) render_screen_original::x#1 ) [522] (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 ) [522] (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 ) - [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 + [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE [524] (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5 [525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK [526] (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4 @@ -12378,7 +12373,7 @@ render_screen_original::@4: scope:[render_screen_original] from render_screen_o [538] (byte) render_screen_original::x#6 ← phi( render_screen_original::@3/(byte) render_screen_original::x#2 render_screen_original::@4/(byte) render_screen_original::x#3 ) [538] (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@3/(byte*) render_screen_original::cols#2 render_screen_original::@4/(byte*) render_screen_original::cols#3 ) [538] (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@3/(byte*) render_screen_original::screen#3 render_screen_original::@4/(byte*) render_screen_original::screen#10 ) - [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 + [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE [540] (byte*) render_screen_original::screen#10 ← ++ (byte*) render_screen_original::screen#7 [541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK [542] (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6 @@ -12952,7 +12947,6 @@ VARIABLE REGISTER WEIGHTS (byte) render_next::l (byte) render_next::l#1 151.5 (byte) render_next::l#7 18.363636363636363 -(word) render_next::next_area_offset (byte) render_next::next_piece_char (byte) render_next::next_piece_char#0 66.86666666666667 (byte*) render_next::next_piece_gfx @@ -12984,14 +12978,10 @@ VARIABLE REGISTER WEIGHTS (byte*) render_playfield::screen_line#1 500.5 (byte*) render_playfield::screen_line#2 1552.0 (void()) render_score() -(word) render_score::level_offset -(word) render_score::lines_offset (byte*) render_score::score_bytes -(word) render_score::score_offset (byte*) render_score::screen (byte*) render_score::screen#3 0.75 (void()) render_screen_original((byte*) render_screen_original::screen) -(byte) render_screen_original::SPACE (byte*) render_screen_original::cols (byte*) render_screen_original::cols#1 101.0 (byte*) render_screen_original::cols#2 75.75 @@ -14321,7 +14311,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@2->render_bcd#1] -- vbuz1=vbuc1 lda #0 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0 [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset @@ -14346,7 +14336,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@3->render_bcd#1] -- vbuz1=vbuc1 lda #0 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+2 @@ -14371,7 +14361,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@4->render_bcd#1] -- vbuz1=vbuc1 lda #0 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+4 @@ -14396,7 +14386,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 1 [phi:render_score::@5->render_bcd#1] -- vbuz1=vbuc1 lda #1 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0 [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset @@ -14421,7 +14411,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@6->render_bcd#1] -- vbuz1=vbuc1 lda #0 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset+1 @@ -14446,7 +14436,7 @@ render_score: { // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@7->render_bcd#1] -- vbuz1=vbuc1 lda #0 sta.z render_bcd.only_low - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset#0 [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 lda #level_offset @@ -14555,7 +14545,7 @@ render_next: { beq b1_from_render_next // [112] phi from render_next to render_next::@2 [phi:render_next->render_next::@2] b2_from_render_next: - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_2+next_area_offset @@ -14568,7 +14558,7 @@ render_next: { b1: // [112] phi from render_next::@1 to render_next::@2 [phi:render_next::@1->render_next::@2] b2_from_b1: - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_1+next_area_offset @@ -17189,7 +17179,7 @@ render_screen_original: { jmp b2 // render_screen_original::@2 b2: - // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y @@ -17269,7 +17259,7 @@ render_screen_original: { jmp b4 // render_screen_original::@4 b4: - // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y @@ -17876,7 +17866,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:216 [ Statement [514] *((const byte*[PLAYFIELD_LINES]) screen_lines_2 + (byte~) render_init::$13) ← (byte*) render_init::li_2#2 [ render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ) always clobbers reg byte a Statement [515] (byte*) render_init::li_1#1 ← (byte*) render_init::li_1#2 + (byte) $28 [ render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ) always clobbers reg byte a Statement [516] (byte*) render_init::li_2#1 ← (byte*) render_init::li_2#2 + (byte) $28 [ render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ) always clobbers reg byte a -Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y +Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:116 [ render_screen_original::x#6 render_screen_original::x#5 render_screen_original::x#4 render_screen_original::x#1 render_screen_original::x#2 render_screen_original::x#3 ] @@ -17884,7 +17874,7 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:116 [ Statement [525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ) always clobbers reg byte a reg byte y Statement [530] *((byte*) render_screen_original::screen#6) ← *((byte*) render_screen_original::oscr#2) [ render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ) always clobbers reg byte a reg byte y Statement [533] *((byte*) render_screen_original::cols#5) ← *((byte*) render_screen_original::ocols#2) [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ) always clobbers reg byte a reg byte y -Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y +Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK [ render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [548] *((const word*) SID_VOICE3_FREQ) ← (word) $ffff [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a Statement [549] *((const byte*) SID_VOICE3_CONTROL) ← (const byte) SID_CONTROL_NOISE [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a @@ -18060,11 +18050,11 @@ Statement [513] *((const byte*[PLAYFIELD_LINES]) screen_lines_1 + (byte~) render Statement [514] *((const byte*[PLAYFIELD_LINES]) screen_lines_2 + (byte~) render_init::$13) ← (byte*) render_init::li_2#2 [ render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ) always clobbers reg byte a Statement [515] (byte*) render_init::li_1#1 ← (byte*) render_init::li_1#2 + (byte) $28 [ render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ) always clobbers reg byte a Statement [516] (byte*) render_init::li_2#1 ← (byte*) render_init::li_2#2 + (byte) $28 [ render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ) always clobbers reg byte a -Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y +Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y Statement [525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ) always clobbers reg byte a reg byte y Statement [530] *((byte*) render_screen_original::screen#6) ← *((byte*) render_screen_original::oscr#2) [ render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ) always clobbers reg byte a reg byte y Statement [533] *((byte*) render_screen_original::cols#5) ← *((byte*) render_screen_original::ocols#2) [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ) always clobbers reg byte a reg byte y -Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y +Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK [ render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [548] *((const word*) SID_VOICE3_FREQ) ← (word) $ffff [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a Statement [549] *((const byte*) SID_VOICE3_CONTROL) ← (const byte) SID_CONTROL_NOISE [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a @@ -18235,11 +18225,11 @@ Statement [513] *((const byte*[PLAYFIELD_LINES]) screen_lines_1 + (byte~) render Statement [514] *((const byte*[PLAYFIELD_LINES]) screen_lines_2 + (byte~) render_init::$13) ← (byte*) render_init::li_2#2 [ render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#2 render_init::li_2#2 ] ) always clobbers reg byte a Statement [515] (byte*) render_init::li_1#1 ← (byte*) render_init::li_1#2 + (byte) $28 [ render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_2#2 render_init::li_1#1 ] ) always clobbers reg byte a Statement [516] (byte*) render_init::li_2#1 ← (byte*) render_init::li_2#2 + (byte) $28 [ render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ( main:13::render_init:18 [ render_screen_showing#0 score_bcd#0 render_init::i#2 render_init::li_1#1 render_init::li_2#1 ] ) always clobbers reg byte a -Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y +Statement [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::screen#5 render_screen_original::cols#4 render_screen_original::x#4 ] ) always clobbers reg byte a reg byte y Statement [525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK [ render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::oscr#4 render_screen_original::ocols#4 render_screen_original::y#6 render_screen_original::cols#4 render_screen_original::x#4 render_screen_original::screen#2 ] ) always clobbers reg byte a reg byte y Statement [530] *((byte*) render_screen_original::screen#6) ← *((byte*) render_screen_original::oscr#2) [ render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#2 render_screen_original::screen#6 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 ] ) always clobbers reg byte a reg byte y Statement [533] *((byte*) render_screen_original::cols#5) ← *((byte*) render_screen_original::ocols#2) [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#2 render_screen_original::cols#5 render_screen_original::x#5 render_screen_original::screen#3 ] ) always clobbers reg byte a reg byte y -Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y +Statement [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE [ render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::screen#7 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK [ render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ( main:13::render_init:18::render_screen_original:508 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] main:13::render_init:18::render_screen_original:510 [ render_screen_showing#0 score_bcd#0 render_screen_original::y#6 render_screen_original::screen#10 render_screen_original::oscr#1 render_screen_original::ocols#1 render_screen_original::cols#6 render_screen_original::x#6 ] ) always clobbers reg byte a reg byte y Statement [548] *((const word*) SID_VOICE3_FREQ) ← (word) $ffff [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a Statement [549] *((const byte*) SID_VOICE3_CONTROL) ← (const byte) SID_CONTROL_NOISE [ ] ( main:13::sid_rnd_init:16 [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a @@ -19426,7 +19416,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#0 [phi:render_score::@2->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@2->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0 [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset @@ -19445,7 +19435,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#1 [phi:render_score::@3->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@3->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+2 @@ -19464,7 +19454,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#2 [phi:render_score::@4->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@4->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+4 @@ -19484,7 +19474,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#3 [phi:render_score::@5->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 1 [phi:render_score::@5->render_bcd#1] -- vbuyy=vbuc1 ldy #1 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0 [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset @@ -19504,7 +19494,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#4 [phi:render_score::@6->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@6->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset+1 @@ -19523,7 +19513,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#5 [phi:render_score::@7->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@7->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset#0 [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 lda #level_offset @@ -19615,7 +19605,7 @@ render_next: { beq b1_from_render_next // [112] phi from render_next to render_next::@2 [phi:render_next->render_next::@2] b2_from_render_next: - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_2+next_area_offset @@ -19628,7 +19618,7 @@ render_next: { b1: // [112] phi from render_next::@1 to render_next::@2 [phi:render_next::@1->render_next::@2] b2_from_b1: - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_1+next_area_offset @@ -21971,7 +21961,7 @@ render_screen_original: { jmp b2 // render_screen_original::@2 b2: - // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y @@ -22049,7 +22039,7 @@ render_screen_original: { jmp b4 // render_screen_original::@4 b4: - // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y @@ -23775,8 +23765,7 @@ FINAL SYMBOL TABLE (byte) render_next::l (byte) render_next::l#1 l zp ZP_BYTE:13 151.5 (byte) render_next::l#7 l zp ZP_BYTE:13 18.363636363636363 -(word) render_next::next_area_offset -(const word) render_next::next_area_offset#0 next_area_offset = (word)(number) $28*(number) $c+(number) $18+(number) 4 +(const word) render_next::next_area_offset next_area_offset = (word)(number) $28*(number) $c+(number) $18+(number) 4 (byte) render_next::next_piece_char (byte) render_next::next_piece_char#0 next_piece_char zp ZP_BYTE:33 66.86666666666667 (byte*) render_next::next_piece_gfx @@ -23820,14 +23809,11 @@ FINAL SYMBOL TABLE (label) render_score::@6 (label) render_score::@7 (label) render_score::@return -(word) render_score::level_offset -(const word) render_score::level_offset#0 level_offset = (word)(number) $28*(number) $13+(number) $1f -(word) render_score::lines_offset -(const word) render_score::lines_offset#0 lines_offset = (byte)(number) $28*(number) 1+(number) $16 +(const word) render_score::level_offset level_offset = (word)(number) $28*(number) $13+(number) $1f +(const word) render_score::lines_offset lines_offset = (byte)(number) $28*(number) 1+(number) $16 (byte*) render_score::score_bytes (const byte*) render_score::score_bytes#0 score_bytes = (byte*)&(dword) score_bcd#14 -(word) render_score::score_offset -(const word) render_score::score_offset#0 score_offset = (byte)(number) $28*(number) 5+(number) $1c +(const word) render_score::score_offset score_offset = (byte)(number) $28*(number) 5+(number) $1c (byte*) render_score::screen (byte*) render_score::screen#3 screen zp ZP_WORD:36 0.75 (void()) render_screen_original((byte*) render_screen_original::screen) @@ -23837,8 +23823,7 @@ FINAL SYMBOL TABLE (label) render_screen_original::@4 (label) render_screen_original::@5 (label) render_screen_original::@return -(byte) render_screen_original::SPACE -(const byte) render_screen_original::SPACE#0 SPACE = (byte) 0 +(const byte) render_screen_original::SPACE SPACE = (byte) 0 (byte*) render_screen_original::cols (byte*) render_screen_original::cols#1 cols zp ZP_WORD:44 101.0 (byte*) render_screen_original::cols#2 cols zp ZP_WORD:44 75.75 @@ -24655,7 +24640,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#0 [phi:render_score::@2->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@2->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0 [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset [phi:render_score::@2->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset @@ -24672,7 +24657,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#1 [phi:render_score::@3->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@3->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 2 [phi:render_score::@3->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+2 @@ -24689,7 +24674,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#2 [phi:render_score::@4->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@4->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset#0+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::score_offset+(byte) 4 [phi:render_score::@4->render_bcd#2] -- vwuz1=vwuc1 lda #score_offset+4 @@ -24707,7 +24692,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#3 [phi:render_score::@5->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 1 [phi:render_score::@5->render_bcd#1] -- vbuyy=vbuc1 ldy #1 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0 [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset [phi:render_score::@5->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset @@ -24725,7 +24710,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#4 [phi:render_score::@6->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@6->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset#0+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::lines_offset+(byte) 1 [phi:render_score::@6->render_bcd#2] -- vwuz1=vwuc1 lda #lines_offset+1 @@ -24742,7 +24727,7 @@ render_score: { // [97] phi (byte) render_bcd::bcd#6 = (byte) render_bcd::bcd#5 [phi:render_score::@7->render_bcd#0] -- register_copy // [97] phi (byte) render_bcd::only_low#6 = (byte) 0 [phi:render_score::@7->render_bcd#1] -- vbuyy=vbuc1 ldy #0 - // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset#0 [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 + // [97] phi (word) render_bcd::offset#6 = (const word) render_score::level_offset [phi:render_score::@7->render_bcd#2] -- vwuz1=vwuc1 lda #level_offset @@ -24836,7 +24821,7 @@ render_next: { cmp #0 beq b1 // [112] phi from render_next to render_next::@2 [phi:render_next->render_next::@2] - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset#0 [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_2+(const word) render_next::next_area_offset [phi:render_next->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_2+next_area_offset @@ -24846,7 +24831,7 @@ render_next: { // render_next::@1 b1: // [112] phi from render_next::@1 to render_next::@2 [phi:render_next::@1->render_next::@2] - // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset#0 [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 + // [112] phi (byte*) render_next::screen_next_area#11 = (const byte*) PLAYFIELD_SCREEN_1+(const word) render_next::next_area_offset [phi:render_next::@1->render_next::@2#0] -- pbuz1=pbuc1 lda #PLAYFIELD_SCREEN_1+next_area_offset @@ -27061,7 +27046,7 @@ render_screen_original: { // render_screen_original::@2 b2: // *screen++ = SPACE - // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y @@ -27141,7 +27126,7 @@ render_screen_original: { // render_screen_original::@4 b4: // *screen++ = SPACE - // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0 -- _deref_pbuz1=vbuc1 + // [539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE -- _deref_pbuz1=vbuc1 lda #SPACE ldy #0 sta (screen),y diff --git a/src/test/ref/complex/tetris/tetris.sym b/src/test/ref/complex/tetris/tetris.sym index 9f2ff9ae8..9e240c574 100644 --- a/src/test/ref/complex/tetris/tetris.sym +++ b/src/test/ref/complex/tetris/tetris.sym @@ -750,8 +750,7 @@ (byte) render_next::l (byte) render_next::l#1 l zp ZP_BYTE:13 151.5 (byte) render_next::l#7 l zp ZP_BYTE:13 18.363636363636363 -(word) render_next::next_area_offset -(const word) render_next::next_area_offset#0 next_area_offset = (word)(number) $28*(number) $c+(number) $18+(number) 4 +(const word) render_next::next_area_offset next_area_offset = (word)(number) $28*(number) $c+(number) $18+(number) 4 (byte) render_next::next_piece_char (byte) render_next::next_piece_char#0 next_piece_char zp ZP_BYTE:33 66.86666666666667 (byte*) render_next::next_piece_gfx @@ -795,14 +794,11 @@ (label) render_score::@6 (label) render_score::@7 (label) render_score::@return -(word) render_score::level_offset -(const word) render_score::level_offset#0 level_offset = (word)(number) $28*(number) $13+(number) $1f -(word) render_score::lines_offset -(const word) render_score::lines_offset#0 lines_offset = (byte)(number) $28*(number) 1+(number) $16 +(const word) render_score::level_offset level_offset = (word)(number) $28*(number) $13+(number) $1f +(const word) render_score::lines_offset lines_offset = (byte)(number) $28*(number) 1+(number) $16 (byte*) render_score::score_bytes (const byte*) render_score::score_bytes#0 score_bytes = (byte*)&(dword) score_bcd#14 -(word) render_score::score_offset -(const word) render_score::score_offset#0 score_offset = (byte)(number) $28*(number) 5+(number) $1c +(const word) render_score::score_offset score_offset = (byte)(number) $28*(number) 5+(number) $1c (byte*) render_score::screen (byte*) render_score::screen#3 screen zp ZP_WORD:36 0.75 (void()) render_screen_original((byte*) render_screen_original::screen) @@ -812,8 +808,7 @@ (label) render_screen_original::@4 (label) render_screen_original::@5 (label) render_screen_original::@return -(byte) render_screen_original::SPACE -(const byte) render_screen_original::SPACE#0 SPACE = (byte) 0 +(const byte) render_screen_original::SPACE SPACE = (byte) 0 (byte*) render_screen_original::cols (byte*) render_screen_original::cols#1 cols zp ZP_WORD:44 101.0 (byte*) render_screen_original::cols#2 cols zp ZP_WORD:44 75.75 diff --git a/src/test/ref/condition-type-mismatch.cfg b/src/test/ref/condition-type-mismatch.cfg index 12c37ed2e..f91770095 100644 --- a/src/test/ref/condition-type-mismatch.cfg +++ b/src/test/ref/condition-type-mismatch.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0) ← (byte) 'a' + [5] *((const byte*) main::screen) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main::@1 [6] return diff --git a/src/test/ref/condition-type-mismatch.log b/src/test/ref/condition-type-mismatch.log index 1d83fa4ee..1878296d1 100644 --- a/src/test/ref/condition-type-mismatch.log +++ b/src/test/ref/condition-type-mismatch.log @@ -9,14 +9,14 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::b#0 ← (number) $c - (bool~) main::$1 ← (number) 0 != (byte) main::b#0 + (byte) main::b ← (number) $c + (bool~) main::$1 ← (number) 0 != (byte) main::b (bool~) main::$0 ← ! (bool~) main::$1 if((bool~) main::$0) goto main::@return to:main::@2 main::@2: scope:[main] from main - (byte*) main::screen#0 ← ((byte*)) (number) $400 - *((byte*) main::screen#0) ← (byte) 'a' + (byte*) main::screen ← ((byte*)) (number) $400 + *((byte*) main::screen) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main main::@2 return @@ -39,15 +39,13 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte) main::b -(byte) main::b#0 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) $c in (byte) main::b#0 ← (number) $c -Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != (byte) main::b#0 +Adding number conversion cast (unumber) $c in (byte) main::b ← (number) $c +Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != (byte) main::b Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::b#0 ← (unumber)(number) $c -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte) main::b ← (unumber)(number) $c +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $c Simplifying constant integer cast 0 @@ -56,16 +54,16 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $c Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inversing boolean not [2] (bool~) main::$0 ← (byte) 0 == (byte) main::b#0 from [1] (bool~) main::$1 ← (byte) 0 != (byte) main::b#0 +Inversing boolean not [2] (bool~) main::$0 ← (byte) 0 == (byte) main::b from [1] (bool~) main::$1 ← (byte) 0 != (byte) main::b Successful SSA optimization Pass2UnaryNotSimplification -Simple Condition (bool~) main::$0 [3] if((byte) 0==(byte) main::b#0) goto main::@return +Simple Condition (bool~) main::$0 [3] if((byte) 0==(byte) main::b) goto main::@return Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) main::b#0 = $c -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte) main::b = $c +Constant (const byte*) main::screen = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -if() condition always false - eliminating [3] if((byte) 0==(const byte) main::b#0) goto main::@return +if() condition always false - eliminating [3] if((byte) 0==(const byte) main::b) goto main::@return Successful SSA optimization Pass2ConstantIfs -Eliminating unused constant (const byte) main::b#0 +Eliminating unused constant (const byte) main::b Successful SSA optimization PassNEliminateUnusedVars Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -100,7 +98,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0) ← (byte) 'a' + [5] *((const byte*) main::screen) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main::@1 [6] return @@ -109,8 +107,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -146,7 +142,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen jmp breturn @@ -158,7 +154,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::screen) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -197,7 +193,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen jmp breturn @@ -236,9 +232,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte) main::b -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 @@ -264,7 +258,7 @@ main: { .label screen = $400 // main::@1 // *screen = 'a' - // [5] *((const byte*) main::screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen // main::@return diff --git a/src/test/ref/condition-type-mismatch.sym b/src/test/ref/condition-type-mismatch.sym index bf525af99..d0d36dce2 100644 --- a/src/test/ref/condition-type-mismatch.sym +++ b/src/test/ref/condition-type-mismatch.sym @@ -4,7 +4,5 @@ (void()) main() (label) main::@1 (label) main::@return -(byte) main::b -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/consolidate-array-index-problem.cfg b/src/test/ref/consolidate-array-index-problem.cfg index 9cda32c9b..60173bef3 100644 --- a/src/test/ref/consolidate-array-index-problem.cfg +++ b/src/test/ref/consolidate-array-index-problem.cfg @@ -15,8 +15,8 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::x#2 ← phi( main/(byte) 0 main::@1/(byte) main::x#1 ) [6] (byte) main::y#0 ← (byte) main::x#2 + (byte) $c - [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' - [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 + [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' + [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK [9] (byte) main::x#1 ← ++ (byte) main::x#2 [10] if((byte) main::x#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/consolidate-array-index-problem.log b/src/test/ref/consolidate-array-index-problem.log index 814249366..64766a786 100644 --- a/src/test/ref/consolidate-array-index-problem.log +++ b/src/test/ref/consolidate-array-index-problem.log @@ -9,17 +9,17 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::BLACK#0 ← (number) 0 - (byte*) main::screen#0 ← ((byte*)) (number) $400 - (byte*) main::cols#0 ← ((byte*)) (number) $d800 + (byte) main::BLACK ← (number) 0 + (byte*) main::screen ← ((byte*)) (number) $400 + (byte*) main::cols ← ((byte*)) (number) $d800 (byte) main::x#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@1/(byte) main::x#1 ) (number~) main::$0 ← (byte) main::x#2 + (number) $c (byte) main::y#0 ← (number~) main::$0 - *((byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' - *((byte*) main::cols#0 + (byte) main::y#0) ← (byte) main::BLACK#0 + *((byte*) main::screen + (byte) main::y#0) ← (byte) 'a' + *((byte*) main::cols + (byte) main::y#0) ← (byte) main::BLACK (byte) main::x#1 ← (byte) main::x#2 + rangenext(0,$a) (bool~) main::$1 ← (byte) main::x#1 != rangelast(0,$a) if((bool~) main::$1) goto main::@1 @@ -45,11 +45,8 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte) main::BLACK -(byte) main::BLACK#0 (byte*) main::cols -(byte*) main::cols#0 (byte*) main::screen -(byte*) main::screen#0 (byte) main::x (byte) main::x#0 (byte) main::x#1 @@ -57,13 +54,13 @@ SYMBOL TABLE SSA (byte) main::y (byte) main::y#0 -Adding number conversion cast (unumber) 0 in (byte) main::BLACK#0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) main::BLACK ← (number) 0 Adding number conversion cast (unumber) $c in (number~) main::$0 ← (byte) main::x#2 + (number) $c Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::x#2 + (unumber)(number) $c Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::BLACK#0 ← (unumber)(number) 0 -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 -Inlining cast (byte*) main::cols#0 ← (byte*)(number) $d800 +Inlining cast (byte) main::BLACK ← (unumber)(number) 0 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 +Inlining cast (byte*) main::cols ← (byte*)(number) $d800 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant pointer cast (byte*) 1024 @@ -78,9 +75,9 @@ Alias (byte) main::y#0 = (byte~) main::$0 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [11] if((byte) main::x#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) main::BLACK#0 = 0 -Constant (const byte*) main::screen#0 = (byte*) 1024 -Constant (const byte*) main::cols#0 = (byte*) 55296 +Constant (const byte) main::BLACK = 0 +Constant (const byte*) main::screen = (byte*) 1024 +Constant (const byte*) main::cols = (byte*) 55296 Constant (const byte) main::x#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [9] main::x#1 ← ++ main::x#2 to ++ @@ -131,8 +128,8 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::x#2 ← phi( main/(byte) 0 main::@1/(byte) main::x#1 ) [6] (byte) main::y#0 ← (byte) main::x#2 + (byte) $c - [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' - [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 + [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' + [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK [9] (byte) main::x#1 ← ++ (byte) main::x#2 [10] if((byte) main::x#1!=(byte) $b) goto main::@1 to:main::@return @@ -143,9 +140,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::BLACK -(byte*) main::cols -(byte*) main::screen (byte) main::x (byte) main::x#1 16.5 (byte) main::x#2 8.25 @@ -208,11 +202,11 @@ main: { lax.z x axs #-[$c] stx.z y - // [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuz1=vbuc2 + // [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'a' ldy.z y sta screen,y - // [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK -- pbuc1_derefidx_vbuz1=vbuc2 lda #BLACK ldy.z y sta cols,y @@ -231,13 +225,13 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::y#0 ] -Statement [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a Statement [6] (byte) main::y#0 ← (byte) main::x#2 + (byte) $c [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::x#2 main::x#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::y#0 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -291,10 +285,10 @@ main: { tya tax axs #-[$c] - // [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuxx=vbuc2 + // [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'a' sta screen,x - // [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK -- pbuc1_derefidx_vbuxx=vbuc2 lda #BLACK sta cols,x // [9] (byte) main::x#1 ← ++ (byte) main::x#2 -- vbuyy=_inc_vbuyy @@ -342,12 +336,9 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte) main::BLACK -(const byte) main::BLACK#0 BLACK = (byte) 0 -(byte*) main::cols -(const byte*) main::cols#0 cols = (byte*) 55296 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte) main::BLACK BLACK = (byte) 0 +(const byte*) main::cols cols = (byte*) 55296 +(const byte*) main::screen screen = (byte*) 1024 (byte) main::x (byte) main::x#1 reg byte y 16.5 (byte) main::x#2 reg byte y 8.25 @@ -392,11 +383,11 @@ main: { tax axs #-[$c] // screen[y] = 'a' - // [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuxx=vbuc2 + // [7] *((const byte*) main::screen + (byte) main::y#0) ← (byte) 'a' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'a' sta screen,x // cols[y] = BLACK - // [8] *((const byte*) main::cols#0 + (byte) main::y#0) ← (const byte) main::BLACK#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) main::cols + (byte) main::y#0) ← (const byte) main::BLACK -- pbuc1_derefidx_vbuxx=vbuc2 lda #BLACK sta cols,x // for(byte x:0..10) diff --git a/src/test/ref/consolidate-array-index-problem.sym b/src/test/ref/consolidate-array-index-problem.sym index 0e020477a..dce75960f 100644 --- a/src/test/ref/consolidate-array-index-problem.sym +++ b/src/test/ref/consolidate-array-index-problem.sym @@ -4,12 +4,9 @@ (void()) main() (label) main::@1 (label) main::@return -(byte) main::BLACK -(const byte) main::BLACK#0 BLACK = (byte) 0 -(byte*) main::cols -(const byte*) main::cols#0 cols = (byte*) 55296 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte) main::BLACK BLACK = (byte) 0 +(const byte*) main::cols cols = (byte*) 55296 +(const byte*) main::screen screen = (byte*) 1024 (byte) main::x (byte) main::x#1 reg byte y 16.5 (byte) main::x#2 reg byte y 8.25 diff --git a/src/test/ref/const-early-identification.cfg b/src/test/ref/const-early-identification.cfg index a65452228..1728193b7 100644 --- a/src/test/ref/const-early-identification.cfg +++ b/src/test/ref/const-early-identification.cfg @@ -10,9 +10,9 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (byte) A#0 - [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 - [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) + [4] *((const byte*) SCREEN) ← (byte) A#0 + [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B + [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) [7] call sub to:main::@return main::@return: scope:[main] from main @@ -21,9 +21,9 @@ main::@return: scope:[main] from main (void()) sub() sub: scope:[sub] from main - [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 + [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 - [11] *((const byte*) SCREEN#0+(byte) 4) ← (byte) sub::D#0 + [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 to:sub::@return sub::@return: scope:[sub] from sub [12] return diff --git a/src/test/ref/const-early-identification.log b/src/test/ref/const-early-identification.log index 349f87315..cd5c52d61 100644 --- a/src/test/ref/const-early-identification.log +++ b/src/test/ref/const-early-identification.log @@ -6,19 +6,19 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte) A#0 ← (byte) 'a' to:@2 (void()) main() main: scope:[main] from @2 (byte) A#1 ← phi( @2/(byte) A#3 ) - *((byte*) SCREEN#0 + (number) 0) ← (byte) A#1 - (byte) main::B#0 ← (byte) 'b' - *((byte*) SCREEN#0 + (number) 1) ← (byte) main::B#0 + *((byte*) SCREEN + (number) 0) ← (byte) A#1 + (byte) main::B ← (byte) 'b' + *((byte*) SCREEN + (number) 1) ← (byte) main::B (byte*~) main::$0 ← & (byte) A#1 (byte*) main::addrA#0 ← (byte*~) main::$0 - *((byte*) SCREEN#0 + (number) 2) ← *((byte*) main::addrA#0) + *((byte*) SCREEN + (number) 2) ← *((byte*) main::addrA#0) call sub to:main::@1 main::@1: scope:[main] from main @@ -30,11 +30,11 @@ main::@return: scope:[main] from main::@1 (void()) sub() sub: scope:[sub] from main (byte) A#2 ← phi( main/(byte) A#1 ) - (byte) sub::C#0 ← (byte) 'c' - *((byte*) SCREEN#0 + (number) 3) ← (byte) sub::C#0 + (byte) sub::C ← (byte) 'c' + *((byte*) SCREEN + (number) 3) ← (byte) sub::C (number~) sub::$0 ← (byte) A#2 + (number) 1 (byte) sub::D#0 ← (number~) sub::$0 - *((byte*) SCREEN#0 + (number) 4) ← (byte) sub::D#0 + *((byte*) SCREEN + (number) 4) ← (byte) sub::D#0 to:sub::@return sub::@return: scope:[sub] from sub return @@ -58,32 +58,29 @@ SYMBOL TABLE SSA (byte) A#2 (byte) A#3 (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$0 (label) main::@1 (label) main::@return (byte) main::B -(byte) main::B#0 (byte*) main::addrA (byte*) main::addrA#0 (void()) sub() (number~) sub::$0 (label) sub::@return (byte) sub::C -(byte) sub::C#0 (byte) sub::D (byte) sub::D#0 -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) A#1 -Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (number) 1) ← (byte) main::B#0 -Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← *((byte*) main::addrA#0) -Adding number conversion cast (unumber) 3 in *((byte*) SCREEN#0 + (number) 3) ← (byte) sub::C#0 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) A#1 +Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte) main::B +Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← *((byte*) main::addrA#0) +Adding number conversion cast (unumber) 3 in *((byte*) SCREEN + (number) 3) ← (byte) sub::C Adding number conversion cast (unumber) 1 in (number~) sub::$0 ← (byte) A#2 + (number) 1 Adding number conversion cast (unumber) sub::$0 in (number~) sub::$0 ← (byte) A#2 + (unumber)(number) 1 -Adding number conversion cast (unumber) 4 in *((byte*) SCREEN#0 + (number) 4) ← (byte) sub::D#0 +Adding number conversion cast (unumber) 4 in *((byte*) SCREEN + (number) 4) ← (byte) sub::D#0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -110,17 +107,17 @@ Identical Phi Values (byte) A#2 (byte) A#1 Successful SSA optimization Pass2IdenticalPhiElimination Constant right-side identified [6] (byte*) main::addrA#0 ← & (byte) A#0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte) main::B#0 = 'b' +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte) main::B = 'b' Constant (const byte*) main::addrA#0 = &A#0 -Constant (const byte) sub::C#0 = 'c' +Constant (const byte) sub::C = 'c' Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero SCREEN#0 in [3] *((const byte*) SCREEN#0 + (byte) 0) ← (byte) A#0 +Simplifying expression containing zero SCREEN in [3] *((const byte*) SCREEN + (byte) 0) ← (byte) A#0 Successful SSA optimization PassNSimplifyExpressionWithZero -Consolidated array index constant in *(SCREEN#0+1) -Consolidated array index constant in *(SCREEN#0+2) -Consolidated array index constant in *(SCREEN#0+3) -Consolidated array index constant in *(SCREEN#0+4) +Consolidated array index constant in *(SCREEN+1) +Consolidated array index constant in *(SCREEN+2) +Consolidated array index constant in *(SCREEN+3) +Consolidated array index constant in *(SCREEN+4) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @2 Adding NOP phi() at start of @3 @@ -151,9 +148,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (byte) A#0 - [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 - [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) + [4] *((const byte*) SCREEN) ← (byte) A#0 + [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B + [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) [7] call sub to:main::@return main::@return: scope:[main] from main @@ -162,9 +159,9 @@ main::@return: scope:[main] from main (void()) sub() sub: scope:[sub] from main - [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 + [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 - [11] *((const byte*) SCREEN#0+(byte) 4) ← (byte) sub::D#0 + [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 to:sub::@return sub::@return: scope:[sub] from sub [12] return @@ -174,12 +171,9 @@ sub::@return: scope:[sub] from sub VARIABLE REGISTER WEIGHTS (byte) A (byte) A#0 1.0 -(byte*) SCREEN (void()) main() -(byte) main::B (byte*) main::addrA (void()) sub() -(byte) sub::C (byte) sub::D (byte) sub::D#0 4.0 @@ -224,13 +218,13 @@ bend: main: { .const B = 'b' .label addrA = A - // [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + // [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1 lda.z A sta SCREEN - // [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B -- _deref_pbuc1=vbuc2 lda #B sta SCREEN+1 - // [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 lda.z addrA sta SCREEN+2 // [7] call sub @@ -245,14 +239,14 @@ main: { sub: { .const C = 'c' .label D = 3 - // [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C -- _deref_pbuc1=vbuc2 lda #C sta SCREEN+3 // [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 -- vbuz1=vbuz2_plus_1 ldy.z A iny sty.z D - // [11] *((const byte*) SCREEN#0+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuz1 + // [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuz1 lda.z D sta SCREEN+4 jmp breturn @@ -265,10 +259,10 @@ sub: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( [ A#0 ] ) always clobbers reg byte a -Statement [4] *((const byte*) SCREEN#0) ← (byte) A#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a -Statement [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a -Statement [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a -Statement [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 [ A#0 ] ( main:2::sub:7 [ A#0 ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← (byte) A#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C [ A#0 ] ( main:2::sub:7 [ A#0 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ A#0 ] : zp ZP_BYTE:2 , Potential registers zp ZP_BYTE:3 [ sub::D#0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -315,13 +309,13 @@ bend: main: { .const B = 'b' .label addrA = A - // [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + // [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1 lda.z A sta SCREEN - // [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B -- _deref_pbuc1=vbuc2 lda #B sta SCREEN+1 - // [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 lda.z addrA sta SCREEN+2 // [7] call sub @@ -335,13 +329,13 @@ main: { // sub sub: { .const C = 'c' - // [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C -- _deref_pbuc1=vbuc2 lda #C sta SCREEN+3 // [10] (byte) sub::D#0 ← (byte) A#0 + (byte) 1 -- vbuxx=vbuz1_plus_1 ldx.z A inx - // [11] *((const byte*) SCREEN#0+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx + // [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx stx SCREEN+4 jmp breturn // sub::@return @@ -374,18 +368,15 @@ FINAL SYMBOL TABLE (label) @end (byte) A (byte) A#0 A zp ZP_BYTE:2 1.0 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return -(byte) main::B -(const byte) main::B#0 B = (byte) 'b' +(const byte) main::B B = (byte) 'b' (byte*) main::addrA (const byte*) main::addrA#0 addrA = &(byte) A#0 (void()) sub() (label) sub::@return -(byte) sub::C -(const byte) sub::C#0 C = (byte) 'c' +(const byte) sub::C C = (byte) 'c' (byte) sub::D (byte) sub::D#0 reg byte x 4.0 @@ -424,15 +415,15 @@ main: { .const B = 'b' .label addrA = A // SCREEN[0] = A - // [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + // [4] *((const byte*) SCREEN) ← (byte) A#0 -- _deref_pbuc1=vbuz1 lda.z A sta SCREEN // SCREEN[1] = B - // [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 1) ← (const byte) main::B -- _deref_pbuc1=vbuc2 lda #B sta SCREEN+1 // SCREEN[2] = *addrA - // [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) SCREEN+(byte) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 lda.z addrA sta SCREEN+2 // sub() @@ -447,7 +438,7 @@ main: { sub: { .const C = 'c' // SCREEN[3] = C - // [9] *((const byte*) SCREEN#0+(byte) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) SCREEN+(byte) 3) ← (const byte) sub::C -- _deref_pbuc1=vbuc2 lda #C sta SCREEN+3 // D = A+1 @@ -455,7 +446,7 @@ sub: { ldx.z A inx // SCREEN[4] = D - // [11] *((const byte*) SCREEN#0+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx + // [11] *((const byte*) SCREEN+(byte) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx stx SCREEN+4 // sub::@return // } diff --git a/src/test/ref/const-early-identification.sym b/src/test/ref/const-early-identification.sym index d2beadb06..1c46bca3a 100644 --- a/src/test/ref/const-early-identification.sym +++ b/src/test/ref/const-early-identification.sym @@ -3,18 +3,15 @@ (label) @end (byte) A (byte) A#0 A zp ZP_BYTE:2 1.0 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return -(byte) main::B -(const byte) main::B#0 B = (byte) 'b' +(const byte) main::B B = (byte) 'b' (byte*) main::addrA (const byte*) main::addrA#0 addrA = &(byte) A#0 (void()) sub() (label) sub::@return -(byte) sub::C -(const byte) sub::C#0 C = (byte) 'c' +(const byte) sub::C C = (byte) 'c' (byte) sub::D (byte) sub::D#0 reg byte x 4.0 diff --git a/src/test/ref/const-if-problem.cfg b/src/test/ref/const-if-problem.cfg index 1835cfddc..599fbce88 100644 --- a/src/test/ref/const-if-problem.cfg +++ b/src/test/ref/const-if-problem.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) SCREEN#0) ← (byte) 'a' + [5] *((const byte*) SCREEN) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main::@1 [6] return diff --git a/src/test/ref/const-if-problem.log b/src/test/ref/const-if-problem.log index acb6321ad..47ab4434d 100644 --- a/src/test/ref/const-if-problem.log +++ b/src/test/ref/const-if-problem.log @@ -6,7 +6,7 @@ Culled Empty Block (label) @2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -14,7 +14,7 @@ main: scope:[main] from @3 if((number) 1==(number) 1) goto main::@1 to:main::@3 main::@1: scope:[main] from main - *((byte*) SCREEN#0 + (number) 0) ← (byte) 'a' + *((byte*) SCREEN + (number) 0) ← (byte) 'a' to:main::@return main::@3: scope:[main] from main call doit @@ -25,12 +25,12 @@ main::@return: scope:[main] from main::@1 main::@5 return to:@return @1: scope:[] from @begin - (byte) cc#0 ← (byte) 'b' + (byte) cc ← (byte) 'b' to:@3 (void()) doit() doit: scope:[doit] from main::@3 - *((byte*) SCREEN#0 + (number) 1) ← (byte) cc#0 + *((byte*) SCREEN + (number) 1) ← (byte) cc call doit2 to:doit::@1 doit::@1: scope:[doit] from doit @@ -41,7 +41,7 @@ doit::@return: scope:[doit] from doit::@1 (void()) doit2() doit2: scope:[doit2] from doit - *((byte*) SCREEN#0 + (number) 2) ← (byte) cc#0 + *((byte*) SCREEN + (number) 2) ← (byte) cc to:doit2::@return doit2::@return: scope:[doit2] from doit2 return @@ -60,9 +60,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte) cc -(byte) cc#0 (void()) doit() (label) doit::@1 (label) doit::@return @@ -74,11 +72,11 @@ SYMBOL TABLE SSA (label) main::@5 (label) main::@return -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) 'a' -Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (number) 1) ← (byte) cc#0 -Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← (byte) cc#0 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) 'a' +Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte) cc +Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte) cc Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -89,12 +87,12 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte) cc#0 = 'b' +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte) cc = 'b' Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [1] if((number) 1==(number) 1) goto main::@1 Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero SCREEN#0 in [2] *((const byte*) SCREEN#0 + (byte) 0) ← (byte) 'a' +Simplifying expression containing zero SCREEN in [2] *((const byte*) SCREEN + (byte) 0) ← (byte) 'a' Successful SSA optimization PassNSimplifyExpressionWithZero Removing unused block main::@3 Removing unused block main::@5 @@ -106,7 +104,7 @@ Removing unused procedure doit2 Removing unused procedure block doit2 Removing unused procedure block doit2::@return Successful SSA optimization Pass2EliminateUnusedBlocks -Eliminating unused constant (const byte) cc#0 +Eliminating unused constant (const byte) cc Successful SSA optimization PassNEliminateUnusedVars Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -143,7 +141,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) SCREEN#0) ← (byte) 'a' + [5] *((const byte*) SCREEN) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main::@1 [6] return @@ -151,8 +149,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN -(byte) cc (void()) main() Initial phi equivalence classes @@ -189,7 +185,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) SCREEN#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta SCREEN jmp breturn @@ -201,7 +197,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) SCREEN#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -240,7 +236,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) SCREEN#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta SCREEN jmp breturn @@ -276,9 +272,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte) cc +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return @@ -307,7 +301,7 @@ Score: 12 main: { // main::@1 // SCREEN[0] = 'a' - // [5] *((const byte*) SCREEN#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta SCREEN // main::@return diff --git a/src/test/ref/const-if-problem.sym b/src/test/ref/const-if-problem.sym index db98cf08d..8f92b859d 100644 --- a/src/test/ref/const-if-problem.sym +++ b/src/test/ref/const-if-problem.sym @@ -1,9 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte) cc +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/const-mult-div.cfg b/src/test/ref/const-mult-div.cfg index 8464cc471..b4e76a0ba 100644 --- a/src/test/ref/const-mult-div.cfg +++ b/src/test/ref/const-mult-div.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 + [4] *((const byte*) main::screen) ← (const byte) main::b to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/const-mult-div.log b/src/test/ref/const-mult-div.log index 608023c32..28ca4d85c 100644 --- a/src/test/ref/const-mult-div.log +++ b/src/test/ref/const-mult-div.log @@ -7,9 +7,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::b#0 ← (number) 6*(number) $e/(number) 3+(number) $16%(number) 3 - (byte*) main::screen#0 ← ((byte*)) (number) $400 - *((byte*) main::screen#0 + (number) 0) ← (byte) main::b#0 + (byte) main::b ← (number) 6*(number) $e/(number) 3+(number) $16%(number) 3 + (byte*) main::screen ← ((byte*)) (number) $400 + *((byte*) main::screen + (number) 0) ← (byte) main::b to:main::@return main::@return: scope:[main] from main return @@ -29,27 +29,25 @@ SYMBOL TABLE SSA (void()) main() (label) main::@return (byte) main::b -(byte) main::b#0 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) 6*$e/3+$16%3 in (byte) main::b#0 ← (number) 6*(number) $e/(number) 3+(number) $16%(number) 3 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) main::b#0 +Adding number conversion cast (unumber) 6*$e/3+$16%3 in (byte) main::b ← (number) 6*(number) $e/(number) 3+(number) $16%(number) 3 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) main::b Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::b#0 ← (unumber)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte) main::b ← (unumber)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte) main::b#0 ← (unumber)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 +Constant right-side identified [0] (byte) main::b ← (unumber)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::b#0 = (unumber)6*$e/3+$16%3 -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte) main::b = (unumber)6*$e/3+$16%3 +Constant (const byte*) main::screen = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [2] *((const byte*) main::screen#0 + (byte) 0) ← (const byte) main::b#0 +Simplifying expression containing zero main::screen in [2] *((const byte*) main::screen + (byte) 0) ← (const byte) main::b Successful SSA optimization PassNSimplifyExpressionWithZero Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -78,7 +76,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 + [4] *((const byte*) main::screen) ← (const byte) main::b to:main::@return main::@return: scope:[main] from main [5] return @@ -87,8 +85,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -120,7 +116,7 @@ bend: main: { .const b = 6*$e/3+mod($16,3) .label screen = $400 - // [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta screen jmp breturn @@ -132,7 +128,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen) ← (const byte) main::b [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -167,7 +163,7 @@ bend: main: { .const b = 6*$e/3+mod($16,3) .label screen = $400 - // [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta screen jmp breturn @@ -202,10 +198,8 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(byte) main::b -(const byte) main::b#0 b = (byte)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte) main::b b = (byte)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 +(const byte*) main::screen screen = (byte*) 1024 @@ -230,7 +224,7 @@ main: { .const b = 6*$e/3+mod($16,3) .label screen = $400 // screen[0] = b - // [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::b -- _deref_pbuc1=vbuc2 lda #b sta screen // main::@return diff --git a/src/test/ref/const-mult-div.sym b/src/test/ref/const-mult-div.sym index a61d1afd1..abf07b789 100644 --- a/src/test/ref/const-mult-div.sym +++ b/src/test/ref/const-mult-div.sym @@ -3,8 +3,6 @@ (label) @end (void()) main() (label) main::@return -(byte) main::b -(const byte) main::b#0 b = (byte)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte) main::b b = (byte)(number) 6*(number) $e/(number) 3+(number) $16%(number) 3 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/const-param.cfg b/src/test/ref/const-param.cfg index 4427b9568..2282a9a2e 100644 --- a/src/test/ref/const-param.cfg +++ b/src/test/ref/const-param.cfg @@ -16,19 +16,19 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) sum::return#0 - [8] *((const byte*) main::screen#0) ← (byte~) main::$0 + [8] *((const byte*) main::screen) ← (byte~) main::$0 [9] call sum [10] (byte) sum::return#1 ← (byte) sum::return#3 to:main::@2 main::@2: scope:[main] from main::@1 [11] (byte~) main::$1 ← (byte) sum::return#1 - [12] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$1 + [12] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$1 [13] call sum [14] (byte) sum::return#2 ← (byte) sum::return#3 to:main::@3 main::@3: scope:[main] from main::@2 [15] (byte~) main::$2 ← (byte) sum::return#2 - [16] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$2 + [16] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 [17] return diff --git a/src/test/ref/const-param.log b/src/test/ref/const-param.log index 185e4ff25..6f670e5bd 100644 --- a/src/test/ref/const-param.log +++ b/src/test/ref/const-param.log @@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::reverse ← (number) $80 (byte) sum::a#0 ← (byte) main::reverse (byte) sum::b#0 ← (byte) 'c' @@ -18,7 +18,7 @@ main: scope:[main] from @2 main::@1: scope:[main] from main (byte) sum::return#5 ← phi( main/(byte) sum::return#0 ) (byte~) main::$0 ← (byte) sum::return#5 - *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$0 + *((byte*) main::screen + (number) 0) ← (byte~) main::$0 (byte) sum::a#1 ← (byte) main::reverse (byte) sum::b#1 ← (byte) 'm' call sum @@ -27,7 +27,7 @@ main::@1: scope:[main] from main main::@2: scope:[main] from main::@1 (byte) sum::return#6 ← phi( main::@1/(byte) sum::return#1 ) (byte~) main::$1 ← (byte) sum::return#6 - *((byte*) main::screen#0 + (number) 1) ← (byte~) main::$1 + *((byte*) main::screen + (number) 1) ← (byte~) main::$1 (byte) sum::a#2 ← (byte) main::reverse (byte) sum::b#2 ← (byte) 'l' call sum @@ -36,7 +36,7 @@ main::@2: scope:[main] from main::@1 main::@3: scope:[main] from main::@2 (byte) sum::return#7 ← phi( main::@2/(byte) sum::return#2 ) (byte~) main::$2 ← (byte) sum::return#7 - *((byte*) main::screen#0 + (number) 2) ← (byte~) main::$2 + *((byte*) main::screen + (number) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 return @@ -76,7 +76,6 @@ SYMBOL TABLE SSA (label) main::@return (byte) main::reverse (byte*) main::screen -(byte*) main::screen#0 (byte()) sum((byte) sum::a , (byte) sum::b) (byte~) sum::$0 (label) sum::@return @@ -102,11 +101,11 @@ SYMBOL TABLE SSA (byte) sum::return#8 Adding number conversion cast (unumber) $80 in (byte) main::reverse ← (number) $80 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$0 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte~) main::$1 -Adding number conversion cast (unumber) 2 in *((byte*) main::screen#0 + (number) 2) ← (byte~) main::$2 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte~) main::$0 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← (byte~) main::$1 +Adding number conversion cast (unumber) 2 in *((byte*) main::screen + (number) 2) ← (byte~) main::$2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte) main::reverse ← (unumber)(number) $80 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -125,7 +124,7 @@ Alias (byte) sum::return#1 = (byte) sum::return#6 Alias (byte) sum::return#2 = (byte) sum::return#7 Alias (byte) sum::return#3 = (byte~) sum::$0 (byte) sum::return#8 (byte) sum::return#4 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::reverse = $80 Constant (const byte) sum::b#0 = 'c' Constant (const byte) sum::b#1 = 'm' @@ -135,7 +134,7 @@ Constant (const byte) sum::a#0 = main::reverse Constant (const byte) sum::a#1 = main::reverse Constant (const byte) sum::a#2 = main::reverse Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [8] *((const byte*) main::screen#0 + (byte) 0) ← (byte~) main::$0 +Simplifying expression containing zero main::screen in [8] *((const byte*) main::screen + (byte) 0) ← (byte~) main::$0 Successful SSA optimization PassNSimplifyExpressionWithZero Inlining constant with var siblings (const byte) sum::b#0 Inlining constant with var siblings (const byte) sum::b#1 @@ -150,8 +149,8 @@ Constant inlined sum::b#0 = (byte) 'c' Constant inlined sum::b#2 = (byte) 'l' Constant inlined sum::a#0 = (const byte) main::reverse Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::screen#0+1) -Consolidated array index constant in *(main::screen#0+2) +Consolidated array index constant in *(main::screen+1) +Consolidated array index constant in *(main::screen+2) Successful SSA optimization Pass2ConstantAdditionElimination Identical Phi Values (byte) sum::a#3 (const byte) main::reverse Successful SSA optimization Pass2IdenticalPhiElimination @@ -192,19 +191,19 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [7] (byte~) main::$0 ← (byte) sum::return#0 - [8] *((const byte*) main::screen#0) ← (byte~) main::$0 + [8] *((const byte*) main::screen) ← (byte~) main::$0 [9] call sum [10] (byte) sum::return#1 ← (byte) sum::return#3 to:main::@2 main::@2: scope:[main] from main::@1 [11] (byte~) main::$1 ← (byte) sum::return#1 - [12] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$1 + [12] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$1 [13] call sum [14] (byte) sum::return#2 ← (byte) sum::return#3 to:main::@3 main::@3: scope:[main] from main::@2 [15] (byte~) main::$2 ← (byte) sum::return#2 - [16] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$2 + [16] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 [17] return @@ -225,7 +224,6 @@ VARIABLE REGISTER WEIGHTS (byte~) main::$0 4.0 (byte~) main::$1 4.0 (byte~) main::$2 4.0 -(byte*) main::screen (byte()) sum((byte) sum::a , (byte) sum::b) (byte) sum::a (byte) sum::b @@ -311,7 +309,7 @@ main: { // [7] (byte~) main::$0 ← (byte) sum::return#0 -- vbuz1=vbuz2 lda.z sum.return sta.z _0 - // [8] *((const byte*) main::screen#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 + // [8] *((const byte*) main::screen) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 lda.z _0 sta screen // [9] call sum @@ -330,7 +328,7 @@ main: { // [11] (byte~) main::$1 ← (byte) sum::return#1 -- vbuz1=vbuz2 lda.z sum.return_1 sta.z _1 - // [12] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 + // [12] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 lda.z _1 sta screen+1 // [13] call sum @@ -349,7 +347,7 @@ main: { // [15] (byte~) main::$2 ← (byte) sum::return#2 -- vbuz1=vbuz2 lda.z sum.return_2 sta.z _2 - // [16] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 + // [16] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 lda.z _2 sta screen+2 jmp breturn @@ -439,7 +437,7 @@ main: { // main::@1 b1: // [7] (byte~) main::$0 ← (byte) sum::return#0 - // [8] *((const byte*) main::screen#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa sta screen // [9] call sum // [18] phi from main::@1 to sum [phi:main::@1->sum] @@ -452,7 +450,7 @@ main: { // main::@2 b2: // [11] (byte~) main::$1 ← (byte) sum::return#1 - // [12] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [12] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta screen+1 // [13] call sum // [18] phi from main::@2 to sum [phi:main::@2->sum] @@ -465,7 +463,7 @@ main: { // main::@3 b3: // [15] (byte~) main::$2 ← (byte) sum::return#2 - // [16] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta screen+2 jmp breturn // main::@return @@ -530,8 +528,7 @@ FINAL SYMBOL TABLE (label) main::@3 (label) main::@return (const byte) main::reverse reverse = (byte) $80 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (byte()) sum((byte) sum::a , (byte) sum::b) (label) sum::@return (byte) sum::a @@ -585,7 +582,7 @@ main: { // main::@1 // [7] (byte~) main::$0 ← (byte) sum::return#0 // screen[0] = sum(reverse, 'c') - // [8] *((const byte*) main::screen#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa sta screen // sum(reverse, 'm') // [9] call sum @@ -598,7 +595,7 @@ main: { // main::@2 // [11] (byte~) main::$1 ← (byte) sum::return#1 // screen[1] = sum(reverse, 'm') - // [12] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [12] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta screen+1 // sum(reverse, 'l') // [13] call sum @@ -611,7 +608,7 @@ main: { // main::@3 // [15] (byte~) main::$2 ← (byte) sum::return#2 // screen[2] = sum(reverse, 'l') - // [16] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta screen+2 // main::@return // } diff --git a/src/test/ref/const-param.sym b/src/test/ref/const-param.sym index d3fdafac6..87c9ab712 100644 --- a/src/test/ref/const-param.sym +++ b/src/test/ref/const-param.sym @@ -10,8 +10,7 @@ (label) main::@3 (label) main::@return (const byte) main::reverse reverse = (byte) $80 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (byte()) sum((byte) sum::a , (byte) sum::b) (label) sum::@return (byte) sum::a diff --git a/src/test/ref/const-pointer.cfg b/src/test/ref/const-pointer.cfg index 56477eb1d..25e4446bb 100644 --- a/src/test/ref/const-pointer.cfg +++ b/src/test/ref/const-pointer.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0) ← (byte) '*' + [5] *((const byte*) main::screen) ← (byte) '*' to:main::@return main::@return: scope:[main] from main::@1 [6] return diff --git a/src/test/ref/const-pointer.log b/src/test/ref/const-pointer.log index 50e6b24c9..628db8cf7 100644 --- a/src/test/ref/const-pointer.log +++ b/src/test/ref/const-pointer.log @@ -10,17 +10,17 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 - (byte*) main::NULL#0 ← ((byte*)) (number) 0 - (byte*) main::rem#0 ← ((byte*)) (number) $ff - (bool~) main::$0 ← (byte*) main::rem#0 != (byte*) main::NULL#0 + (byte*) main::screen ← ((byte*)) (number) $400 + (byte*) main::NULL ← ((byte*)) (number) 0 + (byte*) main::rem ← ((byte*)) (number) $ff + (bool~) main::$0 ← (byte*) main::rem != (byte*) main::NULL if((bool~) main::$0) goto main::@1 to:main::@3 main::@1: scope:[main] from main - *((byte*) main::screen#0 + (number) 0) ← (byte) '*' + *((byte*) main::screen + (number) 0) ← (byte) '*' to:main::@return main::@3: scope:[main] from main - *((byte*) main::screen#0 + (number) 0) ← (byte) '.' + *((byte*) main::screen + (number) 0) ← (byte) '.' to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -43,18 +43,15 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::NULL -(byte*) main::NULL#0 (byte*) main::rem -(byte*) main::rem#0 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) '*' -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) '.' +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) '*' +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) '.' Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 -Inlining cast (byte*) main::NULL#0 ← (byte*)(number) 0 -Inlining cast (byte*) main::rem#0 ← (byte*)(number) $ff +Inlining cast (byte*) main::screen ← (byte*)(number) $400 +Inlining cast (byte*) main::NULL ← (byte*)(number) 0 +Inlining cast (byte*) main::rem ← (byte*)(number) $ff Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant pointer cast (byte*) 0 @@ -65,19 +62,19 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Simple Condition (bool~) main::$0 [4] if((byte*) main::rem#0!=(byte*) main::NULL#0) goto main::@1 +Simple Condition (bool~) main::$0 [4] if((byte*) main::rem!=(byte*) main::NULL) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::screen#0 = (byte*) 1024 -Constant (const byte*) main::NULL#0 = (byte*) 0 -Constant (const byte*) main::rem#0 = (byte*) 255 +Constant (const byte*) main::screen = (byte*) 1024 +Constant (const byte*) main::NULL = (byte*) 0 +Constant (const byte*) main::rem = (byte*) 255 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [4] if((const byte*) main::rem#0!=(const byte*) main::NULL#0) goto main::@1 +if() condition always true - replacing block destination [4] if((const byte*) main::rem!=(const byte*) main::NULL) goto main::@1 Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero main::screen#0 in [5] *((const byte*) main::screen#0 + (byte) 0) ← (byte) '*' -Simplifying expression containing zero main::screen#0 in [6] *((const byte*) main::screen#0 + (byte) 0) ← (byte) '.' +Simplifying expression containing zero main::screen in [5] *((const byte*) main::screen + (byte) 0) ← (byte) '*' +Simplifying expression containing zero main::screen in [6] *((const byte*) main::screen + (byte) 0) ← (byte) '.' Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused constant (const byte*) main::NULL#0 -Eliminating unused constant (const byte*) main::rem#0 +Eliminating unused constant (const byte*) main::NULL +Eliminating unused constant (const byte*) main::rem Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@3 Successful SSA optimization Pass2EliminateUnusedBlocks @@ -113,7 +110,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::screen#0) ← (byte) '*' + [5] *((const byte*) main::screen) ← (byte) '*' to:main::@return main::@return: scope:[main] from main::@1 [6] return @@ -122,9 +119,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::NULL -(byte*) main::rem -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -160,7 +154,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::screen#0) ← (byte) '*' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) '*' -- _deref_pbuc1=vbuc2 lda #'*' sta screen jmp breturn @@ -172,7 +166,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::screen) ← (byte) '*' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -211,7 +205,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::screen#0) ← (byte) '*' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) '*' -- _deref_pbuc1=vbuc2 lda #'*' sta screen jmp breturn @@ -250,10 +244,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::NULL -(byte*) main::rem -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 @@ -279,7 +270,7 @@ main: { .label screen = $400 // main::@1 // screen[0] = '*' - // [5] *((const byte*) main::screen#0) ← (byte) '*' -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen) ← (byte) '*' -- _deref_pbuc1=vbuc2 lda #'*' sta screen // main::@return diff --git a/src/test/ref/const-pointer.sym b/src/test/ref/const-pointer.sym index 1627f4ec0..d0d36dce2 100644 --- a/src/test/ref/const-pointer.sym +++ b/src/test/ref/const-pointer.sym @@ -4,8 +4,5 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::NULL -(byte*) main::rem -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/const-signed-promotion.cfg b/src/test/ref/const-signed-promotion.cfg index 64011d92c..b260c4ac0 100644 --- a/src/test/ref/const-signed-promotion.cfg +++ b/src/test/ref/const-signed-promotion.cfg @@ -20,7 +20,7 @@ main::@1: scope:[main] from main main::@1 [9] if((byte) main::i#1!=(byte) 3) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) + [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) to:main::@return main::@return: scope:[main] from main::@2 [11] return diff --git a/src/test/ref/const-signed-promotion.log b/src/test/ref/const-signed-promotion.log index efaa2f78c..215a27444 100644 --- a/src/test/ref/const-signed-promotion.log +++ b/src/test/ref/const-signed-promotion.log @@ -20,9 +20,9 @@ main::@1: scope:[main] from main main::@1 if((bool~) main::$0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - (signed word*) main::screen#0 ← ((signed word*)) (number) $400 + (signed word*) main::screen ← ((signed word*)) (number) $400 (number~) main::$2 ← (number) 0 * (const byte) SIZEOF_SIGNED_WORD - *((signed word*) main::screen#0) ← *((signed word[3]) world + (number~) main::$2) + *((signed word*) main::screen) ← *((signed word[3]) world + (number~) main::$2) to:main::@return main::@return: scope:[main] from main::@2 return @@ -52,7 +52,6 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 (signed word*) main::screen -(signed word*) main::screen#0 (signed word[3]) world Adding number conversion cast (snumber) $190 in *((signed word[3]) world + (byte~) main::$1) ← (number) $190 @@ -60,7 +59,7 @@ Adding number conversion cast (unumber) 0 in (number~) main::$2 ← (number) 0 * Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (unumber)(number) 0 * (const byte) SIZEOF_SIGNED_WORD Successful SSA optimization PassNAddNumberTypeConversions Inlining cast *((signed word[3]) world + (byte~) main::$1) ← (snumber)(number) $190 -Inlining cast (signed word*) main::screen#0 ← (signed word*)(number) $400 +Inlining cast (signed word*) main::screen ← (signed word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $190 Simplifying constant pointer cast (signed word*) 1024 @@ -77,14 +76,14 @@ Constant right-side identified [9] (byte~) main::$2 ← (byte) 0 * (const byte) Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const signed word[3]) world = { fill( 3, 0) } Constant (const byte) main::i#0 = 0 -Constant (const signed word*) main::screen#0 = (signed word*) 1024 +Constant (const signed word*) main::screen = (signed word*) 1024 Constant (const byte) main::$2 = 0*SIZEOF_SIGNED_WORD Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [7] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3 Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_SIGNED_WORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero world in [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world + (const byte) main::$2) +Simplifying expression containing zero world in [10] *((const signed word*) main::screen) ← *((const signed word[3]) world + (const byte) main::$2) Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$2 Successful SSA optimization PassNEliminateUnusedVars @@ -143,7 +142,7 @@ main::@1: scope:[main] from main main::@1 [9] if((byte) main::i#1!=(byte) 3) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) + [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) to:main::@return main::@return: scope:[main] from main::@2 [11] return @@ -156,7 +155,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 11.0 -(signed word*) main::screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -228,7 +226,7 @@ main: { jmp b2 // main::@2 b2: - // [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 + // [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 lda world sta screen lda world+1 @@ -246,10 +244,10 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$1 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) 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 [7] *((const signed word[3]) world + (byte~) main::$1) ← (signed word) $190 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] (byte~) main::$1 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a Statement [7] *((const signed word[3]) world + (byte~) main::$1) ← (signed word) $190 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) [ ] ( 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 , Potential registers zp ZP_BYTE:3 [ main::$1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -315,7 +313,7 @@ main: { jmp b2 // main::@2 b2: - // [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 + // [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 lda world sta screen lda world+1 @@ -368,8 +366,7 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 11.0 -(signed word*) main::screen -(const signed word*) main::screen#0 screen = (signed word*) 1024 +(const signed word*) main::screen screen = (signed word*) 1024 (const signed word[3]) world world = { fill( 3, 0) } reg byte x [ main::i#2 main::i#1 ] @@ -421,7 +418,7 @@ main: { bne b1 // main::@2 // *screen = world[0] - // [10] *((const signed word*) main::screen#0) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 + // [10] *((const signed word*) main::screen) ← *((const signed word[3]) world) -- _deref_pwsc1=_deref_pwsc2 lda world sta screen lda world+1 diff --git a/src/test/ref/const-signed-promotion.sym b/src/test/ref/const-signed-promotion.sym index 015995472..ea5ce9f1a 100644 --- a/src/test/ref/const-signed-promotion.sym +++ b/src/test/ref/const-signed-promotion.sym @@ -9,8 +9,7 @@ (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 11.0 -(signed word*) main::screen -(const signed word*) main::screen#0 screen = (signed word*) 1024 +(const signed word*) main::screen screen = (signed word*) 1024 (const signed word[3]) world world = { fill( 3, 0) } reg byte x [ main::i#2 main::i#1 ] diff --git a/src/test/ref/const-word-pointer.cfg b/src/test/ref/const-word-pointer.cfg index 6b236bf3a..20aa2b336 100644 --- a/src/test/ref/const-word-pointer.cfg +++ b/src/test/ref/const-word-pointer.cfg @@ -12,14 +12,14 @@ main: scope:[main] from @1 [4] (word) main::w#0 ← (word) $d03 [5] (byte~) main::$1 ← < *((const word*) main::wp#0) - [6] *((const byte*) main::screen#0) ← (byte~) main::$1 + [6] *((const byte*) main::screen) ← (byte~) main::$1 [7] (byte~) main::$2 ← > *((const word*) main::wp#0) - [8] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$2 + [8] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$2 [9] *((const word*) main::wp#0) ← (word) $210c [10] (byte~) main::$3 ← < *((const word*) main::wp#0) - [11] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$3 + [11] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$3 [12] (byte~) main::$4 ← > *((const word*) main::wp#0) - [13] *((const byte*) main::screen#0+(byte) 3) ← (byte~) main::$4 + [13] *((const byte*) main::screen+(byte) 3) ← (byte~) main::$4 to:main::@return main::@return: scope:[main] from main [14] return diff --git a/src/test/ref/const-word-pointer.log b/src/test/ref/const-word-pointer.log index b4ebf6a21..44e8973f0 100644 --- a/src/test/ref/const-word-pointer.log +++ b/src/test/ref/const-word-pointer.log @@ -7,19 +7,19 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (word) main::w#0 ← (number) $d03 (word*~) main::$0 ← & (word) main::w#0 (word*) main::wp#0 ← (word*~) main::$0 (byte~) main::$1 ← < *((word*) main::wp#0) - *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$1 + *((byte*) main::screen + (number) 0) ← (byte~) main::$1 (byte~) main::$2 ← > *((word*) main::wp#0) - *((byte*) main::screen#0 + (number) 1) ← (byte~) main::$2 + *((byte*) main::screen + (number) 1) ← (byte~) main::$2 *((word*) main::wp#0) ← (number) $210c (byte~) main::$3 ← < *((word*) main::wp#0) - *((byte*) main::screen#0 + (number) 2) ← (byte~) main::$3 + *((byte*) main::screen + (number) 2) ← (byte~) main::$3 (byte~) main::$4 ← > *((word*) main::wp#0) - *((byte*) main::screen#0 + (number) 3) ← (byte~) main::$4 + *((byte*) main::screen + (number) 3) ← (byte~) main::$4 to:main::@return main::@return: scope:[main] from main return @@ -44,20 +44,19 @@ SYMBOL TABLE SSA (byte~) main::$4 (label) main::@return (byte*) main::screen -(byte*) main::screen#0 (word) main::w (word) main::w#0 (word*) main::wp (word*) main::wp#0 Adding number conversion cast (unumber) $d03 in (word) main::w#0 ← (number) $d03 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$1 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte~) main::$2 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte~) main::$1 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← (byte~) main::$2 Adding number conversion cast (unumber) $210c in *((word*) main::wp#0) ← (number) $210c -Adding number conversion cast (unumber) 2 in *((byte*) main::screen#0 + (number) 2) ← (byte~) main::$3 -Adding number conversion cast (unumber) 3 in *((byte*) main::screen#0 + (number) 3) ← (byte~) main::$4 +Adding number conversion cast (unumber) 2 in *((byte*) main::screen + (number) 2) ← (byte~) main::$3 +Adding number conversion cast (unumber) 3 in *((byte*) main::screen + (number) 3) ← (byte~) main::$4 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (word) main::w#0 ← (unumber)(number) $d03 Inlining cast *((word*) main::wp#0) ← (unumber)(number) $210c Successful SSA optimization Pass2InlineCast @@ -80,14 +79,14 @@ Alias (word*) main::wp#0 = (word*~) main::$0 Successful SSA optimization Pass2AliasElimination Constant right-side identified [2] (word*) main::wp#0 ← & (word) main::w#0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const word*) main::wp#0 = &main::w#0 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [5] *((const byte*) main::screen#0 + (byte) 0) ← (byte~) main::$1 +Simplifying expression containing zero main::screen in [5] *((const byte*) main::screen + (byte) 0) ← (byte~) main::$1 Successful SSA optimization PassNSimplifyExpressionWithZero -Consolidated array index constant in *(main::screen#0+1) -Consolidated array index constant in *(main::screen#0+2) -Consolidated array index constant in *(main::screen#0+3) +Consolidated array index constant in *(main::screen+1) +Consolidated array index constant in *(main::screen+2) +Consolidated array index constant in *(main::screen+3) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -118,14 +117,14 @@ FINAL CONTROL FLOW GRAPH main: scope:[main] from @1 [4] (word) main::w#0 ← (word) $d03 [5] (byte~) main::$1 ← < *((const word*) main::wp#0) - [6] *((const byte*) main::screen#0) ← (byte~) main::$1 + [6] *((const byte*) main::screen) ← (byte~) main::$1 [7] (byte~) main::$2 ← > *((const word*) main::wp#0) - [8] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$2 + [8] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$2 [9] *((const word*) main::wp#0) ← (word) $210c [10] (byte~) main::$3 ← < *((const word*) main::wp#0) - [11] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$3 + [11] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$3 [12] (byte~) main::$4 ← > *((const word*) main::wp#0) - [13] *((const byte*) main::screen#0+(byte) 3) ← (byte~) main::$4 + [13] *((const byte*) main::screen+(byte) 3) ← (byte~) main::$4 to:main::@return main::@return: scope:[main] from main [14] return @@ -138,7 +137,6 @@ VARIABLE REGISTER WEIGHTS (byte~) main::$2 4.0 (byte~) main::$3 4.0 (byte~) main::$4 4.0 -(byte*) main::screen (word) main::w (word) main::w#0 20.0 (word*) main::wp @@ -201,13 +199,13 @@ main: { // [5] (byte~) main::$1 ← < *((const word*) main::wp#0) -- vbuz1=_lo__deref_pwuc1 lda.z wp sta.z _1 - // [6] *((const byte*) main::screen#0) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 + // [6] *((const byte*) main::screen) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 lda.z _1 sta screen // [7] (byte~) main::$2 ← > *((const word*) main::wp#0) -- vbuz1=_hi__deref_pwuc1 lda.z wp+1 sta.z _2 - // [8] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 + // [8] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 lda.z _2 sta screen+1 // [9] *((const word*) main::wp#0) ← (word) $210c -- _deref_pwuc1=vwuc2 @@ -218,13 +216,13 @@ main: { // [10] (byte~) main::$3 ← < *((const word*) main::wp#0) -- vbuz1=_lo__deref_pwuc1 lda.z wp sta.z _3 - // [11] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1 + // [11] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1 lda.z _3 sta screen+2 // [12] (byte~) main::$4 ← > *((const word*) main::wp#0) -- vbuz1=_hi__deref_pwuc1 lda.z wp+1 sta.z _4 - // [13] *((const byte*) main::screen#0+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::screen+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1 lda.z _4 sta screen+3 jmp breturn @@ -287,11 +285,11 @@ main: { sta.z w+1 // [5] (byte~) main::$1 ← < *((const word*) main::wp#0) -- vbuaa=_lo__deref_pwuc1 lda.z wp - // [6] *((const byte*) main::screen#0) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [6] *((const byte*) main::screen) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta screen // [7] (byte~) main::$2 ← > *((const word*) main::wp#0) -- vbuaa=_hi__deref_pwuc1 lda.z wp+1 - // [8] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta screen+1 // [9] *((const word*) main::wp#0) ← (word) $210c -- _deref_pwuc1=vwuc2 lda #<$210c @@ -300,11 +298,11 @@ main: { sta.z wp+1 // [10] (byte~) main::$3 ← < *((const word*) main::wp#0) -- vbuaa=_lo__deref_pwuc1 lda.z wp - // [11] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa + // [11] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa sta screen+2 // [12] (byte~) main::$4 ← > *((const word*) main::wp#0) -- vbuaa=_hi__deref_pwuc1 lda.z wp+1 - // [13] *((const byte*) main::screen#0+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa + // [13] *((const byte*) main::screen+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa sta screen+3 jmp breturn // main::@return @@ -342,8 +340,7 @@ FINAL SYMBOL TABLE (byte~) main::$3 reg byte a 4.0 (byte~) main::$4 reg byte a 4.0 (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (word) main::w (word) main::w#0 w zp ZP_WORD:2 20.0 (word*) main::wp @@ -388,13 +385,13 @@ main: { // [5] (byte~) main::$1 ← < *((const word*) main::wp#0) -- vbuaa=_lo__deref_pwuc1 lda.z wp // screen[0] = <*wp - // [6] *((const byte*) main::screen#0) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [6] *((const byte*) main::screen) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta screen // >*wp // [7] (byte~) main::$2 ← > *((const word*) main::wp#0) -- vbuaa=_hi__deref_pwuc1 lda.z wp+1 // screen[1] = >*wp - // [8] *((const byte*) main::screen#0+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa + // [8] *((const byte*) main::screen+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta screen+1 // *wp = $210c // [9] *((const word*) main::wp#0) ← (word) $210c -- _deref_pwuc1=vwuc2 @@ -406,13 +403,13 @@ main: { // [10] (byte~) main::$3 ← < *((const word*) main::wp#0) -- vbuaa=_lo__deref_pwuc1 lda.z wp // screen[2] = <*wp - // [11] *((const byte*) main::screen#0+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa + // [11] *((const byte*) main::screen+(byte) 2) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa sta screen+2 // >*wp // [12] (byte~) main::$4 ← > *((const word*) main::wp#0) -- vbuaa=_hi__deref_pwuc1 lda.z wp+1 // screen[3] = >*wp - // [13] *((const byte*) main::screen#0+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa + // [13] *((const byte*) main::screen+(byte) 3) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa sta screen+3 // main::@return // } diff --git a/src/test/ref/const-word-pointer.sym b/src/test/ref/const-word-pointer.sym index 5fdd1c21e..4d9d12f68 100644 --- a/src/test/ref/const-word-pointer.sym +++ b/src/test/ref/const-word-pointer.sym @@ -7,8 +7,7 @@ (byte~) main::$3 reg byte a 4.0 (byte~) main::$4 reg byte a 4.0 (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (word) main::w (word) main::w#0 w zp ZP_WORD:2 20.0 (word*) main::wp diff --git a/src/test/ref/constant-string-concat-0.cfg b/src/test/ref/constant-string-concat-0.cfg index 7844e6b98..502717f22 100644 --- a/src/test/ref/constant-string-concat-0.cfg +++ b/src/test/ref/constant-string-concat-0.cfg @@ -20,6 +20,6 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) + [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 diff --git a/src/test/ref/constant-string-concat-0.log b/src/test/ref/constant-string-concat-0.log index 27943c605..22ac5bdf4 100644 --- a/src/test/ref/constant-string-concat-0.log +++ b/src/test/ref/constant-string-concat-0.log @@ -11,7 +11,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte[]) main::msg ← (const string) main::$1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (number) 0 to:main::@1 main::@1: scope:[main] from main main::@2 @@ -21,7 +21,7 @@ main::@1: scope:[main] from main main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) main::SCREEN#0 + (byte) main::i#3) ← *((byte[]) main::msg + (byte) main::i#3) + *((byte*) main::SCREEN + (byte) main::i#3) ← *((byte[]) main::msg + (byte) main::i#3) (byte) main::i#1 ← ++ (byte) main::i#3 to:main::@1 main::@return: scope:[main] from main::@1 @@ -46,7 +46,6 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -57,7 +56,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← *((byte[]) main::msg + (byte) main::i#2) != (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -72,7 +71,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [5] if(*((byte[]) main::msg + (byte) main::i#2)!=(byte) 0) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte[]) main::msg = main::$1 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 @@ -119,14 +118,13 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) + [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 22.0 (byte) main::i#2 18.333333333333332 @@ -186,7 +184,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda msg,y sta SCREEN,y @@ -204,9 +202,9 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((const byte[]) main::msg + (byte) main::i#2)!=(byte) 0) goto main::@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*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [6] if(*((const byte[]) main::msg + (byte) main::i#2)!=(byte) 0) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -261,7 +259,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta SCREEN,x // [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -305,8 +303,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 18.333333333333332 @@ -352,7 +349,7 @@ main: { // main::@2 b2: // SCREEN[i] = msg[i] - // [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta SCREEN,x // for( byte i=0;msg[i]!=0;i++) diff --git a/src/test/ref/constant-string-concat-0.sym b/src/test/ref/constant-string-concat-0.sym index 3194272bb..2cc567ff7 100644 --- a/src/test/ref/constant-string-concat-0.sym +++ b/src/test/ref/constant-string-concat-0.sym @@ -5,8 +5,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 18.333333333333332 diff --git a/src/test/ref/constant-string-concat.cfg b/src/test/ref/constant-string-concat.cfg index 77595d272..e08fa5fc3 100644 --- a/src/test/ref/constant-string-concat.cfg +++ b/src/test/ref/constant-string-concat.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 8) goto main::@1 to:main::@return diff --git a/src/test/ref/constant-string-concat.log b/src/test/ref/constant-string-concat.log index e9816a3b1..a07fe8419 100644 --- a/src/test/ref/constant-string-concat.log +++ b/src/test/ref/constant-string-concat.log @@ -8,12 +8,12 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte[]) main::s ← (const string) main::$1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← *((byte[]) main::s + (byte) main::i#2) + *((byte*) main::SCREEN + (byte) main::i#2) ← *((byte[]) main::s + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,7) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,7) if((bool~) main::$0) goto main::@1 @@ -39,21 +39,20 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 (byte) main::i#2 (byte[]) main::s -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte[]) main::s = main::$1 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::i#1 ← ++ main::i#2 to ++ @@ -104,7 +103,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 8) goto main::@1 to:main::@return @@ -115,7 +114,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 22.0 @@ -167,7 +165,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda s,y sta SCREEN,y @@ -188,9 +186,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (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 [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -238,7 +236,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda s,x sta SCREEN,x // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -288,8 +286,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 @@ -326,7 +323,7 @@ main: { // main::@1 b1: // SCREEN[i] = s[i] - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte[]) main::s + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda s,x sta SCREEN,x // for( byte i: 0..7) diff --git a/src/test/ref/constant-string-concat.sym b/src/test/ref/constant-string-concat.sym index 69a715a3e..fabc1f4fe 100644 --- a/src/test/ref/constant-string-concat.sym +++ b/src/test/ref/constant-string-concat.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 diff --git a/src/test/ref/constantmin.cfg b/src/test/ref/constantmin.cfg index 7d7462b31..c2173928e 100644 --- a/src/test/ref/constantmin.cfg +++ b/src/test/ref/constantmin.cfg @@ -11,7 +11,7 @@ (void()) main() main: scope:[main] from @1 [4] *((const byte*) SCREEN) ← (const byte) STAR - [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 + [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED to:main::@1 main::@1: scope:[main] from main main::@1 [6] (byte) main::i#2 ← phi( main/(byte) $28 main::@1/(byte) main::i#1 ) diff --git a/src/test/ref/constantmin.log b/src/test/ref/constantmin.log index a31bcc996..f929497da 100644 --- a/src/test/ref/constantmin.log +++ b/src/test/ref/constantmin.log @@ -6,18 +6,18 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN ← ((byte*)) (number) $400 (byte) STAR ← (number) $51 - (byte*) VIC#0 ← ((byte*)) (number) $d000 - (byte*~) $0 ← (byte*) VIC#0 + (number) $10*(number) 2 + (byte*) VIC ← ((byte*)) (number) $d000 + (byte*~) $0 ← (byte*) VIC + (number) $10*(number) 2 (byte*~) $1 ← (byte*~) $0 + (number) 1 (byte*) BGCOL#0 ← (byte*~) $1 - (byte) RED#0 ← (number) 2 + (byte) RED ← (number) 2 to:@1 (void()) main() main: scope:[main] from @1 (byte*) BGCOL#1 ← phi( @1/(byte*) BGCOL#2 ) *((byte*) SCREEN) ← (byte) STAR - *((byte*) BGCOL#1) ← (byte) RED#0 + *((byte*) BGCOL#1) ← (byte) RED (byte) main::i#0 ← (byte) $28 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -51,11 +51,9 @@ SYMBOL TABLE SSA (byte*) BGCOL#1 (byte*) BGCOL#2 (byte) RED -(byte) RED#0 (byte*) SCREEN (byte) STAR (byte*) VIC -(byte*) VIC#0 (void()) main() (number~) main::$0 (bool~) main::$1 @@ -67,16 +65,16 @@ SYMBOL TABLE SSA (byte) main::i#2 Adding number conversion cast (unumber) $51 in (byte) STAR ← (number) $51 -Adding number conversion cast (unumber) $10*2 in (byte*~) $0 ← (byte*) VIC#0 + (number) $10*(number) 2 +Adding number conversion cast (unumber) $10*2 in (byte*~) $0 ← (byte*) VIC + (number) $10*(number) 2 Adding number conversion cast (unumber) 1 in (byte*~) $1 ← (byte*~) $0 + (number) 1 -Adding number conversion cast (unumber) 2 in (byte) RED#0 ← (number) 2 +Adding number conversion cast (unumber) 2 in (byte) RED ← (number) 2 Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) STAR + (number) 1 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) STAR + (unumber)(number) 1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) STAR ← (unumber)(number) $51 -Inlining cast (byte*) VIC#0 ← (byte*)(number) $d000 -Inlining cast (byte) RED#0 ← (unumber)(number) 2 +Inlining cast (byte*) VIC ← (byte*)(number) $d000 +Inlining cast (byte) RED ← (unumber)(number) 2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $51 @@ -99,13 +97,13 @@ Simple Condition (bool~) main::$1 [16] if((byte) main::i#1!=rangelast($28,$4f)) Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) STAR = $51 -Constant (const byte*) VIC#0 = (byte*) 53248 -Constant (const byte) RED#0 = 2 +Constant (const byte*) VIC = (byte*) 53248 +Constant (const byte) RED = 2 Constant (const byte) main::i#0 = $28 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [14] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [16] if(main::i#1!=rangelast($28,$4f)) goto main::@1 to (number) $50 -Converting *(pointer+n) to pointer[n] [9] *((byte*) BGCOL#0) ← (const byte) RED#0 -- *($0 + 1) +Converting *(pointer+n) to pointer[n] [9] *((byte*) BGCOL#0) ← (const byte) RED -- *($0 + 1) Successful SSA optimization Pass2InlineDerefIdx Eliminating unused variable (byte*) BGCOL#0 and assignment [1] (byte*) BGCOL#0 ← (byte*~) $0 + (byte) 1 Successful SSA optimization PassNEliminateUnusedVars @@ -115,18 +113,18 @@ Simplifying constant integer cast $50 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $50 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*~) $0 ← (const byte*) VIC#0 + (byte)(number) $10*(number) 2 +Constant right-side identified [0] (byte*~) $0 ← (const byte*) VIC + (byte)(number) $10*(number) 2 Constant right-side identified [4] (byte~) main::$0 ← (const byte) STAR + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) $0 = VIC#0+(byte)$10*2 +Constant (const byte*) $0 = VIC+(byte)$10*2 Constant (const byte) main::$0 = STAR+1 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 -Constant inlined $0 = (const byte*) VIC#0+(byte)(number) $10*(number) 2 +Constant inlined $0 = (const byte*) VIC+(byte)(number) $10*(number) 2 Constant inlined main::i#0 = (byte) $28 Constant inlined main::$0 = (const byte) STAR+(byte) 1 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(VIC#0+(byte)$10*2+1) +Consolidated array index constant in *(VIC+(byte)$10*2+1) Successful SSA optimization Pass2ConstantAdditionElimination Added new block during phi lifting main::@3(between main::@1 and main::@1) Adding NOP phi() at start of @begin @@ -159,7 +157,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 [4] *((const byte*) SCREEN) ← (const byte) STAR - [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 + [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED to:main::@1 main::@1: scope:[main] from main main::@1 [6] (byte) main::i#2 ← phi( main/(byte) $28 main::@1/(byte) main::i#1 ) @@ -174,8 +172,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (byte*) BGCOL -(byte) RED -(byte*) VIC (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -219,7 +215,7 @@ main: { // [4] *((const byte*) SCREEN) ← (const byte) STAR -- _deref_pbuc1=vbuc2 lda #STAR sta SCREEN - // [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED -- _deref_pbuc1=vbuc2 lda #RED sta VIC+$10*2+1 // [6] phi from main to main::@1 [phi:main->main::@1] @@ -254,11 +250,11 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN) ← (const byte) STAR [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN + (byte) main::i#2) ← (const byte) STAR+(byte) 1 [ 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 [4] *((const byte*) SCREEN) ← (const byte) STAR [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN + (byte) main::i#2) ← (const byte) STAR+(byte) 1 [ main::i#2 ] ( main:2 [ main::i#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 , @@ -299,7 +295,7 @@ main: { // [4] *((const byte*) SCREEN) ← (const byte) STAR -- _deref_pbuc1=vbuc2 lda #STAR sta SCREEN - // [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED -- _deref_pbuc1=vbuc2 lda #RED sta VIC+$10*2+1 // [6] phi from main to main::@1 [phi:main->main::@1] @@ -358,12 +354,10 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (byte*) BGCOL -(byte) RED -(const byte) RED#0 RED = (byte) 2 +(const byte) RED RED = (byte) 2 (const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) STAR STAR = (byte) $51 -(byte*) VIC -(const byte*) VIC#0 VIC = (byte*) 53248 +(const byte*) VIC VIC = (byte*) 53248 (void()) main() (label) main::@1 (label) main::@return @@ -400,7 +394,7 @@ main: { lda #STAR sta SCREEN // *BGCOL = RED - // [5] *((const byte*) VIC#0+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) VIC+(byte)(number) $10*(number) 2+(byte) 1) ← (const byte) RED -- _deref_pbuc1=vbuc2 lda #RED sta VIC+$10*2+1 // [6] phi from main to main::@1 [phi:main->main::@1] diff --git a/src/test/ref/constantmin.sym b/src/test/ref/constantmin.sym index 36587a590..96557f69b 100644 --- a/src/test/ref/constantmin.sym +++ b/src/test/ref/constantmin.sym @@ -2,12 +2,10 @@ (label) @begin (label) @end (byte*) BGCOL -(byte) RED -(const byte) RED#0 RED = (byte) 2 +(const byte) RED RED = (byte) 2 (const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) STAR STAR = (byte) $51 -(byte*) VIC -(const byte*) VIC#0 VIC = (byte*) 53248 +(const byte*) VIC VIC = (byte*) 53248 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/constants.cfg b/src/test/ref/constants.cfg index 3b2b3d1b5..ee00c30ad 100644 --- a/src/test/ref/constants.cfg +++ b/src/test/ref/constants.cfg @@ -53,7 +53,7 @@ test_sbytes::@return: scope:[test_sbytes] from test_sbytes::@4 (void()) assert_sbyte((byte*) assert_sbyte::msg , (signed byte) assert_sbyte::b , (signed byte) assert_sbyte::c) assert_sbyte: scope:[assert_sbyte] from test_sbytes test_sbytes::@1 test_sbytes::@2 test_sbytes::@3 test_sbytes::@4 [22] (signed byte) assert_sbyte::c#5 ← phi( test_sbytes/(signed byte) 0 test_sbytes::@1/(signed byte) 2 test_sbytes::@2/(signed byte) -2 test_sbytes::@3/(signed byte) 2 test_sbytes::@4/(signed byte) 2 ) - [22] (signed byte) assert_sbyte::b#5 ← phi( test_sbytes/(const signed byte) test_sbytes::bb#0 test_sbytes::@1/(const signed byte) test_sbytes::bc#0 test_sbytes::@2/(const signed byte) test_sbytes::bd#0 test_sbytes::@3/(const signed byte) test_sbytes::be#0 test_sbytes::@4/(const signed byte) test_sbytes::bf#0 ) + [22] (signed byte) assert_sbyte::b#5 ← phi( test_sbytes/(const signed byte) test_sbytes::bb test_sbytes::@1/(const signed byte) test_sbytes::bc#0 test_sbytes::@2/(const signed byte) test_sbytes::bd#0 test_sbytes::@3/(const signed byte) test_sbytes::be#0 test_sbytes::@4/(const signed byte) test_sbytes::bf#0 ) [22] (byte*) assert_sbyte::msg#5 ← phi( test_sbytes/(const string) msg test_sbytes::@1/(const string) msg1 test_sbytes::@2/(const string) test_sbytes::msg2 test_sbytes::@3/(const string) test_sbytes::msg3 test_sbytes::@4/(const string) test_sbytes::msg4 ) [23] (byte*) print_str::str#5 ← (byte*) assert_sbyte::msg#5 [24] (byte*~) print_char_cursor#86 ← (byte*) print_line_cursor#1 @@ -135,7 +135,7 @@ test_bytes::@return: scope:[test_bytes] from test_bytes::@2 assert_byte: scope:[assert_byte] from test_bytes test_bytes::@1 test_bytes::@2 [55] (byte*) print_line_cursor#50 ← phi( test_bytes/(byte*) 1024 test_bytes::@1/(byte*) print_line_cursor#1 test_bytes::@2/(byte*) print_line_cursor#1 ) [55] (byte) assert_byte::c#3 ← phi( test_bytes/(byte) 0 test_bytes::@1/(byte) 2 test_bytes::@2/(byte) $fe ) - [55] (byte) assert_byte::b#3 ← phi( test_bytes/(const byte) test_bytes::bb#0 test_bytes::@1/(const byte) test_bytes::bc#0 test_bytes::@2/(const byte) test_bytes::bd#0 ) + [55] (byte) assert_byte::b#3 ← phi( test_bytes/(const byte) test_bytes::bb test_bytes::@1/(const byte) test_bytes::bc#0 test_bytes::@2/(const byte) test_bytes::bd#0 ) [55] (byte*) print_char_cursor#70 ← phi( test_bytes/(byte*) 1024 test_bytes::@1/(byte*~) print_char_cursor#92 test_bytes::@2/(byte*~) print_char_cursor#93 ) [55] (byte*) assert_byte::msg#3 ← phi( test_bytes/(const string) msg test_bytes::@1/(const string) msg1 test_bytes::@2/(const string) test_bytes::msg2 ) [56] (byte*) print_str::str#1 ← (byte*) assert_byte::msg#3 diff --git a/src/test/ref/constants.log b/src/test/ref/constants.log index 931818a2a..768e36570 100644 --- a/src/test/ref/constants.log +++ b/src/test/ref/constants.log @@ -234,9 +234,9 @@ main::@return: scope:[main] from main::@3 test_bytes: scope:[test_bytes] from main::@1 (byte*) print_line_cursor#49 ← phi( main::@1/(byte*) print_line_cursor#5 ) (byte*) print_char_cursor#69 ← phi( main::@1/(byte*) print_char_cursor#7 ) - (byte) test_bytes::bb#0 ← (number) 0 + (byte) test_bytes::bb ← (number) 0 (byte*) assert_byte::msg#0 ← (const string) test_bytes::msg - (byte) assert_byte::b#0 ← (byte) test_bytes::bb#0 + (byte) assert_byte::b#0 ← (byte) test_bytes::bb (byte) assert_byte::c#0 ← (number) 0 call assert_byte to:test_bytes::@1 @@ -245,7 +245,7 @@ test_bytes::@1: scope:[test_bytes] from test_bytes (byte*) print_char_cursor#43 ← phi( test_bytes/(byte*) print_char_cursor#20 ) (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#43 (byte*) print_line_cursor#9 ← (byte*) print_line_cursor#32 - (number~) test_bytes::$1 ← (byte) test_bytes::bb#0 + (number) 2 + (number~) test_bytes::$1 ← (byte) test_bytes::bb + (number) 2 (byte) test_bytes::bc#0 ← (number~) test_bytes::$1 (byte*) assert_byte::msg#1 ← (const string) test_bytes::msg1 (byte) assert_byte::b#1 ← (byte) test_bytes::bc#0 @@ -355,9 +355,9 @@ assert_byte::@return: scope:[assert_byte] from assert_byte::@9 test_sbytes: scope:[test_sbytes] from main::@2 (byte*) print_line_cursor#51 ← phi( main::@2/(byte*) print_line_cursor#6 ) (byte*) print_char_cursor#74 ← phi( main::@2/(byte*) print_char_cursor#8 ) - (signed byte) test_sbytes::bb#0 ← (number) 0 + (signed byte) test_sbytes::bb ← (number) 0 (byte*) assert_sbyte::msg#0 ← (const string) test_sbytes::msg - (signed byte) assert_sbyte::b#0 ← (signed byte) test_sbytes::bb#0 + (signed byte) assert_sbyte::b#0 ← (signed byte) test_sbytes::bb (signed byte) assert_sbyte::c#0 ← (number) 0 call assert_sbyte to:test_sbytes::@1 @@ -366,7 +366,7 @@ test_sbytes::@1: scope:[test_sbytes] from test_sbytes (byte*) print_char_cursor#53 ← phi( test_sbytes/(byte*) print_char_cursor#32 ) (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#53 (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#38 - (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#0 + (number) 2 + (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb + (number) 2 (signed byte) test_sbytes::bc#0 ← (number~) test_sbytes::$1 (byte*) assert_sbyte::msg#1 ← (const string) test_sbytes::msg1 (signed byte) assert_sbyte::b#1 ← (signed byte) test_sbytes::bc#0 @@ -838,7 +838,6 @@ SYMBOL TABLE SSA (label) test_bytes::@3 (label) test_bytes::@return (byte) test_bytes::bb -(byte) test_bytes::bb#0 (byte) test_bytes::bc (byte) test_bytes::bc#0 (byte) test_bytes::bc#1 @@ -859,7 +858,6 @@ SYMBOL TABLE SSA (label) test_sbytes::@5 (label) test_sbytes::@return (signed byte) test_sbytes::bb -(signed byte) test_sbytes::bb#0 (signed byte) test_sbytes::bc (signed byte) test_sbytes::bc#0 (signed byte) test_sbytes::bc#1 @@ -882,18 +880,18 @@ Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 Adding number conversion cast (unumber) 5 in (byte) GREEN ← (number) 5 Adding number conversion cast (unumber) 2 in (byte) RED ← (number) 2 -Adding number conversion cast (unumber) 0 in (byte) test_bytes::bb#0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) test_bytes::bb ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) assert_byte::c#0 ← (number) 0 -Adding number conversion cast (unumber) 2 in (number~) test_bytes::$1 ← (byte) test_bytes::bb#0 + (number) 2 -Adding number conversion cast (unumber) test_bytes::$1 in (number~) test_bytes::$1 ← (byte) test_bytes::bb#0 + (unumber)(number) 2 +Adding number conversion cast (unumber) 2 in (number~) test_bytes::$1 ← (byte) test_bytes::bb + (number) 2 +Adding number conversion cast (unumber) test_bytes::$1 in (number~) test_bytes::$1 ← (byte) test_bytes::bb + (unumber)(number) 2 Adding number conversion cast (unumber) 2 in (byte) assert_byte::c#1 ← (number) 2 Adding number conversion cast (snumber) 4 in (number~) test_bytes::$4 ← (signed byte~) test_bytes::$3 - (number) 4 Adding number conversion cast (snumber) test_bytes::$4 in (number~) test_bytes::$4 ← (signed byte~) test_bytes::$3 - (snumber)(number) 4 Adding number conversion cast (unumber) $fe in (byte) assert_byte::c#2 ← (number) $fe -Adding number conversion cast (snumber) 0 in (signed byte) test_sbytes::bb#0 ← (number) 0 +Adding number conversion cast (snumber) 0 in (signed byte) test_sbytes::bb ← (number) 0 Adding number conversion cast (snumber) 0 in (signed byte) assert_sbyte::c#0 ← (number) 0 -Adding number conversion cast (snumber) 2 in (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#0 + (number) 2 -Adding number conversion cast (snumber) test_sbytes::$1 in (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#0 + (snumber)(number) 2 +Adding number conversion cast (snumber) 2 in (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb + (number) 2 +Adding number conversion cast (snumber) test_sbytes::$1 in (number~) test_sbytes::$1 ← (signed byte) test_sbytes::bb + (snumber)(number) 2 Adding number conversion cast (snumber) 2 in (signed byte) assert_sbyte::c#1 ← (number) 2 Adding number conversion cast (snumber) 4 in (number~) test_sbytes::$3 ← (signed byte) test_sbytes::bc#1 - (number) 4 Adding number conversion cast (snumber) test_sbytes::$3 in (number~) test_sbytes::$3 ← (signed byte) test_sbytes::bc#1 - (snumber)(number) 4 @@ -908,13 +906,13 @@ Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 Inlining cast (byte) GREEN ← (unumber)(number) 5 Inlining cast (byte) RED ← (unumber)(number) 2 -Inlining cast (byte) test_bytes::bb#0 ← (unumber)(number) 0 +Inlining cast (byte) test_bytes::bb ← (unumber)(number) 0 Inlining cast (byte) assert_byte::c#0 ← (unumber)(number) 0 Inlining cast (byte) assert_byte::c#1 ← (unumber)(number) 2 Inlining cast (signed byte~) test_bytes::$3 ← (signed byte)(byte) test_bytes::bc#1 Inlining cast (byte~) test_bytes::$5 ← (byte)(snumber~) test_bytes::$4 Inlining cast (byte) assert_byte::c#2 ← (unumber)(number) $fe -Inlining cast (signed byte) test_sbytes::bb#0 ← (snumber)(number) 0 +Inlining cast (signed byte) test_sbytes::bb ← (snumber)(number) 0 Inlining cast (signed byte) assert_sbyte::c#0 ← (snumber)(number) 0 Inlining cast (signed byte) assert_sbyte::c#1 ← (snumber)(number) 2 Inlining cast (signed byte) assert_sbyte::c#2 ← (snumber)(number) -2 @@ -966,9 +964,9 @@ Finalized signed number type (signed byte) -2 Finalized signed number type (signed byte) 2 Finalized signed number type (signed byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) test_bytes::$1 ← (byte) test_bytes::bb#0 + (byte) 2 +Inferred type updated to byte in (unumber~) test_bytes::$1 ← (byte) test_bytes::bb + (byte) 2 Inferred type updated to signed byte in (snumber~) test_bytes::$4 ← (signed byte~) test_bytes::$3 - (signed byte) 4 -Inferred type updated to signed byte in (snumber~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#0 + (signed byte) 2 +Inferred type updated to signed byte in (snumber~) test_sbytes::$1 ← (signed byte) test_sbytes::bb + (signed byte) 2 Inferred type updated to signed byte in (snumber~) test_sbytes::$3 ← (signed byte) test_sbytes::bc#1 - (signed byte) 4 Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0 Successful SSA optimization Pass2UnaryNotSimplification @@ -1113,7 +1111,7 @@ Constant (const word) memset::num#0 = $3e8 Constant (const byte*) BGCOL = (byte*) 53281 Constant (const byte) GREEN = 5 Constant (const byte) RED = 2 -Constant (const byte) test_bytes::bb#0 = 0 +Constant (const byte) test_bytes::bb = 0 Constant (const byte*) assert_byte::msg#0 = test_bytes::msg Constant (const byte) assert_byte::c#0 = 0 Constant (const byte*) assert_byte::msg#1 = test_bytes::msg1 @@ -1123,7 +1121,7 @@ Constant (const byte) assert_byte::c#2 = $fe Constant (const byte*) print_str::str#2 = assert_byte::str Constant (const byte*) print_str::str#3 = assert_byte::str1 Constant (const byte*) print_str::str#4 = assert_byte::str2 -Constant (const signed byte) test_sbytes::bb#0 = 0 +Constant (const signed byte) test_sbytes::bb = 0 Constant (const byte*) assert_sbyte::msg#0 = test_sbytes::msg Constant (const signed byte) assert_sbyte::c#0 = 0 Constant (const byte*) assert_sbyte::msg#1 = test_sbytes::msg1 @@ -1139,8 +1137,8 @@ Constant (const byte*) print_str::str#6 = assert_sbyte::str Constant (const byte*) print_str::str#7 = assert_sbyte::str1 Constant (const byte*) print_str::str#8 = assert_sbyte::str2 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) assert_byte::b#0 = test_bytes::bb#0 -Constant (const signed byte) assert_sbyte::b#0 = test_sbytes::bb#0 +Constant (const byte) assert_byte::b#0 = test_bytes::bb +Constant (const signed byte) assert_sbyte::b#0 = test_sbytes::bb Constant (const signed byte) assert_sbyte::b#4 = test_sbytes::bf#0 Successful SSA optimization Pass2ConstantIdentification Constant value identified (void*)print_line_cursor#0 in [47] (void*) memset::str#0 ← (void*)(const byte*) print_line_cursor#0 @@ -1148,8 +1146,8 @@ Successful SSA optimization Pass2ConstantValues if() condition always false - eliminating [3] if((const word) memset::num#0<=(byte) 0) goto memset::@1 Successful SSA optimization Pass2ConstantIfs Successful SSA optimization Pass2ConstantStringConsolidation -Simplifying expression containing zero 2 in [90] (byte) test_bytes::bc#0 ← (const byte) test_bytes::bb#0 + (byte) 2 -Simplifying expression containing zero 2 in [154] (signed byte) test_sbytes::bc#0 ← (const signed byte) test_sbytes::bb#0 + (signed byte) 2 +Simplifying expression containing zero 2 in [90] (byte) test_bytes::bc#0 ← (const byte) test_bytes::bb + (byte) 2 +Simplifying expression containing zero 2 in [154] (signed byte) test_sbytes::bc#0 ← (const signed byte) test_sbytes::bb + (signed byte) 2 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused variable (void*) memset::return#2 and assignment [22] (void*) memset::return#2 ← (void*) memset::str#0 Successful SSA optimization PassNEliminateUnusedVars @@ -1227,9 +1225,9 @@ Constant inlined assert_sbyte::b#2 = (const signed byte) test_sbytes::bd#0 Constant inlined assert_sbyte::c#1 = (signed byte) 2 Constant inlined assert_sbyte::b#1 = (const signed byte) test_sbytes::bc#0 Constant inlined assert_sbyte::c#0 = (signed byte) 0 -Constant inlined assert_byte::b#0 = (const byte) test_bytes::bb#0 +Constant inlined assert_byte::b#0 = (const byte) test_bytes::bb Constant inlined assert_sbyte::str1 = (const string) str1 -Constant inlined assert_sbyte::b#0 = (const signed byte) test_sbytes::bb#0 +Constant inlined assert_sbyte::b#0 = (const signed byte) test_sbytes::bb Constant inlined assert_byte::b#1 = (const byte) test_bytes::bc#0 Constant inlined assert_sbyte::str2 = (const string) str2 Constant inlined assert_byte::c#0 = (byte) 0 @@ -1431,7 +1429,7 @@ test_sbytes::@return: scope:[test_sbytes] from test_sbytes::@4 (void()) assert_sbyte((byte*) assert_sbyte::msg , (signed byte) assert_sbyte::b , (signed byte) assert_sbyte::c) assert_sbyte: scope:[assert_sbyte] from test_sbytes test_sbytes::@1 test_sbytes::@2 test_sbytes::@3 test_sbytes::@4 [22] (signed byte) assert_sbyte::c#5 ← phi( test_sbytes/(signed byte) 0 test_sbytes::@1/(signed byte) 2 test_sbytes::@2/(signed byte) -2 test_sbytes::@3/(signed byte) 2 test_sbytes::@4/(signed byte) 2 ) - [22] (signed byte) assert_sbyte::b#5 ← phi( test_sbytes/(const signed byte) test_sbytes::bb#0 test_sbytes::@1/(const signed byte) test_sbytes::bc#0 test_sbytes::@2/(const signed byte) test_sbytes::bd#0 test_sbytes::@3/(const signed byte) test_sbytes::be#0 test_sbytes::@4/(const signed byte) test_sbytes::bf#0 ) + [22] (signed byte) assert_sbyte::b#5 ← phi( test_sbytes/(const signed byte) test_sbytes::bb test_sbytes::@1/(const signed byte) test_sbytes::bc#0 test_sbytes::@2/(const signed byte) test_sbytes::bd#0 test_sbytes::@3/(const signed byte) test_sbytes::be#0 test_sbytes::@4/(const signed byte) test_sbytes::bf#0 ) [22] (byte*) assert_sbyte::msg#5 ← phi( test_sbytes/(const string) msg test_sbytes::@1/(const string) msg1 test_sbytes::@2/(const string) test_sbytes::msg2 test_sbytes::@3/(const string) test_sbytes::msg3 test_sbytes::@4/(const string) test_sbytes::msg4 ) [23] (byte*) print_str::str#5 ← (byte*) assert_sbyte::msg#5 [24] (byte*~) print_char_cursor#86 ← (byte*) print_line_cursor#1 @@ -1513,7 +1511,7 @@ test_bytes::@return: scope:[test_bytes] from test_bytes::@2 assert_byte: scope:[assert_byte] from test_bytes test_bytes::@1 test_bytes::@2 [55] (byte*) print_line_cursor#50 ← phi( test_bytes/(byte*) 1024 test_bytes::@1/(byte*) print_line_cursor#1 test_bytes::@2/(byte*) print_line_cursor#1 ) [55] (byte) assert_byte::c#3 ← phi( test_bytes/(byte) 0 test_bytes::@1/(byte) 2 test_bytes::@2/(byte) $fe ) - [55] (byte) assert_byte::b#3 ← phi( test_bytes/(const byte) test_bytes::bb#0 test_bytes::@1/(const byte) test_bytes::bc#0 test_bytes::@2/(const byte) test_bytes::bd#0 ) + [55] (byte) assert_byte::b#3 ← phi( test_bytes/(const byte) test_bytes::bb test_bytes::@1/(const byte) test_bytes::bc#0 test_bytes::@2/(const byte) test_bytes::bd#0 ) [55] (byte*) print_char_cursor#70 ← phi( test_bytes/(byte*) 1024 test_bytes::@1/(byte*~) print_char_cursor#92 test_bytes::@2/(byte*~) print_char_cursor#93 ) [55] (byte*) assert_byte::msg#3 ← phi( test_bytes/(const string) msg test_bytes::@1/(const string) msg1 test_bytes::@2/(const string) test_bytes::msg2 ) [56] (byte*) print_str::str#1 ← (byte*) assert_byte::msg#3 @@ -1617,11 +1615,9 @@ VARIABLE REGISTER WEIGHTS (byte*) print_str::str#11 6.0 (byte*) print_str::str#5 2.0 (void()) test_bytes() -(byte) test_bytes::bb (byte) test_bytes::bc (byte) test_bytes::bd (void()) test_sbytes() -(signed byte) test_sbytes::bb (signed byte) test_sbytes::bc (signed byte) test_sbytes::bd (signed byte) test_sbytes::be @@ -1734,7 +1730,7 @@ test_sbytes: { // [22] phi (signed byte) assert_sbyte::c#5 = (signed byte) 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1 lda #0 sta.z assert_sbyte.c - // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb#0 [phi:test_sbytes->assert_sbyte#1] -- vbsz1=vbsc1 + // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsz1=vbsc1 lda #bb sta.z assert_sbyte.b // [22] phi (byte*) assert_sbyte::msg#5 = (const string) msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1 @@ -2019,7 +2015,7 @@ test_bytes: { // [55] phi (byte) assert_byte::c#3 = (byte) 0 [phi:test_bytes->assert_byte#1] -- vbuz1=vbuc1 lda #0 sta.z assert_byte.c - // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb#0 [phi:test_bytes->assert_byte#2] -- vbuz1=vbuc1 + // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuz1=vbuc1 lda #bb sta.z assert_byte.b // [55] phi (byte*) print_char_cursor#70 = (byte*) 1024 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1 @@ -2407,7 +2403,7 @@ test_sbytes: { // [22] phi (signed byte) assert_sbyte::c#5 = (signed byte) 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1 lda #0 sta.z assert_sbyte.c - // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb#0 [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 + // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bb // [22] phi (byte*) assert_sbyte::msg#5 = (const string) msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1 lda #assert_byte#1] -- vbuz1=vbuc1 lda #0 sta.z assert_byte.c - // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb#0 [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 + // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 ldx #bb // [55] phi (byte*) print_char_cursor#70 = (byte*) 1024 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1 lda #<$400 @@ -3113,8 +3109,7 @@ FINAL SYMBOL TABLE (label) test_bytes::@1 (label) test_bytes::@2 (label) test_bytes::@return -(byte) test_bytes::bb -(const byte) test_bytes::bb#0 bb = (byte) 0 +(const byte) test_bytes::bb bb = (byte) 0 (byte) test_bytes::bc (const byte) test_bytes::bc#0 bc = (byte) 2 (byte) test_bytes::bd @@ -3126,8 +3121,7 @@ FINAL SYMBOL TABLE (label) test_sbytes::@3 (label) test_sbytes::@4 (label) test_sbytes::@return -(signed byte) test_sbytes::bb -(const signed byte) test_sbytes::bb#0 bb = (signed byte) 0 +(const signed byte) test_sbytes::bb bb = (signed byte) 0 (signed byte) test_sbytes::bc (const signed byte) test_sbytes::bc#0 bc = (signed byte) 2 (signed byte) test_sbytes::bd @@ -3209,7 +3203,7 @@ test_sbytes: { // [22] phi (signed byte) assert_sbyte::c#5 = (signed byte) 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1 lda #0 sta.z assert_sbyte.c - // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb#0 [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 + // [22] phi (signed byte) assert_sbyte::b#5 = (const signed byte) test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1 ldx #bb // [22] phi (byte*) assert_sbyte::msg#5 = (const string) msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1 lda #assert_byte#1] -- vbuz1=vbuc1 lda #0 sta.z assert_byte.c - // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb#0 [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 + // [55] phi (byte) assert_byte::b#3 = (const byte) test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1 ldx #bb // [55] phi (byte*) print_char_cursor#70 = (byte*) 1024 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1 lda #<$400 diff --git a/src/test/ref/constants.sym b/src/test/ref/constants.sym index 5b93642bc..9a87042d8 100644 --- a/src/test/ref/constants.sym +++ b/src/test/ref/constants.sym @@ -92,8 +92,7 @@ (label) test_bytes::@1 (label) test_bytes::@2 (label) test_bytes::@return -(byte) test_bytes::bb -(const byte) test_bytes::bb#0 bb = (byte) 0 +(const byte) test_bytes::bb bb = (byte) 0 (byte) test_bytes::bc (const byte) test_bytes::bc#0 bc = (byte) 2 (byte) test_bytes::bd @@ -105,8 +104,7 @@ (label) test_sbytes::@3 (label) test_sbytes::@4 (label) test_sbytes::@return -(signed byte) test_sbytes::bb -(const signed byte) test_sbytes::bb#0 bb = (signed byte) 0 +(const signed byte) test_sbytes::bb bb = (signed byte) 0 (signed byte) test_sbytes::bc (const signed byte) test_sbytes::bc#0 bc = (signed byte) 2 (signed byte) test_sbytes::bd diff --git a/src/test/ref/deep-nesting.cfg b/src/test/ref/deep-nesting.cfg index a1bb764f3..3d1fbccc0 100644 --- a/src/test/ref/deep-nesting.cfg +++ b/src/test/ref/deep-nesting.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 [5] call f1 to:main::@1 main::@1: scope:[main] from main - [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 + [6] *((const byte*) main::screen) ← (const byte) f1::return#1 to:main::@return main::@return: scope:[main] from main::@1 [7] return diff --git a/src/test/ref/deep-nesting.log b/src/test/ref/deep-nesting.log index f2d2f1cb2..1ae753c42 100644 --- a/src/test/ref/deep-nesting.log +++ b/src/test/ref/deep-nesting.log @@ -206,7 +206,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @101 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) f1::x#0 ← (number) 0 call f1 (byte) f1::return#0 ← (byte) f1::return#2 @@ -214,7 +214,7 @@ main: scope:[main] from @101 main::@1: scope:[main] from main (byte) f1::return#3 ← phi( main/(byte) f1::return#0 ) (byte~) main::$0 ← (byte) f1::return#3 - *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$0 + *((byte*) main::screen + (number) 0) ← (byte~) main::$0 to:main::@return main::@return: scope:[main] from main::@1 return @@ -3525,10 +3525,9 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) 0 in (byte) f1::x#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte~) main::$0 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte~) main::$0 Adding number conversion cast (unumber) 1 in (number~) f1::$1 ← (byte~) f1::$0 + (number) 1 Adding number conversion cast (unumber) f1::$1 in (number~) f1::$1 ← (byte~) f1::$0 + (unumber)(number) 1 Adding number conversion cast (unumber) 1 in (number~) f2::$1 ← (byte~) f2::$0 + (number) 1 @@ -3728,7 +3727,7 @@ Adding number conversion cast (unumber) f98::$1 in (number~) f98::$1 ← (byte~) Adding number conversion cast (unumber) 1 in (number~) f99::$1 ← (byte~) f99::$0 + (number) 1 Adding number conversion cast (unumber) f99::$1 in (number~) f99::$1 ← (byte~) f99::$0 + (unumber)(number) 1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte) f1::x#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -4337,7 +4336,7 @@ Identical Phi Values (byte) f98::x#1 (byte) f98::x#0 Identical Phi Values (byte) f99::x#1 (byte) f99::x#0 Identical Phi Values (byte) f100::return#1 (byte) f100::x#0 Successful SSA optimization Pass2IdenticalPhiElimination -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) f1::x#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) f2::x#0 = f1::x#0 @@ -4542,7 +4541,7 @@ Constant (const byte) f100::return#0 = f100::x#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) f99::$0 = f100::return#0 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [6] *((const byte*) main::screen#0 + (byte) 0) ← (byte~) main::$0 +Simplifying expression containing zero main::screen in [6] *((const byte*) main::screen + (byte) 0) ← (byte~) main::$0 Simplifying expression containing zero 1 in [1092] (byte) f99::return#1 ← (const byte) f99::$0 + (byte) 1 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) f99::$0 @@ -6369,7 +6368,7 @@ main: scope:[main] from @1 [5] call f1 to:main::@1 main::@1: scope:[main] from main - [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 + [6] *((const byte*) main::screen) ← (const byte) f1::return#1 to:main::@return main::@return: scope:[main] from main::@1 [7] return @@ -7577,7 +7576,6 @@ VARIABLE REGISTER WEIGHTS (byte) f99::return (byte) f99::x (void()) main() -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -7617,7 +7615,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 lda #f1.return sta screen jmp breturn @@ -8924,7 +8922,7 @@ f100: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen) ← (const byte) f1::return#1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -9167,7 +9165,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 lda #f1.return sta screen jmp breturn @@ -11300,8 +11298,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 @@ -11331,7 +11328,7 @@ main: { jsr f1 // main::@1 // screen[0] = f1(0) - // [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::screen) ← (const byte) f1::return#1 -- _deref_pbuc1=vbuc2 lda #f1.return sta screen // main::@return diff --git a/src/test/ref/deep-nesting.sym b/src/test/ref/deep-nesting.sym index 7b2953c43..4e1bfe32c 100644 --- a/src/test/ref/deep-nesting.sym +++ b/src/test/ref/deep-nesting.sym @@ -503,6 +503,5 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/default-font.cfg b/src/test/ref/default-font.cfg index 7e06d3ada..6ca81706d 100644 --- a/src/test/ref/default-font.cfg +++ b/src/test/ref/default-font.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@3 [6] (byte) main::x#4 ← phi( main::@3/(byte) main::x#1 main/(byte) 0 ) - [6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN#0+(byte) $28+(byte) 1 ) + [6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN+(byte) $28+(byte) 1 ) [6] (byte) main::ch#3 ← phi( main::@3/(byte) main::ch#1 main/(byte) 0 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 diff --git a/src/test/ref/default-font.log b/src/test/ref/default-font.log index 71b5f13c3..f7d6a02de 100644 --- a/src/test/ref/default-font.log +++ b/src/test/ref/default-font.log @@ -58,19 +58,19 @@ memset::@return: scope:[memset] from memset::@1 return to:@return @4: scope:[] from @begin - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@5 (void()) main() main: scope:[main] from @5 - (void*) memset::str#0 ← (void*)(byte*) SCREEN#0 + (void*) memset::str#0 ← (void*)(byte*) SCREEN (byte) memset::c#0 ← (byte) ' ' (word) memset::num#0 ← (number) $3e8 call memset (void*) memset::return#2 ← (void*) memset::return#1 to:main::@5 main::@5: scope:[main] from main - (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28 + (byte*~) main::$1 ← (byte*) SCREEN + (number) $28 (byte*~) main::$2 ← (byte*~) main::$1 + (number) 1 (byte*) main::screen#0 ← (byte*~) main::$2 (byte) main::ch#0 ← (number) 0 @@ -120,7 +120,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$1 (byte*~) main::$2 @@ -199,14 +198,14 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 -Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) SCREEN + (number) $28 Adding number conversion cast (unumber) 1 in (byte*~) main::$2 ← (byte*~) main::$1 + (number) 1 Adding number conversion cast (unumber) 0 in (byte) main::ch#0 ← (number) 0 Adding number conversion cast (unumber) $28-$10 in (byte*) main::screen#2 ← (byte*) main::screen#4 + (number) $28-(number) $10 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 Inlining cast (byte) main::ch#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -254,14 +253,14 @@ Simple Condition (bool~) memset::$4 [13] if((byte*) memset::dst#2!=(byte*) memse Simple Condition (bool~) main::$3 [39] if((byte) main::y#1!=rangelast(0,$f)) goto main::@2 Simple Condition (bool~) main::$4 [44] if((byte) main::x#1!=rangelast(0,$f)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 Constant (const byte) main::ch#0 = 0 Constant (const byte) main::x#0 = 0 Constant (const byte) main::y#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (void*)SCREEN#0 in [21] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)SCREEN in [21] (void*) memset::str#0 ← (void*)(const byte*) SCREEN Successful SSA optimization Pass2ConstantValues if() condition always false - eliminating [3] if((const word) memset::num#0<=(byte) 0) goto memset::@1 Successful SSA optimization Pass2ConstantIfs @@ -280,10 +279,10 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $10 Finalized unsigned number type (byte) $10 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [10] (byte*~) main::$1 ← (const byte*) SCREEN#0 + (byte) $28 +Constant right-side identified [10] (byte*~) main::$1 ← (const byte*) SCREEN + (byte) $28 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const void*) memset::str#0 = (void*)SCREEN#0 -Constant (const byte*) main::$1 = SCREEN#0+$28 +Constant (const void*) memset::str#0 = (void*)SCREEN +Constant (const byte*) main::$1 = SCREEN+$28 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte*)memset::str#0 in [0] (byte*~) memset::$2 ← (byte*)(const void*) memset::str#0 Constant value identified (byte*)memset::str#0 in [2] (byte*) memset::dst#0 ← (byte*)(const void*) memset::str#0 @@ -303,9 +302,9 @@ Inlining constant with var siblings (const byte) main::ch#0 Inlining constant with var siblings (const byte) main::x#0 Inlining constant with var siblings (const byte) main::y#0 Inlining constant with var siblings (const byte*) main::screen#0 -Constant inlined main::screen#0 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 +Constant inlined main::screen#0 = (const byte*) SCREEN+(byte) $28+(byte) 1 Constant inlined memset::$2 = (byte*)(const void*) memset::str#0 -Constant inlined main::$1 = (const byte*) SCREEN#0+(byte) $28 +Constant inlined main::$1 = (const byte*) SCREEN+(byte) $28 Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 Constant inlined main::x#0 = (byte) 0 Constant inlined main::y#0 = (byte) 0 @@ -372,7 +371,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@3 [6] (byte) main::x#4 ← phi( main::@3/(byte) main::x#1 main/(byte) 0 ) - [6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN#0+(byte) $28+(byte) 1 ) + [6] (byte*) main::screen#5 ← phi( main::@3/(byte*) main::screen#2 main/(const byte*) SCREEN+(byte) $28+(byte) 1 ) [6] (byte) main::ch#3 ← phi( main::@3/(byte) main::ch#1 main/(byte) 0 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 @@ -412,7 +411,6 @@ memset::@2: scope:[memset] from memset::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::ch (byte) main::ch#1 35.5 @@ -498,7 +496,7 @@ main: { // [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z x - // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #SCREEN+$28+1 @@ -698,7 +696,7 @@ main: { // [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z x - // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #SCREEN+$28+1 @@ -859,8 +857,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -896,7 +893,7 @@ FINAL SYMBOL TABLE (const word) memset::num#0 num = (word) $3e8 (void*) memset::return (void*) memset::str -(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0 +(const void*) memset::str#0 str = (void*)(const byte*) SCREEN zp ZP_BYTE:2 [ main::x#4 main::x#1 ] zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] @@ -935,7 +932,7 @@ main: { // [6] phi (byte) main::x#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z x - // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::screen#5 = (const byte*) SCREEN+(byte) $28+(byte) 1 [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #SCREEN+$28+1 diff --git a/src/test/ref/default-font.sym b/src/test/ref/default-font.sym index 9617eea04..3ef15d391 100644 --- a/src/test/ref/default-font.sym +++ b/src/test/ref/default-font.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -38,7 +37,7 @@ (const word) memset::num#0 num = (word) $3e8 (void*) memset::return (void*) memset::str -(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0 +(const void*) memset::str#0 str = (void*)(const byte*) SCREEN zp ZP_BYTE:2 [ main::x#4 main::x#1 ] zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] diff --git a/src/test/ref/double-assignment.cfg b/src/test/ref/double-assignment.cfg index ee427077f..04cb98cec 100644 --- a/src/test/ref/double-assignment.cfg +++ b/src/test/ref/double-assignment.cfg @@ -10,8 +10,8 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 - [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 + [4] *((const byte*) main::screen) ← (const byte) main::a#1 + [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 to:main::@return main::@return: scope:[main] from main [6] return diff --git a/src/test/ref/double-assignment.log b/src/test/ref/double-assignment.log index b5a7cd87e..829b97fe6 100644 --- a/src/test/ref/double-assignment.log +++ b/src/test/ref/double-assignment.log @@ -8,11 +8,11 @@ CONTROL FLOW GRAPH SSA main: scope:[main] from @1 (byte) main::a#0 ← (byte) 0 (byte) main::b#0 ← (byte) 0 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::b#1 ← (number) $c (byte) main::a#1 ← (byte) main::b#1 - *((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1 - *((byte*) main::screen#0 + (number) 1) ← (byte) main::b#1 + *((byte*) main::screen + (number) 0) ← (byte) main::a#1 + *((byte*) main::screen + (number) 1) ← (byte) main::b#1 to:main::@return main::@return: scope:[main] from main return @@ -38,13 +38,12 @@ SYMBOL TABLE SSA (byte) main::b#0 (byte) main::b#1 (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) $c in (byte) main::b#1 ← (number) $c -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte) main::b#1 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) main::a#1 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← (byte) main::b#1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte) main::b#1 ← (unumber)(number) $c Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -60,15 +59,15 @@ Alias (byte) main::a#1 = (byte) main::b#1 Successful SSA optimization Pass2AliasElimination Constant (const byte) main::a#0 = 0 Constant (const byte) main::b#0 = 0 -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::a#1 = $c Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [5] *((const byte*) main::screen#0 + (byte) 0) ← (const byte) main::a#1 +Simplifying expression containing zero main::screen in [5] *((const byte*) main::screen + (byte) 0) ← (const byte) main::a#1 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::a#0 Eliminating unused constant (const byte) main::b#0 Successful SSA optimization PassNEliminateUnusedVars -Consolidated array index constant in *(main::screen#0+1) +Consolidated array index constant in *(main::screen+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -97,8 +96,8 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 - [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 + [4] *((const byte*) main::screen) ← (const byte) main::a#1 + [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 to:main::@return main::@return: scope:[main] from main [6] return @@ -109,7 +108,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte) main::a (byte) main::b -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -141,10 +139,10 @@ bend: main: { .label screen = $400 .const a = $c - // [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 lda #a sta screen - // [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 lda #a sta screen+1 jmp breturn @@ -156,8 +154,8 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen) ← (const byte) main::a#1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -192,10 +190,10 @@ bend: main: { .label screen = $400 .const a = $c - // [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 lda #a sta screen - // [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 lda #a sta screen+1 jmp breturn @@ -235,8 +233,7 @@ FINAL SYMBOL TABLE (byte) main::a (const byte) main::a#1 a = (byte) $c (byte) main::b -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 @@ -261,11 +258,11 @@ main: { .label screen = $400 .const a = $c // screen[0] = a - // [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 lda #a sta screen // screen[1] = b - // [5] *((const byte*) main::screen#0+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::screen+(byte) 1) ← (const byte) main::a#1 -- _deref_pbuc1=vbuc2 sta screen+1 // main::@return // } diff --git a/src/test/ref/double-assignment.sym b/src/test/ref/double-assignment.sym index 074692d62..2ff14d5ae 100644 --- a/src/test/ref/double-assignment.sym +++ b/src/test/ref/double-assignment.sym @@ -6,6 +6,5 @@ (byte) main::a (const byte) main::a#1 a = (byte) $c (byte) main::b -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/double-indexing-arrays.cfg b/src/test/ref/double-indexing-arrays.cfg index 6250ef476..5e074ff14 100644 --- a/src/test/ref/double-indexing-arrays.cfg +++ b/src/test/ref/double-indexing-arrays.cfg @@ -14,16 +14,16 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::x#2 ← phi( main/(byte) 0 main::@1/(byte) main::x#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) - [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) - [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) - [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) - [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) - [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) - [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) - [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) - [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) - [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) + [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) + [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) + [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) + [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) + [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) + [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) + [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) + [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) + [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) + [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) [16] (byte) main::x#1 ← ++ (byte) main::x#2 [17] if((byte) main::x#1!=(byte) $c9) goto main::@1 to:main::@return diff --git a/src/test/ref/double-indexing-arrays.log b/src/test/ref/double-indexing-arrays.log index 9a06b5cc6..d31ecf95a 100644 --- a/src/test/ref/double-indexing-arrays.log +++ b/src/test/ref/double-indexing-arrays.log @@ -7,8 +7,8 @@ CONTROL FLOW GRAPH SSA (byte[$3e8]) MAPDATA ← { fill( $3e8, 0) } (byte[$100]) COLORMAP1 ← { fill( $100, 0) } (byte[$100]) COLORMAP2 ← { fill( $100, 0) } - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) COLS#0 ← ((byte*)) (number) $d800 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) COLS ← ((byte*)) (number) $d800 to:@1 (void()) main() @@ -17,32 +17,32 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@1/(byte) main::x#1 ) - *((byte*) SCREEN#0 + (byte) main::x#2) ← *((byte[$3e8]) MAPDATA + (byte) main::x#2) - *((byte*) COLS#0 + (byte) main::x#2) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (byte) main::x#2)) + *((byte*) SCREEN + (byte) main::x#2) ← *((byte[$3e8]) MAPDATA + (byte) main::x#2) + *((byte*) COLS + (byte) main::x#2) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (byte) main::x#2)) (number~) main::$0 ← (number) $c8 + (byte) main::x#2 (number~) main::$1 ← (number) $c8 + (byte) main::x#2 - *((byte*) SCREEN#0 + (number~) main::$0) ← *((byte[$3e8]) MAPDATA + (number~) main::$1) + *((byte*) SCREEN + (number~) main::$0) ← *((byte[$3e8]) MAPDATA + (number~) main::$1) (number~) main::$2 ← (number) $c8 + (byte) main::x#2 (number~) main::$3 ← (number) $c8 + (byte) main::x#2 - *((byte*) COLS#0 + (number~) main::$2) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (number~) main::$3)) + *((byte*) COLS + (number~) main::$2) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (number~) main::$3)) (number~) main::$4 ← (number) $190 + (byte) main::x#2 (number~) main::$5 ← (number) $190 + (byte) main::x#2 - *((byte*) SCREEN#0 + (number~) main::$4) ← *((byte[$3e8]) MAPDATA + (number~) main::$5) + *((byte*) SCREEN + (number~) main::$4) ← *((byte[$3e8]) MAPDATA + (number~) main::$5) (number~) main::$6 ← (number) $190 + (byte) main::x#2 (number~) main::$7 ← (number) $190 + (byte) main::x#2 - *((byte*) COLS#0 + (number~) main::$6) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (number~) main::$7)) + *((byte*) COLS + (number~) main::$6) ← *((byte[$100]) COLORMAP1 + *((byte[$3e8]) MAPDATA + (number~) main::$7)) (number~) main::$8 ← (number) $258 + (byte) main::x#2 (number~) main::$9 ← (number) $258 + (byte) main::x#2 - *((byte*) SCREEN#0 + (number~) main::$8) ← *((byte[$3e8]) MAPDATA + (number~) main::$9) + *((byte*) SCREEN + (number~) main::$8) ← *((byte[$3e8]) MAPDATA + (number~) main::$9) (number~) main::$10 ← (number) $258 + (byte) main::x#2 (number~) main::$11 ← (number) $258 + (byte) main::x#2 - *((byte*) COLS#0 + (number~) main::$10) ← *((byte[$100]) COLORMAP2 + *((byte[$3e8]) MAPDATA + (number~) main::$11)) + *((byte*) COLS + (number~) main::$10) ← *((byte[$100]) COLORMAP2 + *((byte[$3e8]) MAPDATA + (number~) main::$11)) (number~) main::$12 ← (number) $320 + (byte) main::x#2 (number~) main::$13 ← (number) $320 + (byte) main::x#2 - *((byte*) SCREEN#0 + (number~) main::$12) ← *((byte[$3e8]) MAPDATA + (number~) main::$13) + *((byte*) SCREEN + (number~) main::$12) ← *((byte[$3e8]) MAPDATA + (number~) main::$13) (number~) main::$14 ← (number) $320 + (byte) main::x#2 (number~) main::$15 ← (number) $320 + (byte) main::x#2 - *((byte*) COLS#0 + (number~) main::$14) ← *((byte[$100]) COLORMAP2 + *((byte[$3e8]) MAPDATA + (number~) main::$15)) + *((byte*) COLS + (number~) main::$14) ← *((byte[$100]) COLORMAP2 + *((byte[$3e8]) MAPDATA + (number~) main::$15)) (byte) main::x#1 ← (byte) main::x#2 + rangenext(0,$c8) (bool~) main::$16 ← (byte) main::x#1 != rangelast(0,$c8) if((bool~) main::$16) goto main::@1 @@ -65,10 +65,8 @@ SYMBOL TABLE SSA (byte[$100]) COLORMAP1 (byte[$100]) COLORMAP2 (byte*) COLS -(byte*) COLS#0 (byte[$3e8]) MAPDATA (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (number~) main::$0 (number~) main::$1 @@ -127,8 +125,8 @@ Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (un Adding number conversion cast (unumber) $320 in (number~) main::$15 ← (number) $320 + (byte) main::x#2 Adding number conversion cast (unumber) main::$15 in (number~) main::$15 ← (unumber)(number) $320 + (byte) main::x#2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) COLS#0 ← (byte*)(number) $d800 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) COLS ← (byte*)(number) $d800 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant pointer cast (byte*) 55296 @@ -191,24 +189,24 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte[$3e8]) MAPDATA = { fill( $3e8, 0) } Constant (const byte[$100]) COLORMAP1 = { fill( $100, 0) } Constant (const byte[$100]) COLORMAP2 = { fill( $100, 0) } -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) COLS#0 = (byte*) 55296 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) COLS = (byte*) 55296 Constant (const byte) main::x#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [33] main::x#1 ← ++ main::x#2 to ++ Resolved ranged comparison value [35] if(main::x#1!=rangelast(0,$c8)) goto main::@1 to (number) $c9 -De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) SCREEN#0 + (word~) main::$4) ← *((const byte[$3e8]) MAPDATA + (word~) main::$5) -De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) SCREEN#0 + (word~) main::$4) ← *((byte*~) main::$17) -De-inlining pointer[w] to *(pointer+w) [20] *((const byte*) COLS#0 + (word~) main::$6) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (word~) main::$7)) -De-inlining pointer[w] to *(pointer+w) [20] *((const byte*) COLS#0 + (word~) main::$6) ← *((const byte[$100]) COLORMAP1 + *((byte*~) main::$19)) -De-inlining pointer[w] to *(pointer+w) [23] *((const byte*) SCREEN#0 + (word~) main::$8) ← *((const byte[$3e8]) MAPDATA + (word~) main::$9) -De-inlining pointer[w] to *(pointer+w) [23] *((const byte*) SCREEN#0 + (word~) main::$8) ← *((byte*~) main::$21) -De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) COLS#0 + (word~) main::$10) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA + (word~) main::$11)) -De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) COLS#0 + (word~) main::$10) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$23)) -De-inlining pointer[w] to *(pointer+w) [29] *((const byte*) SCREEN#0 + (word~) main::$12) ← *((const byte[$3e8]) MAPDATA + (word~) main::$13) -De-inlining pointer[w] to *(pointer+w) [29] *((const byte*) SCREEN#0 + (word~) main::$12) ← *((byte*~) main::$25) -De-inlining pointer[w] to *(pointer+w) [32] *((const byte*) COLS#0 + (word~) main::$14) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA + (word~) main::$15)) -De-inlining pointer[w] to *(pointer+w) [32] *((const byte*) COLS#0 + (word~) main::$14) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$27)) +De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) SCREEN + (word~) main::$4) ← *((const byte[$3e8]) MAPDATA + (word~) main::$5) +De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) SCREEN + (word~) main::$4) ← *((byte*~) main::$17) +De-inlining pointer[w] to *(pointer+w) [20] *((const byte*) COLS + (word~) main::$6) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (word~) main::$7)) +De-inlining pointer[w] to *(pointer+w) [20] *((const byte*) COLS + (word~) main::$6) ← *((const byte[$100]) COLORMAP1 + *((byte*~) main::$19)) +De-inlining pointer[w] to *(pointer+w) [23] *((const byte*) SCREEN + (word~) main::$8) ← *((const byte[$3e8]) MAPDATA + (word~) main::$9) +De-inlining pointer[w] to *(pointer+w) [23] *((const byte*) SCREEN + (word~) main::$8) ← *((byte*~) main::$21) +De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) COLS + (word~) main::$10) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA + (word~) main::$11)) +De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) COLS + (word~) main::$10) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$23)) +De-inlining pointer[w] to *(pointer+w) [29] *((const byte*) SCREEN + (word~) main::$12) ← *((const byte[$3e8]) MAPDATA + (word~) main::$13) +De-inlining pointer[w] to *(pointer+w) [29] *((const byte*) SCREEN + (word~) main::$12) ← *((byte*~) main::$25) +De-inlining pointer[w] to *(pointer+w) [32] *((const byte*) COLS + (word~) main::$14) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA + (word~) main::$15)) +De-inlining pointer[w] to *(pointer+w) [32] *((const byte*) COLS + (word~) main::$14) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$27)) Successful SSA optimization Pass2DeInlineWordDerefIdx Adding number conversion cast (unumber) $c9 in if((byte) main::x#1!=(number) $c9) goto main::@1 Successful SSA optimization PassNAddNumberTypeConversions @@ -220,9 +218,9 @@ Inlining constant with var siblings (const byte) main::x#0 Constant inlined main::x#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in assignment *(MAPDATA+$c8 + main::$1) -Consolidated array index constant in assignment *(SCREEN#0+$c8 + main::$0) +Consolidated array index constant in assignment *(SCREEN+$c8 + main::$0) Consolidated array index constant in assignment *(MAPDATA+$c8 + main::$3) -Consolidated array index constant in assignment *(COLS#0+$c8 + main::$2) +Consolidated array index constant in assignment *(COLS+$c8 + main::$2) Consolidated constant in assignment main::$17 Consolidated constant in assignment main::$18 Consolidated constant in assignment main::$19 @@ -239,30 +237,30 @@ Successful SSA optimization Pass2ConstantAdditionElimination Alias (byte) main::x#2 = (byte~) main::$0 (byte~) main::$1 (byte~) main::$2 (byte~) main::$3 (word~) main::$4 (word~) main::$5 (word~) main::$6 (word~) main::$7 (word~) main::$8 (word~) main::$9 (word~) main::$10 (word~) main::$11 (word~) main::$12 (word~) main::$13 (word~) main::$14 (word~) main::$15 Successful SSA optimization Pass2AliasElimination Converting *(pointer+n) to pointer[n] [13] *((byte*~) main::$18) ← *((byte*~) main::$17) -- *(MAPDATA+$190 + main::x#2) -Converting *(pointer+n) to pointer[n] [13] *((byte*~) main::$18) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- *(SCREEN#0+$190 + main::x#2) +Converting *(pointer+n) to pointer[n] [13] *((byte*~) main::$18) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- *(SCREEN+$190 + main::x#2) Converting *(pointer+n) to pointer[n] [18] *((byte*~) main::$20) ← *((const byte[$100]) COLORMAP1 + *((byte*~) main::$19)) -- *(MAPDATA+$190 + main::x#2) -Converting *(pointer+n) to pointer[n] [18] *((byte*~) main::$20) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- *(COLS#0+$190 + main::x#2) +Converting *(pointer+n) to pointer[n] [18] *((byte*~) main::$20) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- *(COLS+$190 + main::x#2) Converting *(pointer+n) to pointer[n] [23] *((byte*~) main::$22) ← *((byte*~) main::$21) -- *(MAPDATA+$258 + main::x#2) -Converting *(pointer+n) to pointer[n] [23] *((byte*~) main::$22) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- *(SCREEN#0+$258 + main::x#2) +Converting *(pointer+n) to pointer[n] [23] *((byte*~) main::$22) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- *(SCREEN+$258 + main::x#2) Converting *(pointer+n) to pointer[n] [28] *((byte*~) main::$24) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$23)) -- *(MAPDATA+$258 + main::x#2) -Converting *(pointer+n) to pointer[n] [28] *((byte*~) main::$24) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- *(COLS#0+$258 + main::x#2) +Converting *(pointer+n) to pointer[n] [28] *((byte*~) main::$24) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- *(COLS+$258 + main::x#2) Converting *(pointer+n) to pointer[n] [33] *((byte*~) main::$26) ← *((byte*~) main::$25) -- *(MAPDATA+$320 + main::x#2) -Converting *(pointer+n) to pointer[n] [33] *((byte*~) main::$26) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- *(SCREEN#0+$320 + main::x#2) +Converting *(pointer+n) to pointer[n] [33] *((byte*~) main::$26) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- *(SCREEN+$320 + main::x#2) Converting *(pointer+n) to pointer[n] [38] *((byte*~) main::$28) ← *((const byte[$100]) COLORMAP2 + *((byte*~) main::$27)) -- *(MAPDATA+$320 + main::x#2) -Converting *(pointer+n) to pointer[n] [38] *((byte*~) main::$28) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- *(COLS#0+$320 + main::x#2) +Converting *(pointer+n) to pointer[n] [38] *((byte*~) main::$28) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- *(COLS+$320 + main::x#2) Successful SSA optimization Pass2InlineDerefIdx Eliminating unused variable (byte*~) main::$17 and assignment [5] (byte*~) main::$17 ← (const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$18 and assignment [6] (byte*~) main::$18 ← (const byte*) SCREEN#0+(word) $190 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$18 and assignment [6] (byte*~) main::$18 ← (const byte*) SCREEN+(word) $190 + (byte) main::x#2 Eliminating unused variable (byte*~) main::$19 and assignment [8] (byte*~) main::$19 ← (const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$20 and assignment [9] (byte*~) main::$20 ← (const byte*) COLS#0+(word) $190 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$20 and assignment [9] (byte*~) main::$20 ← (const byte*) COLS+(word) $190 + (byte) main::x#2 Eliminating unused variable (byte*~) main::$21 and assignment [11] (byte*~) main::$21 ← (const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$22 and assignment [12] (byte*~) main::$22 ← (const byte*) SCREEN#0+(word) $258 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$22 and assignment [12] (byte*~) main::$22 ← (const byte*) SCREEN+(word) $258 + (byte) main::x#2 Eliminating unused variable (byte*~) main::$23 and assignment [14] (byte*~) main::$23 ← (const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$24 and assignment [15] (byte*~) main::$24 ← (const byte*) COLS#0+(word) $258 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$24 and assignment [15] (byte*~) main::$24 ← (const byte*) COLS+(word) $258 + (byte) main::x#2 Eliminating unused variable (byte*~) main::$25 and assignment [17] (byte*~) main::$25 ← (const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$26 and assignment [18] (byte*~) main::$26 ← (const byte*) SCREEN#0+(word) $320 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$26 and assignment [18] (byte*~) main::$26 ← (const byte*) SCREEN+(word) $320 + (byte) main::x#2 Eliminating unused variable (byte*~) main::$27 and assignment [20] (byte*~) main::$27 ← (const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2 -Eliminating unused variable (byte*~) main::$28 and assignment [21] (byte*~) main::$28 ← (const byte*) COLS#0+(word) $320 + (byte) main::x#2 +Eliminating unused variable (byte*~) main::$28 and assignment [21] (byte*~) main::$28 ← (const byte*) COLS+(word) $320 + (byte) main::x#2 Successful SSA optimization PassNEliminateUnusedVars Added new block during phi lifting main::@3(between main::@1 and main::@1) Adding NOP phi() at start of @begin @@ -300,16 +298,16 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::x#2 ← phi( main/(byte) 0 main::@1/(byte) main::x#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) - [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) - [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) - [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) - [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) - [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) - [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) - [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) - [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) - [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) + [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) + [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) + [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) + [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) + [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) + [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) + [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) + [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) + [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) + [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) [16] (byte) main::x#1 ← ++ (byte) main::x#2 [17] if((byte) main::x#1!=(byte) $c9) goto main::@1 to:main::@return @@ -319,8 +317,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) COLS -(byte*) SCREEN (void()) main() (byte) main::x !reg byte y (byte) main::x#1 !reg byte y 16.5 @@ -371,38 +367,38 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA,y sta SCREEN,y - // [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA,y lda COLORMAP1,x sta COLS,y - // [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$c8,y sta SCREEN+$c8,y - // [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$c8,y lda COLORMAP1,x sta COLS+$c8,y - // [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$190,y sta SCREEN+$190,y - // [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$190,y lda COLORMAP1,x sta COLS+$190,y - // [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$258,y sta SCREEN+$258,y - // [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$258,y lda COLORMAP2,x sta COLS+$258,y - // [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$320,y sta SCREEN+$320,y - // [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$320,y lda COLORMAP2,x sta COLS+$320,y @@ -423,16 +419,16 @@ main: { COLORMAP2: .fill $100, 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a -Statement [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x -Statement [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a -Statement [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x -Statement [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a -Statement [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x -Statement [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a -Statement [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x -Statement [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a -Statement [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x +Statement [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x +Statement [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x +Statement [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x +Statement [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x +Statement [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) [ main::x#2 ] ( main:2 [ main::x#2 ] ) always clobbers reg byte a reg byte x Statement [16] (byte) main::x#1 ← ++ (byte) main::x#2 [ main::x#1 ] ( main:2 [ main::x#1 ] ) always clobbers reg byte y Potential registers reg byte y [ main::x#2 main::x#1 ] : reg byte y , @@ -482,38 +478,38 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA,y sta SCREEN,y - // [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA,y lda COLORMAP1,x sta COLS,y - // [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$c8,y sta SCREEN+$c8,y - // [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$c8,y lda COLORMAP1,x sta COLS+$c8,y - // [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$190,y sta SCREEN+$190,y - // [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$190,y lda COLORMAP1,x sta COLS+$190,y - // [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$258,y sta SCREEN+$258,y - // [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$258,y lda COLORMAP2,x sta COLS+$258,y - // [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$320,y sta SCREEN+$320,y - // [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$320,y lda COLORMAP2,x sta COLS+$320,y @@ -564,11 +560,9 @@ FINAL SYMBOL TABLE (label) @end (const byte[$100]) COLORMAP1 COLORMAP1 = { fill( $100, 0) } (const byte[$100]) COLORMAP2 COLORMAP2 = { fill( $100, 0) } -(byte*) COLS -(const byte*) COLS#0 COLS = (byte*) 55296 +(const byte*) COLS COLS = (byte*) 55296 (const byte[$3e8]) MAPDATA MAPDATA = { fill( $3e8, 0) } -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return @@ -608,47 +602,47 @@ main: { // main::@1 b1: // SCREEN[x] = MAPDATA[x] - // [6] *((const byte*) SCREEN#0 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [6] *((const byte*) SCREEN + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA,y sta SCREEN,y // COLS[x] = COLORMAP1[MAPDATA[x]] - // [7] *((const byte*) COLS#0 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [7] *((const byte*) COLS + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA,y lda COLORMAP1,x sta COLS,y // SCREEN[200+x] = MAPDATA[200+x] - // [8] *((const byte*) SCREEN#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [8] *((const byte*) SCREEN+(byte) $c8 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$c8,y sta SCREEN+$c8,y // COLS[200+x] = COLORMAP1[MAPDATA[200+x]] - // [9] *((const byte*) COLS#0+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [9] *((const byte*) COLS+(byte) $c8 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(byte) $c8 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$c8,y lda COLORMAP1,x sta COLS+$c8,y // SCREEN[400+x] = MAPDATA[400+x] - // [10] *((const byte*) SCREEN#0+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [10] *((const byte*) SCREEN+(word) $190 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$190,y sta SCREEN+$190,y // COLS[400+x] = COLORMAP1[MAPDATA[400+x]] - // [11] *((const byte*) COLS#0+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [11] *((const byte*) COLS+(word) $190 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP1 + *((const byte[$3e8]) MAPDATA+(word) $190 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$190,y lda COLORMAP1,x sta COLS+$190,y // SCREEN[600+x] = MAPDATA[600+x] - // [12] *((const byte*) SCREEN#0+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [12] *((const byte*) SCREEN+(word) $258 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$258,y sta SCREEN+$258,y // COLS[600+x] = COLORMAP2[MAPDATA[600+x]] - // [13] *((const byte*) COLS#0+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [13] *((const byte*) COLS+(word) $258 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $258 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$258,y lda COLORMAP2,x sta COLS+$258,y // SCREEN[800+x] = MAPDATA[800+x] - // [14] *((const byte*) SCREEN#0+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy + // [14] *((const byte*) SCREEN+(word) $320 + (byte) main::x#2) ← *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuyy lda MAPDATA+$320,y sta SCREEN+$320,y // COLS[800+x] = COLORMAP2[MAPDATA[800+x]] - // [15] *((const byte*) COLS#0+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) + // [15] *((const byte*) COLS+(word) $320 + (byte) main::x#2) ← *((const byte[$100]) COLORMAP2 + *((const byte[$3e8]) MAPDATA+(word) $320 + (byte) main::x#2)) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_(pbuc3_derefidx_vbuyy) ldx MAPDATA+$320,y lda COLORMAP2,x sta COLS+$320,y diff --git a/src/test/ref/double-indexing-arrays.sym b/src/test/ref/double-indexing-arrays.sym index edc5284d6..ced5924ae 100644 --- a/src/test/ref/double-indexing-arrays.sym +++ b/src/test/ref/double-indexing-arrays.sym @@ -3,11 +3,9 @@ (label) @end (const byte[$100]) COLORMAP1 COLORMAP1 = { fill( $100, 0) } (const byte[$100]) COLORMAP2 COLORMAP2 = { fill( $100, 0) } -(byte*) COLS -(const byte*) COLS#0 COLS = (byte*) 55296 +(const byte*) COLS COLS = (byte*) 55296 (const byte[$3e8]) MAPDATA MAPDATA = { fill( $3e8, 0) } -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/dword.cfg b/src/test/ref/dword.cfg index 1e538b747..a439614f5 100644 --- a/src/test/ref/dword.cfg +++ b/src/test/ref/dword.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] (dword) main::b#0 ← (const dword) main::a#0 + (byte) main::i#2 + [6] (dword) main::b#0 ← (const dword) main::a + (byte) main::i#2 [7] (byte) main::c#0 ← (byte)(dword) main::b#0 [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::c#0 [9] (byte) main::i#1 ← ++ (byte) main::i#2 diff --git a/src/test/ref/dword.log b/src/test/ref/dword.log index bc6d1c011..c026bb528 100644 --- a/src/test/ref/dword.log +++ b/src/test/ref/dword.log @@ -7,12 +7,12 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (dword) main::a#0 ← (number) $ee6b2800 + (dword) main::a ← (number) $ee6b2800 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - (dword~) main::$0 ← (dword) main::a#0 + (byte) main::i#2 + (dword~) main::$0 ← (dword) main::a + (byte) main::i#2 (dword) main::b#0 ← (dword~) main::$0 (byte~) main::$1 ← ((byte)) (dword) main::b#0 (byte) main::c#0 ← (byte~) main::$1 @@ -46,7 +46,6 @@ SYMBOL TABLE SSA (byte*) main::SCREEN (byte*) main::SCREEN#0 (dword) main::a -(dword) main::a#0 (dword) main::b (dword) main::b#0 (byte) main::c @@ -56,9 +55,9 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 -Adding number conversion cast (unumber) $ee6b2800 in (dword) main::a#0 ← (number) $ee6b2800 +Adding number conversion cast (unumber) $ee6b2800 in (dword) main::a ← (number) $ee6b2800 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (dword) main::a#0 ← (unumber)(number) $ee6b2800 +Inlining cast (dword) main::a ← (unumber)(number) $ee6b2800 Inlining cast (byte~) main::$1 ← (byte)(dword) main::b#0 Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast @@ -72,7 +71,7 @@ Alias (byte) main::c#0 = (byte~) main::$1 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [11] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const dword) main::a#0 = $ee6b2800 +Constant (const dword) main::a = $ee6b2800 Constant (const byte) main::i#0 = 0 Constant (const byte*) main::SCREEN#0 = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification @@ -123,7 +122,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] (dword) main::b#0 ← (const dword) main::a#0 + (byte) main::i#2 + [6] (dword) main::b#0 ← (const dword) main::a + (byte) main::i#2 [7] (byte) main::c#0 ← (byte)(dword) main::b#0 [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::c#0 [9] (byte) main::i#1 ← ++ (byte) main::i#2 @@ -137,7 +136,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() (byte*) main::SCREEN -(dword) main::a (dword) main::b (dword) main::b#0 11.0 (byte) main::c @@ -201,7 +199,7 @@ main: { jmp b1 // main::@1 b1: - // [6] (dword) main::b#0 ← (const dword) main::a#0 + (byte) main::i#2 -- vduz1=vduc1_plus_vbuz2 + // [6] (dword) main::b#0 ← (const dword) main::a + (byte) main::i#2 -- vduz1=vduc1_plus_vbuz2 lda.z i clc adc #(byte) main::b#2) goto main::@4 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::a#0 = $80 Constant (const byte) main::b#0 = 2 Successful SSA optimization Pass2ConstantIdentification @@ -160,7 +159,7 @@ main::@1: scope:[main] from main main::@4 main::@5 [6] if((byte) main::a#2!=(byte) main::b#2) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [7] *((const byte*) SCREEN#0) ← (byte) main::a#2 + [7] *((const byte*) SCREEN) ← (byte) main::a#2 to:main::@return main::@return: scope:[main] from main::@3 [8] return @@ -177,7 +176,6 @@ main::@4: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::a (byte) main::a#1 22.0 @@ -244,7 +242,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) SCREEN#0) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 + // [7] *((const byte*) SCREEN) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 lda.z a sta SCREEN jmp breturn @@ -347,7 +345,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) SCREEN#0) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 + // [7] *((const byte*) SCREEN) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 lda.z a sta SCREEN jmp breturn @@ -422,8 +420,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -478,7 +475,7 @@ main: { bne b2 // main::@3 // *SCREEN = a - // [7] *((const byte*) SCREEN#0) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 + // [7] *((const byte*) SCREEN) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 lda.z a sta SCREEN // main::@return diff --git a/src/test/ref/euclid-problem.sym b/src/test/ref/euclid-problem.sym index 5acfef455..80b20fe7e 100644 --- a/src/test/ref/euclid-problem.sym +++ b/src/test/ref/euclid-problem.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/examples/3d/3d.cfg b/src/test/ref/examples/3d/3d.cfg index 65ef6045a..3a2fc4c70 100644 --- a/src/test/ref/examples/3d/3d.cfg +++ b/src/test/ref/examples/3d/3d.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -18,8 +18,8 @@ main: scope:[main] from @1 [5] call sprites_init to:main::@1 main::@1: scope:[main] from main - [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 - [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 + [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 + [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [8] call debug_print_init to:main::@2 main::@2: scope:[main] from main::@1 @@ -66,16 +66,16 @@ anim::@6: scope:[anim] from anim::@8 anim::@9 [28] call rotate_matrix to:anim::@9 anim::@9: scope:[anim] from anim::@6 - [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) - [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) - [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) - [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) - [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) - [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) + [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) + [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) + [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) + [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) + [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) + [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 - [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) + [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) [37] *((const byte*) SPRITES_XPOS + (byte) anim::i2#0) ← (byte~) anim::$10 - [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) + [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) [39] *((const byte*) SPRITES_YPOS + (byte) anim::i2#0) ← (byte~) anim::$12 [40] (byte) anim::i#1 ← ++ (byte) anim::i#2 [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 @@ -216,7 +216,7 @@ debug_print::@return: scope:[debug_print] from debug_print::@17 (void()) print_sbyte_at((signed byte) print_sbyte_at::b , (byte*) print_sbyte_at::at) print_sbyte_at: scope:[print_sbyte_at] from debug_print::@1 debug_print::@12 debug_print::@13 debug_print::@14 debug_print::@15 debug_print::@16 debug_print::print_sbyte_pos1 debug_print::print_sbyte_pos10 debug_print::print_sbyte_pos11 debug_print::print_sbyte_pos12 debug_print::print_sbyte_pos2 debug_print::print_sbyte_pos3 debug_print::print_sbyte_pos4 debug_print::print_sbyte_pos5 debug_print::print_sbyte_pos6 debug_print::print_sbyte_pos7 debug_print::print_sbyte_pos8 debug_print::print_sbyte_pos9 debug_print_init::@1 debug_print_init::@16 debug_print_init::@17 [105] (byte*) print_sbyte_at::at#21 ← phi( debug_print::@1/(byte*) print_sbyte_at::at#15 debug_print::@12/(byte*) print_sbyte_at::at#16 debug_print::@13/(byte*) print_sbyte_at::at#17 debug_print::@14/(byte*) print_sbyte_at::at#18 debug_print::@15/(byte*) print_sbyte_at::at#19 debug_print::@16/(byte*) print_sbyte_at::at#20 debug_print::print_sbyte_pos1/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos1_col#0 debug_print::print_sbyte_pos10/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos10_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos10_col#0 debug_print::print_sbyte_pos11/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos11_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos11_col#0 debug_print::print_sbyte_pos12/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos12_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos12_col#0 debug_print::print_sbyte_pos2/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos2_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos2_col#0 debug_print::print_sbyte_pos3/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos3_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos3_col#0 debug_print::print_sbyte_pos4/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos4_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos4_col#0 debug_print::print_sbyte_pos5/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos5_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos5_col#0 debug_print::print_sbyte_pos6/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos6_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos6_col#0 debug_print::print_sbyte_pos7/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos7_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos7_col#0 debug_print::print_sbyte_pos8/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos8_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos8_col#0 debug_print::print_sbyte_pos9/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos9_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos9_col#0 debug_print_init::@1/(byte*) print_sbyte_at::at#0 debug_print_init::@16/(byte*) print_sbyte_at::at#1 debug_print_init::@17/(byte*) print_sbyte_at::at#2 ) - [105] (signed byte) print_sbyte_at::b#22 ← phi( debug_print::@1/(signed byte) print_sbyte_at::b#16 debug_print::@12/(signed byte) print_sbyte_at::b#17 debug_print::@13/(signed byte) print_sbyte_at::b#18 debug_print::@14/(signed byte) print_sbyte_at::b#19 debug_print::@15/(signed byte) print_sbyte_at::b#20 debug_print::@16/(signed byte) print_sbyte_at::b#21 debug_print::print_sbyte_pos1/(signed byte) print_sbyte_at::b#4 debug_print::print_sbyte_pos10/(signed byte) print_sbyte_at::b#13 debug_print::print_sbyte_pos11/(signed byte) print_sbyte_at::b#14 debug_print::print_sbyte_pos12/(signed byte) print_sbyte_at::b#15 debug_print::print_sbyte_pos2/(signed byte) print_sbyte_at::b#5 debug_print::print_sbyte_pos3/(const signed byte) sz#0 debug_print::print_sbyte_pos4/(signed byte) print_sbyte_at::b#7 debug_print::print_sbyte_pos5/(signed byte) print_sbyte_at::b#8 debug_print::print_sbyte_pos6/(signed byte) print_sbyte_at::b#9 debug_print::print_sbyte_pos7/(signed byte) print_sbyte_at::b#10 debug_print::print_sbyte_pos8/(signed byte) print_sbyte_at::b#11 debug_print::print_sbyte_pos9/(signed byte) print_sbyte_at::b#12 debug_print_init::@1/(signed byte) print_sbyte_at::b#1 debug_print_init::@16/(signed byte) print_sbyte_at::b#2 debug_print_init::@17/(signed byte) print_sbyte_at::b#3 ) + [105] (signed byte) print_sbyte_at::b#22 ← phi( debug_print::@1/(signed byte) print_sbyte_at::b#16 debug_print::@12/(signed byte) print_sbyte_at::b#17 debug_print::@13/(signed byte) print_sbyte_at::b#18 debug_print::@14/(signed byte) print_sbyte_at::b#19 debug_print::@15/(signed byte) print_sbyte_at::b#20 debug_print::@16/(signed byte) print_sbyte_at::b#21 debug_print::print_sbyte_pos1/(signed byte) print_sbyte_at::b#4 debug_print::print_sbyte_pos10/(signed byte) print_sbyte_at::b#13 debug_print::print_sbyte_pos11/(signed byte) print_sbyte_at::b#14 debug_print::print_sbyte_pos12/(signed byte) print_sbyte_at::b#15 debug_print::print_sbyte_pos2/(signed byte) print_sbyte_at::b#5 debug_print::print_sbyte_pos3/(const signed byte) sz debug_print::print_sbyte_pos4/(signed byte) print_sbyte_at::b#7 debug_print::print_sbyte_pos5/(signed byte) print_sbyte_at::b#8 debug_print::print_sbyte_pos6/(signed byte) print_sbyte_at::b#9 debug_print::print_sbyte_pos7/(signed byte) print_sbyte_at::b#10 debug_print::print_sbyte_pos8/(signed byte) print_sbyte_at::b#11 debug_print::print_sbyte_pos9/(signed byte) print_sbyte_at::b#12 debug_print_init::@1/(signed byte) print_sbyte_at::b#1 debug_print_init::@16/(signed byte) print_sbyte_at::b#2 debug_print_init::@17/(signed byte) print_sbyte_at::b#3 ) [106] if((signed byte) print_sbyte_at::b#22<(signed byte) 0) goto print_sbyte_at::@1 to:print_sbyte_at::@3 print_sbyte_at::@3: scope:[print_sbyte_at] from print_sbyte_at @@ -269,9 +269,9 @@ print_byte_at::@return: scope:[print_byte_at] from print_byte_at::@1 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) rotate_matrix: scope:[rotate_matrix] from anim::@6 - [129] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 - [130] *((const signed byte*) yr#0) ← (signed byte) rotate_matrix::y#0 - [131] *((const signed byte*) zr#0) ← (signed byte) rotate_matrix::z#0 + [129] *((const signed byte*) xr) ← (signed byte) rotate_matrix::x#0 + [130] *((const signed byte*) yr) ← (signed byte) rotate_matrix::y#0 + [131] *((const signed byte*) zr) ← (signed byte) rotate_matrix::z#0 asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } to:rotate_matrix::@return rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix @@ -442,7 +442,7 @@ debug_print_init::@return: scope:[debug_print_init] from debug_print_init::@3 (void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at) print_str_at: scope:[print_str_at] from debug_print_init::@10 debug_print_init::@11 debug_print_init::@12 debug_print_init::@13 debug_print_init::@14 debug_print_init::@15 debug_print_init::@4 debug_print_init::@5 debug_print_init::@6 debug_print_init::@7 debug_print_init::@8 debug_print_init::@9 - [243] (byte*) print_str_at::at#15 ← phi( debug_print_init::@9/(const byte*) SCREEN#0+(word)(number) $28*(number) $12 debug_print_init::@10/(const byte*) SCREEN#0+(word)(number) $28*(number) $13 debug_print_init::@11/(const byte*) SCREEN#0+(word)(number) $28*(number) $14 debug_print_init::@12/(const byte*) SCREEN#0+(word)(number) $28*(number) $15 debug_print_init::@13/(const byte*) SCREEN#0+(word)(number) $28*(number) $16 debug_print_init::@14/(const byte*) SCREEN#0+(word)(number) $28*(number) $17 debug_print_init::@15/(const byte*) SCREEN#0+(word)(number) $28*(number) $18 debug_print_init::@4/(const byte*) SCREEN#0+(byte) $22 debug_print_init::@5/(const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 debug_print_init::@6/(const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 debug_print_init::@7/(const byte*) SCREEN#0+(word)(number) $28*(number) $10 debug_print_init::@8/(const byte*) SCREEN#0+(word)(number) $28*(number) $11 ) + [243] (byte*) print_str_at::at#15 ← phi( debug_print_init::@9/(const byte*) SCREEN+(word)(number) $28*(number) $12 debug_print_init::@10/(const byte*) SCREEN+(word)(number) $28*(number) $13 debug_print_init::@11/(const byte*) SCREEN+(word)(number) $28*(number) $14 debug_print_init::@12/(const byte*) SCREEN+(word)(number) $28*(number) $15 debug_print_init::@13/(const byte*) SCREEN+(word)(number) $28*(number) $16 debug_print_init::@14/(const byte*) SCREEN+(word)(number) $28*(number) $17 debug_print_init::@15/(const byte*) SCREEN+(word)(number) $28*(number) $18 debug_print_init::@4/(const byte*) SCREEN+(byte) $22 debug_print_init::@5/(const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 debug_print_init::@6/(const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 debug_print_init::@7/(const byte*) SCREEN+(word)(number) $28*(number) $10 debug_print_init::@8/(const byte*) SCREEN+(word)(number) $28*(number) $11 ) [243] (byte*) print_str_at::str#15 ← phi( debug_print_init::@9/(const string) debug_print_init::str5 debug_print_init::@10/(const string) debug_print_init::str6 debug_print_init::@11/(const string) debug_print_init::str7 debug_print_init::@12/(const string) debug_print_init::str8 debug_print_init::@13/(const string) debug_print_init::str9 debug_print_init::@14/(const string) debug_print_init::str10 debug_print_init::@15/(const string) debug_print_init::str11 debug_print_init::@4/(const string) debug_print_init::str debug_print_init::@5/(const string) debug_print_init::str1 debug_print_init::@6/(const string) debug_print_init::str2 debug_print_init::@7/(const string) debug_print_init::str3 debug_print_init::@8/(const string) debug_print_init::str4 ) to:print_str_at::@1 print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2 @@ -490,7 +490,7 @@ sprites_init: scope:[sprites_init] from main to:sprites_init::@1 sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1 [260] (byte) sprites_init::i#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::i#1 ) - [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN [263] (byte) sprites_init::i#1 ← ++ (byte) sprites_init::i#2 [264] if((byte) sprites_init::i#1!=(byte) 8) goto sprites_init::@1 diff --git a/src/test/ref/examples/3d/3d.log b/src/test/ref/examples/3d/3d.log index e2eada3b4..3b60dac2f 100644 --- a/src/test/ref/examples/3d/3d.log +++ b/src/test/ref/examples/3d/3d.log @@ -398,15 +398,15 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 to:@return @40: scope:[] from @33 (byte*) print_screen#48 ← phi( @33/(byte*) print_screen#50 ) - (signed byte*) xr#0 ← ((signed byte*)) (number) $f0 - (signed byte*) yr#0 ← ((signed byte*)) (number) $f1 - (signed byte*) zr#0 ← ((signed byte*)) (number) $f2 - (signed byte*) pp#0 ← ((signed byte*)) (number) $f3 - (signed byte*) xp#0 ← ((signed byte*)) (number) $f4 - (signed byte*) yp#0 ← ((signed byte*)) (number) $f5 - (word*) psp1#0 ← ((word*)) (number) $f6 - (word*) psp2#0 ← ((word*)) (number) $f8 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (signed byte*) xr ← ((signed byte*)) (number) $f0 + (signed byte*) yr ← ((signed byte*)) (number) $f1 + (signed byte*) zr ← ((signed byte*)) (number) $f2 + (signed byte*) pp ← ((signed byte*)) (number) $f3 + (signed byte*) xp ← ((signed byte*)) (number) $f4 + (signed byte*) yp ← ((signed byte*)) (number) $f5 + (word*) psp1 ← ((word*)) (number) $f6 + (word*) psp2 ← ((word*)) (number) $f8 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@41 (void()) main() @@ -426,9 +426,9 @@ main::@1: scope:[main] from main (signed byte) sy#19 ← phi( main/(signed byte) sy#25 ) (signed byte) sx#18 ← phi( main/(signed byte) sx#23 ) (word~) main::$1 ← ((word)) (byte[$200]) mulf_sqr1 - *((word*) psp1#0) ← (word~) main::$1 + *((word*) psp1) ← (word~) main::$1 (word~) main::$2 ← ((word)) (byte[$200]) mulf_sqr2 - *((word*) psp2#0) ← (word~) main::$2 + *((word*) psp2) ← (word~) main::$2 call debug_print_init to:main::@2 main::@2: scope:[main] from main::@1 @@ -465,7 +465,7 @@ main::@return: scope:[main] from main::@3 (signed byte[8]) yps ← { fill( 8, 0) } (signed byte) sx#2 ← (number) 0 (signed byte) sy#2 ← (number) 0 - (signed byte) sz#0 ← (number) 0 + (signed byte) sz ← (number) 0 to:@45 (void()) anim() @@ -520,7 +520,7 @@ anim::@18: scope:[anim] from anim::@16 *((byte*) BORDERCOL) ← ++ *((byte*) BORDERCOL) (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#8 (signed byte) calculate_matrix::sy#0 ← (signed byte) sy#8 - (signed byte) calculate_matrix::sz#0 ← (signed byte) sz#0 + (signed byte) calculate_matrix::sz#0 ← (signed byte) sz call calculate_matrix to:anim::@27 anim::@27: scope:[anim] from anim::@18 @@ -559,18 +559,18 @@ anim::@29: scope:[anim] from anim::@22 (signed byte) sy#22 ← phi( anim::@22/(signed byte) sy#27 ) (signed byte) sx#21 ← phi( anim::@22/(signed byte) sx#25 ) (byte) anim::i#3 ← phi( anim::@22/(byte) anim::i#2 ) - *((signed byte[8]) xrs + (byte) anim::i#3) ← *((signed byte*) xr#0) - *((signed byte[8]) yrs + (byte) anim::i#3) ← *((signed byte*) yr#0) - *((signed byte[8]) zrs + (byte) anim::i#3) ← *((signed byte*) zr#0) - *((signed byte[8]) pps + (byte) anim::i#3) ← *((signed byte*) pp#0) - *((signed byte[8]) xps + (byte) anim::i#3) ← *((signed byte*) xp#0) - *((signed byte[8]) yps + (byte) anim::i#3) ← *((signed byte*) yp#0) + *((signed byte[8]) xrs + (byte) anim::i#3) ← *((signed byte*) xr) + *((signed byte[8]) yrs + (byte) anim::i#3) ← *((signed byte*) yr) + *((signed byte[8]) zrs + (byte) anim::i#3) ← *((signed byte*) zr) + *((signed byte[8]) pps + (byte) anim::i#3) ← *((signed byte*) pp) + *((signed byte[8]) xps + (byte) anim::i#3) ← *((signed byte*) xp) + *((signed byte[8]) yps + (byte) anim::i#3) ← *((signed byte*) yp) (number~) anim::$8 ← (byte) anim::i#3 * (number) 2 (byte) anim::i2#0 ← (number~) anim::$8 - (byte~) anim::$9 ← ((byte)) *((signed byte*) xp#0) + (byte~) anim::$9 ← ((byte)) *((signed byte*) xp) (number~) anim::$10 ← (number) $80 + (byte~) anim::$9 *((byte*) SPRITES_XPOS + (byte) anim::i2#0) ← (number~) anim::$10 - (byte~) anim::$11 ← ((byte)) *((signed byte*) yp#0) + (byte~) anim::$11 ← ((byte)) *((signed byte*) yp) (number~) anim::$12 ← (number) $80 + (byte~) anim::$11 *((byte*) SPRITES_YPOS + (byte) anim::i2#0) ← (number~) anim::$12 (byte) anim::i#1 ← (byte) anim::i#3 + rangenext(0,7) @@ -610,86 +610,86 @@ debug_print_init: scope:[debug_print_init] from main::@1 call print_cls to:debug_print_init::@5 debug_print_init::@5: scope:[debug_print_init] from debug_print_init - (byte*~) debug_print_init::$1 ← (byte*) SCREEN#0 + (number) $28*(number) 0 + (byte*~) debug_print_init::$1 ← (byte*) SCREEN + (number) $28*(number) 0 (byte*~) debug_print_init::$2 ← (byte*~) debug_print_init::$1 + (number) $22 (byte*) print_str_at::str#1 ← (const string) debug_print_init::str (byte*) print_str_at::at#1 ← (byte*~) debug_print_init::$2 call print_str_at to:debug_print_init::@6 debug_print_init::@6: scope:[debug_print_init] from debug_print_init::@5 - (byte*~) debug_print_init::$4 ← (byte*) SCREEN#0 + (number) $28*(number) 1 + (byte*~) debug_print_init::$4 ← (byte*) SCREEN + (number) $28*(number) 1 (byte*~) debug_print_init::$5 ← (byte*~) debug_print_init::$4 + (number) $22 (byte*) print_str_at::str#2 ← (const string) debug_print_init::str1 (byte*) print_str_at::at#2 ← (byte*~) debug_print_init::$5 call print_str_at to:debug_print_init::@7 debug_print_init::@7: scope:[debug_print_init] from debug_print_init::@6 - (byte*~) debug_print_init::$7 ← (byte*) SCREEN#0 + (number) $28*(number) 2 + (byte*~) debug_print_init::$7 ← (byte*) SCREEN + (number) $28*(number) 2 (byte*~) debug_print_init::$8 ← (byte*~) debug_print_init::$7 + (number) $22 (byte*) print_str_at::str#3 ← (const string) debug_print_init::str2 (byte*) print_str_at::at#3 ← (byte*~) debug_print_init::$8 call print_str_at to:debug_print_init::@8 debug_print_init::@8: scope:[debug_print_init] from debug_print_init::@7 - (byte*~) debug_print_init::$10 ← (byte*) SCREEN#0 + (number) $28*(number) $10 + (byte*~) debug_print_init::$10 ← (byte*) SCREEN + (number) $28*(number) $10 (byte*) print_str_at::str#4 ← (const string) debug_print_init::str3 (byte*) print_str_at::at#4 ← (byte*~) debug_print_init::$10 call print_str_at to:debug_print_init::@9 debug_print_init::@9: scope:[debug_print_init] from debug_print_init::@8 - (byte*~) debug_print_init::$12 ← (byte*) SCREEN#0 + (number) $28*(number) $11 + (byte*~) debug_print_init::$12 ← (byte*) SCREEN + (number) $28*(number) $11 (byte*) print_str_at::str#5 ← (const string) debug_print_init::str4 (byte*) print_str_at::at#5 ← (byte*~) debug_print_init::$12 call print_str_at to:debug_print_init::@10 debug_print_init::@10: scope:[debug_print_init] from debug_print_init::@9 - (byte*~) debug_print_init::$14 ← (byte*) SCREEN#0 + (number) $28*(number) $12 + (byte*~) debug_print_init::$14 ← (byte*) SCREEN + (number) $28*(number) $12 (byte*) print_str_at::str#6 ← (const string) debug_print_init::str5 (byte*) print_str_at::at#6 ← (byte*~) debug_print_init::$14 call print_str_at to:debug_print_init::@11 debug_print_init::@11: scope:[debug_print_init] from debug_print_init::@10 - (byte*~) debug_print_init::$16 ← (byte*) SCREEN#0 + (number) $28*(number) $13 + (byte*~) debug_print_init::$16 ← (byte*) SCREEN + (number) $28*(number) $13 (byte*) print_str_at::str#7 ← (const string) debug_print_init::str6 (byte*) print_str_at::at#7 ← (byte*~) debug_print_init::$16 call print_str_at to:debug_print_init::@12 debug_print_init::@12: scope:[debug_print_init] from debug_print_init::@11 - (byte*~) debug_print_init::$18 ← (byte*) SCREEN#0 + (number) $28*(number) $14 + (byte*~) debug_print_init::$18 ← (byte*) SCREEN + (number) $28*(number) $14 (byte*) print_str_at::str#8 ← (const string) debug_print_init::str7 (byte*) print_str_at::at#8 ← (byte*~) debug_print_init::$18 call print_str_at to:debug_print_init::@13 debug_print_init::@13: scope:[debug_print_init] from debug_print_init::@12 - (byte*~) debug_print_init::$20 ← (byte*) SCREEN#0 + (number) $28*(number) $15 + (byte*~) debug_print_init::$20 ← (byte*) SCREEN + (number) $28*(number) $15 (byte*) print_str_at::str#9 ← (const string) debug_print_init::str8 (byte*) print_str_at::at#9 ← (byte*~) debug_print_init::$20 call print_str_at to:debug_print_init::@14 debug_print_init::@14: scope:[debug_print_init] from debug_print_init::@13 - (byte*~) debug_print_init::$22 ← (byte*) SCREEN#0 + (number) $28*(number) $16 + (byte*~) debug_print_init::$22 ← (byte*) SCREEN + (number) $28*(number) $16 (byte*) print_str_at::str#10 ← (const string) debug_print_init::str9 (byte*) print_str_at::at#10 ← (byte*~) debug_print_init::$22 call print_str_at to:debug_print_init::@15 debug_print_init::@15: scope:[debug_print_init] from debug_print_init::@14 - (byte*~) debug_print_init::$24 ← (byte*) SCREEN#0 + (number) $28*(number) $17 + (byte*~) debug_print_init::$24 ← (byte*) SCREEN + (number) $28*(number) $17 (byte*) print_str_at::str#11 ← (const string) debug_print_init::str10 (byte*) print_str_at::at#11 ← (byte*~) debug_print_init::$24 call print_str_at to:debug_print_init::@16 debug_print_init::@16: scope:[debug_print_init] from debug_print_init::@15 - (byte*~) debug_print_init::$26 ← (byte*) SCREEN#0 + (number) $28*(number) $18 + (byte*~) debug_print_init::$26 ← (byte*) SCREEN + (number) $28*(number) $18 (byte*) print_str_at::str#12 ← (const string) debug_print_init::str11 (byte*) print_str_at::at#12 ← (byte*~) debug_print_init::$26 call print_str_at to:debug_print_init::@17 debug_print_init::@17: scope:[debug_print_init] from debug_print_init::@16 - (byte*~) debug_print_init::$28 ← (byte*) SCREEN#0 + (number) $10*(number) $28 + (byte*~) debug_print_init::$28 ← (byte*) SCREEN + (number) $10*(number) $28 (byte*) debug_print_init::at_line#0 ← (byte*~) debug_print_init::$28 (byte) debug_print_init::c#0 ← (number) 4 - (byte*) debug_print_init::COLS#0 ← ((byte*)) (number) $d800 - (byte*~) debug_print_init::$29 ← (byte*) debug_print_init::COLS#0 + (number) $10*(number) $28 + (byte*) debug_print_init::COLS ← ((byte*)) (number) $d800 + (byte*~) debug_print_init::$29 ← (byte*) debug_print_init::COLS + (number) $10*(number) $28 (byte*) debug_print_init::at_cols#0 ← (byte*~) debug_print_init::$29 (byte) debug_print_init::i#0 ← (byte) 0 to:debug_print_init::@1 @@ -845,7 +845,7 @@ debug_print::@16: scope:[debug_print] from debug_print::print_sbyte_pos2 to:debug_print::@4 debug_print::@4: scope:[debug_print] from debug_print::@16 (byte*) print_screen#17 ← phi( debug_print::@16/(byte*) print_screen#30 ) - (signed byte) debug_print::print_sbyte_pos3_sb#0 ← (signed byte) sz#0 + (signed byte) debug_print::print_sbyte_pos3_sb#0 ← (signed byte) sz (byte) debug_print::print_sbyte_pos3_row#0 ← (number) 2 (byte) debug_print::print_sbyte_pos3_col#0 ← (number) $25 to:debug_print::print_sbyte_pos3 @@ -1053,7 +1053,7 @@ debug_print::print_sbyte_pos12: scope:[debug_print] from debug_print::@13 debug_print::@26: scope:[debug_print] from debug_print::print_sbyte_pos12 to:debug_print::@14 debug_print::@14: scope:[debug_print] from debug_print::@26 - (byte*~) debug_print::$12 ← (byte*) SCREEN#0 + (number) $13*(number) $28 + (byte*~) debug_print::$12 ← (byte*) SCREEN + (number) $13*(number) $28 (byte*) debug_print::at_line#0 ← (byte*~) debug_print::$12 (byte) debug_print::c#0 ← (number) 4 (byte) debug_print::i#0 ← (byte) 0 @@ -1133,16 +1133,16 @@ debug_print::@return: scope:[debug_print] from debug_print::@32 (void()) sprites_init() sprites_init: scope:[sprites_init] from main - (byte*) sprites_init::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) sprites_init::SCREEN ← ((byte*)) (number) $400 *((byte*) SPRITES_ENABLE) ← (number) $ff - (byte*~) sprites_init::$0 ← (byte*) sprites_init::SCREEN#0 + (number) $3f8 + (byte*~) sprites_init::$0 ← (byte*) sprites_init::SCREEN + (number) $3f8 (byte*) sprites_init::sprites_ptr#0 ← (byte*~) sprites_init::$0 (byte) sprites_init::i#0 ← (byte) 0 to:sprites_init::@1 sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1 (byte) sprites_init::i#2 ← phi( sprites_init/(byte) sprites_init::i#0 sprites_init::@1/(byte) sprites_init::i#1 ) (byte*) sprites_init::sprites_ptr#1 ← phi( sprites_init/(byte*) sprites_init::sprites_ptr#0 sprites_init::@1/(byte*) sprites_init::sprites_ptr#1 ) - (byte*~) sprites_init::$1 ← (byte*) SPRITE#0 / (number) $40 + (byte*~) sprites_init::$1 ← (byte*) SPRITE / (number) $40 (byte~) sprites_init::$2 ← ((byte)) (byte*~) sprites_init::$1 *((byte*) sprites_init::sprites_ptr#1 + (byte) sprites_init::i#2) ← (byte~) sprites_init::$2 *((byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (byte) GREEN @@ -1239,9 +1239,9 @@ rotate_matrix: scope:[rotate_matrix] from anim::@22 (signed byte) rotate_matrix::z#1 ← phi( anim::@22/(signed byte) rotate_matrix::z#0 ) (signed byte) rotate_matrix::y#1 ← phi( anim::@22/(signed byte) rotate_matrix::y#0 ) (signed byte) rotate_matrix::x#1 ← phi( anim::@22/(signed byte) rotate_matrix::x#0 ) - *((signed byte*) xr#0) ← (signed byte) rotate_matrix::x#1 - *((signed byte*) yr#0) ← (signed byte) rotate_matrix::y#1 - *((signed byte*) zr#0) ← (signed byte) rotate_matrix::z#1 + *((signed byte*) xr) ← (signed byte) rotate_matrix::x#1 + *((signed byte*) yr) ← (signed byte) rotate_matrix::y#1 + *((signed byte*) zr) ← (signed byte) rotate_matrix::z#1 asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } to:rotate_matrix::@return rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix @@ -1263,8 +1263,8 @@ rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }} - (byte*) SPRITE#0 ← ((byte*)) (number) $3000 - kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + (byte*) SPRITE ← ((byte*)) (number) $3000 + kickasm(location (byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -1376,11 +1376,9 @@ SYMBOL TABLE SSA (const byte) RADIX::OCTAL = (number) 8 (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (signed byte[$140]) SINH (signed byte[$140]) SINQ (byte*) SPRITE -(byte*) SPRITE#0 (byte*) SPRITES_COLS (byte*) SPRITES_ENABLE (byte*) SPRITES_XPOS @@ -1787,7 +1785,6 @@ SYMBOL TABLE SSA (label) debug_print_init::@9 (label) debug_print_init::@return (byte*) debug_print_init::COLS -(byte*) debug_print_init::COLS#0 (byte*) debug_print_init::at_cols (byte*) debug_print_init::at_cols#0 (byte*) debug_print_init::at_cols#1 @@ -1892,7 +1889,6 @@ SYMBOL TABLE SSA (byte[$200]) mulf_sqr1 (byte[$200]) mulf_sqr2 (signed byte*) pp -(signed byte*) pp#0 (signed byte[8]) pps (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 @@ -2095,9 +2091,7 @@ SYMBOL TABLE SSA (byte*) print_str_at::str#8 (byte*) print_str_at::str#9 (word*) psp1 -(word*) psp1#0 (word*) psp2 -(word*) psp2#0 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) (label) rotate_matrix::@return (signed byte) rotate_matrix::x @@ -2118,7 +2112,6 @@ SYMBOL TABLE SSA (label) sprites_init::@1 (label) sprites_init::@return (byte*) sprites_init::SCREEN -(byte*) sprites_init::SCREEN#0 (byte) sprites_init::i (byte) sprites_init::i#0 (byte) sprites_init::i#1 @@ -2190,23 +2183,17 @@ SYMBOL TABLE SSA (signed byte) sy#8 (signed byte) sy#9 (signed byte) sz -(signed byte) sz#0 (signed byte*) xp -(signed byte*) xp#0 (signed byte[8]) xps (signed byte*) xr -(signed byte*) xr#0 (signed byte[8]) xrs (signed byte[8]) xs (signed byte*) yp -(signed byte*) yp#0 (signed byte[8]) yps (signed byte*) yr -(signed byte*) yr#0 (signed byte[8]) yrs (signed byte[8]) ys (signed byte*) zr -(signed byte*) zr#0 (signed byte[8]) zrs (signed byte[8]) zs @@ -2224,7 +2211,7 @@ Adding number conversion cast (unumber) 1 in (byte*~) print_byte_at::$3 ← (byt Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 Adding number conversion cast (snumber) 0 in (signed byte) sx#2 ← (number) 0 Adding number conversion cast (snumber) 0 in (signed byte) sy#2 ← (number) 0 -Adding number conversion cast (snumber) 0 in (signed byte) sz#0 ← (number) 0 +Adding number conversion cast (snumber) 0 in (signed byte) sz ← (number) 0 Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) $fe in (bool~) anim::$1 ← *((byte*) RASTER) != (number) $fe Adding number conversion cast (unumber) $fd in (bool~) anim::$2 ← *((byte*) RASTER) != (number) $fd @@ -2236,24 +2223,24 @@ Adding number conversion cast (unumber) $80 in (number~) anim::$12 ← (number) Adding number conversion cast (unumber) anim::$12 in (number~) anim::$12 ← (unumber)(number) $80 + (byte~) anim::$11 Adding number conversion cast (snumber) 2 in (signed byte) sx#3 ← (signed byte) sx#9 + (number) 2 Adding number conversion cast (snumber) 3 in (signed byte) sy#3 ← (signed byte) sy#9 - (number) 3 -Adding number conversion cast (unumber) $28*0 in (byte*~) debug_print_init::$1 ← (byte*) SCREEN#0 + (number) $28*(number) 0 +Adding number conversion cast (unumber) $28*0 in (byte*~) debug_print_init::$1 ← (byte*) SCREEN + (number) $28*(number) 0 Adding number conversion cast (unumber) $22 in (byte*~) debug_print_init::$2 ← (byte*~) debug_print_init::$1 + (number) $22 -Adding number conversion cast (unumber) $28*1 in (byte*~) debug_print_init::$4 ← (byte*) SCREEN#0 + (number) $28*(number) 1 +Adding number conversion cast (unumber) $28*1 in (byte*~) debug_print_init::$4 ← (byte*) SCREEN + (number) $28*(number) 1 Adding number conversion cast (unumber) $22 in (byte*~) debug_print_init::$5 ← (byte*~) debug_print_init::$4 + (number) $22 -Adding number conversion cast (unumber) $28*2 in (byte*~) debug_print_init::$7 ← (byte*) SCREEN#0 + (number) $28*(number) 2 +Adding number conversion cast (unumber) $28*2 in (byte*~) debug_print_init::$7 ← (byte*) SCREEN + (number) $28*(number) 2 Adding number conversion cast (unumber) $22 in (byte*~) debug_print_init::$8 ← (byte*~) debug_print_init::$7 + (number) $22 -Adding number conversion cast (unumber) $28*$10 in (byte*~) debug_print_init::$10 ← (byte*) SCREEN#0 + (number) $28*(number) $10 -Adding number conversion cast (unumber) $28*$11 in (byte*~) debug_print_init::$12 ← (byte*) SCREEN#0 + (number) $28*(number) $11 -Adding number conversion cast (unumber) $28*$12 in (byte*~) debug_print_init::$14 ← (byte*) SCREEN#0 + (number) $28*(number) $12 -Adding number conversion cast (unumber) $28*$13 in (byte*~) debug_print_init::$16 ← (byte*) SCREEN#0 + (number) $28*(number) $13 -Adding number conversion cast (unumber) $28*$14 in (byte*~) debug_print_init::$18 ← (byte*) SCREEN#0 + (number) $28*(number) $14 -Adding number conversion cast (unumber) $28*$15 in (byte*~) debug_print_init::$20 ← (byte*) SCREEN#0 + (number) $28*(number) $15 -Adding number conversion cast (unumber) $28*$16 in (byte*~) debug_print_init::$22 ← (byte*) SCREEN#0 + (number) $28*(number) $16 -Adding number conversion cast (unumber) $28*$17 in (byte*~) debug_print_init::$24 ← (byte*) SCREEN#0 + (number) $28*(number) $17 -Adding number conversion cast (unumber) $28*$18 in (byte*~) debug_print_init::$26 ← (byte*) SCREEN#0 + (number) $28*(number) $18 -Adding number conversion cast (unumber) $10*$28 in (byte*~) debug_print_init::$28 ← (byte*) SCREEN#0 + (number) $10*(number) $28 +Adding number conversion cast (unumber) $28*$10 in (byte*~) debug_print_init::$10 ← (byte*) SCREEN + (number) $28*(number) $10 +Adding number conversion cast (unumber) $28*$11 in (byte*~) debug_print_init::$12 ← (byte*) SCREEN + (number) $28*(number) $11 +Adding number conversion cast (unumber) $28*$12 in (byte*~) debug_print_init::$14 ← (byte*) SCREEN + (number) $28*(number) $12 +Adding number conversion cast (unumber) $28*$13 in (byte*~) debug_print_init::$16 ← (byte*) SCREEN + (number) $28*(number) $13 +Adding number conversion cast (unumber) $28*$14 in (byte*~) debug_print_init::$18 ← (byte*) SCREEN + (number) $28*(number) $14 +Adding number conversion cast (unumber) $28*$15 in (byte*~) debug_print_init::$20 ← (byte*) SCREEN + (number) $28*(number) $15 +Adding number conversion cast (unumber) $28*$16 in (byte*~) debug_print_init::$22 ← (byte*) SCREEN + (number) $28*(number) $16 +Adding number conversion cast (unumber) $28*$17 in (byte*~) debug_print_init::$24 ← (byte*) SCREEN + (number) $28*(number) $17 +Adding number conversion cast (unumber) $28*$18 in (byte*~) debug_print_init::$26 ← (byte*) SCREEN + (number) $28*(number) $18 +Adding number conversion cast (unumber) $10*$28 in (byte*~) debug_print_init::$28 ← (byte*) SCREEN + (number) $10*(number) $28 Adding number conversion cast (unumber) 4 in (byte) debug_print_init::c#0 ← (number) 4 -Adding number conversion cast (unumber) $10*$28 in (byte*~) debug_print_init::$29 ← (byte*) debug_print_init::COLS#0 + (number) $10*(number) $28 +Adding number conversion cast (unumber) $10*$28 in (byte*~) debug_print_init::$29 ← (byte*) debug_print_init::COLS + (number) $10*(number) $28 Adding number conversion cast (unumber) $28*0 in (byte*~) debug_print_init::$30 ← (byte*) debug_print_init::at_line#1 + (number) $28*(number) 0 Adding number conversion cast (unumber) $28*1 in (byte*~) debug_print_init::$33 ← (byte*) debug_print_init::at_line#2 + (number) $28*(number) 1 Adding number conversion cast (unumber) $28*2 in (byte*~) debug_print_init::$36 ← (byte*) debug_print_init::at_line#3 + (number) $28*(number) 2 @@ -2326,7 +2313,7 @@ Adding number conversion cast (unumber) 6 in (byte) debug_print::print_sbyte_pos Adding number conversion cast (unumber) $25 in (byte) debug_print::print_sbyte_pos12_col#0 ← (number) $25 Adding number conversion cast (unumber) $28 in (number~) debug_print::print_sbyte_pos12_$0 ← (byte) debug_print::print_sbyte_pos12_row#1 * (number) $28 Adding number conversion cast (unumber) debug_print::print_sbyte_pos12_$0 in (number~) debug_print::print_sbyte_pos12_$0 ← (byte) debug_print::print_sbyte_pos12_row#1 * (unumber)(number) $28 -Adding number conversion cast (unumber) $13*$28 in (byte*~) debug_print::$12 ← (byte*) SCREEN#0 + (number) $13*(number) $28 +Adding number conversion cast (unumber) $13*$28 in (byte*~) debug_print::$12 ← (byte*) SCREEN + (number) $13*(number) $28 Adding number conversion cast (unumber) 4 in (byte) debug_print::c#0 ← (number) 4 Adding number conversion cast (unumber) $28*0 in (byte*~) debug_print::$13 ← (byte*) debug_print::at_line#1 + (number) $28*(number) 0 Adding number conversion cast (unumber) $28*1 in (byte*~) debug_print::$16 ← (byte*) debug_print::at_line#2 + (number) $28*(number) 1 @@ -2336,8 +2323,8 @@ Adding number conversion cast (unumber) $28*4 in (byte*~) debug_print::$25 ← ( Adding number conversion cast (unumber) $28*5 in (byte*~) debug_print::$28 ← (byte*) debug_print::at_line#6 + (number) $28*(number) 5 Adding number conversion cast (unumber) 4 in (byte) debug_print::c#1 ← (byte) debug_print::c#8 + (number) 4 Adding number conversion cast (unumber) $ff in *((byte*) SPRITES_ENABLE) ← (number) $ff -Adding number conversion cast (unumber) $3f8 in (byte*~) sprites_init::$0 ← (byte*) sprites_init::SCREEN#0 + (number) $3f8 -Adding number conversion cast (unumber) $40 in (byte*~) sprites_init::$1 ← (byte*) SPRITE#0 / (number) $40 +Adding number conversion cast (unumber) $3f8 in (byte*~) sprites_init::$0 ← (byte*) sprites_init::SCREEN + (number) $3f8 +Adding number conversion cast (unumber) $40 in (byte*~) sprites_init::$1 ← (byte*) SPRITE / (number) $40 Adding number conversion cast (unumber) 0 in *((signed byte[9]) rotation_matrix + (number) 0) ← (signed byte~) calculate_matrix::$10 Adding number conversion cast (unumber) 1 in *((signed byte[9]) rotation_matrix + (number) 1) ← (signed byte~) calculate_matrix::$11 Adding number conversion cast (unumber) 2 in *((signed byte[9]) rotation_matrix + (number) 2) ← (signed byte~) calculate_matrix::$12 @@ -2368,24 +2355,24 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (byte~) print_sbyte_at::$1 ← (byte)(signed byte) print_sbyte_at::b#24 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (signed byte*) xr#0 ← (signed byte*)(number) $f0 -Inlining cast (signed byte*) yr#0 ← (signed byte*)(number) $f1 -Inlining cast (signed byte*) zr#0 ← (signed byte*)(number) $f2 -Inlining cast (signed byte*) pp#0 ← (signed byte*)(number) $f3 -Inlining cast (signed byte*) xp#0 ← (signed byte*)(number) $f4 -Inlining cast (signed byte*) yp#0 ← (signed byte*)(number) $f5 -Inlining cast (word*) psp1#0 ← (word*)(number) $f6 -Inlining cast (word*) psp2#0 ← (word*)(number) $f8 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (signed byte*) xr ← (signed byte*)(number) $f0 +Inlining cast (signed byte*) yr ← (signed byte*)(number) $f1 +Inlining cast (signed byte*) zr ← (signed byte*)(number) $f2 +Inlining cast (signed byte*) pp ← (signed byte*)(number) $f3 +Inlining cast (signed byte*) xp ← (signed byte*)(number) $f4 +Inlining cast (signed byte*) yp ← (signed byte*)(number) $f5 +Inlining cast (word*) psp1 ← (word*)(number) $f6 +Inlining cast (word*) psp2 ← (word*)(number) $f8 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word~) main::$1 ← (word)(byte[$200]) mulf_sqr1 Inlining cast (word~) main::$2 ← (word)(byte[$200]) mulf_sqr2 Inlining cast (signed byte) sx#2 ← (snumber)(number) 0 Inlining cast (signed byte) sy#2 ← (snumber)(number) 0 -Inlining cast (signed byte) sz#0 ← (snumber)(number) 0 -Inlining cast (byte~) anim::$9 ← (byte)*((signed byte*) xp#0) -Inlining cast (byte~) anim::$11 ← (byte)*((signed byte*) yp#0) +Inlining cast (signed byte) sz ← (snumber)(number) 0 +Inlining cast (byte~) anim::$9 ← (byte)*((signed byte*) xp) +Inlining cast (byte~) anim::$11 ← (byte)*((signed byte*) yp) Inlining cast (byte) debug_print_init::c#0 ← (unumber)(number) 4 -Inlining cast (byte*) debug_print_init::COLS#0 ← (byte*)(number) $d800 +Inlining cast (byte*) debug_print_init::COLS ← (byte*)(number) $d800 Inlining cast (byte) debug_print::print_sbyte_pos1_row#0 ← (unumber)(number) 0 Inlining cast (byte) debug_print::print_sbyte_pos1_col#0 ← (unumber)(number) $25 Inlining cast (byte) debug_print::print_sbyte_pos2_row#0 ← (unumber)(number) 1 @@ -2411,10 +2398,10 @@ Inlining cast (byte) debug_print::print_sbyte_pos11_col#0 ← (unumber)(number) Inlining cast (byte) debug_print::print_sbyte_pos12_row#0 ← (unumber)(number) 6 Inlining cast (byte) debug_print::print_sbyte_pos12_col#0 ← (unumber)(number) $25 Inlining cast (byte) debug_print::c#0 ← (unumber)(number) 4 -Inlining cast (byte*) sprites_init::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) sprites_init::SCREEN ← (byte*)(number) $400 Inlining cast *((byte*) SPRITES_ENABLE) ← (unumber)(number) $ff Inlining cast (byte~) sprites_init::$2 ← (byte)(byte*~) sprites_init::$1 -Inlining cast (byte*) SPRITE#0 ← (byte*)(number) $3000 +Inlining cast (byte*) SPRITE ← (byte*)(number) $3000 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53248 Simplifying constant pointer cast (byte*) 53249 @@ -2914,15 +2901,15 @@ Constant (const byte) print_char_at::ch#1 = ' ' Constant (const byte[]) print_hextab = $6 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const signed byte*) xr#0 = (signed byte*) 240 -Constant (const signed byte*) yr#0 = (signed byte*) 241 -Constant (const signed byte*) zr#0 = (signed byte*) 242 -Constant (const signed byte*) pp#0 = (signed byte*) 243 -Constant (const signed byte*) xp#0 = (signed byte*) 244 -Constant (const signed byte*) yp#0 = (signed byte*) 245 -Constant (const word*) psp1#0 = (word*) 246 -Constant (const word*) psp2#0 = (word*) 248 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const signed byte*) xr = (signed byte*) 240 +Constant (const signed byte*) yr = (signed byte*) 241 +Constant (const signed byte*) zr = (signed byte*) 242 +Constant (const signed byte*) pp = (signed byte*) 243 +Constant (const signed byte*) xp = (signed byte*) 244 +Constant (const signed byte*) yp = (signed byte*) 245 +Constant (const word*) psp1 = (word*) 246 +Constant (const word*) psp2 = (word*) 248 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const signed byte[8]) xs = { -$34, -$34, -$34, 0, 0, $34, $34, $34 } Constant (const signed byte[8]) ys = { -$34, 0, $34, -$34, $34, -$34, 0, $34 } Constant (const signed byte[8]) zs = { $34, $34, $34, $34, $34, $34, $34, $34 } @@ -2934,7 +2921,7 @@ Constant (const signed byte[8]) xps = { fill( 8, 0) } Constant (const signed byte[8]) yps = { fill( 8, 0) } Constant (const signed byte) sx#17 = 0 Constant (const signed byte) sy#18 = 0 -Constant (const signed byte) sz#0 = 0 +Constant (const signed byte) sz = 0 Constant (const byte) anim::i#0 = 0 Constant (const byte*) print_str_at::str#1 = debug_print_init::str Constant (const byte*) print_str_at::str#2 = debug_print_init::str1 @@ -2949,7 +2936,7 @@ Constant (const byte*) print_str_at::str#10 = debug_print_init::str9 Constant (const byte*) print_str_at::str#11 = debug_print_init::str10 Constant (const byte*) print_str_at::str#12 = debug_print_init::str11 Constant (const byte) debug_print_init::c#0 = 4 -Constant (const byte*) debug_print_init::COLS#0 = (byte*) 55296 +Constant (const byte*) debug_print_init::COLS = (byte*) 55296 Constant (const byte) debug_print_init::i#0 = 0 Constant (const byte) debug_print_init::j#0 = 0 Constant (const byte) debug_print::print_sbyte_pos1_row#0 = 0 @@ -2978,7 +2965,7 @@ Constant (const byte) debug_print::print_sbyte_pos12_row#0 = 6 Constant (const byte) debug_print::print_sbyte_pos12_col#0 = $25 Constant (const byte) debug_print::c#0 = 4 Constant (const byte) debug_print::i#0 = 0 -Constant (const byte*) sprites_init::SCREEN#0 = (byte*) 1024 +Constant (const byte*) sprites_init::SCREEN = (byte*) 1024 Constant (const byte) sprites_init::i#0 = 0 Constant (const signed byte[9]) rotation_matrix = { fill( 9, 0) } Constant (const byte[$200]) mulf_sqr1 = kickasm {{ .for(var i=0;i<$200;i++) { @@ -2993,7 +2980,7 @@ Constant (const byte[$200]) mulf_sqr2 = kickasm {{ .for(var i=0;i<$200;i++) { .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }} -Constant (const byte*) SPRITE#0 = (byte*) 12288 +Constant (const byte*) SPRITE = (byte*) 12288 Constant (const signed byte[$100]) PERSP_Z = kickasm {{ { .var d = 256.0 .var z0 = 6.0 @@ -3028,8 +3015,8 @@ Constant (const signed byte[$140]) SINQ = kickasm {{ { } }} Successful SSA optimization Pass2ConstantIdentification -Constant (const signed byte) calculate_matrix::sz#0 = sz#0 -Constant (const signed byte) debug_print::print_sbyte_pos3_sb#0 = sz#0 +Constant (const signed byte) calculate_matrix::sz#0 = sz +Constant (const signed byte) debug_print::print_sbyte_pos3_sb#0 = sz Successful SSA optimization Pass2ConstantIdentification Constant (const signed byte) print_sbyte_at::b#6 = debug_print::print_sbyte_pos3_sb#0 Successful SSA optimization Pass2ConstantIdentification @@ -3060,12 +3047,12 @@ Converting *(pointer+n) to pointer[n] [293] *((byte*~) debug_print_init::$60) Converting *(pointer+n) to pointer[n] [297] *((byte*~) debug_print_init::$63) ← (byte) debug_print_init::col#0 -- *(debug_print_init::$62 + debug_print_init::j#2) Converting *(pointer+n) to pointer[n] [301] *((byte*~) debug_print_init::$66) ← (byte) debug_print_init::col#0 -- *(debug_print_init::$65 + debug_print_init::j#2) Successful SSA optimization Pass2InlineDerefIdx -Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [185] (byte*~) debug_print_init::$1 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 0 +Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [185] (byte*~) debug_print_init::$1 ← (const byte*) SCREEN + (byte)(number) $28*(number) 0 Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [244] (byte*~) debug_print_init::$30 ← (byte*) debug_print_init::at_line#0 + (byte)(number) $28*(number) 0 Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [266] (byte*~) debug_print_init::$40 ← (byte*) debug_print_init::at_cols#0 + (byte)(number) $28*(number) 0 Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [459] (byte*~) debug_print::$13 ← (byte*) debug_print::at_line#0 + (byte)(number) $28*(number) 0 Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [185] (byte*~) debug_print_init::$1 ← (const byte*) SCREEN#0 + (byte) 0 +Simplifying expression containing zero SCREEN in [185] (byte*~) debug_print_init::$1 ← (const byte*) SCREEN + (byte) 0 Simplifying expression containing zero debug_print_init::at_line#0 in [244] (byte*~) debug_print_init::$30 ← (byte*) debug_print_init::at_line#0 + (byte) 0 Simplifying expression containing zero debug_print_init::at_cols#0 in [266] (byte*~) debug_print_init::$40 ← (byte*) debug_print_init::at_cols#0 + (byte) 0 Simplifying expression containing zero rotation_matrix in [348] (signed byte) debug_print::print_sbyte_pos4_sb#0 ← *((const signed byte[9]) rotation_matrix + (byte) 0) @@ -3112,19 +3099,19 @@ Alias (byte*) debug_print_init::at_line#0 = (byte*~) debug_print_init::$30 Alias (byte*) debug_print_init::at_cols#0 = (byte*~) debug_print_init::$40 Alias (byte*) debug_print::at_line#0 = (byte*~) debug_print::$13 Successful SSA optimization Pass2AliasElimination -Constant right-side identified [90] (byte*~) debug_print_init::$4 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 1 -Constant right-side identified [93] (byte*~) debug_print_init::$7 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 2 -Constant right-side identified [96] (byte*) print_str_at::at#4 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $10 -Constant right-side identified [98] (byte*) print_str_at::at#5 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $11 -Constant right-side identified [100] (byte*) print_str_at::at#6 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $12 -Constant right-side identified [102] (byte*) print_str_at::at#7 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $13 -Constant right-side identified [104] (byte*) print_str_at::at#8 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $14 -Constant right-side identified [106] (byte*) print_str_at::at#9 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $15 -Constant right-side identified [108] (byte*) print_str_at::at#10 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $16 -Constant right-side identified [110] (byte*) print_str_at::at#11 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $17 -Constant right-side identified [112] (byte*) print_str_at::at#12 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) $18 -Constant right-side identified [114] (byte*) debug_print_init::at_line#0 ← (const byte*) SCREEN#0 + (word)(number) $10*(number) $28 -Constant right-side identified [115] (byte*) debug_print_init::at_cols#0 ← (const byte*) debug_print_init::COLS#0 + (word)(number) $10*(number) $28 +Constant right-side identified [90] (byte*~) debug_print_init::$4 ← (const byte*) SCREEN + (byte)(number) $28*(number) 1 +Constant right-side identified [93] (byte*~) debug_print_init::$7 ← (const byte*) SCREEN + (byte)(number) $28*(number) 2 +Constant right-side identified [96] (byte*) print_str_at::at#4 ← (const byte*) SCREEN + (word)(number) $28*(number) $10 +Constant right-side identified [98] (byte*) print_str_at::at#5 ← (const byte*) SCREEN + (word)(number) $28*(number) $11 +Constant right-side identified [100] (byte*) print_str_at::at#6 ← (const byte*) SCREEN + (word)(number) $28*(number) $12 +Constant right-side identified [102] (byte*) print_str_at::at#7 ← (const byte*) SCREEN + (word)(number) $28*(number) $13 +Constant right-side identified [104] (byte*) print_str_at::at#8 ← (const byte*) SCREEN + (word)(number) $28*(number) $14 +Constant right-side identified [106] (byte*) print_str_at::at#9 ← (const byte*) SCREEN + (word)(number) $28*(number) $15 +Constant right-side identified [108] (byte*) print_str_at::at#10 ← (const byte*) SCREEN + (word)(number) $28*(number) $16 +Constant right-side identified [110] (byte*) print_str_at::at#11 ← (const byte*) SCREEN + (word)(number) $28*(number) $17 +Constant right-side identified [112] (byte*) print_str_at::at#12 ← (const byte*) SCREEN + (word)(number) $28*(number) $18 +Constant right-side identified [114] (byte*) debug_print_init::at_line#0 ← (const byte*) SCREEN + (word)(number) $10*(number) $28 +Constant right-side identified [115] (byte*) debug_print_init::at_cols#0 ← (const byte*) debug_print_init::COLS + (word)(number) $10*(number) $28 Constant right-side identified [165] (byte~) debug_print::print_sbyte_pos1_$0 ← (const byte) debug_print::print_sbyte_pos1_row#0 * (byte) $28 Constant right-side identified [171] (byte~) debug_print::print_sbyte_pos2_$0 ← (const byte) debug_print::print_sbyte_pos2_row#0 * (byte) $28 Constant right-side identified [176] (byte~) debug_print::print_sbyte_pos3_$0 ← (const byte) debug_print::print_sbyte_pos3_row#0 * (byte) $28 @@ -3137,29 +3124,29 @@ Constant right-side identified [211] (byte~) debug_print::print_sbyte_pos9_$0 Constant right-side identified [217] (byte~) debug_print::print_sbyte_pos10_$0 ← (const byte) debug_print::print_sbyte_pos10_row#0 * (byte) $28 Constant right-side identified [223] (byte~) debug_print::print_sbyte_pos11_$0 ← (const byte) debug_print::print_sbyte_pos11_row#0 * (byte) $28 Constant right-side identified [229] (byte~) debug_print::print_sbyte_pos12_$0 ← (const byte) debug_print::print_sbyte_pos12_row#0 * (byte) $28 -Constant right-side identified [234] (byte*) debug_print::at_line#0 ← (const byte*) SCREEN#0 + (word)(number) $13*(number) $28 -Constant right-side identified [265] (byte*) sprites_init::sprites_ptr#0 ← (const byte*) sprites_init::SCREEN#0 + (word) $3f8 -Constant right-side identified [267] (byte*~) sprites_init::$1 ← (const byte*) SPRITE#0 / (byte) $40 +Constant right-side identified [234] (byte*) debug_print::at_line#0 ← (const byte*) SCREEN + (word)(number) $13*(number) $28 +Constant right-side identified [265] (byte*) sprites_init::sprites_ptr#0 ← (const byte*) sprites_init::SCREEN + (word) $3f8 +Constant right-side identified [267] (byte*~) sprites_init::$1 ← (const byte*) SPRITE / (byte) $40 Constant right-side identified [327] (signed byte*) COSH#0 ← (const signed byte[$140]) SINH + (byte) $40 Constant right-side identified [328] (signed byte*) COSQ#0 ← (const signed byte[$140]) SINQ + (byte) $40 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const void*) memset::str#0 = (void*)print_screen#0 Constant (const word) main::$1 = (word)mulf_sqr1 Constant (const word) main::$2 = (word)mulf_sqr2 -Constant (const byte*) debug_print_init::$1 = SCREEN#0 -Constant (const byte*) debug_print_init::$4 = SCREEN#0+(byte)$28*1 -Constant (const byte*) debug_print_init::$7 = SCREEN#0+(byte)$28*2 -Constant (const byte*) print_str_at::at#4 = SCREEN#0+(word)$28*$10 -Constant (const byte*) print_str_at::at#5 = SCREEN#0+(word)$28*$11 -Constant (const byte*) print_str_at::at#6 = SCREEN#0+(word)$28*$12 -Constant (const byte*) print_str_at::at#7 = SCREEN#0+(word)$28*$13 -Constant (const byte*) print_str_at::at#8 = SCREEN#0+(word)$28*$14 -Constant (const byte*) print_str_at::at#9 = SCREEN#0+(word)$28*$15 -Constant (const byte*) print_str_at::at#10 = SCREEN#0+(word)$28*$16 -Constant (const byte*) print_str_at::at#11 = SCREEN#0+(word)$28*$17 -Constant (const byte*) print_str_at::at#12 = SCREEN#0+(word)$28*$18 -Constant (const byte*) debug_print_init::at_line#0 = SCREEN#0+(word)$10*$28 -Constant (const byte*) debug_print_init::at_cols#0 = debug_print_init::COLS#0+(word)$10*$28 +Constant (const byte*) debug_print_init::$1 = SCREEN +Constant (const byte*) debug_print_init::$4 = SCREEN+(byte)$28*1 +Constant (const byte*) debug_print_init::$7 = SCREEN+(byte)$28*2 +Constant (const byte*) print_str_at::at#4 = SCREEN+(word)$28*$10 +Constant (const byte*) print_str_at::at#5 = SCREEN+(word)$28*$11 +Constant (const byte*) print_str_at::at#6 = SCREEN+(word)$28*$12 +Constant (const byte*) print_str_at::at#7 = SCREEN+(word)$28*$13 +Constant (const byte*) print_str_at::at#8 = SCREEN+(word)$28*$14 +Constant (const byte*) print_str_at::at#9 = SCREEN+(word)$28*$15 +Constant (const byte*) print_str_at::at#10 = SCREEN+(word)$28*$16 +Constant (const byte*) print_str_at::at#11 = SCREEN+(word)$28*$17 +Constant (const byte*) print_str_at::at#12 = SCREEN+(word)$28*$18 +Constant (const byte*) debug_print_init::at_line#0 = SCREEN+(word)$10*$28 +Constant (const byte*) debug_print_init::at_cols#0 = debug_print_init::COLS+(word)$10*$28 Constant (const byte) debug_print::print_sbyte_pos1_$0 = debug_print::print_sbyte_pos1_row#0*$28 Constant (const byte) debug_print::print_sbyte_pos2_$0 = debug_print::print_sbyte_pos2_row#0*$28 Constant (const byte) debug_print::print_sbyte_pos3_$0 = debug_print::print_sbyte_pos3_row#0*$28 @@ -3172,9 +3159,9 @@ Constant (const byte) debug_print::print_sbyte_pos9_$0 = debug_print::print_sbyt Constant (const byte) debug_print::print_sbyte_pos10_$0 = debug_print::print_sbyte_pos10_row#0*$28 Constant (const byte) debug_print::print_sbyte_pos11_$0 = debug_print::print_sbyte_pos11_row#0*$28 Constant (const byte) debug_print::print_sbyte_pos12_$0 = debug_print::print_sbyte_pos12_row#0*$28 -Constant (const byte*) debug_print::at_line#0 = SCREEN#0+(word)$13*$28 -Constant (const byte*) sprites_init::sprites_ptr#0 = sprites_init::SCREEN#0+$3f8 -Constant (const byte*) sprites_init::$1 = SPRITE#0/$40 +Constant (const byte*) debug_print::at_line#0 = SCREEN+(word)$13*$28 +Constant (const byte*) sprites_init::sprites_ptr#0 = sprites_init::SCREEN+$3f8 +Constant (const byte*) sprites_init::$1 = SPRITE/$40 Constant (const signed byte*) COSH#0 = SINH+$40 Constant (const signed byte*) COSQ#0 = SINQ+$40 Successful SSA optimization Pass2ConstantIdentification @@ -3281,8 +3268,8 @@ Constant (const byte*) print_sbyte_at::at#12 = debug_print::print_sbyte_pos10_$1 Constant (const byte*) print_sbyte_at::at#13 = debug_print::print_sbyte_pos11_$1+debug_print::print_sbyte_pos11_col#0 Constant (const byte*) print_sbyte_at::at#14 = debug_print::print_sbyte_pos12_$1+debug_print::print_sbyte_pos12_col#0 Successful SSA optimization Pass2ConstantIdentification -Inlining Noop Cast [67] (byte~) anim::$9 ← (byte)*((const signed byte*) xp#0) keeping *(xp#0) -Inlining Noop Cast [70] (byte~) anim::$11 ← (byte)*((const signed byte*) yp#0) keeping *(yp#0) +Inlining Noop Cast [67] (byte~) anim::$9 ← (byte)*((const signed byte*) xp) keeping *(xp) +Inlining Noop Cast [70] (byte~) anim::$11 ← (byte)*((const signed byte*) yp) keeping *(yp) Successful SSA optimization Pass2NopCastInlining Rewriting multiplication to use shift [66] (byte) anim::i2#0 ← (byte) anim::i#2 * (byte) 2 Successful SSA optimization Pass2MultiplyToShiftRewriting @@ -3355,10 +3342,10 @@ Constant inlined print_str_at::str#1 = (const string) debug_print_init::str Constant inlined print_str_at::str#2 = (const string) debug_print_init::str1 Constant inlined print_str_at::str#3 = (const string) debug_print_init::str2 Constant inlined print_str_at::str#4 = (const string) debug_print_init::str3 -Constant inlined debug_print::print_sbyte_pos3_sb#0 = (const signed byte) sz#0 -Constant inlined print_str_at::at#11 = (const byte*) SCREEN#0+(word)(number) $28*(number) $17 -Constant inlined print_str_at::at#10 = (const byte*) SCREEN#0+(word)(number) $28*(number) $16 -Constant inlined print_str_at::at#12 = (const byte*) SCREEN#0+(word)(number) $28*(number) $18 +Constant inlined debug_print::print_sbyte_pos3_sb#0 = (const signed byte) sz +Constant inlined print_str_at::at#11 = (const byte*) SCREEN+(word)(number) $28*(number) $17 +Constant inlined print_str_at::at#10 = (const byte*) SCREEN+(word)(number) $28*(number) $16 +Constant inlined print_str_at::at#12 = (const byte*) SCREEN+(word)(number) $28*(number) $18 Constant inlined debug_print::print_sbyte_pos3_$1 = (const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos3_row#0*(byte) $28 Constant inlined debug_print_init::$58 = (const byte*) debug_print_init::at_cols#0+(byte)(number) $28*(number) 6 Constant inlined debug_print::print_sbyte_pos3_$0 = (const byte) debug_print::print_sbyte_pos3_row#0*(byte) $28 @@ -3394,28 +3381,28 @@ Constant inlined debug_print::print_sbyte_pos8_$0 = (const byte) debug_print::pr Constant inlined debug_print_init::$46 = (const byte*) debug_print_init::at_cols#0+(byte)(number) $28*(number) 2 Constant inlined debug_print_init::i#0 = (byte) 0 Constant inlined debug_print_init::$43 = (const byte*) debug_print_init::at_cols#0+(byte)(number) $28*(number) 1 -Constant inlined print_str_at::at#4 = (const byte*) SCREEN#0+(word)(number) $28*(number) $10 -Constant inlined print_str_at::at#3 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 -Constant inlined print_str_at::at#2 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 -Constant inlined print_str_at::at#1 = (const byte*) SCREEN#0+(byte) $22 -Constant inlined debug_print_init::$7 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2 -Constant inlined print_str_at::at#9 = (const byte*) SCREEN#0+(word)(number) $28*(number) $15 -Constant inlined print_str_at::at#8 = (const byte*) SCREEN#0+(word)(number) $28*(number) $14 -Constant inlined print_str_at::at#7 = (const byte*) SCREEN#0+(word)(number) $28*(number) $13 -Constant inlined print_str_at::at#6 = (const byte*) SCREEN#0+(word)(number) $28*(number) $12 +Constant inlined print_str_at::at#4 = (const byte*) SCREEN+(word)(number) $28*(number) $10 +Constant inlined print_str_at::at#3 = (const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 +Constant inlined print_str_at::at#2 = (const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 +Constant inlined print_str_at::at#1 = (const byte*) SCREEN+(byte) $22 +Constant inlined debug_print_init::$7 = (const byte*) SCREEN+(byte)(number) $28*(number) 2 +Constant inlined print_str_at::at#9 = (const byte*) SCREEN+(word)(number) $28*(number) $15 +Constant inlined print_str_at::at#8 = (const byte*) SCREEN+(word)(number) $28*(number) $14 +Constant inlined print_str_at::at#7 = (const byte*) SCREEN+(word)(number) $28*(number) $13 +Constant inlined print_str_at::at#6 = (const byte*) SCREEN+(word)(number) $28*(number) $12 Constant inlined anim::i#0 = (byte) 0 -Constant inlined print_str_at::at#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $11 +Constant inlined print_str_at::at#5 = (const byte*) SCREEN+(word)(number) $28*(number) $11 Constant inlined sx#17 = (signed byte) 0 Constant inlined debug_print::print_sbyte_pos5_$1 = (const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos5_row#0*(byte) $28 Constant inlined $6 = (const byte[]) print_hextab Constant inlined debug_print::print_sbyte_pos5_$0 = (const byte) debug_print::print_sbyte_pos5_row#0*(byte) $28 -Constant inlined print_sbyte_at::b#6 = (const signed byte) sz#0 -Constant inlined debug_print_init::$1 = (const byte*) SCREEN#0 -Constant inlined debug_print_init::$4 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1 +Constant inlined print_sbyte_at::b#6 = (const signed byte) sz +Constant inlined debug_print_init::$1 = (const byte*) SCREEN +Constant inlined debug_print_init::$4 = (const byte*) SCREEN+(byte)(number) $28*(number) 1 Constant inlined debug_print::print_sbyte_pos2_$0 = (const byte) debug_print::print_sbyte_pos2_row#0*(byte) $28 Constant inlined debug_print::print_sbyte_pos2_$1 = (const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos2_row#0*(byte) $28 -Constant inlined sprites_init::$1 = (const byte*) SPRITE#0/(byte) $40 -Constant inlined sprites_init::$2 = (byte)(const byte*) SPRITE#0/(byte) $40 +Constant inlined sprites_init::$1 = (const byte*) SPRITE/(byte) $40 +Constant inlined sprites_init::$2 = (byte)(const byte*) SPRITE/(byte) $40 Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 Constant inlined debug_print_init::$64 = (const byte*) debug_print_init::at_cols#0+(word)(number) $28*(number) 8 Constant inlined debug_print_init::$61 = (const byte*) debug_print_init::at_cols#0+(word)(number) $28*(number) 7 @@ -3673,7 +3660,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -3689,8 +3676,8 @@ main: scope:[main] from @1 [5] call sprites_init to:main::@1 main::@1: scope:[main] from main - [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 - [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 + [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 + [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [8] call debug_print_init to:main::@2 main::@2: scope:[main] from main::@1 @@ -3737,16 +3724,16 @@ anim::@6: scope:[anim] from anim::@8 anim::@9 [28] call rotate_matrix to:anim::@9 anim::@9: scope:[anim] from anim::@6 - [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) - [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) - [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) - [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) - [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) - [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) + [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) + [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) + [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) + [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) + [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) + [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 - [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) + [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) [37] *((const byte*) SPRITES_XPOS + (byte) anim::i2#0) ← (byte~) anim::$10 - [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) + [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) [39] *((const byte*) SPRITES_YPOS + (byte) anim::i2#0) ← (byte~) anim::$12 [40] (byte) anim::i#1 ← ++ (byte) anim::i#2 [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 @@ -3887,7 +3874,7 @@ debug_print::@return: scope:[debug_print] from debug_print::@17 (void()) print_sbyte_at((signed byte) print_sbyte_at::b , (byte*) print_sbyte_at::at) print_sbyte_at: scope:[print_sbyte_at] from debug_print::@1 debug_print::@12 debug_print::@13 debug_print::@14 debug_print::@15 debug_print::@16 debug_print::print_sbyte_pos1 debug_print::print_sbyte_pos10 debug_print::print_sbyte_pos11 debug_print::print_sbyte_pos12 debug_print::print_sbyte_pos2 debug_print::print_sbyte_pos3 debug_print::print_sbyte_pos4 debug_print::print_sbyte_pos5 debug_print::print_sbyte_pos6 debug_print::print_sbyte_pos7 debug_print::print_sbyte_pos8 debug_print::print_sbyte_pos9 debug_print_init::@1 debug_print_init::@16 debug_print_init::@17 [105] (byte*) print_sbyte_at::at#21 ← phi( debug_print::@1/(byte*) print_sbyte_at::at#15 debug_print::@12/(byte*) print_sbyte_at::at#16 debug_print::@13/(byte*) print_sbyte_at::at#17 debug_print::@14/(byte*) print_sbyte_at::at#18 debug_print::@15/(byte*) print_sbyte_at::at#19 debug_print::@16/(byte*) print_sbyte_at::at#20 debug_print::print_sbyte_pos1/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos1_col#0 debug_print::print_sbyte_pos10/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos10_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos10_col#0 debug_print::print_sbyte_pos11/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos11_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos11_col#0 debug_print::print_sbyte_pos12/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos12_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos12_col#0 debug_print::print_sbyte_pos2/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos2_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos2_col#0 debug_print::print_sbyte_pos3/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos3_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos3_col#0 debug_print::print_sbyte_pos4/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos4_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos4_col#0 debug_print::print_sbyte_pos5/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos5_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos5_col#0 debug_print::print_sbyte_pos6/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos6_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos6_col#0 debug_print::print_sbyte_pos7/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos7_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos7_col#0 debug_print::print_sbyte_pos8/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos8_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos8_col#0 debug_print::print_sbyte_pos9/(const byte*) print_screen#0+(const byte) debug_print::print_sbyte_pos9_row#0*(byte) $28+(const byte) debug_print::print_sbyte_pos9_col#0 debug_print_init::@1/(byte*) print_sbyte_at::at#0 debug_print_init::@16/(byte*) print_sbyte_at::at#1 debug_print_init::@17/(byte*) print_sbyte_at::at#2 ) - [105] (signed byte) print_sbyte_at::b#22 ← phi( debug_print::@1/(signed byte) print_sbyte_at::b#16 debug_print::@12/(signed byte) print_sbyte_at::b#17 debug_print::@13/(signed byte) print_sbyte_at::b#18 debug_print::@14/(signed byte) print_sbyte_at::b#19 debug_print::@15/(signed byte) print_sbyte_at::b#20 debug_print::@16/(signed byte) print_sbyte_at::b#21 debug_print::print_sbyte_pos1/(signed byte) print_sbyte_at::b#4 debug_print::print_sbyte_pos10/(signed byte) print_sbyte_at::b#13 debug_print::print_sbyte_pos11/(signed byte) print_sbyte_at::b#14 debug_print::print_sbyte_pos12/(signed byte) print_sbyte_at::b#15 debug_print::print_sbyte_pos2/(signed byte) print_sbyte_at::b#5 debug_print::print_sbyte_pos3/(const signed byte) sz#0 debug_print::print_sbyte_pos4/(signed byte) print_sbyte_at::b#7 debug_print::print_sbyte_pos5/(signed byte) print_sbyte_at::b#8 debug_print::print_sbyte_pos6/(signed byte) print_sbyte_at::b#9 debug_print::print_sbyte_pos7/(signed byte) print_sbyte_at::b#10 debug_print::print_sbyte_pos8/(signed byte) print_sbyte_at::b#11 debug_print::print_sbyte_pos9/(signed byte) print_sbyte_at::b#12 debug_print_init::@1/(signed byte) print_sbyte_at::b#1 debug_print_init::@16/(signed byte) print_sbyte_at::b#2 debug_print_init::@17/(signed byte) print_sbyte_at::b#3 ) + [105] (signed byte) print_sbyte_at::b#22 ← phi( debug_print::@1/(signed byte) print_sbyte_at::b#16 debug_print::@12/(signed byte) print_sbyte_at::b#17 debug_print::@13/(signed byte) print_sbyte_at::b#18 debug_print::@14/(signed byte) print_sbyte_at::b#19 debug_print::@15/(signed byte) print_sbyte_at::b#20 debug_print::@16/(signed byte) print_sbyte_at::b#21 debug_print::print_sbyte_pos1/(signed byte) print_sbyte_at::b#4 debug_print::print_sbyte_pos10/(signed byte) print_sbyte_at::b#13 debug_print::print_sbyte_pos11/(signed byte) print_sbyte_at::b#14 debug_print::print_sbyte_pos12/(signed byte) print_sbyte_at::b#15 debug_print::print_sbyte_pos2/(signed byte) print_sbyte_at::b#5 debug_print::print_sbyte_pos3/(const signed byte) sz debug_print::print_sbyte_pos4/(signed byte) print_sbyte_at::b#7 debug_print::print_sbyte_pos5/(signed byte) print_sbyte_at::b#8 debug_print::print_sbyte_pos6/(signed byte) print_sbyte_at::b#9 debug_print::print_sbyte_pos7/(signed byte) print_sbyte_at::b#10 debug_print::print_sbyte_pos8/(signed byte) print_sbyte_at::b#11 debug_print::print_sbyte_pos9/(signed byte) print_sbyte_at::b#12 debug_print_init::@1/(signed byte) print_sbyte_at::b#1 debug_print_init::@16/(signed byte) print_sbyte_at::b#2 debug_print_init::@17/(signed byte) print_sbyte_at::b#3 ) [106] if((signed byte) print_sbyte_at::b#22<(signed byte) 0) goto print_sbyte_at::@1 to:print_sbyte_at::@3 print_sbyte_at::@3: scope:[print_sbyte_at] from print_sbyte_at @@ -3940,9 +3927,9 @@ print_byte_at::@return: scope:[print_byte_at] from print_byte_at::@1 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) rotate_matrix: scope:[rotate_matrix] from anim::@6 - [129] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 - [130] *((const signed byte*) yr#0) ← (signed byte) rotate_matrix::y#0 - [131] *((const signed byte*) zr#0) ← (signed byte) rotate_matrix::z#0 + [129] *((const signed byte*) xr) ← (signed byte) rotate_matrix::x#0 + [130] *((const signed byte*) yr) ← (signed byte) rotate_matrix::y#0 + [131] *((const signed byte*) zr) ← (signed byte) rotate_matrix::z#0 asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } to:rotate_matrix::@return rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix @@ -4113,7 +4100,7 @@ debug_print_init::@return: scope:[debug_print_init] from debug_print_init::@3 (void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at) print_str_at: scope:[print_str_at] from debug_print_init::@10 debug_print_init::@11 debug_print_init::@12 debug_print_init::@13 debug_print_init::@14 debug_print_init::@15 debug_print_init::@4 debug_print_init::@5 debug_print_init::@6 debug_print_init::@7 debug_print_init::@8 debug_print_init::@9 - [243] (byte*) print_str_at::at#15 ← phi( debug_print_init::@9/(const byte*) SCREEN#0+(word)(number) $28*(number) $12 debug_print_init::@10/(const byte*) SCREEN#0+(word)(number) $28*(number) $13 debug_print_init::@11/(const byte*) SCREEN#0+(word)(number) $28*(number) $14 debug_print_init::@12/(const byte*) SCREEN#0+(word)(number) $28*(number) $15 debug_print_init::@13/(const byte*) SCREEN#0+(word)(number) $28*(number) $16 debug_print_init::@14/(const byte*) SCREEN#0+(word)(number) $28*(number) $17 debug_print_init::@15/(const byte*) SCREEN#0+(word)(number) $28*(number) $18 debug_print_init::@4/(const byte*) SCREEN#0+(byte) $22 debug_print_init::@5/(const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 debug_print_init::@6/(const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 debug_print_init::@7/(const byte*) SCREEN#0+(word)(number) $28*(number) $10 debug_print_init::@8/(const byte*) SCREEN#0+(word)(number) $28*(number) $11 ) + [243] (byte*) print_str_at::at#15 ← phi( debug_print_init::@9/(const byte*) SCREEN+(word)(number) $28*(number) $12 debug_print_init::@10/(const byte*) SCREEN+(word)(number) $28*(number) $13 debug_print_init::@11/(const byte*) SCREEN+(word)(number) $28*(number) $14 debug_print_init::@12/(const byte*) SCREEN+(word)(number) $28*(number) $15 debug_print_init::@13/(const byte*) SCREEN+(word)(number) $28*(number) $16 debug_print_init::@14/(const byte*) SCREEN+(word)(number) $28*(number) $17 debug_print_init::@15/(const byte*) SCREEN+(word)(number) $28*(number) $18 debug_print_init::@4/(const byte*) SCREEN+(byte) $22 debug_print_init::@5/(const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 debug_print_init::@6/(const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 debug_print_init::@7/(const byte*) SCREEN+(word)(number) $28*(number) $10 debug_print_init::@8/(const byte*) SCREEN+(word)(number) $28*(number) $11 ) [243] (byte*) print_str_at::str#15 ← phi( debug_print_init::@9/(const string) debug_print_init::str5 debug_print_init::@10/(const string) debug_print_init::str6 debug_print_init::@11/(const string) debug_print_init::str7 debug_print_init::@12/(const string) debug_print_init::str8 debug_print_init::@13/(const string) debug_print_init::str9 debug_print_init::@14/(const string) debug_print_init::str10 debug_print_init::@15/(const string) debug_print_init::str11 debug_print_init::@4/(const string) debug_print_init::str debug_print_init::@5/(const string) debug_print_init::str1 debug_print_init::@6/(const string) debug_print_init::str2 debug_print_init::@7/(const string) debug_print_init::str3 debug_print_init::@8/(const string) debug_print_init::str4 ) to:print_str_at::@1 print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2 @@ -4161,7 +4148,7 @@ sprites_init: scope:[sprites_init] from main to:sprites_init::@1 sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1 [260] (byte) sprites_init::i#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::i#1 ) - [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN [263] (byte) sprites_init::i#1 ← ++ (byte) sprites_init::i#2 [264] if((byte) sprites_init::i#1!=(byte) 8) goto sprites_init::@1 @@ -4180,8 +4167,6 @@ null depth in calling loop Loop head: debug_print::@1 tails: debug_print::@17 bl VARIABLE REGISTER WEIGHTS (signed byte*) COSH (signed byte*) COSQ -(byte*) SCREEN -(byte*) SPRITE (void()) anim() (byte~) anim::$10 202.0 (byte~) anim::$12 202.0 @@ -4306,7 +4291,6 @@ VARIABLE REGISTER WEIGHTS (byte*~) debug_print_init::$59 202.0 (byte*~) debug_print_init::$62 202.0 (byte*~) debug_print_init::$65 202.0 -(byte*) debug_print_init::COLS (byte*) debug_print_init::at_cols (byte*) debug_print_init::at_line (byte) debug_print_init::c @@ -4330,7 +4314,6 @@ VARIABLE REGISTER WEIGHTS (word) memset::num (void*) memset::return (void*) memset::str -(signed byte*) pp (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 4.0 (byte~) print_byte_at::$2 2.0 @@ -4396,8 +4379,6 @@ VARIABLE REGISTER WEIGHTS (byte*) print_str_at::str#0 22.0 (byte*) print_str_at::str#13 11.5 (byte*) print_str_at::str#15 2.0 -(word*) psp1 -(word*) psp2 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) (signed byte) rotate_matrix::x (signed byte) rotate_matrix::x#0 34.33333333333333 @@ -4406,7 +4387,6 @@ VARIABLE REGISTER WEIGHTS (signed byte) rotate_matrix::z (signed byte) rotate_matrix::z#0 34.33333333333333 (void()) sprites_init() -(byte*) sprites_init::SCREEN (byte) sprites_init::i (byte) sprites_init::i#1 16.5 (byte) sprites_init::i#2 14.666666666666666 @@ -4418,12 +4398,6 @@ VARIABLE REGISTER WEIGHTS (signed byte) sy (signed byte) sy#10 0.3846153846153846 (signed byte) sy#3 22.0 -(signed byte) sz -(signed byte*) xp -(signed byte*) xr -(signed byte*) yp -(signed byte*) yr -(signed byte*) zr Initial phi equivalence classes [ sx#10 sx#3 ] @@ -4726,7 +4700,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main jsr main // [3] phi from @1 to @end [phi:@1->@end] @@ -4743,13 +4717,13 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 //mulf_init(); lda #mulf_sqr1 sta psp1+1 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -4864,29 +4838,29 @@ anim: { jmp b9 // anim::@9 b9: - // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 //if(*xrxmax) xmax = *xr; lda xr ldy.z i sta xrs,y - // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yr ldy.z i sta yrs,y - // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda zr ldy.z i sta zrs,y - // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda pp ldy.z i sta pps,y - // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda xp ldy.z i sta xps,y - // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yp ldy.z i sta yps,y @@ -4894,7 +4868,7 @@ anim: { lda.z i asl sta.z i2 - // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) -- vbuz1=vbuc1_plus__deref_pbuc2 + // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) -- vbuz1=vbuc1_plus__deref_pbuc2 lda #$80 clc adc xp @@ -4903,7 +4877,7 @@ anim: { lda.z _10 ldy.z i2 sta SPRITES_XPOS,y - // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) -- vbuz1=vbuc1_plus__deref_pbuc2 + // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) -- vbuz1=vbuc1_plus__deref_pbuc2 lda #$80 clc adc yp @@ -5039,7 +5013,7 @@ debug_print: { sta.z print_sbyte_at.at lda #>print_screen+print_sbyte_pos3_row*$28+print_sbyte_pos3_col sta.z print_sbyte_at.at+1 - // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz#0 [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsz1=vbsc1 + // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsz1=vbsc1 lda #sz sta.z print_sbyte_at.b jsr print_sbyte_at @@ -5562,13 +5536,13 @@ rotate_matrix: { .label x = $19 .label y = $1a .label z = $1b - // [129] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsz1 + // [129] *((const signed byte*) xr) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsz1 lda.z x sta xr - // [130] *((const signed byte*) yr#0) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 + // [130] *((const signed byte*) yr) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 lda.z y sta yr - // [131] *((const signed byte*) zr#0) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 + // [131] *((const signed byte*) zr) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 lda.z z sta zr // asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } @@ -6018,7 +5992,7 @@ debug_print_init: { // [184] call print_str_at // [243] phi from debug_print_init::@4 to print_str_at [phi:debug_print_init::@4->print_str_at] print_str_at_from_b4: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$22 @@ -6037,7 +6011,7 @@ debug_print_init: { // [186] call print_str_at // [243] phi from debug_print_init::@5 to print_str_at [phi:debug_print_init::@5->print_str_at] print_str_at_from_b5: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*1+$22 @@ -6056,7 +6030,7 @@ debug_print_init: { // [188] call print_str_at // [243] phi from debug_print_init::@6 to print_str_at [phi:debug_print_init::@6->print_str_at] print_str_at_from_b6: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*2+$22 @@ -6075,7 +6049,7 @@ debug_print_init: { // [190] call print_str_at // [243] phi from debug_print_init::@7 to print_str_at [phi:debug_print_init::@7->print_str_at] print_str_at_from_b7: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$10 @@ -6094,7 +6068,7 @@ debug_print_init: { // [192] call print_str_at // [243] phi from debug_print_init::@8 to print_str_at [phi:debug_print_init::@8->print_str_at] print_str_at_from_b8: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$11 @@ -6113,7 +6087,7 @@ debug_print_init: { // [194] call print_str_at // [243] phi from debug_print_init::@9 to print_str_at [phi:debug_print_init::@9->print_str_at] print_str_at_from_b9: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$12 @@ -6132,7 +6106,7 @@ debug_print_init: { // [196] call print_str_at // [243] phi from debug_print_init::@10 to print_str_at [phi:debug_print_init::@10->print_str_at] print_str_at_from_b10: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$13 @@ -6151,7 +6125,7 @@ debug_print_init: { // [198] call print_str_at // [243] phi from debug_print_init::@11 to print_str_at [phi:debug_print_init::@11->print_str_at] print_str_at_from_b11: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$14 @@ -6170,7 +6144,7 @@ debug_print_init: { // [200] call print_str_at // [243] phi from debug_print_init::@12 to print_str_at [phi:debug_print_init::@12->print_str_at] print_str_at_from_b12: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$15 @@ -6189,7 +6163,7 @@ debug_print_init: { // [202] call print_str_at // [243] phi from debug_print_init::@13 to print_str_at [phi:debug_print_init::@13->print_str_at] print_str_at_from_b13: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$16 @@ -6208,7 +6182,7 @@ debug_print_init: { // [204] call print_str_at // [243] phi from debug_print_init::@14 to print_str_at [phi:debug_print_init::@14->print_str_at] print_str_at_from_b14: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$17 @@ -6227,7 +6201,7 @@ debug_print_init: { // [206] call print_str_at // [243] phi from debug_print_init::@15 to print_str_at [phi:debug_print_init::@15->print_str_at] print_str_at_from_b15: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$18 @@ -6610,7 +6584,7 @@ sprites_init: { jmp b1 // sprites_init::@1 b1: - // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #SPRITE/$40 ldy.z i sta sprites_ptr,y @@ -6718,24 +6692,24 @@ SINQ: REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [14] if(*((const byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ sx#10 sx#3 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ sy#10 sy#3 ] Statement [15] if(*((const byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [16] if(*((const byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a -Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] -Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a -Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a -Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a -Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a -Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a +Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ) always clobbers reg byte a -Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a +Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:28 [ anim::i2#0 ] -Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a +Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a Statement [42] *((const byte*) BORDERCOL) ← (const byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [44] *((const byte*) BORDERCOL) ← (const byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3 [ sx#3 sy#3 ] ( main:2::anim:10 [ sx#3 sy#3 ] ) always clobbers reg byte a @@ -6852,11 +6826,11 @@ Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#1 Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [259] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] ) always clobbers reg byte a -Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a +Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:22 [ sprites_init::i#2 sprites_init::i#1 ] Statement [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a -Statement [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [14] if(*((const byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [15] if(*((const byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [16] if(*((const byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a @@ -6865,15 +6839,15 @@ Statement [26] (signed byte) rotate_matrix::y#0 ← *((const signed byte[8]) ys Removing always clobbered register reg byte y as potential for zp ZP_BYTE:25 [ rotate_matrix::x#0 ] Statement [27] (signed byte) rotate_matrix::z#0 ← *((const signed byte[8]) zs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:26 [ rotate_matrix::y#0 ] -Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ) always clobbers reg byte a -Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a -Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a +Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a +Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a Statement [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 [ sx#10 sy#10 anim::i#1 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#1 ] ) always clobbers reg byte a Statement [42] *((const byte*) BORDERCOL) ← (const byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [44] *((const byte*) BORDERCOL) ← (const byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a @@ -6961,25 +6935,25 @@ Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#1 Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [259] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] ) always clobbers reg byte a -Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a +Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a Statement [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a -Statement [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [14] if(*((const byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [15] if(*((const byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [16] if(*((const byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte[8]) xs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] ) always clobbers reg byte y Statement [26] (signed byte) rotate_matrix::y#0 ← *((const signed byte[8]) ys + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] ) always clobbers reg byte y Statement [27] (signed byte) rotate_matrix::z#0 ← *((const signed byte[8]) zs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] ) always clobbers reg byte y -Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y -Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y +Statement [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] ) always clobbers reg byte a reg byte y Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 ] ) always clobbers reg byte a -Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a -Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a +Statement [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ) always clobbers reg byte a +Statement [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$12 ] ) always clobbers reg byte a Statement [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 [ sx#10 sy#10 anim::i#1 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#1 ] ) always clobbers reg byte a Statement [42] *((const byte*) BORDERCOL) ← (const byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a Statement [44] *((const byte*) BORDERCOL) ← (const byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] ) always clobbers reg byte a @@ -7072,7 +7046,7 @@ Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#1 Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [259] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] ) always clobbers reg byte a -Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a +Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a Statement [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ sx#10 sx#3 ] : zp ZP_BYTE:2 , Potential registers zp ZP_BYTE:3 [ sy#10 sy#3 ] : zp ZP_BYTE:3 , @@ -7381,7 +7355,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main jsr main // [3] phi from @1 to @end [phi:@1->@end] @@ -7398,13 +7372,13 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 //mulf_init(); lda #mulf_sqr1 sta psp1+1 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -7512,29 +7486,29 @@ anim: { jmp b9 // anim::@9 b9: - // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 //if(*xrxmax) xmax = *xr; lda xr ldy.z i sta xrs,y - // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yr ldy.z i sta yrs,y - // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda zr ldy.z i sta zrs,y - // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda pp ldy.z i sta pps,y - // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda xp ldy.z i sta xps,y - // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yp ldy.z i sta yps,y @@ -7542,13 +7516,13 @@ anim: { lda.z i asl tax - // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) -- vbuaa=vbuc1_plus__deref_pbuc2 + // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) -- vbuaa=vbuc1_plus__deref_pbuc2 lda #$80 clc adc xp // [37] *((const byte*) SPRITES_XPOS + (byte) anim::i2#0) ← (byte~) anim::$10 -- pbuc1_derefidx_vbuxx=vbuaa sta SPRITES_XPOS,x - // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) -- vbuaa=vbuc1_plus__deref_pbuc2 + // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) -- vbuaa=vbuc1_plus__deref_pbuc2 lda #$80 clc adc yp @@ -7664,7 +7638,7 @@ debug_print: { sta.z print_sbyte_at.at lda #>print_screen+print_sbyte_pos3_row*$28+print_sbyte_pos3_col sta.z print_sbyte_at.at+1 - // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz#0 [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsxx=vbsc1 + // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsxx=vbsc1 ldx #sz jsr print_sbyte_at jmp b3 @@ -8121,13 +8095,13 @@ print_byte_at: { rotate_matrix: { .label y = 6 .label z = 4 - // [129] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsxx + // [129] *((const signed byte*) xr) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsxx txa sta xr - // [130] *((const signed byte*) yr#0) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 + // [130] *((const signed byte*) yr) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 lda.z y sta yr - // [131] *((const signed byte*) zr#0) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 + // [131] *((const signed byte*) zr) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 lda.z z sta zr // asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } @@ -8496,7 +8470,7 @@ debug_print_init: { // [184] call print_str_at // [243] phi from debug_print_init::@4 to print_str_at [phi:debug_print_init::@4->print_str_at] print_str_at_from_b4: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$22 @@ -8515,7 +8489,7 @@ debug_print_init: { // [186] call print_str_at // [243] phi from debug_print_init::@5 to print_str_at [phi:debug_print_init::@5->print_str_at] print_str_at_from_b5: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*1+$22 @@ -8534,7 +8508,7 @@ debug_print_init: { // [188] call print_str_at // [243] phi from debug_print_init::@6 to print_str_at [phi:debug_print_init::@6->print_str_at] print_str_at_from_b6: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*2+$22 @@ -8553,7 +8527,7 @@ debug_print_init: { // [190] call print_str_at // [243] phi from debug_print_init::@7 to print_str_at [phi:debug_print_init::@7->print_str_at] print_str_at_from_b7: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$10 @@ -8572,7 +8546,7 @@ debug_print_init: { // [192] call print_str_at // [243] phi from debug_print_init::@8 to print_str_at [phi:debug_print_init::@8->print_str_at] print_str_at_from_b8: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$11 @@ -8591,7 +8565,7 @@ debug_print_init: { // [194] call print_str_at // [243] phi from debug_print_init::@9 to print_str_at [phi:debug_print_init::@9->print_str_at] print_str_at_from_b9: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$12 @@ -8610,7 +8584,7 @@ debug_print_init: { // [196] call print_str_at // [243] phi from debug_print_init::@10 to print_str_at [phi:debug_print_init::@10->print_str_at] print_str_at_from_b10: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$13 @@ -8629,7 +8603,7 @@ debug_print_init: { // [198] call print_str_at // [243] phi from debug_print_init::@11 to print_str_at [phi:debug_print_init::@11->print_str_at] print_str_at_from_b11: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$14 @@ -8648,7 +8622,7 @@ debug_print_init: { // [200] call print_str_at // [243] phi from debug_print_init::@12 to print_str_at [phi:debug_print_init::@12->print_str_at] print_str_at_from_b12: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$15 @@ -8667,7 +8641,7 @@ debug_print_init: { // [202] call print_str_at // [243] phi from debug_print_init::@13 to print_str_at [phi:debug_print_init::@13->print_str_at] print_str_at_from_b13: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$16 @@ -8686,7 +8660,7 @@ debug_print_init: { // [204] call print_str_at // [243] phi from debug_print_init::@14 to print_str_at [phi:debug_print_init::@14->print_str_at] print_str_at_from_b14: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$17 @@ -8705,7 +8679,7 @@ debug_print_init: { // [206] call print_str_at // [243] phi from debug_print_init::@15 to print_str_at [phi:debug_print_init::@15->print_str_at] print_str_at_from_b15: - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$18 @@ -9071,7 +9045,7 @@ sprites_init: { jmp b1 // sprites_init::@1 b1: - // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta sprites_ptr,x // [262] *((const byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 @@ -9468,8 +9442,7 @@ FINAL SYMBOL TABLE (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed byte[$140]) SINH SINH = kickasm {{ { .var min = -$2000 .var max = $2000 @@ -9490,8 +9463,7 @@ FINAL SYMBOL TABLE } } }} -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 12288 +(const byte*) SPRITE SPRITE = (byte*) 12288 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XPOS SPRITES_XPOS = (byte*) 53248 @@ -9586,7 +9558,7 @@ FINAL SYMBOL TABLE (label) debug_print::@9 (label) debug_print::@return (byte*) debug_print::at_line -(const byte*) debug_print::at_line#0 at_line = (const byte*) SCREEN#0+(word)(number) $13*(number) $28 +(const byte*) debug_print::at_line#0 at_line = (const byte*) SCREEN+(word)(number) $13*(number) $28 (byte) debug_print::c (byte) debug_print::c#1 c zp ZP_BYTE:5 67.33333333333333 (byte) debug_print::c#2 c zp ZP_BYTE:5 42.52631578947369 @@ -9703,12 +9675,11 @@ FINAL SYMBOL TABLE (label) debug_print_init::@8 (label) debug_print_init::@9 (label) debug_print_init::@return -(byte*) debug_print_init::COLS -(const byte*) debug_print_init::COLS#0 COLS = (byte*) 55296 +(const byte*) debug_print_init::COLS COLS = (byte*) 55296 (byte*) debug_print_init::at_cols -(const byte*) debug_print_init::at_cols#0 at_cols = (const byte*) debug_print_init::COLS#0+(word)(number) $10*(number) $28 +(const byte*) debug_print_init::at_cols#0 at_cols = (const byte*) debug_print_init::COLS+(word)(number) $10*(number) $28 (byte*) debug_print_init::at_line -(const byte*) debug_print_init::at_line#0 at_line = (const byte*) SCREEN#0+(word)(number) $10*(number) $28 +(const byte*) debug_print_init::at_line#0 at_line = (const byte*) SCREEN+(word)(number) $10*(number) $28 (byte) debug_print_init::c (byte) debug_print_init::c#1 c zp ZP_BYTE:2 7.333333333333333 (byte) debug_print_init::c#2 c zp ZP_BYTE:2 30.125 @@ -9764,8 +9735,7 @@ FINAL SYMBOL TABLE .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }} -(signed byte*) pp -(const signed byte*) pp#0 pp = (signed byte*) 243 +(const signed byte*) pp pp = (signed byte*) 243 (const signed byte[8]) pps pps = { fill( 8, 0) } (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 reg byte y 4.0 @@ -9846,10 +9816,8 @@ FINAL SYMBOL TABLE (byte*) print_str_at::str#0 str zp ZP_WORD:13 22.0 (byte*) print_str_at::str#13 str zp ZP_WORD:13 11.5 (byte*) print_str_at::str#15 str zp ZP_WORD:13 2.0 -(word*) psp1 -(const word*) psp1#0 psp1 = (word*) 246 -(word*) psp2 -(const word*) psp2#0 psp2 = (word*) 248 +(const word*) psp1 psp1 = (word*) 246 +(const word*) psp2 psp2 = (word*) 248 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) (label) rotate_matrix::@return (signed byte) rotate_matrix::x @@ -9862,13 +9830,12 @@ FINAL SYMBOL TABLE (void()) sprites_init() (label) sprites_init::@1 (label) sprites_init::@return -(byte*) sprites_init::SCREEN -(const byte*) sprites_init::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) sprites_init::SCREEN SCREEN = (byte*) 1024 (byte) sprites_init::i (byte) sprites_init::i#1 reg byte x 16.5 (byte) sprites_init::i#2 reg byte x 14.666666666666666 (byte*) sprites_init::sprites_ptr -(const byte*) sprites_init::sprites_ptr#0 sprites_ptr = (const byte*) sprites_init::SCREEN#0+(word) $3f8 +(const byte*) sprites_init::sprites_ptr#0 sprites_ptr = (const byte*) sprites_init::SCREEN+(word) $3f8 (void()) store_matrix() (label) store_matrix::@return (signed byte) sx @@ -9877,24 +9844,18 @@ FINAL SYMBOL TABLE (signed byte) sy (signed byte) sy#10 sy zp ZP_BYTE:3 0.3846153846153846 (signed byte) sy#3 sy zp ZP_BYTE:3 22.0 -(signed byte) sz -(const signed byte) sz#0 sz = (signed byte) 0 -(signed byte*) xp -(const signed byte*) xp#0 xp = (signed byte*) 244 +(const signed byte) sz sz = (signed byte) 0 +(const signed byte*) xp xp = (signed byte*) 244 (const signed byte[8]) xps xps = { fill( 8, 0) } -(signed byte*) xr -(const signed byte*) xr#0 xr = (signed byte*) 240 +(const signed byte*) xr xr = (signed byte*) 240 (const signed byte[8]) xrs xrs = { fill( 8, 0) } (const signed byte[8]) xs xs = { (signed byte) -$34, (signed byte) -$34, (signed byte) -$34, (signed byte) 0, (signed byte) 0, (signed byte) $34, (signed byte) $34, (signed byte) $34 } -(signed byte*) yp -(const signed byte*) yp#0 yp = (signed byte*) 245 +(const signed byte*) yp yp = (signed byte*) 245 (const signed byte[8]) yps yps = { fill( 8, 0) } -(signed byte*) yr -(const signed byte*) yr#0 yr = (signed byte*) 241 +(const signed byte*) yr yr = (signed byte*) 241 (const signed byte[8]) yrs yrs = { fill( 8, 0) } (const signed byte[8]) ys ys = { (signed byte) -$34, (signed byte) 0, (signed byte) $34, (signed byte) -$34, (signed byte) $34, (signed byte) -$34, (signed byte) 0, (signed byte) $34 } -(signed byte*) zr -(const signed byte*) zr#0 zr = (signed byte*) 242 +(const signed byte*) zr zr = (signed byte*) 242 (const signed byte[8]) zrs zrs = { fill( 8, 0) } (const signed byte[8]) zs zs = { (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34 } @@ -10015,7 +9976,7 @@ Score: 66046 // @begin // @1 // kickasm - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main // [3] phi from @1 to @end [phi:@1->@end] // @end @@ -10029,14 +9990,14 @@ main: { jsr sprites_init // main::@1 // *psp1 = (word)mulf_sqr1 - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 //mulf_init(); lda #mulf_sqr1 sta psp1+1 // *psp2 = (word)mulf_sqr2 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -10129,30 +10090,30 @@ anim: { jsr rotate_matrix // anim::@9 // xrs[i] = *xr - // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [29] *((const signed byte[8]) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 //if(*xrxmax) xmax = *xr; lda xr ldy.z i sta xrs,y // yrs[i] = *yr - // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [30] *((const signed byte[8]) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yr sta yrs,y // zrs[i] = *zr - // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [31] *((const signed byte[8]) zrs + (byte) anim::i#2) ← *((const signed byte*) zr) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda zr sta zrs,y // pps[i] = *pp - // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [32] *((const signed byte[8]) pps + (byte) anim::i#2) ← *((const signed byte*) pp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda pp sta pps,y // xps[i] = *xp - // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [33] *((const signed byte[8]) xps + (byte) anim::i#2) ← *((const signed byte*) xp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda xp sta xps,y // yps[i] = *yp - // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp#0) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 + // [34] *((const signed byte[8]) yps + (byte) anim::i#2) ← *((const signed byte*) yp) -- pbsc1_derefidx_vbuz1=_deref_pbsc2 lda yp sta yps,y // i2 = i*2 @@ -10161,7 +10122,7 @@ anim: { asl tax // $80+(byte)((*xp)) - // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp#0) -- vbuaa=vbuc1_plus__deref_pbuc2 + // [36] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) xp) -- vbuaa=vbuc1_plus__deref_pbuc2 lda #$80 clc adc xp @@ -10169,7 +10130,7 @@ anim: { // [37] *((const byte*) SPRITES_XPOS + (byte) anim::i2#0) ← (byte~) anim::$10 -- pbuc1_derefidx_vbuxx=vbuaa sta SPRITES_XPOS,x // $80+(byte)((*yp)) - // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp#0) -- vbuaa=vbuc1_plus__deref_pbuc2 + // [38] (byte~) anim::$12 ← (byte) $80 + (byte)*((const signed byte*) yp) -- vbuaa=vbuc1_plus__deref_pbuc2 lda #$80 clc adc yp @@ -10280,7 +10241,7 @@ debug_print: { sta.z print_sbyte_at.at lda #>print_screen+print_sbyte_pos3_row*$28+print_sbyte_pos3_col sta.z print_sbyte_at.at+1 - // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz#0 [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsxx=vbsc1 + // [105] phi (signed byte) print_sbyte_at::b#22 = (const signed byte) sz [phi:debug_print::print_sbyte_pos3->print_sbyte_at#1] -- vbsxx=vbsc1 ldx #sz jsr print_sbyte_at // debug_print::@3 @@ -10692,15 +10653,15 @@ rotate_matrix: { .label y = 6 .label z = 4 // *xr = x - // [129] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsxx + // [129] *((const signed byte*) xr) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsxx txa sta xr // *yr = y - // [130] *((const signed byte*) yr#0) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 + // [130] *((const signed byte*) yr) ← (signed byte) rotate_matrix::y#0 -- _deref_pbsc1=vbsz1 lda.z y sta yr // *zr = z - // [131] *((const signed byte*) zr#0) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 + // [131] *((const signed byte*) zr) ← (signed byte) rotate_matrix::z#0 -- _deref_pbsc1=vbsz1 lda.z z sta zr // asm @@ -11109,7 +11070,7 @@ debug_print_init: { // print_str_at("sx", SCREEN+40*0+34) // [184] call print_str_at // [243] phi from debug_print_init::@4 to print_str_at [phi:debug_print_init::@4->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte) $22 [phi:debug_print_init::@4->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$22 @@ -11125,7 +11086,7 @@ debug_print_init: { // print_str_at("sy", SCREEN+40*1+34) // [186] call print_str_at // [243] phi from debug_print_init::@5 to print_str_at [phi:debug_print_init::@5->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) $22 [phi:debug_print_init::@5->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*1+$22 @@ -11141,7 +11102,7 @@ debug_print_init: { // print_str_at("sz", SCREEN+40*2+34) // [188] call print_str_at // [243] phi from debug_print_init::@6 to print_str_at [phi:debug_print_init::@6->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) $22 [phi:debug_print_init::@6->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*2+$22 @@ -11157,7 +11118,7 @@ debug_print_init: { // print_str_at("x", SCREEN+40*16) // [190] call print_str_at // [243] phi from debug_print_init::@7 to print_str_at [phi:debug_print_init::@7->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $10 [phi:debug_print_init::@7->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$10 @@ -11173,7 +11134,7 @@ debug_print_init: { // print_str_at("y", SCREEN+40*17) // [192] call print_str_at // [243] phi from debug_print_init::@8 to print_str_at [phi:debug_print_init::@8->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $11 [phi:debug_print_init::@8->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$11 @@ -11189,7 +11150,7 @@ debug_print_init: { // print_str_at("z", SCREEN+40*18) // [194] call print_str_at // [243] phi from debug_print_init::@9 to print_str_at [phi:debug_print_init::@9->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $12 [phi:debug_print_init::@9->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$12 @@ -11205,7 +11166,7 @@ debug_print_init: { // print_str_at("xr", SCREEN+40*19) // [196] call print_str_at // [243] phi from debug_print_init::@10 to print_str_at [phi:debug_print_init::@10->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $13 [phi:debug_print_init::@10->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$13 @@ -11221,7 +11182,7 @@ debug_print_init: { // print_str_at("yr", SCREEN+40*20) // [198] call print_str_at // [243] phi from debug_print_init::@11 to print_str_at [phi:debug_print_init::@11->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $14 [phi:debug_print_init::@11->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$14 @@ -11237,7 +11198,7 @@ debug_print_init: { // print_str_at("zr", SCREEN+40*21) // [200] call print_str_at // [243] phi from debug_print_init::@12 to print_str_at [phi:debug_print_init::@12->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $15 [phi:debug_print_init::@12->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$15 @@ -11253,7 +11214,7 @@ debug_print_init: { // print_str_at("pp", SCREEN+40*22) // [202] call print_str_at // [243] phi from debug_print_init::@13 to print_str_at [phi:debug_print_init::@13->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $16 [phi:debug_print_init::@13->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$16 @@ -11269,7 +11230,7 @@ debug_print_init: { // print_str_at("xp", SCREEN+40*23) // [204] call print_str_at // [243] phi from debug_print_init::@14 to print_str_at [phi:debug_print_init::@14->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $17 [phi:debug_print_init::@14->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$17 @@ -11285,7 +11246,7 @@ debug_print_init: { // print_str_at("yp", SCREEN+40*24) // [206] call print_str_at // [243] phi from debug_print_init::@15 to print_str_at [phi:debug_print_init::@15->print_str_at] - // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN#0+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 + // [243] phi (byte*) print_str_at::at#15 = (const byte*) SCREEN+(word)(number) $28*(number) $18 [phi:debug_print_init::@15->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+$28*$18 @@ -11656,7 +11617,7 @@ sprites_init: { // sprites_init::@1 b1: // sprites_ptr[i] = (byte)(SPRITE/$40) - // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta sprites_ptr,x // SPRITES_COLS[i] = GREEN diff --git a/src/test/ref/examples/3d/3d.sym b/src/test/ref/examples/3d/3d.sym index a4981bb89..4b06b340c 100644 --- a/src/test/ref/examples/3d/3d.sym +++ b/src/test/ref/examples/3d/3d.sym @@ -27,8 +27,7 @@ (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const signed byte[$140]) SINH SINH = kickasm {{ { .var min = -$2000 .var max = $2000 @@ -49,8 +48,7 @@ } } }} -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 12288 +(const byte*) SPRITE SPRITE = (byte*) 12288 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XPOS SPRITES_XPOS = (byte*) 53248 @@ -145,7 +143,7 @@ (label) debug_print::@9 (label) debug_print::@return (byte*) debug_print::at_line -(const byte*) debug_print::at_line#0 at_line = (const byte*) SCREEN#0+(word)(number) $13*(number) $28 +(const byte*) debug_print::at_line#0 at_line = (const byte*) SCREEN+(word)(number) $13*(number) $28 (byte) debug_print::c (byte) debug_print::c#1 c zp ZP_BYTE:5 67.33333333333333 (byte) debug_print::c#2 c zp ZP_BYTE:5 42.52631578947369 @@ -262,12 +260,11 @@ (label) debug_print_init::@8 (label) debug_print_init::@9 (label) debug_print_init::@return -(byte*) debug_print_init::COLS -(const byte*) debug_print_init::COLS#0 COLS = (byte*) 55296 +(const byte*) debug_print_init::COLS COLS = (byte*) 55296 (byte*) debug_print_init::at_cols -(const byte*) debug_print_init::at_cols#0 at_cols = (const byte*) debug_print_init::COLS#0+(word)(number) $10*(number) $28 +(const byte*) debug_print_init::at_cols#0 at_cols = (const byte*) debug_print_init::COLS+(word)(number) $10*(number) $28 (byte*) debug_print_init::at_line -(const byte*) debug_print_init::at_line#0 at_line = (const byte*) SCREEN#0+(word)(number) $10*(number) $28 +(const byte*) debug_print_init::at_line#0 at_line = (const byte*) SCREEN+(word)(number) $10*(number) $28 (byte) debug_print_init::c (byte) debug_print_init::c#1 c zp ZP_BYTE:2 7.333333333333333 (byte) debug_print_init::c#2 c zp ZP_BYTE:2 30.125 @@ -323,8 +320,7 @@ .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }} -(signed byte*) pp -(const signed byte*) pp#0 pp = (signed byte*) 243 +(const signed byte*) pp pp = (signed byte*) 243 (const signed byte[8]) pps pps = { fill( 8, 0) } (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 reg byte y 4.0 @@ -405,10 +401,8 @@ (byte*) print_str_at::str#0 str zp ZP_WORD:13 22.0 (byte*) print_str_at::str#13 str zp ZP_WORD:13 11.5 (byte*) print_str_at::str#15 str zp ZP_WORD:13 2.0 -(word*) psp1 -(const word*) psp1#0 psp1 = (word*) 246 -(word*) psp2 -(const word*) psp2#0 psp2 = (word*) 248 +(const word*) psp1 psp1 = (word*) 246 +(const word*) psp2 psp2 = (word*) 248 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) (label) rotate_matrix::@return (signed byte) rotate_matrix::x @@ -421,13 +415,12 @@ (void()) sprites_init() (label) sprites_init::@1 (label) sprites_init::@return -(byte*) sprites_init::SCREEN -(const byte*) sprites_init::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) sprites_init::SCREEN SCREEN = (byte*) 1024 (byte) sprites_init::i (byte) sprites_init::i#1 reg byte x 16.5 (byte) sprites_init::i#2 reg byte x 14.666666666666666 (byte*) sprites_init::sprites_ptr -(const byte*) sprites_init::sprites_ptr#0 sprites_ptr = (const byte*) sprites_init::SCREEN#0+(word) $3f8 +(const byte*) sprites_init::sprites_ptr#0 sprites_ptr = (const byte*) sprites_init::SCREEN+(word) $3f8 (void()) store_matrix() (label) store_matrix::@return (signed byte) sx @@ -436,24 +429,18 @@ (signed byte) sy (signed byte) sy#10 sy zp ZP_BYTE:3 0.3846153846153846 (signed byte) sy#3 sy zp ZP_BYTE:3 22.0 -(signed byte) sz -(const signed byte) sz#0 sz = (signed byte) 0 -(signed byte*) xp -(const signed byte*) xp#0 xp = (signed byte*) 244 +(const signed byte) sz sz = (signed byte) 0 +(const signed byte*) xp xp = (signed byte*) 244 (const signed byte[8]) xps xps = { fill( 8, 0) } -(signed byte*) xr -(const signed byte*) xr#0 xr = (signed byte*) 240 +(const signed byte*) xr xr = (signed byte*) 240 (const signed byte[8]) xrs xrs = { fill( 8, 0) } (const signed byte[8]) xs xs = { (signed byte) -$34, (signed byte) -$34, (signed byte) -$34, (signed byte) 0, (signed byte) 0, (signed byte) $34, (signed byte) $34, (signed byte) $34 } -(signed byte*) yp -(const signed byte*) yp#0 yp = (signed byte*) 245 +(const signed byte*) yp yp = (signed byte*) 245 (const signed byte[8]) yps yps = { fill( 8, 0) } -(signed byte*) yr -(const signed byte*) yr#0 yr = (signed byte*) 241 +(const signed byte*) yr yr = (signed byte*) 241 (const signed byte[8]) yrs yrs = { fill( 8, 0) } (const signed byte[8]) ys ys = { (signed byte) -$34, (signed byte) 0, (signed byte) $34, (signed byte) -$34, (signed byte) $34, (signed byte) -$34, (signed byte) 0, (signed byte) $34 } -(signed byte*) zr -(const signed byte*) zr#0 zr = (signed byte*) 242 +(const signed byte*) zr zr = (signed byte*) 242 (const signed byte[8]) zrs zrs = { fill( 8, 0) } (const signed byte[8]) zs zs = { (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34, (signed byte) $34 } diff --git a/src/test/ref/examples/3d/perspective.cfg b/src/test/ref/examples/3d/perspective.cfg index f5fe3a1b2..5ceea7a25 100644 --- a/src/test/ref/examples/3d/perspective.cfg +++ b/src/test/ref/examples/3d/perspective.cfg @@ -14,8 +14,8 @@ main: scope:[main] from @1 [5] call mulf_init to:main::@1 main::@1: scope:[main] from main - [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 - [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 + [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 + [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [8] call print_cls to:main::@2 main::@2: scope:[main] from main::@1 @@ -60,7 +60,7 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 [27] call perspective to:do_perspective::@8 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 - [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr#0) + [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr) [29] call print_byte to:do_perspective::@9 do_perspective::@9: scope:[do_perspective] from do_perspective::@8 @@ -68,7 +68,7 @@ do_perspective::@9: scope:[do_perspective] from do_perspective::@8 [31] call print_str to:do_perspective::@10 do_perspective::@10: scope:[do_perspective] from do_perspective::@9 - [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr#0) + [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr) [33] call print_byte to:do_perspective::@11 do_perspective::@11: scope:[do_perspective] from do_perspective::@10 @@ -145,9 +145,9 @@ print_char::@return: scope:[print_char] from print_char (void()) perspective((signed byte) perspective::x , (signed byte) perspective::y , (signed byte) perspective::z) perspective: scope:[perspective] from do_perspective::@7 - [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 - [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 - [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 + [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 + [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 + [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } to:perspective::@return perspective::@return: scope:[perspective] from perspective diff --git a/src/test/ref/examples/3d/perspective.log b/src/test/ref/examples/3d/perspective.log index 61c38e1a6..5ef628ca8 100644 --- a/src/test/ref/examples/3d/perspective.log +++ b/src/test/ref/examples/3d/perspective.log @@ -290,11 +290,11 @@ print_cls::@return: scope:[print_cls] from print_cls::@1 (byte*) print_screen#7 ← phi( @33/(byte*) print_screen#8 ) (byte*) print_char_cursor#78 ← phi( @33/(byte*) print_char_cursor#79 ) (byte*) print_line_cursor#29 ← phi( @33/(byte*) print_line_cursor#30 ) - (signed byte*) xr#0 ← ((signed byte*)) (number) $f0 - (signed byte*) yr#0 ← ((signed byte*)) (number) $f1 - (signed byte*) zr#0 ← ((signed byte*)) (number) $f2 - (word*) psp1#0 ← ((word*)) (number) $f3 - (word*) psp2#0 ← ((word*)) (number) $f5 + (signed byte*) xr ← ((signed byte*)) (number) $f0 + (signed byte*) yr ← ((signed byte*)) (number) $f1 + (signed byte*) zr ← ((signed byte*)) (number) $f2 + (word*) psp1 ← ((word*)) (number) $f3 + (word*) psp2 ← ((word*)) (number) $f5 to:@43 (void()) main() @@ -310,9 +310,9 @@ main::@1: scope:[main] from main (byte*) print_line_cursor#22 ← phi( main/(byte*) print_line_cursor#25 ) (byte*) print_screen#3 ← phi( main/(byte*) print_screen#4 ) (word~) main::$1 ← ((word)) (byte[$200]) mulf_sqr1 - *((word*) psp1#0) ← (word~) main::$1 + *((word*) psp1) ← (word~) main::$1 (word~) main::$2 ← ((word)) (byte[$200]) mulf_sqr2 - *((word*) psp2#0) ← (word~) main::$2 + *((word*) psp2) ← (word~) main::$2 call print_cls to:main::@2 main::@2: scope:[main] from main::@1 @@ -424,7 +424,7 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 (byte*) print_line_cursor#32 ← phi( do_perspective::@7/(byte*) print_line_cursor#33 ) (byte*) print_char_cursor#72 ← phi( do_perspective::@7/(byte*) print_char_cursor#25 ) - (byte~) do_perspective::$8 ← ((byte)) *((signed byte*) xr#0) + (byte~) do_perspective::$8 ← ((byte)) *((signed byte*) xr) (byte) print_byte::b#1 ← (byte~) do_perspective::$8 call print_byte to:do_perspective::@9 @@ -439,7 +439,7 @@ do_perspective::@10: scope:[do_perspective] from do_perspective::@9 (byte*) print_line_cursor#28 ← phi( do_perspective::@9/(byte*) print_line_cursor#31 ) (byte*) print_char_cursor#58 ← phi( do_perspective::@9/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#27 ← (byte*) print_char_cursor#58 - (byte~) do_perspective::$11 ← ((byte)) *((signed byte*) yr#0) + (byte~) do_perspective::$11 ← ((byte)) *((signed byte*) yr) (byte) print_byte::b#2 ← (byte~) do_perspective::$11 call print_byte to:do_perspective::@11 @@ -475,9 +475,9 @@ perspective: scope:[perspective] from do_perspective::@7 (signed byte) perspective::z#1 ← phi( do_perspective::@7/(signed byte) perspective::z#0 ) (signed byte) perspective::y#1 ← phi( do_perspective::@7/(signed byte) perspective::y#0 ) (signed byte) perspective::x#1 ← phi( do_perspective::@7/(signed byte) perspective::x#0 ) - *((signed byte*) xr#0) ← (signed byte) perspective::x#1 - *((signed byte*) yr#0) ← (signed byte) perspective::y#1 - *((signed byte*) zr#0) ← (signed byte) perspective::z#1 + *((signed byte*) xr) ← (signed byte) perspective::x#1 + *((signed byte*) yr) ← (signed byte) perspective::y#1 + *((signed byte*) zr) ← (signed byte) perspective::z#1 asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } to:perspective::@return perspective::@return: scope:[perspective] from perspective @@ -917,15 +917,10 @@ SYMBOL TABLE SSA (byte*) print_str::str#8 (byte*) print_str::str#9 (word*) psp1 -(word*) psp1#0 (word*) psp2 -(word*) psp2#0 (signed byte*) xr -(signed byte*) xr#0 (signed byte*) yr -(signed byte*) yr#0 (signed byte*) zr -(signed byte*) zr#0 Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 Adding number conversion cast (unumber) 0 in (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#7) @@ -959,18 +954,18 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#6 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (signed byte*) xr#0 ← (signed byte*)(number) $f0 -Inlining cast (signed byte*) yr#0 ← (signed byte*)(number) $f1 -Inlining cast (signed byte*) zr#0 ← (signed byte*)(number) $f2 -Inlining cast (word*) psp1#0 ← (word*)(number) $f3 -Inlining cast (word*) psp2#0 ← (word*)(number) $f5 +Inlining cast (signed byte*) xr ← (signed byte*)(number) $f0 +Inlining cast (signed byte*) yr ← (signed byte*)(number) $f1 +Inlining cast (signed byte*) zr ← (signed byte*)(number) $f2 +Inlining cast (word*) psp1 ← (word*)(number) $f3 +Inlining cast (word*) psp2 ← (word*)(number) $f5 Inlining cast (word~) main::$1 ← (word)(byte[$200]) mulf_sqr1 Inlining cast (word~) main::$2 ← (word)(byte[$200]) mulf_sqr2 Inlining cast (signed byte) do_perspective::x#0 ← (snumber)(number) $39 Inlining cast (signed byte) do_perspective::y#0 ← (snumber)(number) -$47 Inlining cast (signed byte) do_perspective::z#0 ← (snumber)(number) $36 -Inlining cast (byte~) do_perspective::$8 ← (byte)*((signed byte*) xr#0) -Inlining cast (byte~) do_perspective::$11 ← (byte)*((signed byte*) yr#0) +Inlining cast (byte~) do_perspective::$8 ← (byte)*((signed byte*) xr) +Inlining cast (byte~) do_perspective::$11 ← (byte)*((signed byte*) yr) Inlining cast (signed word) mulf_init::sqr#0 ← (snumber)(number) 0 Inlining cast (signed word) mulf_init::add#0 ← (snumber)(number) 1 Successful SSA optimization Pass2InlineCast @@ -1154,11 +1149,11 @@ Constant (const byte) print_char::ch#1 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const signed byte*) xr#0 = (signed byte*) 240 -Constant (const signed byte*) yr#0 = (signed byte*) 241 -Constant (const signed byte*) zr#0 = (signed byte*) 242 -Constant (const word*) psp1#0 = (word*) 243 -Constant (const word*) psp2#0 = (word*) 245 +Constant (const signed byte*) xr = (signed byte*) 240 +Constant (const signed byte*) yr = (signed byte*) 241 +Constant (const signed byte*) zr = (signed byte*) 242 +Constant (const word*) psp1 = (word*) 243 +Constant (const word*) psp2 = (word*) 245 Constant (const signed byte) do_perspective::x#0 = $39 Constant (const signed byte) do_perspective::y#0 = -$47 Constant (const signed byte) do_perspective::z#0 = $36 @@ -1235,8 +1230,8 @@ Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memse Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) memset::end#0 = memset::$2+memset::num#0 Successful SSA optimization Pass2ConstantIdentification -Inlining Noop Cast [54] (byte) print_byte::b#1 ← (byte)*((const signed byte*) xr#0) keeping *(xr#0) -Inlining Noop Cast [57] (byte) print_byte::b#2 ← (byte)*((const signed byte*) yr#0) keeping *(yr#0) +Inlining Noop Cast [54] (byte) print_byte::b#1 ← (byte)*((const signed byte*) xr) keeping *(xr) +Inlining Noop Cast [57] (byte) print_byte::b#2 ← (byte)*((const signed byte*) yr) keeping *(yr) Successful SSA optimization Pass2NopCastInlining Inlining constant with var siblings (const byte*) memset::dst#0 Inlining constant with var siblings (const byte*) print_str::str#1 @@ -1413,8 +1408,8 @@ main: scope:[main] from @1 [5] call mulf_init to:main::@1 main::@1: scope:[main] from main - [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 - [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 + [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 + [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [8] call print_cls to:main::@2 main::@2: scope:[main] from main::@1 @@ -1459,7 +1454,7 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 [27] call perspective to:do_perspective::@8 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 - [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr#0) + [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr) [29] call print_byte to:do_perspective::@9 do_perspective::@9: scope:[do_perspective] from do_perspective::@8 @@ -1467,7 +1462,7 @@ do_perspective::@9: scope:[do_perspective] from do_perspective::@8 [31] call print_str to:do_perspective::@10 do_perspective::@10: scope:[do_perspective] from do_perspective::@9 - [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr#0) + [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr) [33] call print_byte to:do_perspective::@11 do_perspective::@11: scope:[do_perspective] from do_perspective::@10 @@ -1544,9 +1539,9 @@ print_char::@return: scope:[print_char] from print_char (void()) perspective((signed byte) perspective::x , (signed byte) perspective::y , (signed byte) perspective::z) perspective: scope:[perspective] from do_perspective::@7 - [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 - [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 - [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 + [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 + [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 + [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } to:perspective::@return perspective::@return: scope:[perspective] from perspective @@ -1703,11 +1698,6 @@ VARIABLE REGISTER WEIGHTS (byte*) print_str::str#0 22.0 (byte*) print_str::str#7 11.5 (byte*) print_str::str#9 2.0 -(word*) psp1 -(word*) psp2 -(signed byte*) xr -(signed byte*) yr -(signed byte*) zr Initial phi equivalence classes [ print_line_cursor#11 print_line_cursor#1 ] @@ -1806,12 +1796,12 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 lda #mulf_sqr1 sta psp1+1 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -1945,7 +1935,7 @@ do_perspective: { jmp b8 // do_perspective::@8 b8: - // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr#0) -- vbuz1=_deref_pbuc1 + // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr) -- vbuz1=_deref_pbuc1 lda xr sta.z print_byte.b // [29] call print_byte @@ -1972,7 +1962,7 @@ do_perspective: { jmp b10 // do_perspective::@10 b10: - // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr#0) -- vbuz1=_deref_pbuc1 + // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr) -- vbuz1=_deref_pbuc1 lda yr sta.z print_byte.b // [33] call print_byte @@ -2172,13 +2162,13 @@ print_char: { // Apply perspective to a 3d-point. Result is returned in (*xr,*yr) // Implemented in assembler to utilize seriously fast multiplication perspective: { - // [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 + // [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.x sta xr - // [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 + // [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.y sta yr - // [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 + // [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.z sta zr // asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } @@ -2479,8 +2469,8 @@ PERSP_Z: REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [41] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#11 + (byte) $28 [ print_line_cursor#1 print_char_cursor#2 ] ( main:2::do_perspective:10::print_ln:37 [ print_line_cursor#1 print_char_cursor#2 ] ) always clobbers reg byte a Statement [42] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#2) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#2 ] ( main:2::do_perspective:10::print_ln:37 [ print_line_cursor#1 print_char_cursor#2 ] ) always clobbers reg byte a Statement [46] if((byte) 0!=*((byte*) print_str::str#7)) goto print_str::@2 [ print_char_cursor#2 print_str::str#7 ] ( main:2::do_perspective:10::print_str:13 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:17 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:21 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:25 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:31 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:35 [ print_char_cursor#2 print_str::str#7 ] ) always clobbers reg byte a reg byte y @@ -2491,9 +2481,9 @@ Statement [55] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f [ p Statement [60] *((byte*) print_char_cursor#44) ← (byte) print_char::ch#4 [ print_char_cursor#44 ] ( main:2::do_perspective:10::print_byte:29::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_byte:33::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_byte:29::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_byte:33::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#5 print_byte::b#6 print_byte::b#0 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:10 [ print_sbyte::b#6 print_sbyte::b#0 print_sbyte::b#4 ] -Statement [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a -Statement [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a -Statement [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a Statement asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } always clobbers reg byte a reg byte y Statement [78] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#4 [ print_char_cursor#12 print_sbyte::b#0 ] ( main:2::do_perspective:10::print_sbyte:15 [ print_char_cursor#12 print_sbyte::b#0 ] main:2::do_perspective:10::print_sbyte:19 [ print_char_cursor#12 print_sbyte::b#0 ] main:2::do_perspective:10::print_sbyte:23 [ print_char_cursor#12 print_sbyte::b#0 ] ) always clobbers reg byte a Statement [84] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:8::memset:80 [ memset::dst#2 ] ) always clobbers reg byte a @@ -2513,8 +2503,8 @@ Statement [100] (byte~) mulf_init::$10 ← (byte) 1 - (byte) mulf_init::i#2 [ mu Statement [101] *((const byte[$200]) mulf_sqr2+(word) $100 + (byte~) mulf_init::$10) ← (byte) mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 ] ( main:2::mulf_init:5 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 ] ) always clobbers reg byte a Statement [102] (signed word) mulf_init::sqr#1 ← (signed word) mulf_init::sqr#2 + (signed word) mulf_init::add#2 [ mulf_init::i#2 mulf_init::add#2 mulf_init::sqr#1 ] ( main:2::mulf_init:5 [ mulf_init::i#2 mulf_init::add#2 mulf_init::sqr#1 ] ) always clobbers reg byte a Statement [103] (signed word) mulf_init::add#1 ← (signed word) mulf_init::add#2 + (signed byte) 2 [ mulf_init::i#2 mulf_init::sqr#1 mulf_init::add#1 ] ( main:2::mulf_init:5 [ mulf_init::i#2 mulf_init::sqr#1 mulf_init::add#1 ] ) always clobbers reg byte a -Statement [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [41] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#11 + (byte) $28 [ print_line_cursor#1 print_char_cursor#2 ] ( main:2::do_perspective:10::print_ln:37 [ print_line_cursor#1 print_char_cursor#2 ] ) always clobbers reg byte a Statement [42] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#2) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#2 ] ( main:2::do_perspective:10::print_ln:37 [ print_line_cursor#1 print_char_cursor#2 ] ) always clobbers reg byte a Statement [46] if((byte) 0!=*((byte*) print_str::str#7)) goto print_str::@2 [ print_char_cursor#2 print_str::str#7 ] ( main:2::do_perspective:10::print_str:13 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:17 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:21 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:25 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:31 [ print_char_cursor#2 print_str::str#7 ] main:2::do_perspective:10::print_str:35 [ print_char_cursor#2 print_str::str#7 ] ) always clobbers reg byte a reg byte y @@ -2522,9 +2512,9 @@ Statement [48] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#7) [ Statement [52] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte) 4 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] ( main:2::do_perspective:10::print_byte:29 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] main:2::do_perspective:10::print_byte:33 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74 [ print_byte::b#3 print_char_cursor#69 print_byte::$0 ] ) always clobbers reg byte a Statement [55] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte) $f [ print_char_cursor#12 print_byte::$2 ] ( main:2::do_perspective:10::print_byte:29 [ print_char_cursor#12 print_byte::$2 ] main:2::do_perspective:10::print_byte:33 [ print_char_cursor#12 print_byte::$2 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74 [ print_char_cursor#12 print_byte::$2 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74 [ print_char_cursor#12 print_byte::$2 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74 [ print_char_cursor#12 print_byte::$2 ] ) always clobbers reg byte a Statement [60] *((byte*) print_char_cursor#44) ← (byte) print_char::ch#4 [ print_char_cursor#44 ] ( main:2::do_perspective:10::print_byte:29::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_byte:33::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74::print_char:54 [ print_byte::b#3 print_char_cursor#44 ] main:2::do_perspective:10::print_byte:29::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_byte:33::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_byte:74::print_char:57 [ print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_char:71 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:15::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:19::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] main:2::do_perspective:10::print_sbyte:23::print_char:77 [ print_sbyte::b#4 print_char_cursor#44 ] ) always clobbers reg byte y -Statement [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a -Statement [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a -Statement [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a +Statement [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 [ ] ( main:2::do_perspective:10::perspective:27 [ print_char_cursor#2 ] ) always clobbers reg byte a Statement asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } always clobbers reg byte a reg byte y Statement [78] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#4 [ print_char_cursor#12 print_sbyte::b#0 ] ( main:2::do_perspective:10::print_sbyte:15 [ print_char_cursor#12 print_sbyte::b#0 ] main:2::do_perspective:10::print_sbyte:19 [ print_char_cursor#12 print_sbyte::b#0 ] main:2::do_perspective:10::print_sbyte:23 [ print_char_cursor#12 print_sbyte::b#0 ] ) always clobbers reg byte a Statement [84] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:8::memset:80 [ memset::dst#2 ] ) always clobbers reg byte a @@ -2644,12 +2634,12 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 lda #mulf_sqr1 sta psp1+1 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -2780,7 +2770,7 @@ do_perspective: { jmp b8 // do_perspective::@8 b8: - // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr#0) -- vbuxx=_deref_pbuc1 + // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr) -- vbuxx=_deref_pbuc1 ldx xr // [29] call print_byte // [51] phi from do_perspective::@8 to print_byte [phi:do_perspective::@8->print_byte] @@ -2806,7 +2796,7 @@ do_perspective: { jmp b10 // do_perspective::@10 b10: - // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr#0) -- vbuxx=_deref_pbuc1 + // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr) -- vbuxx=_deref_pbuc1 ldx yr // [33] call print_byte // [51] phi from do_perspective::@10 to print_byte [phi:do_perspective::@10->print_byte] @@ -2995,13 +2985,13 @@ print_char: { // Apply perspective to a 3d-point. Result is returned in (*xr,*yr) // Implemented in assembler to utilize seriously fast multiplication perspective: { - // [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 + // [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.x sta xr - // [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 + // [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.y sta yr - // [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 + // [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.z sta zr // asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } @@ -3562,16 +3552,11 @@ FINAL SYMBOL TABLE (byte*) print_str::str#0 str zp ZP_WORD:2 22.0 (byte*) print_str::str#7 str zp ZP_WORD:2 11.5 (byte*) print_str::str#9 str zp ZP_WORD:2 2.0 -(word*) psp1 -(const word*) psp1#0 psp1 = (word*) 243 -(word*) psp2 -(const word*) psp2#0 psp2 = (word*) 245 -(signed byte*) xr -(const signed byte*) xr#0 xr = (signed byte*) 240 -(signed byte*) yr -(const signed byte*) yr#0 yr = (signed byte*) 241 -(signed byte*) zr -(const signed byte*) zr#0 zr = (signed byte*) 242 +(const word*) psp1 psp1 = (word*) 243 +(const word*) psp2 psp2 = (word*) 245 +(const signed byte*) xr xr = (signed byte*) 240 +(const signed byte*) yr yr = (signed byte*) 241 +(const signed byte*) zr zr = (signed byte*) 242 reg byte x [ print_byte::b#3 print_byte::b#5 print_byte::b#6 print_byte::b#0 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] @@ -3626,13 +3611,13 @@ main: { jsr mulf_init // main::@1 // *psp1 = (word)mulf_sqr1 - // [6] *((const word*) psp1#0) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 + // [6] *((const word*) psp1) ← (word)(const byte[$200]) mulf_sqr1 -- _deref_pwuc1=vwuc2 lda #mulf_sqr1 sta psp1+1 // *psp2 = (word)mulf_sqr2 - // [7] *((const word*) psp2#0) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 + // [7] *((const word*) psp2) ← (word)(const byte[$200]) mulf_sqr2 -- _deref_pwuc1=vwuc2 lda #mulf_sqr2 @@ -3737,7 +3722,7 @@ do_perspective: { // [27] call perspective jsr perspective // do_perspective::@8 - // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr#0) -- vbuxx=_deref_pbuc1 + // [28] (byte~) print_byte::b#6 ← (byte)*((const signed byte*) xr) -- vbuxx=_deref_pbuc1 ldx xr // print_byte((byte)*xr) // [29] call print_byte @@ -3758,7 +3743,7 @@ do_perspective: { sta.z print_str.str+1 jsr print_str // do_perspective::@10 - // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr#0) -- vbuxx=_deref_pbuc1 + // [32] (byte~) print_byte::b#5 ← (byte)*((const signed byte*) yr) -- vbuxx=_deref_pbuc1 ldx yr // print_byte((byte)*yr) // [33] call print_byte @@ -3936,15 +3921,15 @@ print_char: { // Implemented in assembler to utilize seriously fast multiplication perspective: { // *xr = x - // [63] *((const signed byte*) xr#0) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 + // [63] *((const signed byte*) xr) ← (const signed byte) do_perspective::x#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.x sta xr // *yr = y - // [64] *((const signed byte*) yr#0) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 + // [64] *((const signed byte*) yr) ← (const signed byte) do_perspective::y#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.y sta yr // *zr = z - // [65] *((const signed byte*) zr#0) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 + // [65] *((const signed byte*) zr) ← (const signed byte) do_perspective::z#0 -- _deref_pbsc1=vbsc2 lda #do_perspective.z sta zr // asm diff --git a/src/test/ref/examples/3d/perspective.sym b/src/test/ref/examples/3d/perspective.sym index fb628fc8e..dd758c7ff 100644 --- a/src/test/ref/examples/3d/perspective.sym +++ b/src/test/ref/examples/3d/perspective.sym @@ -136,16 +136,11 @@ (byte*) print_str::str#0 str zp ZP_WORD:2 22.0 (byte*) print_str::str#7 str zp ZP_WORD:2 11.5 (byte*) print_str::str#9 str zp ZP_WORD:2 2.0 -(word*) psp1 -(const word*) psp1#0 psp1 = (word*) 243 -(word*) psp2 -(const word*) psp2#0 psp2 = (word*) 245 -(signed byte*) xr -(const signed byte*) xr#0 xr = (signed byte*) 240 -(signed byte*) yr -(const signed byte*) yr#0 yr = (signed byte*) 241 -(signed byte*) zr -(const signed byte*) zr#0 zr = (signed byte*) 242 +(const word*) psp1 psp1 = (word*) 243 +(const word*) psp2 psp2 = (word*) 245 +(const signed byte*) xr xr = (signed byte*) 240 +(const signed byte*) yr yr = (signed byte*) 241 +(const signed byte*) zr zr = (signed byte*) 242 reg byte x [ print_byte::b#3 print_byte::b#5 print_byte::b#6 print_byte::b#0 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] diff --git a/src/test/ref/examples/bresenham/bitmap-bresenham.cfg b/src/test/ref/examples/bresenham/bitmap-bresenham.cfg index 12870a92b..a0432a180 100644 --- a/src/test/ref/examples/bresenham/bitmap-bresenham.cfg +++ b/src/test/ref/examples/bresenham/bitmap-bresenham.cfg @@ -35,7 +35,7 @@ lines: scope:[lines] from main::@1 to:lines::@1 lines::@1: scope:[lines] from lines lines::@3 [16] (byte) lines::l#2 ← phi( lines/(byte) 0 lines::@3/(byte) lines::l#1 ) - [17] if((byte) lines::l#2<(const byte) lines_cnt#0) goto lines::@2 + [17] if((byte) lines::l#2<(const byte) lines_cnt) goto lines::@2 to:lines::@return lines::@return: scope:[lines] from lines::@1 [18] return diff --git a/src/test/ref/examples/bresenham/bitmap-bresenham.log b/src/test/ref/examples/bresenham/bitmap-bresenham.log index a1a01f9f8..32d8cdf00 100644 --- a/src/test/ref/examples/bresenham/bitmap-bresenham.log +++ b/src/test/ref/examples/bresenham/bitmap-bresenham.log @@ -624,7 +624,7 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 (byte*) BITMAP ← ((byte*)) (number) $2000 (byte[]) lines_x ← { (number) $3c, (number) $50, (number) $6e, (number) $50, (number) $3c, (number) $28, (number) $a, (number) $28, (number) $3c } (byte[]) lines_y ← { (number) $a, (number) $28, (number) $3c, (number) $50, (number) $6e, (number) $50, (number) $3c, (number) $28, (number) $a } - (byte) lines_cnt#0 ← (number) 8 + (byte) lines_cnt ← (number) 8 to:@15 (void()) main() @@ -671,7 +671,7 @@ lines: scope:[lines] from main::@1 to:lines::@1 lines::@1: scope:[lines] from lines lines::@7 (byte) lines::l#2 ← phi( lines/(byte) lines::l#0 lines::@7/(byte) lines::l#1 ) - (bool~) lines::$0 ← (byte) lines::l#2 < (byte) lines_cnt#0 + (bool~) lines::$0 ← (byte) lines::l#2 < (byte) lines_cnt if((bool~) lines::$0) goto lines::@2 to:lines::@return lines::@2: scope:[lines] from lines::@1 @@ -1244,7 +1244,6 @@ SYMBOL TABLE SSA (byte) lines::l#3 (byte) lines::l#4 (byte) lines_cnt -(byte) lines_cnt#0 (byte[]) lines_x (byte[]) lines_y (void()) main() @@ -1301,7 +1300,7 @@ Adding number conversion cast (unumber) bitmap_line_ydxi::$6 in (number~) bitmap Adding number conversion cast (unumber) 1 in (byte~) bitmap_line_ydxd::$0 ← (byte) bitmap_line_ydxd::xd#2 >> (number) 1 Adding number conversion cast (unumber) 1 in (number~) bitmap_line_ydxd::$6 ← (byte) bitmap_line_ydxd::y1#2 + (number) 1 Adding number conversion cast (unumber) bitmap_line_ydxd::$6 in (number~) bitmap_line_ydxd::$6 ← (byte) bitmap_line_ydxd::y1#2 + (unumber)(number) 1 -Adding number conversion cast (unumber) 8 in (byte) lines_cnt#0 ← (number) 8 +Adding number conversion cast (unumber) 8 in (byte) lines_cnt ← (number) 8 Adding number conversion cast (unumber) 0 in *((byte*) BORDERCOL) ← (number) 0 Adding number conversion cast (unumber) 0 in *((byte*) BGCOL) ← (number) 0 Adding number conversion cast (unumber) 3 in (number~) main::$2 ← (byte~) main::$1 | (number) 3 @@ -1340,7 +1339,7 @@ Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0 Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0 Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 -Inlining cast (byte) lines_cnt#0 ← (unumber)(number) 8 +Inlining cast (byte) lines_cnt ← (unumber)(number) 8 Inlining cast *((byte*) BORDERCOL) ← (unumber)(number) 0 Inlining cast *((byte*) BGCOL) ← (unumber)(number) 0 Inlining cast (word~) main::$3 ← (word)(byte*) SCREEN @@ -1604,7 +1603,7 @@ Simple Condition (bool~) bitmap_line_ydxi::$4 [231] if((byte) bitmap_line_ydxi:: Simple Condition (bool~) bitmap_line_ydxi::$7 [235] if((byte) bitmap_line_ydxi::y#2!=(byte~) bitmap_line_ydxi::$6) goto bitmap_line_ydxi::@1 Simple Condition (bool~) bitmap_line_ydxd::$4 [255] if((byte) bitmap_line_ydxd::yd#5>=(byte) bitmap_line_ydxd::e#1) goto bitmap_line_ydxd::@2 Simple Condition (bool~) bitmap_line_ydxd::$7 [259] if((byte) bitmap_line_ydxd::y#3!=(byte~) bitmap_line_ydxd::$6) goto bitmap_line_ydxd::@1 -Simple Condition (bool~) lines::$0 [295] if((byte) lines::l#2<(byte) lines_cnt#0) goto lines::@2 +Simple Condition (bool~) lines::$0 [295] if((byte) lines::l#2<(byte) lines_cnt) goto lines::@2 Simple Condition (bool~) init_screen::$1 [311] if((byte*) init_screen::c#2!=(byte*~) init_screen::$0) goto init_screen::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [7] (byte[$100]) bitmap_plot_xlo ← { fill( $100, 0) } @@ -1641,7 +1640,7 @@ Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte*) BITMAP = (byte*) 8192 Constant (const byte[]) lines_x = { $3c, $50, $6e, $50, $3c, $28, $a, $28, $3c } Constant (const byte[]) lines_y = { $a, $28, $3c, $50, $6e, $50, $3c, $28, $a } -Constant (const byte) lines_cnt#0 = 8 +Constant (const byte) lines_cnt = 8 Constant (const byte) lines::l#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) bitmap_init::bitmap#0 = BITMAP @@ -2016,7 +2015,7 @@ lines: scope:[lines] from main::@1 to:lines::@1 lines::@1: scope:[lines] from lines lines::@3 [16] (byte) lines::l#2 ← phi( lines/(byte) 0 lines::@3/(byte) lines::l#1 ) - [17] if((byte) lines::l#2<(const byte) lines_cnt#0) goto lines::@2 + [17] if((byte) lines::l#2<(const byte) lines_cnt) goto lines::@2 to:lines::@return lines::@return: scope:[lines] from lines::@1 [18] return @@ -2585,7 +2584,6 @@ VARIABLE REGISTER WEIGHTS (byte) lines::l (byte) lines::l#1 202.0 (byte) lines::l#2 101.0 -(byte) lines_cnt (void()) main() Initial phi equivalence classes @@ -2857,7 +2855,7 @@ lines: { jmp b1 // lines::@1 b1: - // [17] if((byte) lines::l#2<(const byte) lines_cnt#0) goto lines::@2 -- vbuz1_lt_vbuc1_then_la1 + // [17] if((byte) lines::l#2<(const byte) lines_cnt) goto lines::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b2 @@ -4288,7 +4286,7 @@ lines: { jmp b1 // lines::@1 b1: - // [17] if((byte) lines::l#2<(const byte) lines_cnt#0) goto lines::@2 -- vbuz1_lt_vbuc1_then_la1 + // [17] if((byte) lines::l#2<(const byte) lines_cnt) goto lines::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z l cmp #lines_cnt bcc b2 @@ -5632,8 +5630,7 @@ FINAL SYMBOL TABLE (byte) lines::l (byte) lines::l#1 l zp ZP_BYTE:6 202.0 (byte) lines::l#2 l zp ZP_BYTE:6 101.0 -(byte) lines_cnt -(const byte) lines_cnt#0 lines_cnt = (byte) 8 +(const byte) lines_cnt lines_cnt = (byte) 8 (const byte[]) lines_x lines_x = { (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a, (byte) $28, (byte) $3c } (const byte[]) lines_y lines_y = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28, (byte) $a } (void()) main() @@ -5747,7 +5744,7 @@ lines: { // lines::@1 b1: // for(byte l=0; l> (number) 3 -Adding number conversion cast (unumber) $3e8 in (byte*~) main::$11 ← (byte*) SCREEN#0 + (number) $3e8 -Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) 1 -Adding number conversion cast (unumber) 1 in (byte*~) main::$2 ← (byte*) SCREEN#0 + (number) 1 +Adding number conversion cast (unumber) $3e8 in (byte*~) main::$11 ← (byte*) SCREEN + (number) $3e8 +Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) SCREEN + (number) 1 +Adding number conversion cast (unumber) 1 in (byte*~) main::$2 ← (byte*) SCREEN + (number) 1 Adding number conversion cast (unumber) $a in (byte*~) main::$3 ← (byte*~) main::$2 + (number) $a -Adding number conversion cast (unumber) 1 in (byte*~) main::$5 ← (byte*) SCREEN#0 + (number) 1 +Adding number conversion cast (unumber) 1 in (byte*~) main::$5 ← (byte*) SCREEN + (number) 1 Adding number conversion cast (unumber) $14 in (byte*~) main::$6 ← (byte*~) main::$5 + (number) $14 -Adding number conversion cast (unumber) 1 in (byte*~) main::$8 ← (byte*) SCREEN#0 + (number) 1 +Adding number conversion cast (unumber) 1 in (byte*~) main::$8 ← (byte*) SCREEN + (number) 1 Adding number conversion cast (unumber) $1e in (byte*~) main::$9 ← (byte*~) main::$8 + (number) $1e Adding number conversion cast (unumber) $20 in (byte) plot_chargen::ch#0 ← (number) $20 Adding number conversion cast (unumber) 0 in (byte) plot_chargen::shift#0 ← (number) 0 @@ -1090,7 +1089,7 @@ Adding number conversion cast (unumber) 8 in (number~) plot_chargen::$1 ← (wor Adding number conversion cast (unumber) plot_chargen::$1 in (number~) plot_chargen::$1 ← (word~) plot_chargen::$0 * (unumber)(number) 8 Adding number conversion cast (unumber) 0 in (bool~) plot_chargen::$3 ← (byte) plot_chargen::shift#2 != (number) 0 Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT) ← (number) $32 -Adding number conversion cast (unumber) $28 in (byte*~) plot_chargen::$5 ← (byte*) SCREEN#0 + (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) plot_chargen::$5 ← (byte*) SCREEN + (number) $28 Adding number conversion cast (unumber) 1 in (byte*~) plot_chargen::$6 ← (byte*~) plot_chargen::$5 + (number) 1 Adding number conversion cast (unumber) $a in (byte) mul8u::b#0 ← (number) $a Adding number conversion cast (unumber) $800 in (byte*~) plot_chargen::$9 ← (byte*) plot_chargen::chargen#2 + (number) $800 @@ -1166,7 +1165,7 @@ Inlining cast (byte) KEY_ARROW_LEFT ← (unumber)(number) $39 Inlining cast (byte) KEY_2 ← (unumber)(number) $3b Inlining cast (byte) KEY_SPACE ← (unumber)(number) $3c Inlining cast (byte) KEY_Q ← (unumber)(number) $3e -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) plot_chargen::ch#0 ← (unumber)(number) $20 Inlining cast (byte) plot_chargen::shift#0 ← (unumber)(number) 0 Inlining cast (byte) main::cur_pos#0 ← (unumber)(number) 0 @@ -1606,7 +1605,7 @@ Constant (const byte) KEY_SPACE = $3c Constant (const byte) KEY_Q = $3e Constant (const byte[8]) keyboard_matrix_row_bitmask = { $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f } Constant (const byte[8]) keyboard_matrix_col_bitmask = { 1, 2, 4, 8, $10, $20, $40, $80 } -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte*) print_str_at::str#0 = main::str Constant (const byte*) print_str_at::str#1 = main::str1 Constant (const byte*) print_str_at::str#2 = main::str2 @@ -1630,7 +1629,7 @@ Constant (const byte) plot_chargen::x#0 = 0 Constant (const byte) plot_chargen::c#0 = '.' Constant (const byte) plot_chargen::c#1 = '*' Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::sc#0 = SCREEN#0 +Constant (const byte*) main::sc#0 = SCREEN Constant (const byte) keyboard_key_pressed::key#0 = KEY_F1 Constant (const byte) keyboard_key_pressed::key#1 = KEY_F3 Constant (const byte) keyboard_key_pressed::key#2 = KEY_F5 @@ -1666,22 +1665,22 @@ Finalized unsigned number type (byte) $40 Finalized unsigned number type (byte) 8 Finalized unsigned number type (byte) 8 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [25] (byte*~) main::$11 ← (const byte*) SCREEN#0 + (word) $3e8 -Constant right-side identified [29] (byte*) print_str_at::at#0 ← (const byte*) SCREEN#0 + (byte) 1 -Constant right-side identified [31] (byte*~) main::$2 ← (const byte*) SCREEN#0 + (byte) 1 -Constant right-side identified [34] (byte*~) main::$5 ← (const byte*) SCREEN#0 + (byte) 1 -Constant right-side identified [37] (byte*~) main::$8 ← (const byte*) SCREEN#0 + (byte) 1 -Constant right-side identified [104] (byte*~) plot_chargen::$5 ← (const byte*) SCREEN#0 + (byte) $28 +Constant right-side identified [25] (byte*~) main::$11 ← (const byte*) SCREEN + (word) $3e8 +Constant right-side identified [29] (byte*) print_str_at::at#0 ← (const byte*) SCREEN + (byte) 1 +Constant right-side identified [31] (byte*~) main::$2 ← (const byte*) SCREEN + (byte) 1 +Constant right-side identified [34] (byte*~) main::$5 ← (const byte*) SCREEN + (byte) 1 +Constant right-side identified [37] (byte*~) main::$8 ← (const byte*) SCREEN + (byte) 1 +Constant right-side identified [104] (byte*~) plot_chargen::$5 ← (const byte*) SCREEN + (byte) $28 Successful SSA optimization Pass2ConstantRValueConsolidation Identified constant from value list (byte[]) { (const byte) KEY_AT, (const byte) KEY_A, (const byte) KEY_B, (const byte) KEY_C, (const byte) KEY_D, (const byte) KEY_E, (const byte) KEY_F, (const byte) KEY_G, (const byte) KEY_H, (const byte) KEY_I, (const byte) KEY_J, (const byte) KEY_K, (const byte) KEY_L, (const byte) KEY_M, (const byte) KEY_N, (const byte) KEY_O, (const byte) KEY_P, (const byte) KEY_Q, (const byte) KEY_R, (const byte) KEY_S, (const byte) KEY_T, (const byte) KEY_U, (const byte) KEY_V, (const byte) KEY_W, (const byte) KEY_X, (const byte) KEY_Y, (const byte) KEY_Z, (byte) $3f, (const byte) KEY_POUND, (byte) $3f, (const byte) KEY_ARROW_UP, (const byte) KEY_ARROW_LEFT, (const byte) KEY_SPACE, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (byte) $3f, (const byte) KEY_ASTERISK, (const byte) KEY_PLUS, (const byte) KEY_COMMA, (const byte) KEY_MINUS, (const byte) KEY_DOT, (const byte) KEY_SLASH, (const byte) KEY_0, (const byte) KEY_1, (const byte) KEY_2, (const byte) KEY_3, (const byte) KEY_4, (const byte) KEY_5, (const byte) KEY_6, (const byte) KEY_7, (const byte) KEY_8, (const byte) KEY_9, (const byte) KEY_COLON, (const byte) KEY_SEMICOLON, (byte) $3f, (const byte) KEY_EQUALS, (byte) $3f, (byte) $3f } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte[]) keyboard_char_keycodes = { KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f } -Constant (const byte*) main::$11 = SCREEN#0+$3e8 -Constant (const byte*) print_str_at::at#0 = SCREEN#0+1 -Constant (const byte*) main::$2 = SCREEN#0+1 -Constant (const byte*) main::$5 = SCREEN#0+1 -Constant (const byte*) main::$8 = SCREEN#0+1 -Constant (const byte*) plot_chargen::$5 = SCREEN#0+$28 +Constant (const byte*) main::$11 = SCREEN+$3e8 +Constant (const byte*) print_str_at::at#0 = SCREEN+1 +Constant (const byte*) main::$2 = SCREEN+1 +Constant (const byte*) main::$5 = SCREEN+1 +Constant (const byte*) main::$8 = SCREEN+1 +Constant (const byte*) plot_chargen::$5 = SCREEN+$28 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [28] (byte*) print_str_at::at#1 ← (const byte*) main::$2 + (byte) $a Constant right-side identified [30] (byte*) print_str_at::at#2 ← (const byte*) main::$5 + (byte) $14 @@ -1730,19 +1729,19 @@ Inlining constant with var siblings (const byte) plot_chargen::c#1 Constant inlined print_str_at::str#1 = (const string) main::str1 Constant inlined main::shift#1 = (byte) 1 Constant inlined print_str_at::str#2 = (const string) main::str2 -Constant inlined print_str_at::at#3 = (const byte*) SCREEN#0+(byte) 1+(byte) $1e +Constant inlined print_str_at::at#3 = (const byte*) SCREEN+(byte) 1+(byte) $1e Constant inlined print_str_at::str#3 = (const string) main::str3 -Constant inlined print_str_at::at#2 = (const byte*) SCREEN#0+(byte) 1+(byte) $14 +Constant inlined print_str_at::at#2 = (const byte*) SCREEN+(byte) 1+(byte) $14 Constant inlined plot_chargen::c#0 = (byte) '.' -Constant inlined print_str_at::at#1 = (const byte*) SCREEN#0+(byte) 1+(byte) $a +Constant inlined print_str_at::at#1 = (const byte*) SCREEN+(byte) 1+(byte) $a Constant inlined plot_chargen::c#1 = (byte) '*' -Constant inlined print_str_at::at#0 = (const byte*) SCREEN#0+(byte) 1 +Constant inlined print_str_at::at#0 = (const byte*) SCREEN+(byte) 1 Constant inlined print_str_at::str#0 = (const string) main::str -Constant inlined main::$11 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined main::$11 = (const byte*) SCREEN+(word) $3e8 Constant inlined main::shift#2 = (byte) 0 Constant inlined main::i#0 = (byte) 0 -Constant inlined plot_chargen::$6 = (const byte*) SCREEN#0+(byte) $28+(byte) 1 -Constant inlined plot_chargen::$5 = (const byte*) SCREEN#0+(byte) $28 +Constant inlined plot_chargen::$6 = (const byte*) SCREEN+(byte) $28+(byte) 1 +Constant inlined plot_chargen::$5 = (const byte*) SCREEN+(byte) $28 Constant inlined plot_chargen::shift#0 = (byte) 0 Constant inlined main::ch#0 = (byte) 0 Constant inlined keyboard_key_pressed::key#0 = (const byte) KEY_F1 @@ -1751,17 +1750,17 @@ Constant inlined keyboard_key_pressed::key#1 = (const byte) KEY_F3 Constant inlined keyboard_key_pressed::key#4 = (const byte) KEY_LSHIFT Constant inlined keyboard_key_pressed::key#2 = (const byte) KEY_F5 Constant inlined keyboard_key_pressed::key#3 = (const byte) KEY_F7 -Constant inlined main::sc#0 = (const byte*) SCREEN#0 +Constant inlined main::sc#0 = (const byte*) SCREEN Constant inlined main::cur_pos#3 = (byte) 2 Constant inlined mul8u::res#0 = (byte) 0 Constant inlined main::cur_pos#4 = (byte) 3 Constant inlined main::cur_pos#1 = (byte) 0 -Constant inlined main::$2 = (const byte*) SCREEN#0+(byte) 1 +Constant inlined main::$2 = (const byte*) SCREEN+(byte) 1 Constant inlined main::cur_pos#2 = (byte) 1 Constant inlined main::cur_pos#0 = (byte) 0 -Constant inlined main::$5 = (const byte*) SCREEN#0+(byte) 1 +Constant inlined main::$5 = (const byte*) SCREEN+(byte) 1 Constant inlined plot_chargen::y#0 = (byte) 0 -Constant inlined main::$8 = (const byte*) SCREEN#0+(byte) 1 +Constant inlined main::$8 = (const byte*) SCREEN+(byte) 1 Constant inlined main::pressed#0 = (byte) 0 Constant inlined plot_chargen::x#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining @@ -1922,8 +1921,8 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte*) main::sc#2 ← phi( main/(const byte*) SCREEN#0 main::@2/(byte*) main::sc#1 ) - [6] if((byte*) main::sc#2<(const byte*) SCREEN#0+(word) $3e8) goto main::@2 + [5] (byte*) main::sc#2 ← phi( main/(const byte*) SCREEN main::@2/(byte*) main::sc#1 ) + [6] if((byte*) main::sc#2<(const byte*) SCREEN+(word) $3e8) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 [7] phi() @@ -2073,7 +2072,7 @@ plot_chargen::@1: scope:[plot_chargen] from plot_chargen plot_chargen::@2 to:plot_chargen::@9 plot_chargen::@9: scope:[plot_chargen] from plot_chargen::@1 [83] (word~) plot_chargen::$7 ← (word) mul8u::return#2 - [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN#0+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 + [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 to:plot_chargen::@3 plot_chargen::@3: scope:[plot_chargen] from plot_chargen::@7 plot_chargen::@9 [85] (byte*) plot_chargen::sc#7 ← phi( plot_chargen::@7/(byte*) plot_chargen::sc#2 plot_chargen::@9/(byte*) plot_chargen::sc#0 ) @@ -2173,7 +2172,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k (void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at) print_str_at: scope:[print_str_at] from main::@17 main::@18 main::@19 main::@3 - [127] (byte*) print_str_at::at#7 ← phi( main::@17/(const byte*) SCREEN#0+(byte) 1+(byte) $a main::@3/(const byte*) SCREEN#0+(byte) 1 main::@18/(const byte*) SCREEN#0+(byte) 1+(byte) $14 main::@19/(const byte*) SCREEN#0+(byte) 1+(byte) $1e ) + [127] (byte*) print_str_at::at#7 ← phi( main::@17/(const byte*) SCREEN+(byte) 1+(byte) $a main::@3/(const byte*) SCREEN+(byte) 1 main::@18/(const byte*) SCREEN+(byte) 1+(byte) $14 main::@19/(const byte*) SCREEN+(byte) 1+(byte) $1e ) [127] (byte*) print_str_at::str#7 ← phi( main::@17/(const string) main::str1 main::@3/(const string) main::str main::@18/(const string) main::str2 main::@19/(const string) main::str3 ) to:print_str_at::@1 print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2 @@ -2192,7 +2191,6 @@ print_str_at::@2: scope:[print_str_at] from print_str_at::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (byte()) keyboard_get_keycode((byte) keyboard_get_keycode::ch) (byte) keyboard_get_keycode::ch (byte) keyboard_get_keycode::ch#0 103.0 @@ -2569,7 +2567,7 @@ main: { .label shift = 6 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2578,7 +2576,7 @@ main: { // Clear screen // main::@1 b1: - // [6] if((byte*) main::sc#2<(const byte*) SCREEN#0+(word) $3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 + // [6] if((byte*) main::sc#2<(const byte*) SCREEN+(word) $3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z sc+1 cmp #>SCREEN+$3e8 bcc b2 @@ -2595,7 +2593,7 @@ main: { // [8] call print_str_at // [127] phi from main::@3 to print_str_at [phi:main::@3->print_str_at] print_str_at_from_b3: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1 @@ -2614,7 +2612,7 @@ main: { // [10] call print_str_at // [127] phi from main::@17 to print_str_at [phi:main::@17->print_str_at] print_str_at_from_b17: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$a @@ -2633,7 +2631,7 @@ main: { // [12] call print_str_at // [127] phi from main::@18 to print_str_at [phi:main::@18->print_str_at] print_str_at_from_b18: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$14 @@ -2652,7 +2650,7 @@ main: { // [14] call print_str_at // [127] phi from main::@19 to print_str_at [phi:main::@19->print_str_at] print_str_at_from_b19: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$1e @@ -3104,7 +3102,7 @@ plot_chargen: { sta.z _7 lda.z mul8u.return+1 sta.z _7+1 - // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN#0+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz2 + // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz2 lda.z _7 clc adc #main::@1] b1_from_main: - // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -3741,7 +3739,7 @@ main: { // Clear screen // main::@1 b1: - // [6] if((byte*) main::sc#2<(const byte*) SCREEN#0+(word) $3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 + // [6] if((byte*) main::sc#2<(const byte*) SCREEN+(word) $3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z sc+1 cmp #>SCREEN+$3e8 bcc b2 @@ -3758,7 +3756,7 @@ main: { // [8] call print_str_at // [127] phi from main::@3 to print_str_at [phi:main::@3->print_str_at] print_str_at_from_b3: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1 @@ -3777,7 +3775,7 @@ main: { // [10] call print_str_at // [127] phi from main::@17 to print_str_at [phi:main::@17->print_str_at] print_str_at_from_b17: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$a @@ -3796,7 +3794,7 @@ main: { // [12] call print_str_at // [127] phi from main::@18 to print_str_at [phi:main::@18->print_str_at] print_str_at_from_b18: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$14 @@ -3815,7 +3813,7 @@ main: { // [14] call print_str_at // [127] phi from main::@19 to print_str_at [phi:main::@19->print_str_at] print_str_at_from_b19: - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$1e @@ -4198,7 +4196,7 @@ plot_chargen: { // plot_chargen::@9 b9: // [83] (word~) plot_chargen::$7 ← (word) mul8u::return#2 - // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN#0+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz1 + // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z sc adc #main::@1] - // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::sc#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -5070,7 +5067,7 @@ main: { // main::@1 b1: // for( byte* sc=SCREEN;scSCREEN+$3e8 bcs !b2+ @@ -5088,7 +5085,7 @@ main: { // print_str_at("f1", SCREEN+1) // [8] call print_str_at // [127] phi from main::@3 to print_str_at [phi:main::@3->print_str_at] - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1 @@ -5104,7 +5101,7 @@ main: { // print_str_at("f3", SCREEN+1+10) // [10] call print_str_at // [127] phi from main::@17 to print_str_at [phi:main::@17->print_str_at] - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$a @@ -5120,7 +5117,7 @@ main: { // print_str_at("f5", SCREEN+1+20) // [12] call print_str_at // [127] phi from main::@18 to print_str_at [phi:main::@18->print_str_at] - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$14 @@ -5136,7 +5133,7 @@ main: { // print_str_at("f7", SCREEN+1+30) // [14] call print_str_at // [127] phi from main::@19 to print_str_at [phi:main::@19->print_str_at] - // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN#0+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 + // [127] phi (byte*) print_str_at::at#7 = (const byte*) SCREEN+(byte) 1+(byte) $1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 lda #SCREEN+1+$1e @@ -5473,7 +5470,7 @@ plot_chargen: { // plot_chargen::@9 // [83] (word~) plot_chargen::$7 ← (word) mul8u::return#2 // sc = SCREEN+40+1+mul8u(pos, 10) - // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN#0+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz1 + // [84] (byte*) plot_chargen::sc#0 ← (const byte*) SCREEN+(byte) $28+(byte) 1 + (word~) plot_chargen::$7 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z sc adc #159 && i<=351 ) { .byte round(((i-256)*(i-256))/256) } @@ -821,7 +817,7 @@ Resolved ranged next value [122] init_screen::l#1 ← ++ init_screen::l#2 to ++ Resolved ranged comparison value [124] if(init_screen::l#1!=rangelast(0,$27)) goto init_screen::@1 to (number) $28 Resolved ranged next value [133] init_screen::m#1 ← ++ init_screen::m#2 to ++ Resolved ranged comparison value [135] if(init_screen::m#1!=rangelast(0,$18)) goto init_screen::@3 to (number) $19 -Simplifying expression containing zero init_screen::COLS#3 in [128] *((byte*) init_screen::COLS#3 + (byte) 0) ← (const byte) init_screen::WHITE#0 +Simplifying expression containing zero init_screen::COLS#3 in [128] *((byte*) init_screen::COLS#3 + (byte) 0) ← (const byte) init_screen::WHITE Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused variable (void*) memset::return#2 and assignment [34] (void*) memset::return#2 ← (void*) memset::str#0 Successful SSA optimization PassNEliminateUnusedVars @@ -1106,10 +1102,10 @@ print_byte_at::@return: scope:[print_byte_at] from print_byte_at::@1 (signed byte()) fmul8((signed byte) fmul8::a , (signed byte) fmul8::b) fmul8: scope:[fmul8] from main::@3 - [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 - [59] *((const signed byte*) bp#0) ← (signed byte) fmul8::b#0 + [58] *((const signed byte*) ap) ← (signed byte) fmul8::a#0 + [59] *((const signed byte*) bp) ← (signed byte) fmul8::b#0 asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } - [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp#0) + [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp) to:fmul8::@return fmul8::@return: scope:[fmul8] from fmul8 [62] return @@ -1122,17 +1118,17 @@ init_screen: scope:[init_screen] from main to:init_screen::@1 init_screen::@1: scope:[init_screen] from init_screen init_screen::@1 [65] (byte) init_screen::l#2 ← phi( init_screen::@1/(byte) init_screen::l#1 init_screen/(byte) 0 ) - [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 + [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE [67] (byte) init_screen::l#1 ← ++ (byte) init_screen::l#2 [68] if((byte) init_screen::l#1!=(byte) $28) goto init_screen::@1 to:init_screen::@2 init_screen::@2: scope:[init_screen] from init_screen::@1 init_screen::@2 [69] (byte) init_screen::m#2 ← phi( init_screen::@1/(byte) 0 init_screen::@2/(byte) init_screen::m#1 ) [69] (byte*) init_screen::COLS#3 ← phi( init_screen::@1/(byte*) 55296 init_screen::@2/(byte*) init_screen::COLS#1 ) - [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 - [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 - [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 - [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 + [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE + [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE + [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE + [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE [74] (byte*) init_screen::COLS#1 ← (byte*) init_screen::COLS#3 + (byte) $28 [75] (byte) init_screen::m#1 ← ++ (byte) init_screen::m#2 [76] if((byte) init_screen::m#1!=(byte) $19) goto init_screen::@2 @@ -1168,9 +1164,6 @@ memset::@2: scope:[memset] from memset::@1 VARIABLE REGISTER WEIGHTS -(signed byte*) ap -(signed byte*) bp -(signed byte*) cp (signed byte()) fmul8((signed byte) fmul8::a , (signed byte) fmul8::b) (signed byte) fmul8::a (signed byte) fmul8::a#0 51.5 @@ -1183,7 +1176,6 @@ VARIABLE REGISTER WEIGHTS (byte*) init_screen::COLS (byte*) init_screen::COLS#1 7.333333333333333 (byte*) init_screen::COLS#3 13.2 -(byte) init_screen::WHITE (byte) init_screen::l (byte) init_screen::l#1 16.5 (byte) init_screen::l#2 16.5 @@ -1716,10 +1708,10 @@ fmul8: { .label b = $18 .label return = $19 .label return_1 = $20 - // [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsz1 + // [58] *((const signed byte*) ap) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsz1 lda.z a sta ap - // [59] *((const signed byte*) bp#0) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsz1 + // [59] *((const signed byte*) bp) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsz1 lda.z b sta bp // asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } @@ -1734,7 +1726,7 @@ fmul8: { A2: sbc mulf_sqr2,x sta cp - // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp#0) -- vbsz1=_deref_pbsc1 + // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp) -- vbsz1=_deref_pbsc1 lda cp sta.z return_1 jmp breturn @@ -1765,7 +1757,7 @@ init_screen: { jmp b1 // init_screen::@1 b1: - // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE -- pbuc1_derefidx_vbuz1=vbuc2 lda #WHITE ldy.z l sta $d800,y @@ -1793,19 +1785,19 @@ init_screen: { jmp b2 // init_screen::@2 b2: - // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 -- _deref_pbuz1=vbuc1 + // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE -- _deref_pbuz1=vbuc1 lda #WHITE ldy #0 sta (COLS),y - // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #1 sta (COLS),y - // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #2 sta (COLS),y - // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #3 sta (COLS),y @@ -1943,14 +1935,14 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:31 [ p Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x Removing always clobbered register reg byte x as potential for zp ZP_BYTE:7 [ main::i#2 main::i#1 ] Removing always clobbered register reg byte x as potential for zp ZP_BYTE:10 [ main::j#2 main::j#1 ] -Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a +Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ init_screen::l#2 init_screen::l#1 ] -Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:20 [ init_screen::m#2 init_screen::m#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:20 [ init_screen::m#2 init_screen::m#1 ] -Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y Statement [74] (byte*) init_screen::COLS#1 ← (byte*) init_screen::COLS#3 + (byte) $28 [ init_screen::m#2 init_screen::COLS#1 ] ( main:2::init_screen:5 [ init_screen::m#2 init_screen::COLS#1 ] ) always clobbers reg byte a Statement [83] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a Statement [85] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y @@ -1977,11 +1969,11 @@ Statement [51] (byte*) print_char_at::at#2 ← (byte*) print_byte_at::at#0 [ pri Statement [53] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#0 & (byte) $f [ print_byte_at::at#0 print_byte_at::$2 ] ( main:2::print_sbyte_at:9::print_byte_at:41 [ main::k#2 main::at#4 print_byte_at::at#0 print_byte_at::$2 ] main:2::print_sbyte_at:17::print_byte_at:41 [ main::i#2 main::at#2 print_byte_at::at#0 print_byte_at::$2 ] main:2::print_sbyte_at:28::print_byte_at:41 [ main::i#2 main::at#2 main::j#2 main::at#3 print_byte_at::at#0 print_byte_at::$2 ] ) always clobbers reg byte a Statement [54] (byte*) print_char_at::at#3 ← (byte*) print_byte_at::at#0 + (byte) 1 [ print_char_at::at#3 print_byte_at::$2 ] ( main:2::print_sbyte_at:9::print_byte_at:41 [ main::k#2 main::at#4 print_char_at::at#3 print_byte_at::$2 ] main:2::print_sbyte_at:17::print_byte_at:41 [ main::i#2 main::at#2 print_char_at::at#3 print_byte_at::$2 ] main:2::print_sbyte_at:28::print_byte_at:41 [ main::i#2 main::at#2 main::j#2 main::at#3 print_char_at::at#3 print_byte_at::$2 ] ) always clobbers reg byte a Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x -Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a -Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a +Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y Statement [74] (byte*) init_screen::COLS#1 ← (byte*) init_screen::COLS#3 + (byte) $28 [ init_screen::m#2 init_screen::COLS#1 ] ( main:2::init_screen:5 [ init_screen::m#2 init_screen::COLS#1 ] ) always clobbers reg byte a Statement [83] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a Statement [85] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y @@ -2007,11 +1999,11 @@ Statement [51] (byte*) print_char_at::at#2 ← (byte*) print_byte_at::at#0 [ pri Statement [53] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#0 & (byte) $f [ print_byte_at::at#0 print_byte_at::$2 ] ( main:2::print_sbyte_at:9::print_byte_at:41 [ main::k#2 main::at#4 print_byte_at::at#0 print_byte_at::$2 ] main:2::print_sbyte_at:17::print_byte_at:41 [ main::i#2 main::at#2 print_byte_at::at#0 print_byte_at::$2 ] main:2::print_sbyte_at:28::print_byte_at:41 [ main::i#2 main::at#2 main::j#2 main::at#3 print_byte_at::at#0 print_byte_at::$2 ] ) always clobbers reg byte a Statement [54] (byte*) print_char_at::at#3 ← (byte*) print_byte_at::at#0 + (byte) 1 [ print_char_at::at#3 print_byte_at::$2 ] ( main:2::print_sbyte_at:9::print_byte_at:41 [ main::k#2 main::at#4 print_char_at::at#3 print_byte_at::$2 ] main:2::print_sbyte_at:17::print_byte_at:41 [ main::i#2 main::at#2 print_char_at::at#3 print_byte_at::$2 ] main:2::print_sbyte_at:28::print_byte_at:41 [ main::i#2 main::at#2 main::j#2 main::at#3 print_char_at::at#3 print_byte_at::$2 ] ) always clobbers reg byte a Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x -Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a -Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y -Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE [ init_screen::l#2 ] ( main:2::init_screen:5 [ init_screen::l#2 ] ) always clobbers reg byte a +Statement [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y +Statement [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( main:2::init_screen:5 [ init_screen::COLS#3 init_screen::m#2 ] ) always clobbers reg byte a reg byte y Statement [74] (byte*) init_screen::COLS#1 ← (byte*) init_screen::COLS#3 + (byte) $28 [ init_screen::m#2 init_screen::COLS#1 ] ( main:2::init_screen:5 [ init_screen::m#2 init_screen::COLS#1 ] ) always clobbers reg byte a Statement [83] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a Statement [85] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::init_screen:5::print_cls:64::memset:79 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y @@ -2435,9 +2427,9 @@ print_byte_at: { // fmul8 // fmul8(signed byte register(A) a, signed byte register(X) b) fmul8: { - // [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa + // [58] *((const signed byte*) ap) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa sta ap - // [59] *((const signed byte*) bp#0) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsxx + // [59] *((const signed byte*) bp) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsxx txa sta bp // asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } @@ -2452,7 +2444,7 @@ fmul8: { A2: sbc mulf_sqr2,x sta cp - // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp#0) -- vbsaa=_deref_pbsc1 + // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp) -- vbsaa=_deref_pbsc1 lda cp jmp breturn // fmul8::@return @@ -2479,7 +2471,7 @@ init_screen: { jmp b1 // init_screen::@1 b1: - // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE -- pbuc1_derefidx_vbuxx=vbuc2 lda #WHITE sta $d800,x // [67] (byte) init_screen::l#1 ← ++ (byte) init_screen::l#2 -- vbuxx=_inc_vbuxx @@ -2504,19 +2496,19 @@ init_screen: { jmp b2 // init_screen::@2 b2: - // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 -- _deref_pbuz1=vbuc1 + // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE -- _deref_pbuz1=vbuc1 lda #WHITE ldy #0 sta (COLS),y - // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #1 sta (COLS),y - // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #2 sta (COLS),y - // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 lda #WHITE ldy #3 sta (COLS),y @@ -2728,12 +2720,9 @@ FINAL SYMBOL TABLE (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(signed byte*) ap -(const signed byte*) ap#0 ap = (signed byte*) 253 -(signed byte*) bp -(const signed byte*) bp#0 bp = (signed byte*) 254 -(signed byte*) cp -(const signed byte*) cp#0 cp = (signed byte*) 255 +(const signed byte*) ap ap = (signed byte*) 253 +(const signed byte*) bp bp = (signed byte*) 254 +(const signed byte*) cp cp = (signed byte*) 255 (signed byte()) fmul8((signed byte) fmul8::a , (signed byte) fmul8::b) (label) fmul8::@return (signed byte) fmul8::a @@ -2750,8 +2739,7 @@ FINAL SYMBOL TABLE (byte*) init_screen::COLS (byte*) init_screen::COLS#1 COLS zp ZP_WORD:10 7.333333333333333 (byte*) init_screen::COLS#3 COLS zp ZP_WORD:10 13.2 -(byte) init_screen::WHITE -(const byte) init_screen::WHITE#0 WHITE = (byte) 1 +(const byte) init_screen::WHITE WHITE = (byte) 1 (byte) init_screen::l (byte) init_screen::l#1 reg byte x 16.5 (byte) init_screen::l#2 reg byte x 16.5 @@ -3203,10 +3191,10 @@ print_byte_at: { // fmul8(signed byte register(A) a, signed byte register(X) b) fmul8: { // *ap = a - // [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa + // [58] *((const signed byte*) ap) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa sta ap // *bp = b - // [59] *((const signed byte*) bp#0) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsxx + // [59] *((const signed byte*) bp) ← (signed byte) fmul8::b#0 -- _deref_pbsc1=vbsxx txa sta bp // asm @@ -3223,7 +3211,7 @@ fmul8: { sbc mulf_sqr2,x sta cp // return *cp; - // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp#0) -- vbsaa=_deref_pbsc1 + // [61] (signed byte) fmul8::return#1 ← *((const signed byte*) cp) -- vbsaa=_deref_pbsc1 // fmul8::@return // } // [62] return @@ -3245,7 +3233,7 @@ init_screen: { // init_screen::@1 b1: // COLS[l] = WHITE - // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [66] *((byte*) 55296 + (byte) init_screen::l#2) ← (const byte) init_screen::WHITE -- pbuc1_derefidx_vbuxx=vbuc2 lda #WHITE sta $d800,x // for(byte l: 0..39) @@ -3268,20 +3256,20 @@ init_screen: { // init_screen::@2 b2: // COLS[0] = WHITE - // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE#0 -- _deref_pbuz1=vbuc1 + // [70] *((byte*) init_screen::COLS#3) ← (const byte) init_screen::WHITE -- _deref_pbuz1=vbuc1 lda #WHITE ldy #0 sta (COLS),y // COLS[1] = WHITE - // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [71] *((byte*) init_screen::COLS#3 + (byte) 1) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 ldy #1 sta (COLS),y // COLS[2] = WHITE - // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [72] *((byte*) init_screen::COLS#3 + (byte) 2) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 ldy #2 sta (COLS),y // COLS[3] = WHITE - // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE#0 -- pbuz1_derefidx_vbuc1=vbuc2 + // [73] *((byte*) init_screen::COLS#3 + (byte) 3) ← (const byte) init_screen::WHITE -- pbuz1_derefidx_vbuc1=vbuc2 ldy #3 sta (COLS),y // COLS += 40 diff --git a/src/test/ref/examples/fastmultiply/fastmultiply8.sym b/src/test/ref/examples/fastmultiply/fastmultiply8.sym index f4bfc444e..b99953ce9 100644 --- a/src/test/ref/examples/fastmultiply/fastmultiply8.sym +++ b/src/test/ref/examples/fastmultiply/fastmultiply8.sym @@ -5,12 +5,9 @@ (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(signed byte*) ap -(const signed byte*) ap#0 ap = (signed byte*) 253 -(signed byte*) bp -(const signed byte*) bp#0 bp = (signed byte*) 254 -(signed byte*) cp -(const signed byte*) cp#0 cp = (signed byte*) 255 +(const signed byte*) ap ap = (signed byte*) 253 +(const signed byte*) bp bp = (signed byte*) 254 +(const signed byte*) cp cp = (signed byte*) 255 (signed byte()) fmul8((signed byte) fmul8::a , (signed byte) fmul8::b) (label) fmul8::@return (signed byte) fmul8::a @@ -27,8 +24,7 @@ (byte*) init_screen::COLS (byte*) init_screen::COLS#1 COLS zp ZP_WORD:10 7.333333333333333 (byte*) init_screen::COLS#3 COLS zp ZP_WORD:10 13.2 -(byte) init_screen::WHITE -(const byte) init_screen::WHITE#0 WHITE = (byte) 1 +(const byte) init_screen::WHITE WHITE = (byte) 1 (byte) init_screen::l (byte) init_screen::l#1 reg byte x 16.5 (byte) init_screen::l#2 reg byte x 16.5 diff --git a/src/test/ref/examples/fire/fire.cfg b/src/test/ref/examples/fire/fire.cfg index 597d862c1..56c46a50f 100644 --- a/src/test/ref/examples/fire/fire.cfg +++ b/src/test/ref/examples/fire/fire.cfg @@ -55,21 +55,21 @@ main::@3: scope:[main] from main::toD0182 (void()) fire((byte*) fire::screenbase) fire: scope:[fire] from main::@1 main::@2 - [25] (byte*) fire::screen#0 ← phi( main::@1/(const byte*) SCREEN1#0 main::@2/(const byte*) SCREEN2#0 ) + [25] (byte*) fire::screen#0 ← phi( main::@1/(const byte*) SCREEN1 main::@2/(const byte*) SCREEN2 ) [26] (byte*~) fire::screen#11 ← (byte*) fire::screen#0 to:fire::@1 fire::@1: scope:[fire] from fire fire::@4 [27] (byte*) fire::screen#4 ← phi( fire/(byte*~) fire::screen#11 fire::@4/(byte*) fire::screen#2 ) - [27] (byte*) fire::buffer#4 ← phi( fire/(const byte*) BUFFER#0 fire::@4/(byte*) fire::buffer#2 ) - [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 + [27] (byte*) fire::buffer#4 ← phi( fire/(const byte*) BUFFER fire::@4/(byte*) fire::buffer#2 ) + [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 to:fire::@3 fire::@3: scope:[fire] from fire::@1 [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 to:fire::@6 fire::@6: scope:[fire] from fire::@3 fire::@8 [30] (byte*) fire::screen#10 ← phi( fire::@8/(byte*) fire::screen#3 fire::@3/(byte*) fire::screen#1 ) - [30] (byte*) fire::buffer#10 ← phi( fire::@8/(byte*) fire::buffer#3 fire::@3/(const byte*) BUFFER#0+(word)(number) $18*(number) $28 ) - [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 + [30] (byte*) fire::buffer#10 ← phi( fire::@8/(byte*) fire::buffer#3 fire::@3/(const byte*) BUFFER+(word)(number) $18*(number) $28 ) + [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 to:fire::@return fire::@return: scope:[fire] from fire::@6 [32] return @@ -119,12 +119,12 @@ makecharset: scope:[makecharset] from main::@8 [56] phi() to:makecharset::@1 makecharset::@1: scope:[makecharset] from makecharset makecharset::@2 - [57] (byte*) makecharset::font#2 ← phi( makecharset/(const byte*) CHARSET#0 makecharset::@2/(byte*) makecharset::font#1 ) - [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 + [57] (byte*) makecharset::font#2 ← phi( makecharset/(const byte*) CHARSET makecharset::@2/(byte*) makecharset::font#1 ) + [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 to:makecharset::@3 makecharset::@3: scope:[makecharset] from makecharset::@1 makecharset::@4 - [59] (byte*) makecharset::font1#2 ← phi( makecharset::@1/(const byte*) CHARSET#0+(word)(number) $40*(number) 8 makecharset::@4/(byte*) makecharset::font1#1 ) - [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 + [59] (byte*) makecharset::font1#2 ← phi( makecharset::@1/(const byte*) CHARSET+(word)(number) $40*(number) 8 makecharset::@4/(byte*) makecharset::font1#1 ) + [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 to:makecharset::@5 makecharset::@5: scope:[makecharset] from makecharset::@3 makecharset::@7 [61] (byte) makecharset::c#2 ← phi( makecharset::@7/(byte) makecharset::c#1 makecharset::@3/(byte) 0 ) @@ -151,7 +151,7 @@ makecharset::@10: scope:[makecharset] from makecharset::@8 [69] (word~) makecharset::$15 ← (word)(byte) makecharset::c#2 [70] (word~) makecharset::$16 ← (word~) makecharset::$15 << (byte) 3 [71] (word~) makecharset::$17 ← (word~) makecharset::$16 + (byte) makecharset::i#2 - [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 + [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [73] *((byte*~) makecharset::$18) ← (byte) makecharset::b#2 [74] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#2 to:makecharset::@6 @@ -191,7 +191,7 @@ sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) fillscreen: scope:[fillscreen] from main main::@4 main::@5 main::@6 - [91] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER#0 main::@5/(const byte*) SCREEN2#0 main::@6/(const byte*) COLS main::@4/(const byte*) SCREEN1#0 ) + [91] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER main::@5/(const byte*) SCREEN2 main::@6/(const byte*) COLS main::@4/(const byte*) SCREEN1 ) [91] (byte) fillscreen::fill#5 ← phi( main/(byte) 0 main::@5/(byte) 0 main::@6/(const byte) YELLOW main::@4/(byte) 0 ) to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@1 diff --git a/src/test/ref/examples/fire/fire.log b/src/test/ref/examples/fire/fire.log index 63d6f1d0e..6ff30fc4d 100644 --- a/src/test/ref/examples/fire/fire.log +++ b/src/test/ref/examples/fire/fire.log @@ -79,10 +79,10 @@ sid_rnd::@return: scope:[sid_rnd] from sid_rnd return to:@return @6: scope:[] from @4 - (byte*) SCREEN1#0 ← ((byte*)) (number) $3800 - (byte*) SCREEN2#0 ← ((byte*)) (number) $3c00 - (byte*) BUFFER#0 ← ((byte*)) (number) $4000 - (byte*) CHARSET#0 ← ((byte*)) (number) $3000 + (byte*) SCREEN1 ← ((byte*)) (number) $3800 + (byte*) SCREEN2 ← ((byte*)) (number) $3c00 + (byte*) BUFFER ← ((byte*)) (number) $4000 + (byte*) CHARSET ← ((byte*)) (number) $3000 to:@10 (void()) main() @@ -90,17 +90,17 @@ main: scope:[main] from @10 asm { sei } *((byte*) BORDERCOL) ← (byte) BLACK *((byte*) BGCOL) ← (byte) BLACK - (byte*) fillscreen::screen#0 ← (byte*) BUFFER#0 + (byte*) fillscreen::screen#0 ← (byte*) BUFFER (byte) fillscreen::fill#0 ← (number) 0 call fillscreen to:main::@9 main::@9: scope:[main] from main - (byte*) fillscreen::screen#1 ← (byte*) SCREEN1#0 + (byte*) fillscreen::screen#1 ← (byte*) SCREEN1 (byte) fillscreen::fill#1 ← (number) 0 call fillscreen to:main::@10 main::@10: scope:[main] from main::@9 - (byte*) fillscreen::screen#2 ← (byte*) SCREEN2#0 + (byte*) fillscreen::screen#2 ← (byte*) SCREEN2 (byte) fillscreen::fill#2 ← (number) 0 call fillscreen to:main::@11 @@ -113,7 +113,7 @@ main::@12: scope:[main] from main::@11 call sid_rnd_init to:main::@13 main::@13: scope:[main] from main::@12 - (byte*) makecharset::charset#0 ← (byte*) CHARSET#0 + (byte*) makecharset::charset#0 ← (byte*) CHARSET call makecharset to:main::@14 main::@14: scope:[main] from main::@13 @@ -122,12 +122,12 @@ main::@1: scope:[main] from main::@14 main::@8 if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) fire::screenbase#0 ← (byte*) SCREEN1#0 + (byte*) fire::screenbase#0 ← (byte*) SCREEN1 call fire to:main::@15 main::@15: scope:[main] from main::@2 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN1#0 - (byte*) main::toD0181_gfx#0 ← (byte*) CHARSET#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN1 + (byte*) main::toD0181_gfx#0 ← (byte*) CHARSET to:main::toD0181 main::toD0181: scope:[main] from main::@15 (byte*) main::toD0181_gfx#1 ← phi( main::@15/(byte*) main::toD0181_gfx#0 ) @@ -151,12 +151,12 @@ main::@7: scope:[main] from main::toD0181_@return (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$7 ← (byte) main::toD0181_return#3 *((byte*) D018) ← (byte~) main::$7 - (byte*) fire::screenbase#1 ← (byte*) SCREEN2#0 + (byte*) fire::screenbase#1 ← (byte*) SCREEN2 call fire to:main::@16 main::@16: scope:[main] from main::@7 - (byte*) main::toD0182_screen#0 ← (byte*) SCREEN2#0 - (byte*) main::toD0182_gfx#0 ← (byte*) CHARSET#0 + (byte*) main::toD0182_screen#0 ← (byte*) SCREEN2 + (byte*) main::toD0182_gfx#0 ← (byte*) CHARSET to:main::toD0182 main::toD0182: scope:[main] from main::@16 (byte*) main::toD0182_gfx#1 ← phi( main::@16/(byte*) main::toD0182_gfx#0 ) @@ -189,13 +189,13 @@ main::@return: scope:[main] from main::@1 fire: scope:[fire] from main::@2 main::@7 (byte*) fire::screenbase#2 ← phi( main::@2/(byte*) fire::screenbase#0 main::@7/(byte*) fire::screenbase#1 ) (byte*) fire::screen#0 ← (byte*) fire::screenbase#2 - (byte*) fire::buffer#0 ← (byte*) BUFFER#0 + (byte*) fire::buffer#0 ← (byte*) BUFFER to:fire::@1 fire::@1: scope:[fire] from fire fire::@4 (byte*) fire::screen#9 ← phi( fire/(byte*) fire::screen#0 fire::@4/(byte*) fire::screen#2 ) (byte*) fire::screenbase#4 ← phi( fire/(byte*) fire::screenbase#2 fire::@4/(byte*) fire::screenbase#5 ) (byte*) fire::buffer#4 ← phi( fire/(byte*) fire::buffer#0 fire::@4/(byte*) fire::buffer#2 ) - (byte*~) fire::$2 ← (byte*) BUFFER#0 + (number) $18*(number) $28 + (byte*~) fire::$2 ← (byte*) BUFFER + (number) $18*(number) $28 (bool~) fire::$3 ← (byte*) fire::buffer#4 != (byte*~) fire::$2 if((bool~) fire::$3) goto fire::@2 to:fire::@3 @@ -216,7 +216,7 @@ fire::@3: scope:[fire] from fire::@1 (byte*) fire::screenbase#3 ← phi( fire::@1/(byte*) fire::screenbase#4 ) (byte*~) fire::$0 ← (byte*) fire::screenbase#3 + (number) $18*(number) $28 (byte*) fire::screen#1 ← (byte*~) fire::$0 - (byte*~) fire::$1 ← (byte*) BUFFER#0 + (number) $18*(number) $28 + (byte*~) fire::$1 ← (byte*) BUFFER + (number) $18*(number) $28 (byte*) fire::buffer#1 ← (byte*~) fire::$1 to:fire::@9 fire::@4: scope:[fire] from fire::@2 fire::@7 @@ -239,7 +239,7 @@ fire::@7: scope:[fire] from fire::@2 fire::@9: scope:[fire] from fire::@15 fire::@3 (byte*) fire::screen#10 ← phi( fire::@15/(byte*) fire::screen#3 fire::@3/(byte*) fire::screen#1 ) (byte*) fire::buffer#7 ← phi( fire::@15/(byte*) fire::buffer#3 fire::@3/(byte*) fire::buffer#1 ) - (byte*~) fire::$10 ← (byte*) BUFFER#0 + (number) $19*(number) $28 + (byte*~) fire::$10 ← (byte*) BUFFER + (number) $19*(number) $28 (bool~) fire::$11 ← (byte*) fire::buffer#7 != (byte*~) fire::$10 if((bool~) fire::$11) goto fire::@10 to:fire::@return @@ -438,15 +438,11 @@ SYMBOL TABLE SSA (byte) BLACK (byte*) BORDERCOL (byte*) BUFFER -(byte*) BUFFER#0 (byte*) CHARSET -(byte*) CHARSET#0 (byte*) COLS (byte*) D018 (byte*) SCREEN1 -(byte*) SCREEN1#0 (byte*) SCREEN2 -(byte*) SCREEN2#0 (byte) SID_CONTROL_NOISE (byte*) SID_VOICE3_CONTROL (word*) SID_VOICE3_FREQ @@ -751,7 +747,7 @@ Adding number conversion cast (unumber) main::toD0182_$6 in (number~) main::toD0 Adding number conversion cast (unumber) $f in (number~) main::toD0182_$7 ← (unumber~) main::toD0182_$6 & (number) $f Adding number conversion cast (unumber) main::toD0182_$7 in (number~) main::toD0182_$7 ← (unumber~) main::toD0182_$6 & (unumber)(number) $f Adding number conversion cast (unumber) main::toD0182_$8 in (number~) main::toD0182_$8 ← (unumber~) main::toD0182_$3 | (unumber~) main::toD0182_$7 -Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$2 ← (byte*) BUFFER#0 + (number) $18*(number) $28 +Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$2 ← (byte*) BUFFER + (number) $18*(number) $28 Adding number conversion cast (unumber) $28-1 in (byte~) fire::$4 ← *((byte*) fire::buffer#5 + (number) $28-(number) 1) + *((byte*) fire::buffer#5 + (number) $28-(number) 1) Adding number conversion cast (unumber) $28-1 in (byte~) fire::$4 ← *((byte*) fire::buffer#5 + (unumber)(number) $28-(number) 1) + *((byte*) fire::buffer#5 + (number) $28-(number) 1) Adding number conversion cast (unumber) $28 in (byte~) fire::$5 ← (byte~) fire::$4 + *((byte*) fire::buffer#5 + (number) $28) @@ -760,9 +756,9 @@ Adding number conversion cast (unumber) 4 in (number~) fire::$7 ← (byte~) fire Adding number conversion cast (unumber) fire::$7 in (number~) fire::$7 ← (byte~) fire::$6 / (unumber)(number) 4 Adding number conversion cast (unumber) 2 in (bool~) fire::$8 ← (byte) fire::c#0 > (number) 2 Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$0 ← (byte*) fire::screenbase#3 + (number) $18*(number) $28 -Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$1 ← (byte*) BUFFER#0 + (number) $18*(number) $28 +Adding number conversion cast (unumber) $18*$28 in (byte*~) fire::$1 ← (byte*) BUFFER + (number) $18*(number) $28 Adding number conversion cast (unumber) 3 in (byte) fire::c#1 ← (byte) fire::c#3 - (number) 3 -Adding number conversion cast (unumber) $19*$28 in (byte*~) fire::$10 ← (byte*) BUFFER#0 + (number) $19*(number) $28 +Adding number conversion cast (unumber) $19*$28 in (byte*~) fire::$10 ← (byte*) BUFFER + (number) $19*(number) $28 Adding number conversion cast (unumber) $10 in (number~) fire::$13 ← (byte~) fire::$12 / (number) $10 Adding number conversion cast (unumber) fire::$13 in (number~) fire::$13 ← (byte~) fire::$12 / (unumber)(number) $10 Adding number conversion cast (unumber) $30 in (number~) fire::$14 ← (number) $30 + (unumber~) fire::$13 @@ -804,10 +800,10 @@ Inlining cast (byte*) SID_VOICE3_CONTROL ← (byte*)(number) $d412 Inlining cast (byte) SID_CONTROL_NOISE ← (unumber)(number) $80 Inlining cast (byte*) SID_VOICE3_OSC ← (byte*)(number) $d41b Inlining cast *((word*) SID_VOICE3_FREQ) ← (unumber)(number) $ffff -Inlining cast (byte*) SCREEN1#0 ← (byte*)(number) $3800 -Inlining cast (byte*) SCREEN2#0 ← (byte*)(number) $3c00 -Inlining cast (byte*) BUFFER#0 ← (byte*)(number) $4000 -Inlining cast (byte*) CHARSET#0 ← (byte*)(number) $3000 +Inlining cast (byte*) SCREEN1 ← (byte*)(number) $3800 +Inlining cast (byte*) SCREEN2 ← (byte*)(number) $3c00 +Inlining cast (byte*) BUFFER ← (byte*)(number) $4000 +Inlining cast (byte*) CHARSET ← (byte*)(number) $3000 Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) 0 Inlining cast (byte) fillscreen::fill#1 ← (unumber)(number) 0 Inlining cast (byte) fillscreen::fill#2 ← (unumber)(number) 0 @@ -1024,10 +1020,10 @@ Constant (const word*) SID_VOICE3_FREQ = (word*) 54286 Constant (const byte*) SID_VOICE3_CONTROL = (byte*) 54290 Constant (const byte) SID_CONTROL_NOISE = $80 Constant (const byte*) SID_VOICE3_OSC = (byte*) 54299 -Constant (const byte*) SCREEN1#0 = (byte*) 14336 -Constant (const byte*) SCREEN2#0 = (byte*) 15360 -Constant (const byte*) BUFFER#0 = (byte*) 16384 -Constant (const byte*) CHARSET#0 = (byte*) 12288 +Constant (const byte*) SCREEN1 = (byte*) 14336 +Constant (const byte*) SCREEN2 = (byte*) 15360 +Constant (const byte*) BUFFER = (byte*) 16384 +Constant (const byte*) CHARSET = (byte*) 12288 Constant (const byte) fillscreen::fill#0 = 0 Constant (const byte) fillscreen::fill#1 = 0 Constant (const byte) fillscreen::fill#2 = 0 @@ -1039,19 +1035,19 @@ Constant (const byte) makecharset::b#0 = 0 Constant (const byte) makecharset::ii#0 = 0 Constant (const word) fillscreen::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) fillscreen::screen#0 = BUFFER#0 -Constant (const byte*) fillscreen::screen#1 = SCREEN1#0 -Constant (const byte*) fillscreen::screen#2 = SCREEN2#0 +Constant (const byte*) fillscreen::screen#0 = BUFFER +Constant (const byte*) fillscreen::screen#1 = SCREEN1 +Constant (const byte*) fillscreen::screen#2 = SCREEN2 Constant (const byte*) fillscreen::screen#3 = COLS Constant (const byte) fillscreen::fill#3 = YELLOW -Constant (const byte*) makecharset::charset#0 = CHARSET#0 -Constant (const byte*) fire::screenbase#0 = SCREEN1#0 -Constant (const byte*) main::toD0181_screen#0 = SCREEN1#0 -Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0 -Constant (const byte*) fire::screenbase#1 = SCREEN2#0 -Constant (const byte*) main::toD0182_screen#0 = SCREEN2#0 -Constant (const byte*) main::toD0182_gfx#0 = CHARSET#0 -Constant (const byte*) fire::buffer#0 = BUFFER#0 +Constant (const byte*) makecharset::charset#0 = CHARSET +Constant (const byte*) fire::screenbase#0 = SCREEN1 +Constant (const byte*) main::toD0181_screen#0 = SCREEN1 +Constant (const byte*) main::toD0181_gfx#0 = CHARSET +Constant (const byte*) fire::screenbase#1 = SCREEN2 +Constant (const byte*) main::toD0182_screen#0 = SCREEN2 +Constant (const byte*) main::toD0182_gfx#0 = CHARSET +Constant (const byte*) fire::buffer#0 = BUFFER Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [45] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [49] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 @@ -1084,9 +1080,9 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 1 Finalized unsigned number type (word) $3e8 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [38] (byte*~) fire::$2 ← (const byte*) BUFFER#0 + (word)(number) $18*(number) $28 -Constant right-side identified [46] (byte*) fire::buffer#1 ← (const byte*) BUFFER#0 + (word)(number) $18*(number) $28 -Constant right-side identified [54] (byte*~) fire::$10 ← (const byte*) BUFFER#0 + (word)(number) $19*(number) $28 +Constant right-side identified [38] (byte*~) fire::$2 ← (const byte*) BUFFER + (word)(number) $18*(number) $28 +Constant right-side identified [46] (byte*) fire::buffer#1 ← (const byte*) BUFFER + (word)(number) $18*(number) $28 +Constant right-side identified [54] (byte*~) fire::$10 ← (const byte*) BUFFER + (word)(number) $19*(number) $28 Constant right-side identified [67] (byte*~) makecharset::$0 ← (const byte*) makecharset::charset#0 + (byte)(number) 1*(number) 8 Constant right-side identified [71] (byte*) makecharset::font1#0 ← (const byte*) makecharset::charset#0 + (word)(number) $40*(number) 8 Constant right-side identified [73] (byte*~) makecharset::$3 ← (const byte*) makecharset::charset#0 + (word)(number) $100*(number) 8 @@ -1096,9 +1092,9 @@ Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 Constant (const word) main::toD0182_$0 = (word)main::toD0182_screen#0 Constant (const word) main::toD0182_$4 = (word)main::toD0182_gfx#0 -Constant (const byte*) fire::$2 = BUFFER#0+(word)$18*$28 -Constant (const byte*) fire::buffer#1 = BUFFER#0+(word)$18*$28 -Constant (const byte*) fire::$10 = BUFFER#0+(word)$19*$28 +Constant (const byte*) fire::$2 = BUFFER+(word)$18*$28 +Constant (const byte*) fire::buffer#1 = BUFFER+(word)$18*$28 +Constant (const byte*) fire::$10 = BUFFER+(word)$19*$28 Constant (const byte*) makecharset::$0 = makecharset::charset#0+(byte)1*8 Constant (const byte*) makecharset::font1#0 = makecharset::charset#0+(word)$40*8 Constant (const byte*) makecharset::$3 = makecharset::charset#0+(word)$100*8 @@ -1161,49 +1157,49 @@ Inlining constant with var siblings (const byte*) fillscreen::screen#2 Inlining constant with var siblings (const byte*) fillscreen::screen#3 Inlining constant with var siblings (const byte) fillscreen::fill#3 Constant inlined fillscreen::fill#2 = (byte) 0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN1#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN1 +Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET Constant inlined fillscreen::fill#1 = (byte) 0 Constant inlined fillscreen::fill#3 = (const byte) YELLOW -Constant inlined fire::$10 = (const byte*) BUFFER#0+(word)(number) $19*(number) $28 -Constant inlined main::toD0182_$4 = (word)(const byte*) CHARSET#0 -Constant inlined main::toD0182_$5 = >(word)(const byte*) CHARSET#0 -Constant inlined main::toD0182_$6 = >(word)(const byte*) CHARSET#0/(byte) 4 -Constant inlined main::toD0182_$7 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f -Constant inlined main::toD0182_$0 = (word)(const byte*) SCREEN2#0 -Constant inlined main::toD0182_$1 = (word)(const byte*) SCREEN2#0&(word) $3fff +Constant inlined fire::$10 = (const byte*) BUFFER+(word)(number) $19*(number) $28 +Constant inlined main::toD0182_$4 = (word)(const byte*) CHARSET +Constant inlined main::toD0182_$5 = >(word)(const byte*) CHARSET +Constant inlined main::toD0182_$6 = >(word)(const byte*) CHARSET/(byte) 4 +Constant inlined main::toD0182_$7 = >(word)(const byte*) CHARSET/(byte) 4&(byte) $f +Constant inlined main::toD0182_$0 = (word)(const byte*) SCREEN2 +Constant inlined main::toD0182_$1 = (word)(const byte*) SCREEN2&(word) $3fff Constant inlined makecharset::bc#0 = (byte) 0 -Constant inlined main::toD0182_$2 = (word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0182_$3 = >(word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$2 = (word)(const byte*) SCREEN2&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$3 = >(word)(const byte*) SCREEN2&(word) $3fff*(byte) 4 Constant inlined fillscreen::screen#3 = (const byte*) COLS -Constant inlined fillscreen::screen#2 = (const byte*) SCREEN2#0 -Constant inlined fillscreen::screen#1 = (const byte*) SCREEN1#0 -Constant inlined fillscreen::screen#0 = (const byte*) BUFFER#0 -Constant inlined fire::$2 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 -Constant inlined fire::screenbase#1 = (const byte*) SCREEN2#0 -Constant inlined fire::screenbase#0 = (const byte*) SCREEN1#0 +Constant inlined fillscreen::screen#2 = (const byte*) SCREEN2 +Constant inlined fillscreen::screen#1 = (const byte*) SCREEN1 +Constant inlined fillscreen::screen#0 = (const byte*) BUFFER +Constant inlined fire::$2 = (const byte*) BUFFER+(word)(number) $18*(number) $28 +Constant inlined fire::screenbase#1 = (const byte*) SCREEN2 +Constant inlined fire::screenbase#0 = (const byte*) SCREEN1 Constant inlined fillscreen::i#0 = (word) 0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f -Constant inlined makecharset::$3 = (const byte*) CHARSET#0+(word)(number) $100*(number) 8 -Constant inlined main::toD0182_gfx#0 = (const byte*) CHARSET#0 -Constant inlined makecharset::$0 = (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN1#0&(word) $3fff -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN1#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) CHARSET#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) CHARSET#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) CHARSET#0 -Constant inlined makecharset::$14 = (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$7 = >(word)(const byte*) CHARSET/(byte) 4&(byte) $f +Constant inlined makecharset::$3 = (const byte*) CHARSET+(word)(number) $100*(number) 8 +Constant inlined main::toD0182_gfx#0 = (const byte*) CHARSET +Constant inlined makecharset::$0 = (const byte*) CHARSET+(byte)(number) 1*(number) 8 +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN1&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN1&(word) $3fff +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN1 +Constant inlined main::toD0181_$6 = >(word)(const byte*) CHARSET/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) CHARSET +Constant inlined main::toD0181_$4 = (word)(const byte*) CHARSET +Constant inlined makecharset::$14 = (const byte*) CHARSET+(byte)(number) 1*(number) 8 +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN1&(word) $3fff*(byte) 4 Constant inlined makecharset::ii#0 = (byte) 0 Constant inlined makecharset::i#0 = (byte) 0 -Constant inlined makecharset::font1#0 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 -Constant inlined makecharset::charset#0 = (const byte*) CHARSET#0 -Constant inlined main::toD0182_screen#0 = (const byte*) SCREEN2#0 +Constant inlined makecharset::font1#0 = (const byte*) CHARSET+(word)(number) $40*(number) 8 +Constant inlined makecharset::charset#0 = (const byte*) CHARSET +Constant inlined main::toD0182_screen#0 = (const byte*) SCREEN2 Constant inlined makecharset::b#0 = (byte) 0 -Constant inlined fire::buffer#1 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 +Constant inlined fire::buffer#1 = (const byte*) BUFFER+(word)(number) $18*(number) $28 Constant inlined makecharset::c#0 = (byte) 0 -Constant inlined fire::buffer#0 = (const byte*) BUFFER#0 +Constant inlined fire::buffer#0 = (const byte*) BUFFER Constant inlined fillscreen::fill#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting fire::@16(between fire::@2 and fire::@4) @@ -1376,21 +1372,21 @@ main::@3: scope:[main] from main::toD0182 (void()) fire((byte*) fire::screenbase) fire: scope:[fire] from main::@1 main::@2 - [25] (byte*) fire::screen#0 ← phi( main::@1/(const byte*) SCREEN1#0 main::@2/(const byte*) SCREEN2#0 ) + [25] (byte*) fire::screen#0 ← phi( main::@1/(const byte*) SCREEN1 main::@2/(const byte*) SCREEN2 ) [26] (byte*~) fire::screen#11 ← (byte*) fire::screen#0 to:fire::@1 fire::@1: scope:[fire] from fire fire::@4 [27] (byte*) fire::screen#4 ← phi( fire/(byte*~) fire::screen#11 fire::@4/(byte*) fire::screen#2 ) - [27] (byte*) fire::buffer#4 ← phi( fire/(const byte*) BUFFER#0 fire::@4/(byte*) fire::buffer#2 ) - [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 + [27] (byte*) fire::buffer#4 ← phi( fire/(const byte*) BUFFER fire::@4/(byte*) fire::buffer#2 ) + [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 to:fire::@3 fire::@3: scope:[fire] from fire::@1 [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 to:fire::@6 fire::@6: scope:[fire] from fire::@3 fire::@8 [30] (byte*) fire::screen#10 ← phi( fire::@8/(byte*) fire::screen#3 fire::@3/(byte*) fire::screen#1 ) - [30] (byte*) fire::buffer#10 ← phi( fire::@8/(byte*) fire::buffer#3 fire::@3/(const byte*) BUFFER#0+(word)(number) $18*(number) $28 ) - [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 + [30] (byte*) fire::buffer#10 ← phi( fire::@8/(byte*) fire::buffer#3 fire::@3/(const byte*) BUFFER+(word)(number) $18*(number) $28 ) + [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 to:fire::@return fire::@return: scope:[fire] from fire::@6 [32] return @@ -1440,12 +1436,12 @@ makecharset: scope:[makecharset] from main::@8 [56] phi() to:makecharset::@1 makecharset::@1: scope:[makecharset] from makecharset makecharset::@2 - [57] (byte*) makecharset::font#2 ← phi( makecharset/(const byte*) CHARSET#0 makecharset::@2/(byte*) makecharset::font#1 ) - [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 + [57] (byte*) makecharset::font#2 ← phi( makecharset/(const byte*) CHARSET makecharset::@2/(byte*) makecharset::font#1 ) + [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 to:makecharset::@3 makecharset::@3: scope:[makecharset] from makecharset::@1 makecharset::@4 - [59] (byte*) makecharset::font1#2 ← phi( makecharset::@1/(const byte*) CHARSET#0+(word)(number) $40*(number) 8 makecharset::@4/(byte*) makecharset::font1#1 ) - [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 + [59] (byte*) makecharset::font1#2 ← phi( makecharset::@1/(const byte*) CHARSET+(word)(number) $40*(number) 8 makecharset::@4/(byte*) makecharset::font1#1 ) + [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 to:makecharset::@5 makecharset::@5: scope:[makecharset] from makecharset::@3 makecharset::@7 [61] (byte) makecharset::c#2 ← phi( makecharset::@7/(byte) makecharset::c#1 makecharset::@3/(byte) 0 ) @@ -1472,7 +1468,7 @@ makecharset::@10: scope:[makecharset] from makecharset::@8 [69] (word~) makecharset::$15 ← (word)(byte) makecharset::c#2 [70] (word~) makecharset::$16 ← (word~) makecharset::$15 << (byte) 3 [71] (word~) makecharset::$17 ← (word~) makecharset::$16 + (byte) makecharset::i#2 - [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 + [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [73] *((byte*~) makecharset::$18) ← (byte) makecharset::b#2 [74] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#2 to:makecharset::@6 @@ -1512,7 +1508,7 @@ sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) fillscreen: scope:[fillscreen] from main main::@4 main::@5 main::@6 - [91] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER#0 main::@5/(const byte*) SCREEN2#0 main::@6/(const byte*) COLS main::@4/(const byte*) SCREEN1#0 ) + [91] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER main::@5/(const byte*) SCREEN2 main::@6/(const byte*) COLS main::@4/(const byte*) SCREEN1 ) [91] (byte) fillscreen::fill#5 ← phi( main/(byte) 0 main::@5/(byte) 0 main::@6/(const byte) YELLOW main::@4/(byte) 0 ) to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@1 @@ -1529,10 +1525,6 @@ fillscreen::@return: scope:[fillscreen] from fillscreen::@1 VARIABLE REGISTER WEIGHTS -(byte*) BUFFER -(byte*) CHARSET -(byte*) SCREEN1 -(byte*) SCREEN2 (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (byte) fillscreen::fill (byte) fillscreen::fill#5 1.8333333333333333 @@ -1770,7 +1762,7 @@ main: { // [7] call fillscreen // [91] phi from main to fillscreen [phi:main->fillscreen] fillscreen_from_main: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER [phi:main->fillscreen#0] -- pbuz1=pbuc1 lda #BUFFER @@ -1787,7 +1779,7 @@ main: { // [9] call fillscreen // [91] phi from main::@4 to fillscreen [phi:main::@4->fillscreen] fillscreen_from_b4: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -1804,7 +1796,7 @@ main: { // [11] call fillscreen // [91] phi from main::@5 to fillscreen [phi:main::@5->fillscreen] fillscreen_from_b5: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -1855,7 +1847,7 @@ main: { // [19] call fire // [25] phi from main::@1 to fire [phi:main::@1->fire] fire_from_b1: - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1 [phi:main::@1->fire#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -1875,7 +1867,7 @@ main: { // [22] call fire // [25] phi from main::@2 to fire [phi:main::@2->fire] fire_from_b2: - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2 [phi:main::@2->fire#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -1922,7 +1914,7 @@ fire: { // [27] phi from fire to fire::@1 [phi:fire->fire::@1] b1_from_fire: // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#11 [phi:fire->fire::@1#0] -- register_copy - // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 + // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER [phi:fire->fire::@1#1] -- pbuz1=pbuc1 lda #BUFFER @@ -1930,7 +1922,7 @@ fire: { jmp b1 // fire::@1 b1: - // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 + // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer+1 cmp #>BUFFER+$18*$28 bne b2 @@ -1951,7 +1943,7 @@ fire: { // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6] b6_from_b3: // [30] phi (byte*) fire::screen#10 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy - // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 + // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 lda #BUFFER+$18*$28 @@ -1959,7 +1951,7 @@ fire: { jmp b6 // fire::@6 b6: - // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 + // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer_10+1 cmp #>BUFFER+$19*$28 bne b7_from_b6 @@ -2125,7 +2117,7 @@ makecharset: { .label _18 = $29 // [57] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1] b1_from_makecharset: - // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 + // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 lda #CHARSET @@ -2133,7 +2125,7 @@ makecharset: { jmp b1 // makecharset::@1 b1: - // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 + // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z font+1 cmp #>CHARSET+1*8 bne b2 @@ -2142,7 +2134,7 @@ makecharset: { bne b2 // [59] phi from makecharset::@1 to makecharset::@3 [phi:makecharset::@1->makecharset::@3] b3_from_b1: - // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 + // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 lda #CHARSET+$40*8 @@ -2150,7 +2142,7 @@ makecharset: { jmp b3 // makecharset::@3 b3: - // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 + // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z font1+1 cmp #>CHARSET+$100*8 bne b4 @@ -2241,7 +2233,7 @@ makecharset: { lda #0 adc.z _16+1 sta.z _17+1 - // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz2 + // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz2 lda.z _17 clc adc #> (byte) 4 [ fire::buffer#10 fire::screen#10 fire::$13 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 fire::$13 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 fire::$13 ] ) always clobbers reg byte a Statement [39] *((byte*) fire::buffer#10) ← (byte~) fire::$14 [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte y Statement [40] *((byte*) fire::screen#10) ← *((byte*) fire::buffer#10) [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte a reg byte y @@ -2433,8 +2425,8 @@ Statement [46] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 [ fire::screen# Statement [48] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ) always clobbers reg byte a Statement [50] *((byte*) fire::buffer#4) ← (byte) fire::c#2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte y Statement [51] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a reg byte y -Statement [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a -Statement [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a +Statement [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a +Statement [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a Statement [69] (word~) makecharset::$15 ← (word)(byte) makecharset::c#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$15 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$15 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ makecharset::c#2 makecharset::c#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:18 [ makecharset::i#2 makecharset::i#1 ] @@ -2442,7 +2434,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:19 [ m Removing always clobbered register reg byte a as potential for zp ZP_BYTE:21 [ makecharset::b#2 makecharset::b#6 makecharset::b#1 ] Statement [70] (word~) makecharset::$16 ← (word~) makecharset::$15 << (byte) 3 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$16 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$16 ] ) always clobbers reg byte a Statement [71] (word~) makecharset::$17 ← (word~) makecharset::$16 + (byte) makecharset::i#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$17 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$17 ] ) always clobbers reg byte a -Statement [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ) always clobbers reg byte a +Statement [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ) always clobbers reg byte a Statement [73] *((byte*~) makecharset::$18) ← (byte) makecharset::b#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:17 [ makecharset::c#2 makecharset::c#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:18 [ makecharset::i#2 makecharset::i#1 ] @@ -2470,9 +2462,9 @@ Statement [6] *((const byte*) BGCOL) ← (const byte) BLACK [ ] ( main:2 [ ] ) a Statement [21] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [24] *((const byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [26] (byte*~) fire::screen#11 ← (byte*) fire::screen#0 [ fire::screen#0 fire::screen#11 ] ( main:2::fire:19 [ fire::screen#0 fire::screen#11 ] main:2::fire:22 [ fire::screen#0 fire::screen#11 ] ) always clobbers reg byte a -Statement [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a +Statement [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a Statement [29] (byte*) fire::screen#1 ← (byte*) fire::screen#0 + (word)(number) $18*(number) $28 [ fire::screen#1 ] ( main:2::fire:19 [ fire::screen#1 ] main:2::fire:22 [ fire::screen#1 ] ) always clobbers reg byte a -Statement [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte a +Statement [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte a Statement [37] (byte~) fire::$13 ← (byte~) fire::$12 >> (byte) 4 [ fire::buffer#10 fire::screen#10 fire::$13 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 fire::$13 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 fire::$13 ] ) always clobbers reg byte a Statement [39] *((byte*) fire::buffer#10) ← (byte~) fire::$14 [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte y Statement [40] *((byte*) fire::screen#10) ← *((byte*) fire::buffer#10) [ fire::buffer#10 fire::screen#10 ] ( main:2::fire:19 [ fire::buffer#10 fire::screen#10 ] main:2::fire:22 [ fire::buffer#10 fire::screen#10 ] ) always clobbers reg byte a reg byte y @@ -2483,14 +2475,14 @@ Statement [46] (byte) fire::c#0 ← (byte~) fire::$6 >> (byte) 2 [ fire::screen# Statement [48] (byte) fire::c#1 ← (byte) fire::c#0 - (byte) 3 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 fire::c#1 ] ) always clobbers reg byte a Statement [50] *((byte*) fire::buffer#4) ← (byte) fire::c#2 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte y Statement [51] *((byte*) fire::screen#4) ← *((byte*) fire::buffer#4) [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ( main:2::fire:19 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] main:2::fire:22 [ fire::screen#0 fire::buffer#4 fire::screen#4 ] ) always clobbers reg byte a reg byte y -Statement [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a -Statement [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a +Statement [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 [ makecharset::font#2 ] ( main:2::makecharset:17 [ makecharset::font#2 ] ) always clobbers reg byte a +Statement [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 [ makecharset::font1#2 ] ( main:2::makecharset:17 [ makecharset::font1#2 ] ) always clobbers reg byte a Statement [62] if((byte) makecharset::c#2<(byte) $40) goto makecharset::@6 [ makecharset::c#2 ] ( main:2::makecharset:17 [ makecharset::c#2 ] ) always clobbers reg byte a Statement [65] if((byte) makecharset::i#2<(byte) 8) goto makecharset::@8 [ makecharset::c#2 makecharset::i#2 makecharset::bc#6 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#6 ] ) always clobbers reg byte a Statement [69] (word~) makecharset::$15 ← (word)(byte) makecharset::c#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$15 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$15 ] ) always clobbers reg byte a Statement [70] (word~) makecharset::$16 ← (word~) makecharset::$15 << (byte) 3 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$16 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$16 ] ) always clobbers reg byte a Statement [71] (word~) makecharset::$17 ← (word~) makecharset::$16 + (byte) makecharset::i#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$17 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$17 ] ) always clobbers reg byte a -Statement [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ) always clobbers reg byte a +Statement [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 makecharset::b#2 makecharset::$18 ] ) always clobbers reg byte a Statement [73] *((byte*~) makecharset::$18) ← (byte) makecharset::b#2 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::bc#3 ] ) always clobbers reg byte a reg byte y Statement [75] (byte) makecharset::bc#1 ← (byte) makecharset::bc#3 + (byte) makecharset::c#2 [ makecharset::c#2 makecharset::i#2 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::ii#2 makecharset::b#2 makecharset::bc#1 ] ) always clobbers reg byte a Statement [77] (byte) makecharset::bc#2 ← (byte) makecharset::bc#1 - (byte) $40 [ makecharset::c#2 makecharset::i#2 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ( main:2::makecharset:17 [ makecharset::c#2 makecharset::i#2 makecharset::ii#2 makecharset::b#2 makecharset::bc#2 ] ) always clobbers reg byte a reg byte x @@ -2643,7 +2635,7 @@ main: { // [7] call fillscreen // [91] phi from main to fillscreen [phi:main->fillscreen] fillscreen_from_main: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER [phi:main->fillscreen#0] -- pbuz1=pbuc1 lda #BUFFER @@ -2659,7 +2651,7 @@ main: { // [9] call fillscreen // [91] phi from main::@4 to fillscreen [phi:main::@4->fillscreen] fillscreen_from_b4: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -2675,7 +2667,7 @@ main: { // [11] call fillscreen // [91] phi from main::@5 to fillscreen [phi:main::@5->fillscreen] fillscreen_from_b5: - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -2724,7 +2716,7 @@ main: { // [19] call fire // [25] phi from main::@1 to fire [phi:main::@1->fire] fire_from_b1: - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1 [phi:main::@1->fire#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -2744,7 +2736,7 @@ main: { // [22] call fire // [25] phi from main::@2 to fire [phi:main::@2->fire] fire_from_b2: - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2 [phi:main::@2->fire#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -2781,7 +2773,7 @@ fire: { // [27] phi from fire to fire::@1 [phi:fire->fire::@1] b1_from_fire: // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#11 [phi:fire->fire::@1#0] -- register_copy - // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 + // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER [phi:fire->fire::@1#1] -- pbuz1=pbuc1 lda #BUFFER @@ -2789,7 +2781,7 @@ fire: { jmp b1 // fire::@1 b1: - // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 + // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer+1 cmp #>BUFFER+$18*$28 bne b2 @@ -2810,7 +2802,7 @@ fire: { // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6] b6_from_b3: // [30] phi (byte*) fire::screen#10 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy - // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 + // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 lda #BUFFER+$18*$28 @@ -2818,7 +2810,7 @@ fire: { jmp b6 // fire::@6 b6: - // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 + // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer_10+1 cmp #>BUFFER+$19*$28 bne b7_from_b6 @@ -2959,7 +2951,7 @@ makecharset: { .label _18 = $b // [57] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1] b1_from_makecharset: - // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 + // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 lda #CHARSET @@ -2967,7 +2959,7 @@ makecharset: { jmp b1 // makecharset::@1 b1: - // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 + // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z font+1 cmp #>CHARSET+1*8 bne b2 @@ -2976,7 +2968,7 @@ makecharset: { bne b2 // [59] phi from makecharset::@1 to makecharset::@3 [phi:makecharset::@1->makecharset::@3] b3_from_b1: - // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 + // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 lda #CHARSET+$40*8 @@ -2984,7 +2976,7 @@ makecharset: { jmp b3 // makecharset::@3 b3: - // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 + // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z font1+1 cmp #>CHARSET+$100*8 bne b4 @@ -3069,7 +3061,7 @@ makecharset: { bcc !+ inc.z _17+1 !: - // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz1 + // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z _18 adc #(word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN1&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) SCREEN2&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte~) makecharset::$11 reg byte a 2002.0 @@ -3586,7 +3574,7 @@ main: { // fillscreen(BUFFER, 00) // [7] call fillscreen // [91] phi from main to fillscreen [phi:main->fillscreen] - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER#0 [phi:main->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) BUFFER [phi:main->fillscreen#0] -- pbuz1=pbuc1 lda #BUFFER @@ -3599,7 +3587,7 @@ main: { // fillscreen(SCREEN1, 00) // [9] call fillscreen // [91] phi from main::@4 to fillscreen [phi:main::@4->fillscreen] - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1#0 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN1 [phi:main::@4->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -3612,7 +3600,7 @@ main: { // fillscreen(SCREEN2, 00) // [11] call fillscreen // [91] phi from main::@5 to fillscreen [phi:main::@5->fillscreen] - // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2#0 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 + // [91] phi (byte*) fillscreen::screen#6 = (const byte*) SCREEN2 [phi:main::@5->fillscreen#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -3650,7 +3638,7 @@ main: { // fire(SCREEN1) // [19] call fire // [25] phi from main::@1 to fire [phi:main::@1->fire] - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1#0 [phi:main::@1->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN1 [phi:main::@1->fire#0] -- pbuz1=pbuc1 lda #SCREEN1 @@ -3666,7 +3654,7 @@ main: { // fire(SCREEN2) // [22] call fire // [25] phi from main::@2 to fire [phi:main::@2->fire] - // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2#0 [phi:main::@2->fire#0] -- pbuz1=pbuc1 + // [25] phi (byte*) fire::screen#0 = (const byte*) SCREEN2 [phi:main::@2->fire#0] -- pbuz1=pbuc1 lda #SCREEN2 @@ -3698,7 +3686,7 @@ fire: { sta.z screen_11+1 // [27] phi from fire to fire::@1 [phi:fire->fire::@1] // [27] phi (byte*) fire::screen#4 = (byte*~) fire::screen#11 [phi:fire->fire::@1#0] -- register_copy - // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER#0 [phi:fire->fire::@1#1] -- pbuz1=pbuc1 + // [27] phi (byte*) fire::buffer#4 = (const byte*) BUFFER [phi:fire->fire::@1#1] -- pbuz1=pbuc1 lda #BUFFER @@ -3706,7 +3694,7 @@ fire: { // fire::@1 b1: // while (buffer != (BUFFER + (24 * 40))) - // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER#0+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 + // [28] if((byte*) fire::buffer#4!=(const byte*) BUFFER+(word)(number) $18*(number) $28) goto fire::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer+1 cmp #>BUFFER+$18*$28 bne b2 @@ -3725,7 +3713,7 @@ fire: { sta.z screen+1 // [30] phi from fire::@3 to fire::@6 [phi:fire::@3->fire::@6] // [30] phi (byte*) fire::screen#10 = (byte*) fire::screen#1 [phi:fire::@3->fire::@6#0] -- register_copy - // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER#0+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 + // [30] phi (byte*) fire::buffer#10 = (const byte*) BUFFER+(word)(number) $18*(number) $28 [phi:fire::@3->fire::@6#1] -- pbuz1=pbuc1 lda #BUFFER+$18*$28 @@ -3733,7 +3721,7 @@ fire: { // fire::@6 b6: // for(; buffer != (BUFFER+(25*40)); ++screen, ++buffer) - // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER#0+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 + // [31] if((byte*) fire::buffer#10!=(const byte*) BUFFER+(word)(number) $19*(number) $28) goto fire::@7 -- pbuz1_neq_pbuc1_then_la1 lda.z buffer_10+1 cmp #>BUFFER+$19*$28 bne b7 @@ -3872,7 +3860,7 @@ makecharset: { .label ii = 8 .label _18 = $b // [57] phi from makecharset to makecharset::@1 [phi:makecharset->makecharset::@1] - // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET#0 [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 + // [57] phi (byte*) makecharset::font#2 = (const byte*) CHARSET [phi:makecharset->makecharset::@1#0] -- pbuz1=pbuc1 lda #CHARSET @@ -3880,7 +3868,7 @@ makecharset: { // makecharset::@1 b1: // for (unsigned char *font = charset; font != (charset+(1*8)); ++font) - // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET#0+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 + // [58] if((byte*) makecharset::font#2!=(const byte*) CHARSET+(byte)(number) 1*(number) 8) goto makecharset::@2 -- pbuz1_neq_pbuc1_then_la1 lda.z font+1 cmp #>CHARSET+1*8 beq !b2+ @@ -3892,7 +3880,7 @@ makecharset: { jmp b2 !b2: // [59] phi from makecharset::@1 to makecharset::@3 [phi:makecharset::@1->makecharset::@3] - // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET#0+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 + // [59] phi (byte*) makecharset::font1#2 = (const byte*) CHARSET+(word)(number) $40*(number) 8 [phi:makecharset::@1->makecharset::@3#0] -- pbuz1=pbuc1 lda #CHARSET+$40*8 @@ -3900,7 +3888,7 @@ makecharset: { // makecharset::@3 b3: // for (unsigned char *font = (charset+(64*8)); font != (charset+(256*8)); ++font) - // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET#0+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 + // [60] if((byte*) makecharset::font1#2!=(const byte*) CHARSET+(word)(number) $100*(number) 8) goto makecharset::@4 -- pbuz1_neq_pbuc1_then_la1 lda.z font1+1 cmp #>CHARSET+$100*8 beq !b4+ @@ -3987,7 +3975,7 @@ makecharset: { inc.z _17+1 !: // (charset + (1 * 8)) [(((unsigned short)c) << 3) + i] = b - // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET#0+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz1 + // [72] (byte*~) makecharset::$18 ← (const byte*) CHARSET+(byte)(number) 1*(number) 8 + (word~) makecharset::$17 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z _18 adc #(word)(const byte*) SCREEN1#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN1&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) SCREEN2#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) SCREEN2&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte~) makecharset::$11 reg byte a 2002.0 diff --git a/src/test/ref/examples/linking/linking.cfg b/src/test/ref/examples/linking/linking.cfg index 2fcfd4391..5ac82723d 100644 --- a/src/test/ref/examples/linking/linking.cfg +++ b/src/test/ref/examples/linking/linking.cfg @@ -19,11 +19,11 @@ main::@1: scope:[main] from main main::@1 [8] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 - [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL#0) + [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL) [10] call fillscreen to:main::@3 main::@3: scope:[main] from main::@2 - [11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [11] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) to:main::@2 (void()) fillscreen((byte) fillscreen::c) @@ -32,8 +32,8 @@ fillscreen: scope:[fillscreen] from main::@2 to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 [13] (byte) fillscreen::i#2 ← phi( fillscreen/(byte) 0 fillscreen::@2/(byte) fillscreen::i#1 ) - [13] (byte*) fillscreen::screen#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::screen#1 ) - [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [13] (byte*) fillscreen::screen#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::screen#1 ) + [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [15] return diff --git a/src/test/ref/examples/linking/linking.log b/src/test/ref/examples/linking/linking.log index 107cf6cce..35c83d06d 100644 --- a/src/test/ref/examples/linking/linking.log +++ b/src/test/ref/examples/linking/linking.log @@ -15,7 +15,7 @@ Culled Empty Block (label) fillscreen::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) BGCOL#0 ← ((byte*)) (number) $d021 + (byte*) BGCOL ← ((byte*)) (number) $d021 to:@1 (void()) main() @@ -33,30 +33,30 @@ main::@3: scope:[main] from main::@1 main::@9 if(true) goto main::@4 to:main::@return main::@4: scope:[main] from main::@3 - (byte) fillscreen::c#0 ← *((byte*) BGCOL#0) + (byte) fillscreen::c#0 ← *((byte*) BGCOL) call fillscreen to:main::@9 main::@9: scope:[main] from main::@4 - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) to:main::@3 main::@return: scope:[main] from main::@3 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@2 (void()) fillscreen((byte) fillscreen::c) fillscreen: scope:[fillscreen] from main::@4 (byte) fillscreen::c#3 ← phi( main::@4/(byte) fillscreen::c#0 ) (byte) fillscreen::i#0 ← (number) 0 - (byte*) fillscreen::screen#0 ← (byte*) SCREEN#0 + (byte*) fillscreen::screen#0 ← (byte*) SCREEN to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 (byte) fillscreen::i#3 ← phi( fillscreen/(byte) fillscreen::i#0 fillscreen::@2/(byte) fillscreen::i#1 ) (byte) fillscreen::c#2 ← phi( fillscreen/(byte) fillscreen::c#3 fillscreen::@2/(byte) fillscreen::c#1 ) (byte*) fillscreen::screen#2 ← phi( fillscreen/(byte*) fillscreen::screen#0 fillscreen::@2/(byte*) fillscreen::screen#1 ) - (byte*~) fillscreen::$0 ← (byte*) SCREEN#0 + (number) $3e8 + (byte*~) fillscreen::$0 ← (byte*) SCREEN + (number) $3e8 (bool~) fillscreen::$1 ← (byte*) fillscreen::screen#2 < (byte*~) fillscreen::$0 if((bool~) fillscreen::$1) goto fillscreen::@2 to:fillscreen::@return @@ -87,9 +87,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte[$100]) base (void()) fillscreen((byte) fillscreen::c) (byte*~) fillscreen::$0 @@ -126,10 +124,10 @@ SYMBOL TABLE SSA (byte) main::i#2 Adding number conversion cast (unumber) 0 in (byte) fillscreen::i#0 ← (number) 0 -Adding number conversion cast (unumber) $3e8 in (byte*~) fillscreen::$0 ← (byte*) SCREEN#0 + (number) $3e8 +Adding number conversion cast (unumber) $3e8 in (byte*~) fillscreen::$0 ← (byte*) SCREEN + (number) $3e8 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) fillscreen::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53281 @@ -152,13 +150,13 @@ Simple Condition (bool~) fillscreen::$1 [19] if((byte*) fillscreen::screen#2<(by Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [26] (byte[$100]) base ← { fill( $100, 0) } Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) BGCOL#0 = (byte*) 53281 +Constant (const byte*) BGCOL = (byte*) 53281 Constant (const byte) main::i#0 = 0 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) fillscreen::i#0 = 0 Constant (const byte[$100]) base = { fill( $100, 0) } Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) fillscreen::screen#0 = SCREEN#0 +Constant (const byte*) fillscreen::screen#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [7] if(true) goto main::@4 Successful SSA optimization Pass2ConstantIfs @@ -172,17 +170,17 @@ Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [8] (byte*~) fillscreen::$0 ← (const byte*) SCREEN#0 + (word) $3e8 +Constant right-side identified [8] (byte*~) fillscreen::$0 ← (const byte*) SCREEN + (word) $3e8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) fillscreen::$0 = SCREEN#0+$3e8 +Constant (const byte*) fillscreen::$0 = SCREEN+$3e8 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) fillscreen::i#0 Inlining constant with var siblings (const byte*) fillscreen::screen#0 Constant inlined fillscreen::i#0 = (byte) 0 Constant inlined main::i#0 = (byte) 0 -Constant inlined fillscreen::screen#0 = (const byte*) SCREEN#0 -Constant inlined fillscreen::$0 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined fillscreen::screen#0 = (const byte*) SCREEN +Constant inlined fillscreen::$0 = (const byte*) SCREEN+(word) $3e8 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@10(between main::@1 and main::@1) Adding NOP phi() at start of @begin @@ -237,11 +235,11 @@ main::@1: scope:[main] from main main::@1 [8] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 - [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL#0) + [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL) [10] call fillscreen to:main::@3 main::@3: scope:[main] from main::@2 - [11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [11] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) to:main::@2 (void()) fillscreen((byte) fillscreen::c) @@ -250,8 +248,8 @@ fillscreen: scope:[fillscreen] from main::@2 to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 [13] (byte) fillscreen::i#2 ← phi( fillscreen/(byte) 0 fillscreen::@2/(byte) fillscreen::i#1 ) - [13] (byte*) fillscreen::screen#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::screen#1 ) - [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [13] (byte*) fillscreen::screen#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::screen#1 ) + [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [15] return @@ -265,8 +263,6 @@ fillscreen::@2: scope:[fillscreen] from fillscreen::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte*) SCREEN (void()) fillscreen((byte) fillscreen::c) (byte~) fillscreen::$2 202.0 (byte) fillscreen::c @@ -368,7 +364,7 @@ main: { jmp b2 // main::@2 b2: - // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL#0) -- vbuz1=_deref_pbuc1 + // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL) -- vbuz1=_deref_pbuc1 lda BGCOL sta.z fillscreen.c // [10] call fillscreen @@ -378,7 +374,7 @@ main: { jmp b3 // main::@3 b3: - // [11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL jmp b2 } @@ -395,7 +391,7 @@ fillscreen: { // [13] phi (byte) fillscreen::i#2 = (byte) 0 [phi:fillscreen->fillscreen::@1#0] -- vbuz1=vbuc1 lda #0 sta.z i - // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 + // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -403,7 +399,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z screen+1 cmp #>SCREEN+$3e8 bcc b2 @@ -447,14 +443,14 @@ fillscreen: { base: .fill $100, 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte a +Statement [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ fillscreen::c#0 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ fillscreen::i#2 fillscreen::i#1 ] Statement [16] (byte~) fillscreen::$2 ← (byte) fillscreen::c#0 + *((const byte[$100]) base + (byte) fillscreen::i#2) [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 fillscreen::$2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 fillscreen::$2 ] ) always clobbers reg byte a Statement [17] *((byte*) fillscreen::screen#2) ← (byte~) fillscreen::$2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ fillscreen::c#0 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ fillscreen::i#2 fillscreen::i#1 ] -Statement [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte a +Statement [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte a Statement [16] (byte~) fillscreen::$2 ← (byte) fillscreen::c#0 + *((const byte[$100]) base + (byte) fillscreen::i#2) [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 fillscreen::$2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 fillscreen::$2 ] ) always clobbers reg byte a Statement [17] *((byte*) fillscreen::screen#2) ← (byte~) fillscreen::$2 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ( main:2::fillscreen:10 [ fillscreen::c#0 fillscreen::screen#2 fillscreen::i#2 ] ) always clobbers reg byte y Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -539,7 +535,7 @@ main: { jmp b2 // main::@2 b2: - // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL#0) -- vbuz1=_deref_pbuc1 + // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL) -- vbuz1=_deref_pbuc1 lda BGCOL sta.z fillscreen.c // [10] call fillscreen @@ -549,7 +545,7 @@ main: { jmp b3 // main::@3 b3: - // [11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL jmp b2 } @@ -563,7 +559,7 @@ fillscreen: { b1_from_fillscreen: // [13] phi (byte) fillscreen::i#2 = (byte) 0 [phi:fillscreen->fillscreen::@1#0] -- vbuxx=vbuc1 ldx #0 - // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 + // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -571,7 +567,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [14] if((byte*) fillscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z screen+1 cmp #>SCREEN+$3e8 bcc b2 @@ -645,10 +641,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) BGCOL BGCOL = (byte*) 53281 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$100]) base base = { fill( $100, 0) } (void()) fillscreen((byte) fillscreen::c) (byte~) fillscreen::$2 reg byte a 202.0 @@ -732,7 +726,7 @@ main: { // main::@2 b2: // fillscreen(*BGCOL) - // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL#0) -- vbuz1=_deref_pbuc1 + // [9] (byte) fillscreen::c#0 ← *((const byte*) BGCOL) -- vbuz1=_deref_pbuc1 lda BGCOL sta.z fillscreen.c // [10] call fillscreen @@ -740,7 +734,7 @@ main: { jsr fillscreen // main::@3 // (*BGCOL)++; - // [11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL jmp b2 } @@ -753,7 +747,7 @@ fillscreen: { // [13] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] // [13] phi (byte) fillscreen::i#2 = (byte) 0 [phi:fillscreen->fillscreen::@1#0] -- vbuxx=vbuc1 ldx #0 - // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 + // [13] phi (byte*) fillscreen::screen#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -761,7 +755,7 @@ fillscreen: { // fillscreen::@1 b1: // for( char *screen = SCREEN; screenSCREEN+$3e8 bcc b2 diff --git a/src/test/ref/examples/linking/linking.sym b/src/test/ref/examples/linking/linking.sym index bc6893d4f..e7f78cf74 100644 --- a/src/test/ref/examples/linking/linking.sym +++ b/src/test/ref/examples/linking/linking.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) BGCOL BGCOL = (byte*) 53281 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$100]) base base = { fill( $100, 0) } (void()) fillscreen((byte) fillscreen::c) (byte~) fillscreen::$2 reg byte a 202.0 diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.cfg b/src/test/ref/examples/multiplexer/simple-multiplexer.cfg index 7304144ad..5a24e64b4 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.cfg +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -182,7 +182,7 @@ init: scope:[init] from main init::@1: scope:[init] from init init::@1 [83] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 ) [83] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [85] (byte~) init::$8 ← (byte) init::sx#2 << (byte) 1 [86] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$8) ← (word) init::xp#2 [87] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.log b/src/test/ref/examples/multiplexer/simple-multiplexer.log index 91d465128..c2993d1be 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.log +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.log @@ -292,15 +292,15 @@ plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexSho (byte) plex_sprite_idx#38 ← phi( @9/(byte) plex_sprite_idx#40 ) (byte) plex_show_idx#38 ← phi( @9/(byte) plex_show_idx#40 ) (byte*) PLEX_SCREEN_PTR#25 ← phi( @9/(byte*) PLEX_SCREEN_PTR#27 ) - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$100]) YSIN ← kickasm {{ .var min = 50 .var max = 250-21 .var ampl = max-min; .for(var i=0;i<256;i++) .byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256))) }} - (byte*) SPRITE#0 ← ((byte*)) (number) $2000 - kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + (byte*) SPRITE ← ((byte*)) (number) $2000 + kickasm(location (byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -357,7 +357,7 @@ init: scope:[init] from main (byte~) init::$0 ← (byte) VIC_DEN | (byte) VIC_RSEL (number~) init::$1 ← (byte~) init::$0 | (number) 3 *((byte*) D011) ← (number~) init::$1 - (byte*) plexInit::screen#0 ← (byte*) SCREEN#0 + (byte*) plexInit::screen#0 ← (byte*) SCREEN call plexInit to:init::@5 init::@5: scope:[init] from init @@ -371,7 +371,7 @@ init::@1: scope:[init] from init::@1 init::@5 (byte*) PLEX_SCREEN_PTR#28 ← phi( init::@1/(byte*) PLEX_SCREEN_PTR#28 init::@5/(byte*) PLEX_SCREEN_PTR#5 ) (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init::@5/(word) init::xp#0 ) (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init::@5/(byte) init::sx#0 ) - (byte*~) init::$4 ← (byte*) SPRITE#0 / (number) $40 + (byte*~) init::$4 ← (byte*) SPRITE / (number) $40 (byte~) init::$5 ← ((byte)) (byte*~) init::$4 *((byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte~) init::$5 (byte~) init::$8 ← (byte) init::sx#2 * (const byte) SIZEOF_WORD @@ -690,10 +690,8 @@ SYMBOL TABLE SSA (byte[PLEX_COUNT]) PLEX_YPOS (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (const byte) SIZEOF_WORD = (byte) 2 (byte*) SPRITE -(byte*) SPRITE#0 (byte*) SPRITES_COLS (byte*) SPRITES_ENABLE (byte*) SPRITES_XMSB @@ -1149,7 +1147,7 @@ Adding number conversion cast (unumber) init::$1 in (number~) init::$1 ← (byte Adding number conversion cast (unumber) $20 in (word) init::xp#0 ← (number) $20 Adding number conversion cast (unumber) 1 in (number~) init::$3 ← (byte) PLEX_COUNT - (number) 1 Adding number conversion cast (unumber) init::$3 in (number~) init::$3 ← (byte) PLEX_COUNT - (unumber)(number) 1 -Adding number conversion cast (unumber) $40 in (byte*~) init::$4 ← (byte*) SPRITE#0 / (number) $40 +Adding number conversion cast (unumber) $40 in (byte*~) init::$4 ← (byte*) SPRITE / (number) $40 Adding number conversion cast (unumber) 9 in (word) init::xp#1 ← (word) init::xp#2 + (number) 9 Adding number conversion cast (unumber) $ff in *((byte*) SPRITES_ENABLE) ← (number) $ff Adding number conversion cast (unumber) 0 in (byte) loop::sin_idx#0 ← (number) 0 @@ -1187,8 +1185,8 @@ Inlining cast *((byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2 Inlining cast (byte) plex_free_next#0 ← (unumber)(number) 0 Inlining cast (byte) plex_sprite_msb#4 ← (unumber)(number) 1 Inlining cast (byte) plex_free_next#4 ← (unumber)(number) 0 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) SPRITE#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) SPRITE ← (byte*)(number) $2000 Inlining cast (word) init::xp#0 ← (unumber)(number) $20 Inlining cast (byte~) init::$5 ← (byte)(byte*~) init::$4 Inlining cast *((byte*) SPRITES_ENABLE) ← (unumber)(number) $ff @@ -1548,14 +1546,14 @@ Constant (const byte) plex_free_next#0 = 0 Constant (const byte) plex_sprite_msb#4 = 1 Constant (const byte[8]) PLEX_FREE_YPOS = { fill( 8, 0) } Constant (const byte) plex_free_next#29 = 0 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$100]) YSIN = kickasm {{ .var min = 50 .var max = 250-21 .var ampl = max-min; .for(var i=0;i<256;i++) .byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256))) }} -Constant (const byte*) SPRITE#0 = (byte*) 8192 +Constant (const byte*) SPRITE = (byte*) 8192 Constant (const word) init::xp#0 = $20 Constant (const byte) init::sx#0 = 0 Constant (const byte) init::ss#0 = 0 @@ -1563,7 +1561,7 @@ Constant (const byte) loop::sin_idx#0 = 0 Constant (const byte) loop::sy#0 = 0 Constant (const byte) loop::ss#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) plexInit::screen#0 = SCREEN#0 +Constant (const byte*) plexInit::screen#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification Constant value identified { fill( PLEX_COUNT, 0) } in [14] (word[PLEX_COUNT]) PLEX_XPOS ← { fill( PLEX_COUNT, 0) } Constant value identified { fill( PLEX_COUNT, 0) } in [15] (byte[PLEX_COUNT]) PLEX_YPOS ← { fill( PLEX_COUNT, 0) } @@ -1610,7 +1608,7 @@ Constant right-side identified [5] (byte~) plexInit::$1 ← (const byte) PLEX_CO Constant right-side identified [11] (byte~) plexSort::$1 ← (const byte) PLEX_COUNT - (byte) 2 Constant right-side identified [63] (byte~) init::$0 ← (const byte) VIC_DEN | (const byte) VIC_RSEL Constant right-side identified [67] (byte~) init::$3 ← (const byte) PLEX_COUNT - (byte) 1 -Constant right-side identified [69] (byte*~) init::$4 ← (const byte*) SPRITE#0 / (byte) $40 +Constant right-side identified [69] (byte*~) init::$4 ← (const byte*) SPRITE / (byte) $40 Constant right-side identified [86] (byte~) loop::$2 ← (const byte) PLEX_COUNT - (byte) 1 Constant right-side identified [98] (byte~) loop::$8 ← (const byte) PLEX_COUNT - (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -1623,7 +1621,7 @@ Constant (const byte) plexInit::$1 = PLEX_COUNT-1 Constant (const byte) plexSort::$1 = PLEX_COUNT-2 Constant (const byte) init::$0 = VIC_DEN|VIC_RSEL Constant (const byte) init::$3 = PLEX_COUNT-1 -Constant (const byte*) init::$4 = SPRITE#0/$40 +Constant (const byte*) init::$4 = SPRITE/$40 Constant (const byte) loop::$2 = PLEX_COUNT-1 Constant (const byte) loop::$8 = PLEX_COUNT-1 Successful SSA optimization Pass2ConstantIdentification @@ -1702,14 +1700,14 @@ Constant inlined init::$3 = (const byte) PLEX_COUNT-(byte) 1 Constant inlined init::$1 = (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined loop::sin_idx#0 = (byte) 0 Constant inlined init::$0 = (const byte) VIC_DEN|(const byte) VIC_RSEL -Constant inlined plexInit::screen#0 = (const byte*) SCREEN#0 +Constant inlined plexInit::screen#0 = (const byte*) SCREEN Constant inlined loop::$2 = (const byte) PLEX_COUNT-(byte) 1 Constant inlined plex_sprite_msb#4 = (byte) 1 -Constant inlined init::$5 = (byte)(const byte*) SPRITE#0/(byte) $40 +Constant inlined init::$5 = (byte)(const byte*) SPRITE/(byte) $40 Constant inlined plex_show_idx#1 = (byte) 0 Constant inlined plex_sprite_idx#1 = (byte) 0 Constant inlined plex_sprite_msb#1 = (byte) 1 -Constant inlined init::$4 = (const byte*) SPRITE#0/(byte) $40 +Constant inlined init::$4 = (const byte*) SPRITE/(byte) $40 Constant inlined loop::sy#0 = (byte) 0 Constant inlined plex_free_next#0 = (byte) 0 Constant inlined loop::ss#0 = (byte) 0 @@ -1833,7 +1831,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -2013,7 +2011,7 @@ init: scope:[init] from main init::@1: scope:[init] from init init::@1 [83] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 ) [83] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [85] (byte~) init::$8 ← (byte) init::sx#2 << (byte) 1 [86] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$8) ← (word) init::xp#2 [87] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 @@ -2053,8 +2051,6 @@ plexInit::@return: scope:[plexInit] from plexInit::@1 VARIABLE REGISTER WEIGHTS (byte*) PLEX_SCREEN_PTR -(byte*) SCREEN -(byte*) SPRITE (void()) init() (byte~) init::$8 22.0 (byte) init::ss @@ -2270,7 +2266,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -2762,7 +2758,7 @@ init: { jmp b1 // init::@1 b1: - // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #SPRITE/$40 ldy.z sx sta PLEX_PTR,y @@ -2924,7 +2920,7 @@ Statement [72] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#2 Statement [77] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:3::loop:8::plexSort:22 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] Statement [81] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ ] ( main:3::init:6 [ ] ) always clobbers reg byte a -Statement [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a +Statement [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:13 [ init::sx#2 init::sx#1 ] Statement [85] (byte~) init::$8 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$8 ] ( main:3::init:6 [ init::sx#2 init::xp#2 init::$8 ] ) always clobbers reg byte a Statement [86] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$8) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a @@ -2953,7 +2949,7 @@ Statement [70] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT]) PLEX_YPOS Statement [72] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:3::loop:8::plexSort:22 [ loop::sin_idx#1 plexSort::m#2 ] ) always clobbers reg byte a Statement [77] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:3::loop:8::plexSort:22 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] ) always clobbers reg byte a Statement [81] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ ] ( main:3::init:6 [ ] ) always clobbers reg byte a -Statement [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a +Statement [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [85] (byte~) init::$8 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$8 ] ( main:3::init:6 [ init::sx#2 init::xp#2 init::$8 ] ) always clobbers reg byte a Statement [86] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$8) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:3::init:6 [ init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [87] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:3::init:6 [ init::sx#2 init::xp#1 ] ) always clobbers reg byte a @@ -3105,7 +3101,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -3542,7 +3538,7 @@ init: { jmp b1 // init::@1 b1: - // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta PLEX_PTR,x // [85] (byte~) init::$8 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 @@ -3803,15 +3799,13 @@ FINAL SYMBOL TABLE (const byte[8]) PLEX_FREE_YPOS PLEX_FREE_YPOS = { fill( 8, 0) } (const byte[PLEX_COUNT]) PLEX_PTR PLEX_PTR = { fill( PLEX_COUNT, 0) } (byte*) PLEX_SCREEN_PTR -(const byte*) PLEX_SCREEN_PTR#1 PLEX_SCREEN_PTR = (const byte*) SCREEN#0+(word) $3f8 +(const byte*) PLEX_SCREEN_PTR#1 PLEX_SCREEN_PTR = (const byte*) SCREEN+(word) $3f8 (const byte[PLEX_COUNT]) PLEX_SORTED_IDX PLEX_SORTED_IDX = { fill( PLEX_COUNT, 0) } (const word[PLEX_COUNT]) PLEX_XPOS PLEX_XPOS = { fill( PLEX_COUNT, 0) } (const byte[PLEX_COUNT]) PLEX_YPOS PLEX_YPOS = { fill( PLEX_COUNT, 0) } (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 8192 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SPRITE SPRITE = (byte*) 8192 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 @@ -4011,7 +4005,7 @@ Score: 62204 // @begin // @1 // kickasm - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] phi from @1 to @2 [phi:@1->@2] // @2 // [3] call main @@ -4420,7 +4414,7 @@ init: { // init::@1 b1: // PLEX_PTR[sx] = (byte)(SPRITE/$40) - // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [84] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta PLEX_PTR,x // PLEX_XPOS[sx] = xp diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.sym b/src/test/ref/examples/multiplexer/simple-multiplexer.sym index 615342907..588432fb3 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.sym +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.sym @@ -10,15 +10,13 @@ (const byte[8]) PLEX_FREE_YPOS PLEX_FREE_YPOS = { fill( 8, 0) } (const byte[PLEX_COUNT]) PLEX_PTR PLEX_PTR = { fill( PLEX_COUNT, 0) } (byte*) PLEX_SCREEN_PTR -(const byte*) PLEX_SCREEN_PTR#1 PLEX_SCREEN_PTR = (const byte*) SCREEN#0+(word) $3f8 +(const byte*) PLEX_SCREEN_PTR#1 PLEX_SCREEN_PTR = (const byte*) SCREEN+(word) $3f8 (const byte[PLEX_COUNT]) PLEX_SORTED_IDX PLEX_SORTED_IDX = { fill( PLEX_COUNT, 0) } (const word[PLEX_COUNT]) PLEX_XPOS PLEX_XPOS = { fill( PLEX_COUNT, 0) } (const byte[PLEX_COUNT]) PLEX_YPOS PLEX_YPOS = { fill( PLEX_COUNT, 0) } (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 8192 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SPRITE SPRITE = (byte*) 8192 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 diff --git a/src/test/ref/examples/rotate/rotate.cfg b/src/test/ref/examples/rotate/rotate.cfg index faec6503e..e206b74a3 100644 --- a/src/test/ref/examples/rotate/rotate.cfg +++ b/src/test/ref/examples/rotate/rotate.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -133,7 +133,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [68] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) SCREEN#0 print_dword_at::@1/(const byte*) SCREEN#0+(byte) 4 ) + [68] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) SCREEN print_dword_at::@1/(const byte*) SCREEN+(byte) 4 ) [68] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [69] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [70] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 @@ -259,7 +259,7 @@ init::@2: scope:[init] from init to:init::@1 init::@1: scope:[init] from init::@1 init::@2 [124] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@2/(byte) 0 ) - [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN [127] (byte) init::i#1 ← ++ (byte) init::i#2 [128] if((byte) init::i#1!=(byte) 8) goto init::@1 diff --git a/src/test/ref/examples/rotate/rotate.log b/src/test/ref/examples/rotate/rotate.log index 8e011dcf8..a7301043c 100644 --- a/src/test/ref/examples/rotate/rotate.log +++ b/src/test/ref/examples/rotate/rotate.log @@ -423,7 +423,7 @@ print_char_at::@return: scope:[print_char_at] from print_char_at return to:@return @51: scope:[] from @44 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[$140]) SIN ← kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} @@ -453,14 +453,14 @@ init: scope:[init] from main to:init::@3 init::@3: scope:[init] from init *((byte*) SPRITES_ENABLE) ← (number) $ff - (byte*~) init::$1 ← (byte*) SCREEN#0 + (number) $3f8 + (byte*~) init::$1 ← (byte*) SCREEN + (number) $3f8 (byte*) init::sprites_ptr#0 ← (byte*~) init::$1 (byte) init::i#0 ← (byte) 0 to:init::@1 init::@1: scope:[init] from init::@1 init::@3 (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@3/(byte) init::i#0 ) (byte*) init::sprites_ptr#1 ← phi( init::@1/(byte*) init::sprites_ptr#1 init::@3/(byte*) init::sprites_ptr#0 ) - (byte*~) init::$2 ← (byte*) SPRITE#0 / (number) $40 + (byte*~) init::$2 ← (byte*) SPRITE / (number) $40 (byte~) init::$3 ← ((byte)) (byte*~) init::$2 *((byte*) init::sprites_ptr#1 + (byte) init::i#2) ← (byte~) init::$3 *((byte*) SPRITES_COLS + (byte) init::i#2) ← (byte) GREEN @@ -726,7 +726,7 @@ anim::@26: scope:[anim] from anim::@13 (dword~) anim::$30 ← (dword~) anim::$29 - (dword) CLOCKS_PER_INIT (dword) anim::cyclecount#0 ← (dword~) anim::$30 (dword) print_dword_at::dw#0 ← (dword) anim::cyclecount#0 - (byte*) print_dword_at::at#0 ← (byte*) SCREEN#0 + (byte*) print_dword_at::at#0 ← (byte*) SCREEN call print_dword_at to:anim::@27 anim::@27: scope:[anim] from anim::@26 @@ -739,8 +739,8 @@ anim::@return: scope:[anim] from anim::@1 to:@return @54: scope:[] from @53 (byte*) COS#11 ← phi( @53/(byte*) COS#15 ) - (byte*) SPRITE#0 ← ((byte*)) (number) $3000 - kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + (byte*) SPRITE ← ((byte*)) (number) $3000 + kickasm(location (byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -808,10 +808,8 @@ SYMBOL TABLE SSA (const byte) RADIX::OCTAL = (number) 8 (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (byte[$140]) SIN (byte*) SPRITE -(byte*) SPRITE#0 (byte*) SPRITES_COLS (byte*) SPRITES_ENABLE (byte*) SPRITES_XMSB @@ -1323,8 +1321,8 @@ Adding number conversion cast (unumber) print_byte_at::$2 in (number~) print_byt Adding number conversion cast (unumber) 1 in (byte*~) print_byte_at::$3 ← (byte*) print_byte_at::at#3 + (number) 1 Adding number conversion cast (unumber) $40 in (byte*~) $1 ← (byte[$140]) SIN + (number) $40 Adding number conversion cast (unumber) $ff in *((byte*) SPRITES_ENABLE) ← (number) $ff -Adding number conversion cast (unumber) $3f8 in (byte*~) init::$1 ← (byte*) SCREEN#0 + (number) $3f8 -Adding number conversion cast (unumber) $40 in (byte*~) init::$2 ← (byte*) SPRITE#0 / (number) $40 +Adding number conversion cast (unumber) $3f8 in (byte*~) init::$1 ← (byte*) SCREEN + (number) $3f8 +Adding number conversion cast (unumber) $40 in (byte*~) init::$2 ← (byte*) SPRITE / (number) $40 Adding number conversion cast (unumber) 0 in (byte) anim::angle#0 ← (number) 0 Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) 0 in (byte) anim::sprite_msb#0 ← (number) 0 @@ -1387,7 +1385,7 @@ Inlining cast (signed word~) mulf8s_prepared::$6 ← (signed word)(word) mulf8s_ Inlining cast (byte~) mulf8s_prepared::$13 ← (byte)*((signed byte*) mulf8s_prepared::memA) Inlining cast (dword) CLOCKS_PER_INIT ← (unumber)(number) $12 Inlining cast *((dword*) CIA2_TIMER_AB) ← (unumber)(number) $ffffffff -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast *((byte*) SPRITES_ENABLE) ← (unumber)(number) $ff Inlining cast (byte~) init::$3 ← (byte)(byte*~) init::$2 Inlining cast (byte) anim::angle#0 ← (unumber)(number) 0 @@ -1397,7 +1395,7 @@ Inlining cast (byte) anim::sprite_msb#0 ← (unumber)(number) 0 Inlining cast (byte~) anim::mulf8s_prepare1_$0 ← (byte)(signed byte) anim::mulf8s_prepare1_a#1 Inlining cast (byte~) anim::mulf8s_prepare2_$0 ← (byte)(signed byte) anim::mulf8s_prepare2_a#1 Inlining cast (signed byte~) anim::$16 ← (signed byte)(byte~) anim::$15 -Inlining cast (byte*) SPRITE#0 ← (byte*)(number) $3000 +Inlining cast (byte*) SPRITE ← (byte*)(number) $3000 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53248 Simplifying constant pointer cast (byte*) 53249 @@ -1719,7 +1717,7 @@ Constant (const byte*) mulf8u_prepared::memB = (byte*) 255 Constant (const signed byte*) mulf8s_prepared::memA = (signed byte*) 253 Constant (const dword) CLOCKS_PER_INIT = $12 Constant (const byte[]) print_hextab = $2 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[$140]) SIN = kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} @@ -1729,11 +1727,11 @@ Constant (const signed byte[8]) ys = { -$46, 0, $46, -$46, $46, -$46, 0, $46 } Constant (const byte) anim::angle#0 = 0 Constant (const byte) anim::sprite_msb#0 = 0 Constant (const byte) anim::i#0 = 0 -Constant (const byte*) SPRITE#0 = (byte*) 12288 +Constant (const byte*) SPRITE = (byte*) 12288 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) mulf_init::sqr2_hi#0 = mulf_sqr2_hi Constant (const byte*) mulf_init::sqr2_lo#0 = mulf_sqr2_lo -Constant (const byte*) print_dword_at::at#0 = SCREEN#0 +Constant (const byte*) print_dword_at::at#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_word_at::at#0 = print_dword_at::at#0 Successful SSA optimization Pass2ConstantIdentification @@ -1775,8 +1773,8 @@ Constant right-side identified [29] (byte*~) mulf_init::$4 ← (const byte[$200] Constant right-side identified [30] (byte*~) mulf_init::$5 ← (const byte[$200]) mulf_sqr1_hi + (word) $100 Constant right-side identified [89] (byte*) print_word_at::at#1 ← (const byte*) print_dword_at::at#0 + (byte) 4 Constant right-side identified [105] (byte*) COS#0 ← (const byte[$140]) SIN + (byte) $40 -Constant right-side identified [112] (byte*) init::sprites_ptr#0 ← (const byte*) SCREEN#0 + (word) $3f8 -Constant right-side identified [114] (byte*~) init::$2 ← (const byte*) SPRITE#0 / (byte) $40 +Constant right-side identified [112] (byte*) init::sprites_ptr#0 ← (const byte*) SCREEN + (word) $3f8 +Constant right-side identified [114] (byte*~) init::$2 ← (const byte*) SPRITE / (byte) $40 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) mulf_init::sqr1_hi#0 = mulf_sqr1_hi+1 Constant (const byte*) mulf_init::sqr1_lo#0 = mulf_sqr1_lo+1 @@ -1790,8 +1788,8 @@ Constant (const byte) clock_start::$1 = CIA_TIMER_CONTROL_CONTINUOUS Constant (const byte) clock_start::$6 = CIA_TIMER_CONTROL_START Constant (const byte*) print_word_at::at#1 = print_dword_at::at#0+4 Constant (const byte*) COS#0 = SIN+$40 -Constant (const byte*) init::sprites_ptr#0 = SCREEN#0+$3f8 -Constant (const byte*) init::$2 = SPRITE#0/$40 +Constant (const byte*) init::sprites_ptr#0 = SCREEN+$3f8 +Constant (const byte*) init::$2 = SPRITE/$40 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte)init::$2 in [115] (byte~) init::$3 ← (byte)(const byte*) init::$2 Successful SSA optimization Pass2ConstantValues @@ -1857,20 +1855,20 @@ Constant inlined anim::i#0 = (byte) 0 Constant inlined mulf_init::$5 = (const byte[$200]) mulf_sqr1_hi+(word) $100 Constant inlined mulf_init::dir#1 = (byte) 1 Constant inlined mulf_init::dir#0 = (byte) $ff -Constant inlined print_dword_at::at#0 = (const byte*) SCREEN#0 +Constant inlined print_dword_at::at#0 = (const byte*) SCREEN Constant inlined mulf_init::x_255#0 = (byte) -1 Constant inlined mulf_init::x_2#0 = (byte) 0 Constant inlined mulf_init::sqr#0 = (byte) 0 -Constant inlined init::$3 = (byte)(const byte*) SPRITE#0/(byte) $40 -Constant inlined init::$2 = (const byte*) SPRITE#0/(byte) $40 +Constant inlined init::$3 = (byte)(const byte*) SPRITE/(byte) $40 +Constant inlined init::$2 = (const byte*) SPRITE/(byte) $40 Constant inlined anim::angle#0 = (byte) 0 Constant inlined clock_start::$1 = (const byte) CIA_TIMER_CONTROL_CONTINUOUS Constant inlined mulf_init::$7 = (const byte[$200]) mulf_sqr1_lo+(word) $200 Constant inlined mulf_init::sqr1_hi#0 = (const byte[$200]) mulf_sqr1_hi+(byte) 1 Constant inlined mulf_init::sqr1_lo#0 = (const byte[$200]) mulf_sqr1_lo+(byte) 1 Constant inlined mulf_init::$15 = (const byte[$200]) mulf_sqr2_lo+(word) $1ff -Constant inlined print_word_at::at#1 = (const byte*) SCREEN#0+(byte) 4 -Constant inlined print_word_at::at#0 = (const byte*) SCREEN#0 +Constant inlined print_word_at::at#1 = (const byte*) SCREEN+(byte) 4 +Constant inlined print_word_at::at#0 = (const byte*) SCREEN Successful SSA optimization Pass2ConstantInlining Consolidated constant in assignment anim::xpos#0 Consolidated constant in assignment anim::ypos#0 @@ -2015,7 +2013,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -2146,7 +2144,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [68] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) SCREEN#0 print_dword_at::@1/(const byte*) SCREEN#0+(byte) 4 ) + [68] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) SCREEN print_dword_at::@1/(const byte*) SCREEN+(byte) 4 ) [68] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [69] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [70] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 @@ -2272,7 +2270,7 @@ init::@2: scope:[init] from init to:init::@1 init::@1: scope:[init] from init::@1 init::@2 [124] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@2/(byte) 0 ) - [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN [127] (byte) init::i#1 ← ++ (byte) init::i#2 [128] if((byte) init::i#1!=(byte) 8) goto init::@1 @@ -2345,8 +2343,6 @@ mulf_init::@3: scope:[mulf_init] from mulf_init::@2 mulf_init::@4 VARIABLE REGISTER WEIGHTS (byte*) COS -(byte*) SCREEN -(byte*) SPRITE (void()) anim() (signed word~) anim::$11 202.0 (signed word~) anim::$12 202.0 @@ -2717,7 +2713,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main jsr main // [3] phi from @1 to @end [phi:@1->@end] @@ -3108,7 +3104,7 @@ print_dword_at: { // [64] call print_word_at // [68] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN @@ -3126,7 +3122,7 @@ print_dword_at: { // [66] call print_word_at // [68] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN+4 @@ -3491,7 +3487,7 @@ init: { jmp b1 // init::@1 b1: - // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #SPRITE/$40 ldy.z i sta sprites_ptr,y @@ -3833,7 +3829,7 @@ Statement [117] *((const dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main Statement [118] *((const byte*) CIA2_TIMER_B_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [119] *((const byte*) CIA2_TIMER_A_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [123] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a +Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:19 [ init::i#2 init::i#1 ] Statement [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Statement [132] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a @@ -3916,7 +3912,7 @@ Statement [117] *((const dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main Statement [118] *((const byte*) CIA2_TIMER_B_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [119] *((const byte*) CIA2_TIMER_A_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [123] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a +Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Statement [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Statement [132] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a Statement [134] if((byte*) mulf_init::sqr2_lo#2!=(const byte[$200]) mulf_sqr2_lo+(word) $1ff) goto mulf_init::@6 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ) always clobbers reg byte a @@ -3988,7 +3984,7 @@ Statement [117] *((const dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main Statement [118] *((const byte*) CIA2_TIMER_B_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [119] *((const byte*) CIA2_TIMER_A_CONTROL) ← (const byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] ) always clobbers reg byte a Statement [123] *((const byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a +Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Statement [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] ) always clobbers reg byte a Statement [132] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a Statement [134] if((byte*) mulf_init::sqr2_lo#2!=(const byte[$200]) mulf_sqr2_lo+(word) $1ff) goto mulf_init::@6 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ) always clobbers reg byte a @@ -4201,7 +4197,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main jsr main // [3] phi from @1 to @end [phi:@1->@end] @@ -4521,7 +4517,7 @@ print_dword_at: { // [64] call print_word_at // [68] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN @@ -4539,7 +4535,7 @@ print_dword_at: { // [66] call print_word_at // [68] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN+4 @@ -4863,7 +4859,7 @@ init: { jmp b1 // init::@1 b1: - // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta sprites_ptr,x // [126] *((const byte*) SPRITES_COLS + (byte) init::i#2) ← (const byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 @@ -5295,13 +5291,11 @@ FINAL SYMBOL TABLE (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$140]) SIN SIN = kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 12288 +(const byte*) SPRITE SPRITE = (byte*) 12288 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 @@ -5384,7 +5378,7 @@ FINAL SYMBOL TABLE (byte) init::i#1 reg byte x 16.5 (byte) init::i#2 reg byte x 14.666666666666666 (byte*) init::sprites_ptr -(const byte*) init::sprites_ptr#0 sprites_ptr = (const byte*) SCREEN#0+(word) $3f8 +(const byte*) init::sprites_ptr#0 sprites_ptr = (const byte*) SCREEN+(word) $3f8 (void()) main() (label) main::@1 (label) main::@return @@ -5596,7 +5590,7 @@ Score: 30994 // @begin // @1 // kickasm - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // [2] call main // [3] phi from @1 to @end [phi:@1->@end] // @end @@ -5904,7 +5898,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [64] call print_word_at // [68] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN @@ -5920,7 +5914,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [66] call print_word_at // [68] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] - // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [68] phi (byte*) print_word_at::at#2 = (const byte*) SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #SCREEN+4 @@ -6236,7 +6230,7 @@ init: { // init::@1 b1: // sprites_ptr[i] = (byte)(SPRITE/$40) - // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta sprites_ptr,x // SPRITES_COLS[i] = GREEN diff --git a/src/test/ref/examples/rotate/rotate.sym b/src/test/ref/examples/rotate/rotate.sym index e1c1fd73a..649d3c5b2 100644 --- a/src/test/ref/examples/rotate/rotate.sym +++ b/src/test/ref/examples/rotate/rotate.sym @@ -18,13 +18,11 @@ (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$140]) SIN SIN = kickasm {{ .for(var i=0;i<$140;i++) .byte >round($7fff*sin(i*2*PI/256)) }} -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 12288 +(const byte*) SPRITE SPRITE = (byte*) 12288 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 @@ -107,7 +105,7 @@ (byte) init::i#1 reg byte x 16.5 (byte) init::i#2 reg byte x 14.666666666666666 (byte*) init::sprites_ptr -(const byte*) init::sprites_ptr#0 sprites_ptr = (const byte*) SCREEN#0+(word) $3f8 +(const byte*) init::sprites_ptr#0 sprites_ptr = (const byte*) SCREEN+(word) $3f8 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/examples/scroll/scroll.cfg b/src/test/ref/examples/scroll/scroll.cfg index 9396c1109..6d5811719 100644 --- a/src/test/ref/examples/scroll/scroll.cfg +++ b/src/test/ref/examples/scroll/scroll.cfg @@ -14,15 +14,15 @@ main: scope:[main] from @1 [5] call fillscreen to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [6] (byte*) main::nxt#10 ← phi( main/(const byte*) TEXT#0 main::@1/(byte*) main::nxt#10 main::@4/(byte*) main::nxt#11 ) + [6] (byte*) main::nxt#10 ← phi( main/(const byte*) TEXT main::@1/(byte*) main::nxt#10 main::@4/(byte*) main::nxt#11 ) [6] (byte) main::scroll#7 ← phi( main/(byte) 7 main::@1/(byte) main::scroll#7 main::@4/(byte) main::scroll#4 ) - [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 + [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 [11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4 to:main::@5 @@ -35,10 +35,10 @@ main::@7: scope:[main] from main::@5 [15] if((byte) main::c#0!=(byte) 0) goto main::@9 to:main::@8 main::@8: scope:[main] from main::@7 - [16] (byte) main::c#1 ← *((const byte*) TEXT#0) + [16] (byte) main::c#1 ← *((const byte*) TEXT) to:main::@9 main::@9: scope:[main] from main::@7 main::@8 - [17] (byte*) main::nxt#4 ← phi( main::@7/(byte*) main::nxt#10 main::@8/(const byte*) TEXT#0 ) + [17] (byte*) main::nxt#4 ← phi( main::@7/(byte*) main::nxt#10 main::@8/(const byte*) TEXT ) [17] (byte) main::c#2 ← phi( main::@7/(byte) main::c#0 main::@8/(byte) main::c#1 ) [18] *((const byte[]) main::line+(byte) $27) ← (byte) main::c#2 [19] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 @@ -46,8 +46,8 @@ main::@9: scope:[main] from main::@7 main::@8 main::@4: scope:[main] from main::@3 main::@9 [20] (byte*) main::nxt#11 ← phi( main::@9/(byte*) main::nxt#1 main::@3/(byte*) main::nxt#10 ) [20] (byte) main::scroll#4 ← phi( main::@9/(byte) 7 main::@3/(byte) main::scroll#1 ) - [21] *((const byte*) SCROLL#0) ← (byte) main::scroll#4 - [22] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [21] *((const byte*) SCROLL) ← (byte) main::scroll#4 + [22] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 main::@6: scope:[main] from main::@5 [23] *((const byte[]) main::line + (byte) main::i#2) ← *((const byte[]) main::line+(byte) 1 + (byte) main::i#2) @@ -59,8 +59,8 @@ fillscreen: scope:[fillscreen] from main [25] phi() to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 - [26] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::cursor#1 ) - [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [26] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::cursor#1 ) + [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [28] return diff --git a/src/test/ref/examples/scroll/scroll.log b/src/test/ref/examples/scroll/scroll.log index 8e0c13082..81c1b7b88 100644 --- a/src/test/ref/examples/scroll/scroll.log +++ b/src/test/ref/examples/scroll/scroll.log @@ -17,41 +17,41 @@ Culled Empty Block (label) fillscreen::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) BGCOL#0 ← ((byte*)) (number) $d020 - (byte*) SCROLL#0 ← ((byte*)) (number) $d016 - (byte*) TEXT#0 ← (const string) $0 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) BGCOL ← ((byte*)) (number) $d020 + (byte*) SCROLL ← ((byte*)) (number) $d016 + (byte*) TEXT ← (const string) $0 to:@2 (void()) main() main: scope:[main] from @2 - (byte*) fillscreen::screen#0 ← (byte*) SCREEN#0 + (byte*) fillscreen::screen#0 ← (byte*) SCREEN (byte) fillscreen::fill#0 ← (number) $20 call fillscreen to:main::@17 main::@17: scope:[main] from main (byte) main::scroll#0 ← (number) 7 - (byte*) main::nxt#0 ← (byte*) TEXT#0 - (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28 + (byte*) main::nxt#0 ← (byte*) TEXT + (byte*~) main::$1 ← (byte*) SCREEN + (number) $28 (byte[]) main::line ← (byte*~) main::$1 to:main::@2 main::@2: scope:[main] from main::@17 main::@2 main::@7 (byte*) main::nxt#10 ← phi( main::@17/(byte*) main::nxt#0 main::@2/(byte*) main::nxt#10 main::@7/(byte*) main::nxt#11 ) (byte) main::scroll#7 ← phi( main::@17/(byte) main::scroll#0 main::@2/(byte) main::scroll#7 main::@7/(byte) main::scroll#4 ) - (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $fe + (bool~) main::$2 ← *((byte*) RASTER) != (number) $fe if((bool~) main::$2) goto main::@2 to:main::@4 main::@4: scope:[main] from main::@2 main::@4 (byte*) main::nxt#9 ← phi( main::@2/(byte*) main::nxt#10 main::@4/(byte*) main::nxt#9 ) (byte) main::scroll#5 ← phi( main::@2/(byte) main::scroll#7 main::@4/(byte) main::scroll#5 ) - (bool~) main::$3 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$3 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$3) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@4 (byte*) main::nxt#8 ← phi( main::@4/(byte*) main::nxt#9 ) (byte) main::scroll#3 ← phi( main::@4/(byte) main::scroll#5 ) - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) (byte) main::scroll#1 ← -- (byte) main::scroll#3 (bool~) main::$5 ← (byte) main::scroll#1 == (number) $ff (bool~) main::$6 ← ! (bool~) main::$5 @@ -60,8 +60,8 @@ main::@5: scope:[main] from main::@4 main::@7: scope:[main] from main::@15 main::@5 (byte*) main::nxt#11 ← phi( main::@15/(byte*) main::nxt#1 main::@5/(byte*) main::nxt#8 ) (byte) main::scroll#4 ← phi( main::@15/(byte) main::scroll#6 main::@5/(byte) main::scroll#1 ) - *((byte*) SCROLL#0) ← (byte) main::scroll#4 - *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) + *((byte*) SCROLL) ← (byte) main::scroll#4 + *((byte*) BGCOL) ← -- *((byte*) BGCOL) if(true) goto main::@2 to:main::@return main::@6: scope:[main] from main::@5 @@ -101,7 +101,7 @@ main::@15: scope:[main] from main::@10 main::@14 to:main::@7 main::@14: scope:[main] from main::@10 (byte) main::scroll#9 ← phi( main::@10/(byte) main::scroll#8 ) - (byte*) main::nxt#2 ← (byte*) TEXT#0 + (byte*) main::nxt#2 ← (byte*) TEXT (byte) main::c#1 ← *((byte*) main::nxt#2) to:main::@15 main::@return: scope:[main] from main::@7 @@ -146,15 +146,10 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) RASTER -(byte*) RASTER#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte*) SCROLL -(byte*) SCROLL#0 (byte*) TEXT -(byte*) TEXT#0 (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (byte*~) fillscreen::$0 (bool~) fillscreen::$1 @@ -237,9 +232,9 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $20 in (byte) fillscreen::fill#0 ← (number) $20 Adding number conversion cast (unumber) 7 in (byte) main::scroll#0 ← (number) 7 -Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) $28 -Adding number conversion cast (unumber) $fe in (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $fe -Adding number conversion cast (unumber) $ff in (bool~) main::$3 ← *((byte*) RASTER#0) != (number) $ff +Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) SCREEN + (number) $28 +Adding number conversion cast (unumber) $fe in (bool~) main::$2 ← *((byte*) RASTER) != (number) $fe +Adding number conversion cast (unumber) $ff in (bool~) main::$3 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) $ff in (bool~) main::$5 ← (byte) main::scroll#1 == (number) $ff Adding number conversion cast (unumber) 7 in (byte) main::scroll#2 ← (number) 7 Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 @@ -250,10 +245,10 @@ Adding number conversion cast (unumber) 0 in (bool~) main::$9 ← (byte) main::c Adding number conversion cast (unumber) $27 in *((byte[]) main::line + (number) $27) ← (byte) main::c#2 Adding number conversion cast (unumber) $3e8 in (byte*~) fillscreen::$0 ← (byte*) fillscreen::screen#2 + (number) $3e8 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d020 -Inlining cast (byte*) SCROLL#0 ← (byte*)(number) $d016 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d020 +Inlining cast (byte*) SCROLL ← (byte*)(number) $d016 Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) $20 Inlining cast (byte) main::scroll#0 ← (unumber)(number) 7 Inlining cast (byte) main::scroll#2 ← (unumber)(number) 7 @@ -317,35 +312,35 @@ Identical Phi Values (byte) fillscreen::fill#3 (byte) fillscreen::fill#0 Identical Phi Values (byte*) fillscreen::screen#2 (byte*) fillscreen::cursor#0 Identical Phi Values (byte) fillscreen::fill#1 (byte) fillscreen::fill#3 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$2 [14] if(*((byte*) RASTER#0)!=(byte) $fe) goto main::@2 -Simple Condition (bool~) main::$3 [17] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@4 +Simple Condition (bool~) main::$2 [14] if(*((byte*) RASTER)!=(byte) $fe) goto main::@2 +Simple Condition (bool~) main::$3 [17] if(*((byte*) RASTER)!=(byte) $ff) goto main::@4 Simple Condition (bool~) main::$6 [23] if((byte) main::scroll#1!=(byte) $ff) goto main::@7 Simple Condition (bool~) main::$7 [33] if((byte) main::i#2!=(byte) $27) goto main::@9 Simple Condition (bool~) main::$10 [42] if((byte) main::c#0!=(byte) 0) goto main::@15 Simple Condition (bool~) fillscreen::$1 [55] if((byte*) fillscreen::cursor#2<(byte*~) fillscreen::$0) goto fillscreen::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) BGCOL#0 = (byte*) 53280 -Constant (const byte*) SCROLL#0 = (byte*) 53270 -Constant (const byte*) TEXT#0 = $0 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) BGCOL = (byte*) 53280 +Constant (const byte*) SCROLL = (byte*) 53270 +Constant (const byte*) TEXT = $0 Constant (const byte) fillscreen::fill#0 = $20 Constant (const byte) main::scroll#0 = 7 Constant (const byte) main::scroll#2 = 7 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) fillscreen::screen#0 = SCREEN#0 -Constant (const byte*) main::nxt#0 = TEXT#0 -Constant (const byte*) main::nxt#2 = TEXT#0 +Constant (const byte*) fillscreen::screen#0 = SCREEN +Constant (const byte*) main::nxt#0 = TEXT +Constant (const byte*) main::nxt#2 = TEXT Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [27] if(true) goto main::@2 Successful SSA optimization Pass2ConstantIfs Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [1] (byte[]) main::line ← (const byte*) SCREEN#0 + (byte) $28 +Constant right-side identified [1] (byte[]) main::line ← (const byte*) SCREEN + (byte) $28 Constant right-side identified [23] (byte*~) fillscreen::$0 ← (const byte*) fillscreen::screen#0 + (word) $3e8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte[]) main::line = SCREEN#0+$28 +Constant (const byte[]) main::line = SCREEN+$28 Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+$3e8 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::scroll#0 @@ -353,14 +348,14 @@ Inlining constant with var siblings (const byte) main::scroll#2 Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte*) main::nxt#0 Inlining constant with var siblings (const byte*) main::nxt#2 -Constant inlined main::nxt#0 = (const byte*) TEXT#0 +Constant inlined main::nxt#0 = (const byte*) TEXT Constant inlined main::scroll#0 = (byte) 7 -Constant inlined fillscreen::screen#0 = (const byte*) SCREEN#0 -Constant inlined fillscreen::$0 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined fillscreen::screen#0 = (const byte*) SCREEN +Constant inlined fillscreen::$0 = (const byte*) SCREEN+(word) $3e8 Constant inlined main::scroll#2 = (byte) 7 Constant inlined main::i#0 = (byte) 0 -Constant inlined $0 = (const byte*) TEXT#0 -Constant inlined main::nxt#2 = (const byte*) TEXT#0 +Constant inlined $0 = (const byte*) TEXT +Constant inlined main::nxt#2 = (const byte*) TEXT Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in assignment *(main::line+1 + main::$8) Consolidated array index constant in *(main::line+$27) @@ -435,15 +430,15 @@ main: scope:[main] from @1 [5] call fillscreen to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [6] (byte*) main::nxt#10 ← phi( main/(const byte*) TEXT#0 main::@1/(byte*) main::nxt#10 main::@4/(byte*) main::nxt#11 ) + [6] (byte*) main::nxt#10 ← phi( main/(const byte*) TEXT main::@1/(byte*) main::nxt#10 main::@4/(byte*) main::nxt#11 ) [6] (byte) main::scroll#7 ← phi( main/(byte) 7 main::@1/(byte) main::scroll#7 main::@4/(byte) main::scroll#4 ) - [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 + [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 [11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4 to:main::@5 @@ -456,10 +451,10 @@ main::@7: scope:[main] from main::@5 [15] if((byte) main::c#0!=(byte) 0) goto main::@9 to:main::@8 main::@8: scope:[main] from main::@7 - [16] (byte) main::c#1 ← *((const byte*) TEXT#0) + [16] (byte) main::c#1 ← *((const byte*) TEXT) to:main::@9 main::@9: scope:[main] from main::@7 main::@8 - [17] (byte*) main::nxt#4 ← phi( main::@7/(byte*) main::nxt#10 main::@8/(const byte*) TEXT#0 ) + [17] (byte*) main::nxt#4 ← phi( main::@7/(byte*) main::nxt#10 main::@8/(const byte*) TEXT ) [17] (byte) main::c#2 ← phi( main::@7/(byte) main::c#0 main::@8/(byte) main::c#1 ) [18] *((const byte[]) main::line+(byte) $27) ← (byte) main::c#2 [19] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 @@ -467,8 +462,8 @@ main::@9: scope:[main] from main::@7 main::@8 main::@4: scope:[main] from main::@3 main::@9 [20] (byte*) main::nxt#11 ← phi( main::@9/(byte*) main::nxt#1 main::@3/(byte*) main::nxt#10 ) [20] (byte) main::scroll#4 ← phi( main::@9/(byte) 7 main::@3/(byte) main::scroll#1 ) - [21] *((const byte*) SCROLL#0) ← (byte) main::scroll#4 - [22] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [21] *((const byte*) SCROLL) ← (byte) main::scroll#4 + [22] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 main::@6: scope:[main] from main::@5 [23] *((const byte[]) main::line + (byte) main::i#2) ← *((const byte[]) main::line+(byte) 1 + (byte) main::i#2) @@ -480,8 +475,8 @@ fillscreen: scope:[fillscreen] from main [25] phi() to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 - [26] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::cursor#1 ) - [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [26] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::cursor#1 ) + [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [28] return @@ -493,11 +488,6 @@ fillscreen::@2: scope:[fillscreen] from fillscreen::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte*) RASTER -(byte*) SCREEN -(byte*) SCROLL -(byte*) TEXT (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (byte*) fillscreen::cursor (byte*) fillscreen::cursor#1 22.0 @@ -581,7 +571,7 @@ main: { jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #TEXT @@ -599,21 +589,21 @@ main: { jmp b1 // main::@1 b1: - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1_from_b1 jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuz1=_dec_vbuz1 dec.z scroll @@ -649,12 +639,12 @@ main: { jmp b8 // main::@8 b8: - // [16] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuz1=_deref_pbuc1 + // [16] (byte) main::c#1 ← *((const byte*) TEXT) -- vbuz1=_deref_pbuc1 lda TEXT sta.z c // [17] phi from main::@8 to main::@9 [phi:main::@8->main::@9] b9_from_b8: - // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 + // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 lda #TEXT @@ -690,10 +680,10 @@ main: { jmp b4 // main::@4 b4: - // [21] *((const byte*) SCROLL#0) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuz1 + // [21] *((const byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuz1 lda.z scroll sta SCROLL - // [22] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [22] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1_from_b4 // main::@6 @@ -715,7 +705,7 @@ fillscreen: { .label cursor = 7 // [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] b1_from_fillscreen: - // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -723,7 +713,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 @@ -758,19 +748,19 @@ fillscreen: { .byte 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::scroll#7 main::scroll#4 main::scroll#1 ] -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a Statement [14] (byte) main::c#0 ← *((byte*) main::nxt#10) [ main::nxt#10 main::c#0 ] ( main:2 [ main::nxt#10 main::c#0 ] ) always clobbers reg byte a reg byte y Statement [23] *((const byte[]) main::line + (byte) main::i#2) ← *((const byte[]) main::line+(byte) 1 + (byte) main::i#2) [ main::nxt#10 main::i#2 ] ( main:2 [ main::nxt#10 main::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ] -Statement [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a +Statement [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a Statement [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] ) always clobbers reg byte a Statement [14] (byte) main::c#0 ← *((byte*) main::nxt#10) [ main::nxt#10 main::c#0 ] ( main:2 [ main::nxt#10 main::c#0 ] ) always clobbers reg byte a reg byte y Statement [23] *((const byte[]) main::line + (byte) main::i#2) ← *((const byte[]) main::line+(byte) 1 + (byte) main::i#2) [ main::nxt#10 main::i#2 ] ( main:2 [ main::nxt#10 main::i#2 ] ) always clobbers reg byte a -Statement [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a +Statement [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a Statement [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y Potential registers zp ZP_BYTE:2 [ main::scroll#7 main::scroll#4 main::scroll#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::i#2 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -826,7 +816,7 @@ main: { jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #TEXT @@ -843,21 +833,21 @@ main: { jmp b1 // main::@1 b1: - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1_from_b1 jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx dex @@ -889,11 +879,11 @@ main: { jmp b8 // main::@8 b8: - // [16] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 + // [16] (byte) main::c#1 ← *((const byte*) TEXT) -- vbuxx=_deref_pbuc1 ldx TEXT // [17] phi from main::@8 to main::@9 [phi:main::@8->main::@9] b9_from_b8: - // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 + // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 lda #TEXT @@ -927,9 +917,9 @@ main: { jmp b4 // main::@4 b4: - // [21] *((const byte*) SCROLL#0) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx + // [21] *((const byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx stx SCROLL - // [22] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [22] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1_from_b4 // main::@6 @@ -950,7 +940,7 @@ fillscreen: { .label cursor = 2 // [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] b1_from_fillscreen: - // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -958,7 +948,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 @@ -1047,16 +1037,11 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCROLL -(const byte*) SCROLL#0 SCROLL = (byte*) 53270 -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCROLL SCROLL = (byte*) 53270 +(const byte*) TEXT TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (label) fillscreen::@1 (label) fillscreen::@2 @@ -1084,7 +1069,7 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte x 202.0 (byte) main::i#2 reg byte x 168.33333333333331 -(const byte[]) main::line line = (const byte*) SCREEN#0+(byte) $28 +(const byte[]) main::line line = (const byte*) SCREEN+(byte) $28 (byte*) main::nxt (byte*) main::nxt#1 nxt zp ZP_WORD:2 22.0 (byte*) main::nxt#10 nxt zp ZP_WORD:2 20.500000000000004 @@ -1130,7 +1115,7 @@ main: { // [25] phi from main to fillscreen [phi:main->fillscreen] jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] - // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::nxt#10 = (const byte*) TEXT [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #TEXT @@ -1144,20 +1129,20 @@ main: { // main::@1 b1: // while(*RASTER!=$fe) - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1 // main::@2 b2: // while(*RASTER!=$ff) - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 // main::@3 // ++*BGCOL; - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // if(--scroll==$ff) // [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx @@ -1188,10 +1173,10 @@ main: { bne b9 // main::@8 // c = *nxt - // [16] (byte) main::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 + // [16] (byte) main::c#1 ← *((const byte*) TEXT) -- vbuxx=_deref_pbuc1 ldx TEXT // [17] phi from main::@8 to main::@9 [phi:main::@8->main::@9] - // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 + // [17] phi (byte*) main::nxt#4 = (const byte*) TEXT [phi:main::@8->main::@9#0] -- pbuz1=pbuc1 lda #TEXT @@ -1221,10 +1206,10 @@ main: { // main::@4 b4: // *SCROLL = scroll - // [21] *((const byte*) SCROLL#0) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx + // [21] *((const byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx stx SCROLL // --*BGCOL; - // [22] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [22] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 // main::@6 @@ -1245,7 +1230,7 @@ fillscreen: { .const fill = $20 .label cursor = 2 // [26] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] - // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [26] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1253,7 +1238,7 @@ fillscreen: { // fillscreen::@1 b1: // for( byte* cursor = screen; cursor < screen+1000; cursor++) - // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [27] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 diff --git a/src/test/ref/examples/scroll/scroll.sym b/src/test/ref/examples/scroll/scroll.sym index 27f48f504..8aeb965bd 100644 --- a/src/test/ref/examples/scroll/scroll.sym +++ b/src/test/ref/examples/scroll/scroll.sym @@ -1,16 +1,11 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCROLL -(const byte*) SCROLL#0 SCROLL = (byte*) 53270 -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCROLL SCROLL = (byte*) 53270 +(const byte*) TEXT TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (label) fillscreen::@1 (label) fillscreen::@2 @@ -38,7 +33,7 @@ (byte) main::i (byte) main::i#1 reg byte x 202.0 (byte) main::i#2 reg byte x 168.33333333333331 -(const byte[]) main::line line = (const byte*) SCREEN#0+(byte) $28 +(const byte[]) main::line line = (const byte*) SCREEN+(byte) $28 (byte*) main::nxt (byte*) main::nxt#1 nxt zp ZP_WORD:2 22.0 (byte*) main::nxt#10 nxt zp ZP_WORD:2 20.500000000000004 diff --git a/src/test/ref/examples/scrollbig/scrollbig.cfg b/src/test/ref/examples/scrollbig/scrollbig.cfg index 9d722020d..05603b5c9 100644 --- a/src/test/ref/examples/scrollbig/scrollbig.cfg +++ b/src/test/ref/examples/scrollbig/scrollbig.cfg @@ -14,21 +14,21 @@ main: scope:[main] from @1 [5] call fillscreen to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN#0 main::@4/(byte*) current_chargen#11 ) - [6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT#0 main::@4/(byte*) nxt#14 ) + [6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN main::@4/(byte*) current_chargen#11 ) + [6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT main::@4/(byte*) nxt#14 ) [6] (byte) current_bit#29 ← phi( main::@1/(byte) current_bit#29 main/(byte) 1 main::@4/(byte) current_bit#12 ) [6] (byte) scroll#18 ← phi( main::@1/(byte) scroll#18 main/(byte) 7 main::@4/(byte) scroll#10 ) - [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 + [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [10] call scroll_soft to:main::@4 main::@4: scope:[main] from main::@3 - [11] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 (void()) scroll_soft() @@ -45,7 +45,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@2 [16] (byte*) nxt#14 ← phi( scroll_soft/(byte*) nxt#31 scroll_soft::@2/(byte*) nxt#35 ) [16] (byte) current_bit#12 ← phi( scroll_soft/(byte) current_bit#29 scroll_soft::@2/(byte) current_bit#21 ) [16] (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@2/(byte) 7 ) - [17] *((const byte*) SCROLL#0) ← (byte) scroll#10 + [17] *((const byte*) SCROLL) ← (byte) scroll#10 to:scroll_soft::@return scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1 [18] return @@ -64,7 +64,7 @@ scroll_bit::@2: scope:[scroll_bit] from scroll_bit scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2 [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 - [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 + [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 to:scroll_bit::@1 scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8 [27] (byte*) nxt#35 ← phi( scroll_bit/(byte*) nxt#31 scroll_bit::@8/(byte*) nxt#19 ) @@ -74,10 +74,10 @@ scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8 to:scroll_bit::@7 scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1 asm { sei } - [30] *((const byte*) PROCPORT#0) ← (byte) $32 + [30] *((const byte*) PROCPORT) ← (byte) $32 to:scroll_bit::@3 scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@4 scroll_bit::@7 - [31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN#0+(byte) $28+(byte) $27 ) + [31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN+(byte) $28+(byte) $27 ) [31] (byte) scroll_bit::r#2 ← phi( scroll_bit::@4/(byte) scroll_bit::r#1 scroll_bit::@7/(byte) 0 ) [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [33] (byte~) scroll_bit::$9 ← (byte) scroll_bit::bits#0 & (byte) current_bit#21 @@ -94,7 +94,7 @@ scroll_bit::@4: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@5 [40] if((byte) scroll_bit::r#1!=(byte) 8) goto scroll_bit::@3 to:scroll_bit::@6 scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4 - [41] *((const byte*) PROCPORT#0) ← (byte) $37 + [41] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:scroll_bit::@return scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 @@ -113,14 +113,14 @@ scroll_hard::@return: scope:[scroll_hard] from scroll_hard::@1 [47] return to:@return scroll_hard::@2: scope:[scroll_hard] from scroll_hard::@1 - [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) - [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) - [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) - [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) - [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) - [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) - [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) - [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) + [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) + [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) + [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) + [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) + [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) + [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) + [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) + [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [56] (byte) scroll_hard::i#1 ← ++ (byte) scroll_hard::i#2 to:scroll_hard::@1 @@ -130,11 +130,11 @@ next_char: scope:[next_char] from scroll_bit::@2 [58] if((byte) next_char::c#0!=(byte) 0) goto next_char::@1 to:next_char::@2 next_char::@2: scope:[next_char] from next_char - [59] (byte) next_char::c#1 ← *((const byte*) TEXT#0) + [59] (byte) next_char::c#1 ← *((const byte*) TEXT) to:next_char::@1 next_char::@1: scope:[next_char] from next_char next_char::@2 [60] (byte) next_char::return#1 ← phi( next_char/(byte) next_char::c#0 next_char::@2/(byte) next_char::c#1 ) - [60] (byte*) nxt#18 ← phi( next_char/(byte*) nxt#31 next_char::@2/(const byte*) TEXT#0 ) + [60] (byte*) nxt#18 ← phi( next_char/(byte*) nxt#31 next_char::@2/(const byte*) TEXT ) [61] (byte*) nxt#19 ← ++ (byte*) nxt#18 to:next_char::@return next_char::@return: scope:[next_char] from next_char::@1 @@ -146,8 +146,8 @@ fillscreen: scope:[fillscreen] from main [63] phi() to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 - [64] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::cursor#1 ) - [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [64] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::cursor#1 ) + [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [66] return diff --git a/src/test/ref/examples/scrollbig/scrollbig.log b/src/test/ref/examples/scrollbig/scrollbig.log index a4a5abf12..b5ab0356b 100644 --- a/src/test/ref/examples/scrollbig/scrollbig.log +++ b/src/test/ref/examples/scrollbig/scrollbig.log @@ -22,13 +22,13 @@ Culled Empty Block (label) fillscreen::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) PROCPORT#0 ← ((byte*)) (number) 1 - (byte*) CHARGEN#0 ← ((byte*)) (number) $d000 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) BGCOL#0 ← ((byte*)) (number) $d020 - (byte*) SCROLL#0 ← ((byte*)) (number) $d016 - (byte*) TEXT#0 ← (const string) $0 + (byte*) PROCPORT ← ((byte*)) (number) 1 + (byte*) CHARGEN ← ((byte*)) (number) $d000 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) BGCOL ← ((byte*)) (number) $d020 + (byte*) SCROLL ← ((byte*)) (number) $d016 + (byte*) TEXT ← (const string) $0 to:@1 (void()) main() @@ -37,7 +37,7 @@ main: scope:[main] from @6 (byte*) nxt#36 ← phi( @6/(byte*) nxt#26 ) (byte) current_bit#31 ← phi( @6/(byte) current_bit#23 ) (byte) scroll#21 ← phi( @6/(byte) scroll#15 ) - (byte*) fillscreen::screen#0 ← (byte*) SCREEN#0 + (byte*) fillscreen::screen#0 ← (byte*) SCREEN (byte) fillscreen::fill#0 ← (number) $20 call fillscreen to:main::@7 @@ -52,7 +52,7 @@ main::@2: scope:[main] from main::@2 main::@7 main::@8 (byte*) nxt#31 ← phi( main::@2/(byte*) nxt#31 main::@7/(byte*) nxt#34 main::@8/(byte*) nxt#0 ) (byte) current_bit#29 ← phi( main::@2/(byte) current_bit#29 main::@7/(byte) current_bit#30 main::@8/(byte) current_bit#0 ) (byte) scroll#18 ← phi( main::@2/(byte) scroll#18 main::@7/(byte) scroll#20 main::@8/(byte) scroll#0 ) - (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $fe + (bool~) main::$1 ← *((byte*) RASTER) != (number) $fe if((bool~) main::$1) goto main::@2 to:main::@4 main::@4: scope:[main] from main::@2 main::@4 @@ -60,7 +60,7 @@ main::@4: scope:[main] from main::@2 main::@4 (byte*) nxt#27 ← phi( main::@2/(byte*) nxt#31 main::@4/(byte*) nxt#27 ) (byte) current_bit#24 ← phi( main::@2/(byte) current_bit#29 main::@4/(byte) current_bit#24 ) (byte) scroll#16 ← phi( main::@2/(byte) scroll#18 main::@4/(byte) scroll#16 ) - (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$2 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$2) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@4 @@ -68,7 +68,7 @@ main::@5: scope:[main] from main::@4 (byte*) nxt#21 ← phi( main::@4/(byte*) nxt#27 ) (byte) current_bit#17 ← phi( main::@4/(byte) current_bit#24 ) (byte) scroll#13 ← phi( main::@4/(byte) scroll#16 ) - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) call scroll_soft to:main::@8 main::@8: scope:[main] from main::@5 @@ -80,7 +80,7 @@ main::@8: scope:[main] from main::@5 (byte) current_bit#0 ← (byte) current_bit#9 (byte*) nxt#0 ← (byte*) nxt#11 (byte*) current_chargen#0 ← (byte*) current_chargen#8 - *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) + *((byte*) BGCOL) ← -- *((byte*) BGCOL) if(true) goto main::@2 to:main::@return main::@return: scope:[main] from main::@8 @@ -114,7 +114,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@3 (byte*) nxt#23 ← phi( scroll_soft/(byte*) nxt#28 scroll_soft::@3/(byte*) nxt#2 ) (byte) current_bit#19 ← phi( scroll_soft/(byte) current_bit#25 scroll_soft::@3/(byte) current_bit#2 ) (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@3/(byte) scroll#14 ) - *((byte*) SCROLL#0) ← (byte) scroll#10 + *((byte*) SCROLL) ← (byte) scroll#10 to:scroll_soft::@return scroll_soft::@2: scope:[scroll_soft] from scroll_soft (byte*) current_chargen#16 ← phi( scroll_soft/(byte*) current_chargen#23 ) @@ -145,7 +145,7 @@ scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1 to:@return @2: scope:[] from @1 (byte) scroll#19 ← phi( @1/(byte) scroll#2 ) - (byte*) current_chargen#4 ← (byte*) CHARGEN#0 + (byte*) current_chargen#4 ← (byte*) CHARGEN (byte) current_bit#4 ← (number) 1 to:@3 @@ -171,8 +171,8 @@ scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1 (byte) current_bit#21 ← phi( scroll_bit::@1/(byte) current_bit#26 ) (byte*) current_chargen#19 ← phi( scroll_bit::@1/(byte*) current_chargen#24 ) asm { sei } - *((byte*) PROCPORT#0) ← (number) $32 - (byte*~) scroll_bit::$4 ← (byte*) SCREEN#0 + (number) $28 + *((byte*) PROCPORT) ← (number) $32 + (byte*~) scroll_bit::$4 ← (byte*) SCREEN + (number) $28 (byte*~) scroll_bit::$5 ← (byte*~) scroll_bit::$4 + (number) $27 (byte*) scroll_bit::sc#0 ← (byte*~) scroll_bit::$5 (byte) scroll_bit::r#0 ← (byte) 0 @@ -189,7 +189,7 @@ scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2 (byte*) nxt#4 ← (byte*) nxt#15 (word) scroll_bit::c#0 ← (byte~) scroll_bit::$6 (number~) scroll_bit::$7 ← (word) scroll_bit::c#0 * (number) 8 - (byte*~) scroll_bit::$8 ← (byte*) CHARGEN#0 + (number~) scroll_bit::$7 + (byte*~) scroll_bit::$8 ← (byte*) CHARGEN + (number~) scroll_bit::$7 (byte*) current_chargen#5 ← (byte*~) scroll_bit::$8 (byte) current_bit#6 ← (number) $80 to:scroll_bit::@1 @@ -232,7 +232,7 @@ scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4 (byte*) current_chargen#20 ← phi( scroll_bit::@4/(byte*) current_chargen#18 ) (byte*) nxt#25 ← phi( scroll_bit::@4/(byte*) nxt#30 ) (byte) current_bit#22 ← phi( scroll_bit::@4/(byte) current_bit#20 ) - *((byte*) PROCPORT#0) ← (number) $37 + *((byte*) PROCPORT) ← (number) $37 asm { cli } to:scroll_bit::@return scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 @@ -248,7 +248,7 @@ scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 (byte*) current_chargen#26 ← phi( @2/(byte*) current_chargen#4 ) (byte) current_bit#28 ← phi( @2/(byte) current_bit#4 ) (byte) scroll#17 ← phi( @2/(byte) scroll#19 ) - (byte*) nxt#6 ← (byte*) TEXT#0 + (byte*) nxt#6 ← (byte*) TEXT to:@6 (byte()) next_char() @@ -266,7 +266,7 @@ next_char::@1: scope:[next_char] from next_char next_char::@2 (byte) next_char::return#1 ← (byte) next_char::c#2 to:next_char::@return next_char::@2: scope:[next_char] from next_char - (byte*) nxt#8 ← (byte*) TEXT#0 + (byte*) nxt#8 ← (byte*) TEXT (byte) next_char::c#1 ← *((byte*) nxt#8) to:next_char::@1 next_char::@return: scope:[next_char] from next_char::@1 @@ -288,36 +288,36 @@ scroll_hard::@1: scope:[scroll_hard] from scroll_hard scroll_hard::@2 to:scroll_hard::@return scroll_hard::@2: scope:[scroll_hard] from scroll_hard::@1 (byte) scroll_hard::i#3 ← phi( scroll_hard::@1/(byte) scroll_hard::i#2 ) - (byte*~) scroll_hard::$1 ← (byte*) SCREEN#0 + (number) $28*(number) 0 - (byte*~) scroll_hard::$2 ← (byte*) SCREEN#0 + (number) $28*(number) 0 + (byte*~) scroll_hard::$1 ← (byte*) SCREEN + (number) $28*(number) 0 + (byte*~) scroll_hard::$2 ← (byte*) SCREEN + (number) $28*(number) 0 (number~) scroll_hard::$3 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$1 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$2 + (number~) scroll_hard::$3) - (byte*~) scroll_hard::$4 ← (byte*) SCREEN#0 + (number) $28*(number) 1 - (byte*~) scroll_hard::$5 ← (byte*) SCREEN#0 + (number) $28*(number) 1 + (byte*~) scroll_hard::$4 ← (byte*) SCREEN + (number) $28*(number) 1 + (byte*~) scroll_hard::$5 ← (byte*) SCREEN + (number) $28*(number) 1 (number~) scroll_hard::$6 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$4 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$5 + (number~) scroll_hard::$6) - (byte*~) scroll_hard::$7 ← (byte*) SCREEN#0 + (number) $28*(number) 2 - (byte*~) scroll_hard::$8 ← (byte*) SCREEN#0 + (number) $28*(number) 2 + (byte*~) scroll_hard::$7 ← (byte*) SCREEN + (number) $28*(number) 2 + (byte*~) scroll_hard::$8 ← (byte*) SCREEN + (number) $28*(number) 2 (number~) scroll_hard::$9 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$7 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$8 + (number~) scroll_hard::$9) - (byte*~) scroll_hard::$10 ← (byte*) SCREEN#0 + (number) $28*(number) 3 - (byte*~) scroll_hard::$11 ← (byte*) SCREEN#0 + (number) $28*(number) 3 + (byte*~) scroll_hard::$10 ← (byte*) SCREEN + (number) $28*(number) 3 + (byte*~) scroll_hard::$11 ← (byte*) SCREEN + (number) $28*(number) 3 (number~) scroll_hard::$12 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$10 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$11 + (number~) scroll_hard::$12) - (byte*~) scroll_hard::$13 ← (byte*) SCREEN#0 + (number) $28*(number) 4 - (byte*~) scroll_hard::$14 ← (byte*) SCREEN#0 + (number) $28*(number) 4 + (byte*~) scroll_hard::$13 ← (byte*) SCREEN + (number) $28*(number) 4 + (byte*~) scroll_hard::$14 ← (byte*) SCREEN + (number) $28*(number) 4 (number~) scroll_hard::$15 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$13 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$14 + (number~) scroll_hard::$15) - (byte*~) scroll_hard::$16 ← (byte*) SCREEN#0 + (number) $28*(number) 5 - (byte*~) scroll_hard::$17 ← (byte*) SCREEN#0 + (number) $28*(number) 5 + (byte*~) scroll_hard::$16 ← (byte*) SCREEN + (number) $28*(number) 5 + (byte*~) scroll_hard::$17 ← (byte*) SCREEN + (number) $28*(number) 5 (number~) scroll_hard::$18 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$16 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$17 + (number~) scroll_hard::$18) - (byte*~) scroll_hard::$19 ← (byte*) SCREEN#0 + (number) $28*(number) 6 - (byte*~) scroll_hard::$20 ← (byte*) SCREEN#0 + (number) $28*(number) 6 + (byte*~) scroll_hard::$19 ← (byte*) SCREEN + (number) $28*(number) 6 + (byte*~) scroll_hard::$20 ← (byte*) SCREEN + (number) $28*(number) 6 (number~) scroll_hard::$21 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$19 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$20 + (number~) scroll_hard::$21) - (byte*~) scroll_hard::$22 ← (byte*) SCREEN#0 + (number) $28*(number) 7 - (byte*~) scroll_hard::$23 ← (byte*) SCREEN#0 + (number) $28*(number) 7 + (byte*~) scroll_hard::$22 ← (byte*) SCREEN + (number) $28*(number) 7 + (byte*~) scroll_hard::$23 ← (byte*) SCREEN + (number) $28*(number) 7 (number~) scroll_hard::$24 ← (byte) scroll_hard::i#3 + (number) 1 *((byte*~) scroll_hard::$22 + (byte) scroll_hard::i#3) ← *((byte*~) scroll_hard::$23 + (number~) scroll_hard::$24) (byte) scroll_hard::i#1 ← ++ (byte) scroll_hard::i#3 @@ -379,19 +379,12 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) CHARGEN -(byte*) CHARGEN#0 (byte*) PROCPORT -(byte*) PROCPORT#0 (byte*) RASTER -(byte*) RASTER#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte*) SCROLL -(byte*) SCROLL#0 (byte*) TEXT -(byte*) TEXT#0 (byte) current_bit (byte) current_bit#0 (byte) current_bit#1 @@ -651,8 +644,8 @@ SYMBOL TABLE SSA (label) scroll_soft::@return Adding number conversion cast (unumber) $20 in (byte) fillscreen::fill#0 ← (number) $20 -Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $fe -Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $ff +Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((byte*) RASTER) != (number) $fe +Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) 7 in (byte) scroll#2 ← (number) 7 Adding number conversion cast (unumber) $ff in (bool~) scroll_soft::$0 ← (byte) scroll#3 == (number) $ff Adding number conversion cast (unumber) 7 in (byte) scroll#4 ← (number) 7 @@ -660,8 +653,8 @@ Adding number conversion cast (unumber) 1 in (byte) current_bit#4 ← (number) 1 Adding number conversion cast (unumber) 2 in (number~) scroll_bit::$0 ← (byte) current_bit#13 / (number) 2 Adding number conversion cast (unumber) scroll_bit::$0 in (number~) scroll_bit::$0 ← (byte) current_bit#13 / (unumber)(number) 2 Adding number conversion cast (unumber) 0 in (bool~) scroll_bit::$1 ← (byte) current_bit#5 == (number) 0 -Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT#0) ← (number) $32 -Adding number conversion cast (unumber) $28 in (byte*~) scroll_bit::$4 ← (byte*) SCREEN#0 + (number) $28 +Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT) ← (number) $32 +Adding number conversion cast (unumber) $28 in (byte*~) scroll_bit::$4 ← (byte*) SCREEN + (number) $28 Adding number conversion cast (unumber) $27 in (byte*~) scroll_bit::$5 ← (byte*~) scroll_bit::$4 + (number) $27 Adding number conversion cast (unumber) 8 in (number~) scroll_bit::$7 ← (word) scroll_bit::c#0 * (number) 8 Adding number conversion cast (unumber) scroll_bit::$7 in (number~) scroll_bit::$7 ← (word) scroll_bit::c#0 * (unumber)(number) 8 @@ -670,58 +663,58 @@ Adding number conversion cast (unumber) 0 in (bool~) scroll_bit::$10 ← (byte~) Adding number conversion cast (unumber) $28 in (byte*~) scroll_bit::$12 ← (byte*) scroll_bit::sc#2 + (number) $28 Adding number conversion cast (unumber) $80+' ' in (byte) scroll_bit::b#1 ← (number) $80+(byte) ' ' Adding number conversion cast (unumber) $80 in (byte) scroll_bit::b#1 ← ((unumber)) (number) $80+(byte) ' ' -Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT#0) ← (number) $37 +Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT) ← (number) $37 Adding number conversion cast (unumber) 0 in (bool~) next_char::$0 ← (byte) next_char::c#0 == (number) 0 Adding number conversion cast (unumber) 0 in (byte) scroll_hard::i#0 ← (number) 0 Adding number conversion cast (unumber) $27 in (bool~) scroll_hard::$0 ← (byte) scroll_hard::i#2 != (number) $27 -Adding number conversion cast (unumber) $28*0 in (byte*~) scroll_hard::$1 ← (byte*) SCREEN#0 + (number) $28*(number) 0 -Adding number conversion cast (unumber) $28*0 in (byte*~) scroll_hard::$2 ← (byte*) SCREEN#0 + (number) $28*(number) 0 +Adding number conversion cast (unumber) $28*0 in (byte*~) scroll_hard::$1 ← (byte*) SCREEN + (number) $28*(number) 0 +Adding number conversion cast (unumber) $28*0 in (byte*~) scroll_hard::$2 ← (byte*) SCREEN + (number) $28*(number) 0 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$3 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$3 in (number~) scroll_hard::$3 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*1 in (byte*~) scroll_hard::$4 ← (byte*) SCREEN#0 + (number) $28*(number) 1 -Adding number conversion cast (unumber) $28*1 in (byte*~) scroll_hard::$5 ← (byte*) SCREEN#0 + (number) $28*(number) 1 +Adding number conversion cast (unumber) $28*1 in (byte*~) scroll_hard::$4 ← (byte*) SCREEN + (number) $28*(number) 1 +Adding number conversion cast (unumber) $28*1 in (byte*~) scroll_hard::$5 ← (byte*) SCREEN + (number) $28*(number) 1 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$6 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$6 in (number~) scroll_hard::$6 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*2 in (byte*~) scroll_hard::$7 ← (byte*) SCREEN#0 + (number) $28*(number) 2 -Adding number conversion cast (unumber) $28*2 in (byte*~) scroll_hard::$8 ← (byte*) SCREEN#0 + (number) $28*(number) 2 +Adding number conversion cast (unumber) $28*2 in (byte*~) scroll_hard::$7 ← (byte*) SCREEN + (number) $28*(number) 2 +Adding number conversion cast (unumber) $28*2 in (byte*~) scroll_hard::$8 ← (byte*) SCREEN + (number) $28*(number) 2 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$9 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$9 in (number~) scroll_hard::$9 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*3 in (byte*~) scroll_hard::$10 ← (byte*) SCREEN#0 + (number) $28*(number) 3 -Adding number conversion cast (unumber) $28*3 in (byte*~) scroll_hard::$11 ← (byte*) SCREEN#0 + (number) $28*(number) 3 +Adding number conversion cast (unumber) $28*3 in (byte*~) scroll_hard::$10 ← (byte*) SCREEN + (number) $28*(number) 3 +Adding number conversion cast (unumber) $28*3 in (byte*~) scroll_hard::$11 ← (byte*) SCREEN + (number) $28*(number) 3 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$12 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$12 in (number~) scroll_hard::$12 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*4 in (byte*~) scroll_hard::$13 ← (byte*) SCREEN#0 + (number) $28*(number) 4 -Adding number conversion cast (unumber) $28*4 in (byte*~) scroll_hard::$14 ← (byte*) SCREEN#0 + (number) $28*(number) 4 +Adding number conversion cast (unumber) $28*4 in (byte*~) scroll_hard::$13 ← (byte*) SCREEN + (number) $28*(number) 4 +Adding number conversion cast (unumber) $28*4 in (byte*~) scroll_hard::$14 ← (byte*) SCREEN + (number) $28*(number) 4 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$15 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$15 in (number~) scroll_hard::$15 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*5 in (byte*~) scroll_hard::$16 ← (byte*) SCREEN#0 + (number) $28*(number) 5 -Adding number conversion cast (unumber) $28*5 in (byte*~) scroll_hard::$17 ← (byte*) SCREEN#0 + (number) $28*(number) 5 +Adding number conversion cast (unumber) $28*5 in (byte*~) scroll_hard::$16 ← (byte*) SCREEN + (number) $28*(number) 5 +Adding number conversion cast (unumber) $28*5 in (byte*~) scroll_hard::$17 ← (byte*) SCREEN + (number) $28*(number) 5 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$18 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$18 in (number~) scroll_hard::$18 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*6 in (byte*~) scroll_hard::$19 ← (byte*) SCREEN#0 + (number) $28*(number) 6 -Adding number conversion cast (unumber) $28*6 in (byte*~) scroll_hard::$20 ← (byte*) SCREEN#0 + (number) $28*(number) 6 +Adding number conversion cast (unumber) $28*6 in (byte*~) scroll_hard::$19 ← (byte*) SCREEN + (number) $28*(number) 6 +Adding number conversion cast (unumber) $28*6 in (byte*~) scroll_hard::$20 ← (byte*) SCREEN + (number) $28*(number) 6 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$21 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$21 in (number~) scroll_hard::$21 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28*7 in (byte*~) scroll_hard::$22 ← (byte*) SCREEN#0 + (number) $28*(number) 7 -Adding number conversion cast (unumber) $28*7 in (byte*~) scroll_hard::$23 ← (byte*) SCREEN#0 + (number) $28*(number) 7 +Adding number conversion cast (unumber) $28*7 in (byte*~) scroll_hard::$22 ← (byte*) SCREEN + (number) $28*(number) 7 +Adding number conversion cast (unumber) $28*7 in (byte*~) scroll_hard::$23 ← (byte*) SCREEN + (number) $28*(number) 7 Adding number conversion cast (unumber) 1 in (number~) scroll_hard::$24 ← (byte) scroll_hard::i#3 + (number) 1 Adding number conversion cast (unumber) scroll_hard::$24 in (number~) scroll_hard::$24 ← (byte) scroll_hard::i#3 + (unumber)(number) 1 Adding number conversion cast (unumber) $3e8 in (byte*~) fillscreen::$0 ← (byte*) fillscreen::screen#2 + (number) $3e8 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) PROCPORT#0 ← (byte*)(number) 1 -Inlining cast (byte*) CHARGEN#0 ← (byte*)(number) $d000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d020 -Inlining cast (byte*) SCROLL#0 ← (byte*)(number) $d016 +Inlining cast (byte*) PROCPORT ← (byte*)(number) 1 +Inlining cast (byte*) CHARGEN ← (byte*)(number) $d000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d020 +Inlining cast (byte*) SCROLL ← (byte*)(number) $d016 Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) $20 Inlining cast (byte) scroll#2 ← (unumber)(number) 7 Inlining cast (byte) scroll#4 ← (unumber)(number) 7 Inlining cast (byte) current_bit#4 ← (unumber)(number) 1 -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $32 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $32 Inlining cast (byte) current_bit#6 ← (unumber)(number) $80 Inlining cast (byte) scroll_bit::b#1 ← (unumber)(unumber)(number) $80+(byte) ' ' -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $37 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $37 Inlining cast (byte) scroll_hard::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1 @@ -832,7 +825,7 @@ Alias (byte) current_bit#12 = (byte) current_bit#19 (byte) current_bit#3 Alias (byte*) nxt#14 = (byte*) nxt#23 (byte*) nxt#3 Alias (byte*) current_chargen#11 = (byte*) current_chargen#17 (byte*) current_chargen#3 Alias (byte) scroll#15 = (byte) scroll#19 (byte) scroll#2 (byte) scroll#17 -Alias (byte*) CHARGEN#0 = (byte*) current_chargen#4 (byte*) current_chargen#26 (byte*) current_chargen#21 +Alias (byte*) CHARGEN = (byte*) current_chargen#4 (byte*) current_chargen#26 (byte*) current_chargen#21 Alias (byte) current_bit#5 = (byte~) scroll_bit::$0 Alias (byte*) current_chargen#19 = (byte*) current_chargen#24 Alias (byte) current_bit#21 = (byte) current_bit#26 @@ -853,7 +846,7 @@ Alias (byte) current_bit#15 = (byte) current_bit#22 (byte) current_bit#20 (byte) Alias (byte*) nxt#16 = (byte*) nxt#25 (byte*) nxt#30 (byte*) nxt#5 Alias (byte*) current_chargen#13 = (byte*) current_chargen#20 (byte*) current_chargen#18 (byte*) current_chargen#6 Alias (byte) current_bit#23 = (byte) current_bit#28 (byte) current_bit#4 -Alias (byte*) TEXT#0 = (byte*) nxt#6 (byte*) nxt#26 +Alias (byte*) TEXT = (byte*) nxt#6 (byte*) nxt#26 Alias (byte) next_char::return#1 = (byte) next_char::c#2 (byte) next_char::return#4 (byte) next_char::return#2 Alias (byte*) nxt#19 = (byte*) nxt#7 (byte*) nxt#9 Alias (byte) scroll_hard::i#2 = (byte) scroll_hard::i#3 @@ -874,8 +867,8 @@ Alias (byte*) nxt#16 = (byte*) nxt#32 Successful SSA optimization Pass2AliasElimination Identical Phi Values (byte) scroll#20 (byte) scroll#15 Identical Phi Values (byte) current_bit#30 (byte) current_bit#23 -Identical Phi Values (byte*) nxt#34 (byte*) TEXT#0 -Identical Phi Values (byte*) current_chargen#29 (byte*) CHARGEN#0 +Identical Phi Values (byte*) nxt#34 (byte*) TEXT +Identical Phi Values (byte*) current_chargen#29 (byte*) CHARGEN Identical Phi Values (byte) scroll#13 (byte) scroll#18 Identical Phi Values (byte) current_bit#17 (byte) current_bit#29 Identical Phi Values (byte*) nxt#21 (byte*) nxt#31 @@ -908,8 +901,8 @@ Identical Phi Values (byte) current_bit#16 (byte) current_bit#0 Identical Phi Values (byte*) nxt#10 (byte*) nxt#0 Identical Phi Values (byte*) current_chargen#14 (byte*) current_chargen#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$1 [14] if(*((byte*) RASTER#0)!=(byte) $fe) goto main::@2 -Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@4 +Simple Condition (bool~) main::$1 [14] if(*((byte*) RASTER)!=(byte) $fe) goto main::@2 +Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER)!=(byte) $ff) goto main::@4 Simple Condition (bool~) scroll_soft::$1 [39] if((byte) scroll#3!=(byte) $ff) goto scroll_soft::@1 Simple Condition (bool~) scroll_bit::$2 [63] if((byte) current_bit#5!=(byte) 0) goto scroll_bit::@1 Simple Condition (bool~) scroll_bit::$11 [90] if((byte~) scroll_bit::$9==(byte) 0) goto scroll_bit::@4 @@ -918,13 +911,13 @@ Simple Condition (bool~) next_char::$1 [114] if((byte) next_char::c#0!=(byte) 0) Simple Condition (bool~) scroll_hard::$0 [127] if((byte) scroll_hard::i#2!=(byte) $27) goto scroll_hard::@2 Simple Condition (bool~) fillscreen::$1 [168] if((byte*) fillscreen::cursor#2<(byte*~) fillscreen::$0) goto fillscreen::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) PROCPORT#0 = (byte*) 1 -Constant (const byte*) CHARGEN#0 = (byte*) 53248 -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) BGCOL#0 = (byte*) 53280 -Constant (const byte*) SCROLL#0 = (byte*) 53270 -Constant (const byte*) TEXT#0 = $0 +Constant (const byte*) PROCPORT = (byte*) 1 +Constant (const byte*) CHARGEN = (byte*) 53248 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) BGCOL = (byte*) 53280 +Constant (const byte*) SCROLL = (byte*) 53270 +Constant (const byte*) TEXT = $0 Constant (const byte) fillscreen::fill#0 = $20 Constant (const byte) scroll#15 = 7 Constant (const byte) scroll#14 = 7 @@ -935,18 +928,18 @@ Constant (const byte) scroll_bit::b#0 = ' ' Constant (const byte) scroll_bit::b#1 = $80+' ' Constant (const byte) scroll_hard::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) fillscreen::screen#0 = SCREEN#0 -Constant (const byte*) nxt#8 = TEXT#0 +Constant (const byte*) fillscreen::screen#0 = SCREEN +Constant (const byte*) nxt#8 = TEXT Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [27] if(true) goto main::@2 Successful SSA optimization Pass2ConstantIfs Resolved ranged next value [95] scroll_bit::r#1 ← ++ scroll_bit::r#2 to ++ Resolved ranged comparison value [97] if(scroll_bit::r#1!=rangelast(0,7)) goto scroll_bit::@3 to (number) 8 -Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [129] (byte*~) scroll_hard::$1 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 0 -Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [130] (byte*~) scroll_hard::$2 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 0 +Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [129] (byte*~) scroll_hard::$1 ← (const byte*) SCREEN + (byte)(number) $28*(number) 0 +Simplifying constant evaluating to zero (byte)(number) $28*(number) 0 in [130] (byte*~) scroll_hard::$2 ← (const byte*) SCREEN + (byte)(number) $28*(number) 0 Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [129] (byte*~) scroll_hard::$1 ← (const byte*) SCREEN#0 + (byte) 0 -Simplifying expression containing zero SCREEN#0 in [130] (byte*~) scroll_hard::$2 ← (const byte*) SCREEN#0 + (byte) 0 +Simplifying expression containing zero SCREEN in [129] (byte*~) scroll_hard::$1 ← (const byte*) SCREEN + (byte) 0 +Simplifying expression containing zero SCREEN in [130] (byte*~) scroll_hard::$2 ← (const byte*) SCREEN + (byte) 0 Successful SSA optimization PassNSimplifyExpressionWithZero Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks @@ -956,40 +949,40 @@ Simplifying constant integer cast 8 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 8 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [19] (byte*~) scroll_bit::$4 ← (const byte*) SCREEN#0 + (byte) $28 -Constant right-side identified [50] (byte*~) scroll_hard::$4 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 1 -Constant right-side identified [51] (byte*~) scroll_hard::$5 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 1 -Constant right-side identified [54] (byte*~) scroll_hard::$7 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 2 -Constant right-side identified [55] (byte*~) scroll_hard::$8 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 2 -Constant right-side identified [58] (byte*~) scroll_hard::$10 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 3 -Constant right-side identified [59] (byte*~) scroll_hard::$11 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 3 -Constant right-side identified [62] (byte*~) scroll_hard::$13 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 4 -Constant right-side identified [63] (byte*~) scroll_hard::$14 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 4 -Constant right-side identified [66] (byte*~) scroll_hard::$16 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 5 -Constant right-side identified [67] (byte*~) scroll_hard::$17 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 5 -Constant right-side identified [70] (byte*~) scroll_hard::$19 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 6 -Constant right-side identified [71] (byte*~) scroll_hard::$20 ← (const byte*) SCREEN#0 + (byte)(number) $28*(number) 6 -Constant right-side identified [74] (byte*~) scroll_hard::$22 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) 7 -Constant right-side identified [75] (byte*~) scroll_hard::$23 ← (const byte*) SCREEN#0 + (word)(number) $28*(number) 7 +Constant right-side identified [19] (byte*~) scroll_bit::$4 ← (const byte*) SCREEN + (byte) $28 +Constant right-side identified [50] (byte*~) scroll_hard::$4 ← (const byte*) SCREEN + (byte)(number) $28*(number) 1 +Constant right-side identified [51] (byte*~) scroll_hard::$5 ← (const byte*) SCREEN + (byte)(number) $28*(number) 1 +Constant right-side identified [54] (byte*~) scroll_hard::$7 ← (const byte*) SCREEN + (byte)(number) $28*(number) 2 +Constant right-side identified [55] (byte*~) scroll_hard::$8 ← (const byte*) SCREEN + (byte)(number) $28*(number) 2 +Constant right-side identified [58] (byte*~) scroll_hard::$10 ← (const byte*) SCREEN + (byte)(number) $28*(number) 3 +Constant right-side identified [59] (byte*~) scroll_hard::$11 ← (const byte*) SCREEN + (byte)(number) $28*(number) 3 +Constant right-side identified [62] (byte*~) scroll_hard::$13 ← (const byte*) SCREEN + (byte)(number) $28*(number) 4 +Constant right-side identified [63] (byte*~) scroll_hard::$14 ← (const byte*) SCREEN + (byte)(number) $28*(number) 4 +Constant right-side identified [66] (byte*~) scroll_hard::$16 ← (const byte*) SCREEN + (byte)(number) $28*(number) 5 +Constant right-side identified [67] (byte*~) scroll_hard::$17 ← (const byte*) SCREEN + (byte)(number) $28*(number) 5 +Constant right-side identified [70] (byte*~) scroll_hard::$19 ← (const byte*) SCREEN + (byte)(number) $28*(number) 6 +Constant right-side identified [71] (byte*~) scroll_hard::$20 ← (const byte*) SCREEN + (byte)(number) $28*(number) 6 +Constant right-side identified [74] (byte*~) scroll_hard::$22 ← (const byte*) SCREEN + (word)(number) $28*(number) 7 +Constant right-side identified [75] (byte*~) scroll_hard::$23 ← (const byte*) SCREEN + (word)(number) $28*(number) 7 Constant right-side identified [81] (byte*~) fillscreen::$0 ← (const byte*) fillscreen::screen#0 + (word) $3e8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) scroll_bit::$4 = SCREEN#0+$28 -Constant (const byte*) scroll_hard::$1 = SCREEN#0 -Constant (const byte*) scroll_hard::$2 = SCREEN#0 -Constant (const byte*) scroll_hard::$4 = SCREEN#0+(byte)$28*1 -Constant (const byte*) scroll_hard::$5 = SCREEN#0+(byte)$28*1 -Constant (const byte*) scroll_hard::$7 = SCREEN#0+(byte)$28*2 -Constant (const byte*) scroll_hard::$8 = SCREEN#0+(byte)$28*2 -Constant (const byte*) scroll_hard::$10 = SCREEN#0+(byte)$28*3 -Constant (const byte*) scroll_hard::$11 = SCREEN#0+(byte)$28*3 -Constant (const byte*) scroll_hard::$13 = SCREEN#0+(byte)$28*4 -Constant (const byte*) scroll_hard::$14 = SCREEN#0+(byte)$28*4 -Constant (const byte*) scroll_hard::$16 = SCREEN#0+(byte)$28*5 -Constant (const byte*) scroll_hard::$17 = SCREEN#0+(byte)$28*5 -Constant (const byte*) scroll_hard::$19 = SCREEN#0+(byte)$28*6 -Constant (const byte*) scroll_hard::$20 = SCREEN#0+(byte)$28*6 -Constant (const byte*) scroll_hard::$22 = SCREEN#0+(word)$28*7 -Constant (const byte*) scroll_hard::$23 = SCREEN#0+(word)$28*7 +Constant (const byte*) scroll_bit::$4 = SCREEN+$28 +Constant (const byte*) scroll_hard::$1 = SCREEN +Constant (const byte*) scroll_hard::$2 = SCREEN +Constant (const byte*) scroll_hard::$4 = SCREEN+(byte)$28*1 +Constant (const byte*) scroll_hard::$5 = SCREEN+(byte)$28*1 +Constant (const byte*) scroll_hard::$7 = SCREEN+(byte)$28*2 +Constant (const byte*) scroll_hard::$8 = SCREEN+(byte)$28*2 +Constant (const byte*) scroll_hard::$10 = SCREEN+(byte)$28*3 +Constant (const byte*) scroll_hard::$11 = SCREEN+(byte)$28*3 +Constant (const byte*) scroll_hard::$13 = SCREEN+(byte)$28*4 +Constant (const byte*) scroll_hard::$14 = SCREEN+(byte)$28*4 +Constant (const byte*) scroll_hard::$16 = SCREEN+(byte)$28*5 +Constant (const byte*) scroll_hard::$17 = SCREEN+(byte)$28*5 +Constant (const byte*) scroll_hard::$19 = SCREEN+(byte)$28*6 +Constant (const byte*) scroll_hard::$20 = SCREEN+(byte)$28*6 +Constant (const byte*) scroll_hard::$22 = SCREEN+(word)$28*7 +Constant (const byte*) scroll_hard::$23 = SCREEN+(word)$28*7 Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+$3e8 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [19] (byte*) scroll_bit::sc#0 ← (const byte*) scroll_bit::$4 + (byte) $27 @@ -1009,45 +1002,45 @@ Inlining constant with var siblings (const byte) scroll#14 Inlining constant with var siblings (const byte) current_bit#23 Inlining constant with var siblings (const byte) current_bit#6 Inlining constant with var siblings (const byte*) nxt#8 -Constant inlined scroll_hard::$4 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1 -Constant inlined scroll_hard::$5 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 1 -Constant inlined scroll_hard::$2 = (const byte*) SCREEN#0 -Constant inlined scroll_hard::$1 = (const byte*) SCREEN#0 -Constant inlined $0 = (const byte*) TEXT#0 -Constant inlined scroll_hard::$23 = (const byte*) SCREEN#0+(word)(number) $28*(number) 7 +Constant inlined scroll_hard::$4 = (const byte*) SCREEN+(byte)(number) $28*(number) 1 +Constant inlined scroll_hard::$5 = (const byte*) SCREEN+(byte)(number) $28*(number) 1 +Constant inlined scroll_hard::$2 = (const byte*) SCREEN +Constant inlined scroll_hard::$1 = (const byte*) SCREEN +Constant inlined $0 = (const byte*) TEXT +Constant inlined scroll_hard::$23 = (const byte*) SCREEN+(word)(number) $28*(number) 7 Constant inlined current_bit#6 = (byte) $80 Constant inlined scroll_bit::r#0 = (byte) 0 Constant inlined current_bit#23 = (byte) 1 -Constant inlined fillscreen::screen#0 = (const byte*) SCREEN#0 -Constant inlined nxt#8 = (const byte*) TEXT#0 -Constant inlined scroll_hard::$8 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2 -Constant inlined scroll_hard::$7 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 2 -Constant inlined scroll_hard::$20 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 6 -Constant inlined scroll_hard::$22 = (const byte*) SCREEN#0+(word)(number) $28*(number) 7 +Constant inlined fillscreen::screen#0 = (const byte*) SCREEN +Constant inlined nxt#8 = (const byte*) TEXT +Constant inlined scroll_hard::$8 = (const byte*) SCREEN+(byte)(number) $28*(number) 2 +Constant inlined scroll_hard::$7 = (const byte*) SCREEN+(byte)(number) $28*(number) 2 +Constant inlined scroll_hard::$20 = (const byte*) SCREEN+(byte)(number) $28*(number) 6 +Constant inlined scroll_hard::$22 = (const byte*) SCREEN+(word)(number) $28*(number) 7 Constant inlined scroll_hard::i#0 = (byte) 0 -Constant inlined scroll_bit::$4 = (const byte*) SCREEN#0+(byte) $28 +Constant inlined scroll_bit::$4 = (const byte*) SCREEN+(byte) $28 Constant inlined scroll_bit::b#0 = (byte) ' ' -Constant inlined fillscreen::$0 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined fillscreen::$0 = (const byte*) SCREEN+(word) $3e8 Constant inlined scroll_bit::b#1 = (byte) $80+(byte) ' ' -Constant inlined scroll_hard::$13 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 4 -Constant inlined scroll_hard::$14 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 4 -Constant inlined scroll_hard::$16 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 5 -Constant inlined scroll_hard::$17 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 5 -Constant inlined scroll_hard::$19 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 6 -Constant inlined scroll_bit::sc#0 = (const byte*) SCREEN#0+(byte) $28+(byte) $27 +Constant inlined scroll_hard::$13 = (const byte*) SCREEN+(byte)(number) $28*(number) 4 +Constant inlined scroll_hard::$14 = (const byte*) SCREEN+(byte)(number) $28*(number) 4 +Constant inlined scroll_hard::$16 = (const byte*) SCREEN+(byte)(number) $28*(number) 5 +Constant inlined scroll_hard::$17 = (const byte*) SCREEN+(byte)(number) $28*(number) 5 +Constant inlined scroll_hard::$19 = (const byte*) SCREEN+(byte)(number) $28*(number) 6 +Constant inlined scroll_bit::sc#0 = (const byte*) SCREEN+(byte) $28+(byte) $27 Constant inlined scroll#15 = (byte) 7 -Constant inlined scroll_hard::$10 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 3 -Constant inlined scroll_hard::$11 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 3 +Constant inlined scroll_hard::$10 = (const byte*) SCREEN+(byte)(number) $28*(number) 3 +Constant inlined scroll_hard::$11 = (const byte*) SCREEN+(byte)(number) $28*(number) 3 Constant inlined scroll#14 = (byte) 7 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in assignment *(SCREEN#0+1 + scroll_hard::$3) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*1+1 + scroll_hard::$6) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*2+1 + scroll_hard::$9) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*3+1 + scroll_hard::$12) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*4+1 + scroll_hard::$15) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*5+1 + scroll_hard::$18) -Consolidated array index constant in assignment *(SCREEN#0+(byte)$28*6+1 + scroll_hard::$21) -Consolidated array index constant in assignment *(SCREEN#0+(word)$28*7+1 + scroll_hard::$24) +Consolidated array index constant in assignment *(SCREEN+1 + scroll_hard::$3) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*1+1 + scroll_hard::$6) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*2+1 + scroll_hard::$9) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*3+1 + scroll_hard::$12) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*4+1 + scroll_hard::$15) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*5+1 + scroll_hard::$18) +Consolidated array index constant in assignment *(SCREEN+(byte)$28*6+1 + scroll_hard::$21) +Consolidated array index constant in assignment *(SCREEN+(word)$28*7+1 + scroll_hard::$24) Successful SSA optimization Pass2ConstantAdditionElimination Alias (byte) scroll_hard::i#2 = (byte~) scroll_hard::$3 (byte~) scroll_hard::$6 (byte~) scroll_hard::$9 (byte~) scroll_hard::$12 (byte~) scroll_hard::$15 (byte~) scroll_hard::$18 (byte~) scroll_hard::$21 (byte~) scroll_hard::$24 Successful SSA optimization Pass2AliasElimination @@ -1148,21 +1141,21 @@ main: scope:[main] from @1 [5] call fillscreen to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN#0 main::@4/(byte*) current_chargen#11 ) - [6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT#0 main::@4/(byte*) nxt#14 ) + [6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN main::@4/(byte*) current_chargen#11 ) + [6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT main::@4/(byte*) nxt#14 ) [6] (byte) current_bit#29 ← phi( main::@1/(byte) current_bit#29 main/(byte) 1 main::@4/(byte) current_bit#12 ) [6] (byte) scroll#18 ← phi( main::@1/(byte) scroll#18 main/(byte) 7 main::@4/(byte) scroll#10 ) - [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 + [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [10] call scroll_soft to:main::@4 main::@4: scope:[main] from main::@3 - [11] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 (void()) scroll_soft() @@ -1179,7 +1172,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@2 [16] (byte*) nxt#14 ← phi( scroll_soft/(byte*) nxt#31 scroll_soft::@2/(byte*) nxt#35 ) [16] (byte) current_bit#12 ← phi( scroll_soft/(byte) current_bit#29 scroll_soft::@2/(byte) current_bit#21 ) [16] (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@2/(byte) 7 ) - [17] *((const byte*) SCROLL#0) ← (byte) scroll#10 + [17] *((const byte*) SCROLL) ← (byte) scroll#10 to:scroll_soft::@return scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1 [18] return @@ -1198,7 +1191,7 @@ scroll_bit::@2: scope:[scroll_bit] from scroll_bit scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2 [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 - [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 + [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 to:scroll_bit::@1 scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8 [27] (byte*) nxt#35 ← phi( scroll_bit/(byte*) nxt#31 scroll_bit::@8/(byte*) nxt#19 ) @@ -1208,10 +1201,10 @@ scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8 to:scroll_bit::@7 scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1 asm { sei } - [30] *((const byte*) PROCPORT#0) ← (byte) $32 + [30] *((const byte*) PROCPORT) ← (byte) $32 to:scroll_bit::@3 scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@4 scroll_bit::@7 - [31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN#0+(byte) $28+(byte) $27 ) + [31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN+(byte) $28+(byte) $27 ) [31] (byte) scroll_bit::r#2 ← phi( scroll_bit::@4/(byte) scroll_bit::r#1 scroll_bit::@7/(byte) 0 ) [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [33] (byte~) scroll_bit::$9 ← (byte) scroll_bit::bits#0 & (byte) current_bit#21 @@ -1228,7 +1221,7 @@ scroll_bit::@4: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@5 [40] if((byte) scroll_bit::r#1!=(byte) 8) goto scroll_bit::@3 to:scroll_bit::@6 scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4 - [41] *((const byte*) PROCPORT#0) ← (byte) $37 + [41] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:scroll_bit::@return scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 @@ -1247,14 +1240,14 @@ scroll_hard::@return: scope:[scroll_hard] from scroll_hard::@1 [47] return to:@return scroll_hard::@2: scope:[scroll_hard] from scroll_hard::@1 - [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) - [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) - [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) - [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) - [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) - [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) - [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) - [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) + [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) + [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) + [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) + [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) + [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) + [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) + [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) + [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [56] (byte) scroll_hard::i#1 ← ++ (byte) scroll_hard::i#2 to:scroll_hard::@1 @@ -1264,11 +1257,11 @@ next_char: scope:[next_char] from scroll_bit::@2 [58] if((byte) next_char::c#0!=(byte) 0) goto next_char::@1 to:next_char::@2 next_char::@2: scope:[next_char] from next_char - [59] (byte) next_char::c#1 ← *((const byte*) TEXT#0) + [59] (byte) next_char::c#1 ← *((const byte*) TEXT) to:next_char::@1 next_char::@1: scope:[next_char] from next_char next_char::@2 [60] (byte) next_char::return#1 ← phi( next_char/(byte) next_char::c#0 next_char::@2/(byte) next_char::c#1 ) - [60] (byte*) nxt#18 ← phi( next_char/(byte*) nxt#31 next_char::@2/(const byte*) TEXT#0 ) + [60] (byte*) nxt#18 ← phi( next_char/(byte*) nxt#31 next_char::@2/(const byte*) TEXT ) [61] (byte*) nxt#19 ← ++ (byte*) nxt#18 to:next_char::@return next_char::@return: scope:[next_char] from next_char::@1 @@ -1280,8 +1273,8 @@ fillscreen: scope:[fillscreen] from main [63] phi() to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@2 - [64] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN#0 fillscreen::@2/(byte*) fillscreen::cursor#1 ) - [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 + [64] (byte*) fillscreen::cursor#2 ← phi( fillscreen/(const byte*) SCREEN fillscreen::@2/(byte*) fillscreen::cursor#1 ) + [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 to:fillscreen::@return fillscreen::@return: scope:[fillscreen] from fillscreen::@1 [66] return @@ -1293,13 +1286,6 @@ fillscreen::@2: scope:[fillscreen] from fillscreen::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte*) CHARGEN -(byte*) PROCPORT -(byte*) RASTER -(byte*) SCREEN -(byte*) SCROLL -(byte*) TEXT (byte) current_bit (byte) current_bit#12 3.0 (byte) current_bit#21 5.833333333333333 @@ -1446,12 +1432,12 @@ main: { jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARGEN sta.z current_chargen+1 - // [6] phi (byte*) nxt#31 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) nxt#31 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -1474,28 +1460,28 @@ main: { jmp b1 // main::@1 b1: - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1_from_b1 jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [10] call scroll_soft jsr scroll_soft jmp b4 // main::@4 b4: - // [11] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1_from_b4 } @@ -1532,7 +1518,7 @@ scroll_soft: { jmp b1 // scroll_soft::@1 b1: - // [17] *((const byte*) SCROLL#0) ← (byte) scroll#10 -- _deref_pbuc1=vbuz1 + // [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuz1 lda.z scroll sta SCROLL jmp breturn @@ -1585,7 +1571,7 @@ scroll_bit: { rol.z _7+1 asl.z _7 rol.z _7+1 - // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz2 + // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz2 lda.z _7 clc adc #scroll_bit::@3] b3_from_b7: - // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN#0+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 + // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 lda #SCREEN+$28+$27 @@ -1691,7 +1677,7 @@ scroll_bit: { jmp b6 // scroll_bit::@6 b6: - // [41] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -1725,35 +1711,35 @@ scroll_hard: { rts // scroll_hard::@2 b2: - // [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+1,y sta SCREEN,y - // [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*1+1,y sta SCREEN+$28*1,y - // [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*2+1,y sta SCREEN+$28*2,y - // [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*3+1,y sta SCREEN+$28*3,y - // [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*4+1,y sta SCREEN+$28*4,y - // [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*5+1,y sta SCREEN+$28*5,y - // [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*6+1,y sta SCREEN+$28*6,y - // [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28*7+1,y sta SCREEN+$28*7,y @@ -1781,13 +1767,13 @@ next_char: { jmp b2 // next_char::@2 b2: - // [59] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuz1=_deref_pbuc1 + // [59] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuz1=_deref_pbuc1 lda TEXT sta.z c // [60] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] b1_from_b2: // [60] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [60] phi (byte*) nxt#18 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [60] phi (byte*) nxt#18 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -1818,7 +1804,7 @@ fillscreen: { .label cursor = $e // [64] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] b1_from_fillscreen: - // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1826,7 +1812,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 @@ -1861,53 +1847,53 @@ fillscreen: { .byte 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ scroll#18 scroll#10 scroll#3 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ] -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a Statement [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [ scroll_bit::c#0 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::c#0 nxt#19 ] ) always clobbers reg byte a Statement [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 [ scroll_bit::$7 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::$7 nxt#19 ] ) always clobbers reg byte a -Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] ) always clobbers reg byte a -Statement [30] *((const byte*) PROCPORT#0) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a +Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] ) always clobbers reg byte a +Statement [30] *((const byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a Statement [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ scroll_bit::r#2 scroll_bit::r#1 ] Statement [37] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ scroll_bit::r#2 scroll_bit::r#1 ] Statement [38] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte) $28 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ) always clobbers reg byte a -Statement [41] *((const byte*) PROCPORT#0) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a -Statement [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [41] *((const byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a +Statement [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 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 [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [57] (byte) next_char::c#0 ← *((byte*) nxt#31) [ nxt#31 next_char::c#0 ] ( main:2::scroll_soft:10::scroll_bit:15::next_char:22 [ nxt#31 next_char::c#0 ] ) always clobbers reg byte a reg byte y -Statement [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a +Statement [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a Statement [67] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ) always clobbers reg byte a Statement [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [ scroll_bit::c#0 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::c#0 nxt#19 ] ) always clobbers reg byte a Statement [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 [ scroll_bit::$7 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::$7 nxt#19 ] ) always clobbers reg byte a -Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] ) always clobbers reg byte a -Statement [30] *((const byte*) PROCPORT#0) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a +Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] ) always clobbers reg byte a +Statement [30] *((const byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a Statement [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ) always clobbers reg byte a reg byte y Statement [37] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ) always clobbers reg byte y Statement [38] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte) $28 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ) always clobbers reg byte a -Statement [41] *((const byte*) PROCPORT#0) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a -Statement [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a -Statement [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [41] *((const byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] ) always clobbers reg byte a +Statement [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a +Statement [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] ) always clobbers reg byte a Statement [57] (byte) next_char::c#0 ← *((byte*) nxt#31) [ nxt#31 next_char::c#0 ] ( main:2::scroll_soft:10::scroll_bit:15::next_char:22 [ nxt#31 next_char::c#0 ] ) always clobbers reg byte a reg byte y -Statement [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a +Statement [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a Statement [67] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) always clobbers reg byte a reg byte y Potential registers zp ZP_BYTE:2 [ scroll#18 scroll#10 scroll#3 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ] : zp ZP_BYTE:3 , reg byte x , @@ -1993,12 +1979,12 @@ main: { jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARGEN sta.z current_chargen+1 - // [6] phi (byte*) nxt#31 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) nxt#31 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -2020,28 +2006,28 @@ main: { jmp b1 // main::@1 b1: - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1_from_b1 jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [10] call scroll_soft jsr scroll_soft jmp b4 // main::@4 b4: - // [11] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1_from_b4 } @@ -2076,7 +2062,7 @@ scroll_soft: { jmp b1 // scroll_soft::@1 b1: - // [17] *((const byte*) SCROLL#0) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx + // [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx stx SCROLL jmp breturn // scroll_soft::@return @@ -2118,7 +2104,7 @@ scroll_bit: { rol.z _7+1 asl.z _7 rol.z _7+1 - // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1 + // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z current_chargen adc #scroll_bit::@3] b3_from_b7: - // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN#0+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 + // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 lda #SCREEN+$28+$27 @@ -2216,7 +2202,7 @@ scroll_bit: { jmp b6 // scroll_bit::@6 b6: - // [41] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -2247,28 +2233,28 @@ scroll_hard: { rts // scroll_hard::@2 b2: - // [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+1,x sta SCREEN,x - // [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*1+1,x sta SCREEN+$28*1,x - // [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*2+1,x sta SCREEN+$28*2,x - // [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*3+1,x sta SCREEN+$28*3,x - // [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*4+1,x sta SCREEN+$28*4,x - // [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*5+1,x sta SCREEN+$28*5,x - // [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*6+1,x sta SCREEN+$28*6,x - // [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*7+1,x sta SCREEN+$28*7,x // [56] (byte) scroll_hard::i#1 ← ++ (byte) scroll_hard::i#2 -- vbuxx=_inc_vbuxx @@ -2291,12 +2277,12 @@ next_char: { jmp b2 // next_char::@2 b2: - // [59] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 + // [59] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuxx=_deref_pbuc1 ldx TEXT // [60] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] b1_from_b2: // [60] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [60] phi (byte*) nxt#18 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [60] phi (byte*) nxt#18 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -2327,7 +2313,7 @@ fillscreen: { .label cursor = 7 // [64] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] b1_from_fillscreen: - // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2335,7 +2321,7 @@ fillscreen: { jmp b1 // fillscreen::@1 b1: - // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 @@ -2462,20 +2448,13 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCROLL -(const byte*) SCROLL#0 SCROLL = (byte*) 53270 -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCROLL SCROLL = (byte*) 53270 +(const byte*) TEXT TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " (byte) current_bit (byte) current_bit#12 current_bit zp ZP_BYTE:2 3.0 (byte) current_bit#21 current_bit zp ZP_BYTE:2 5.833333333333333 @@ -2604,12 +2583,12 @@ main: { // [63] phi from main to fillscreen [phi:main->fillscreen] jsr fillscreen // [6] phi from main to main::@1 [phi:main->main::@1] - // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARGEN sta.z current_chargen+1 - // [6] phi (byte*) nxt#31 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) nxt#31 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -2628,27 +2607,27 @@ main: { // main::@1 b1: // while(*RASTER!=$fe) - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1 // main::@2 b2: // while(*RASTER!=$ff) - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 // main::@3 // ++*BGCOL; - // [9] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // scroll_soft() // [10] call scroll_soft jsr scroll_soft // main::@4 // --*BGCOL; - // [11] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -2679,7 +2658,7 @@ scroll_soft: { // scroll_soft::@1 b1: // *SCROLL = scroll - // [17] *((const byte*) SCROLL#0) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx + // [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx stx SCROLL // scroll_soft::@return // } @@ -2721,7 +2700,7 @@ scroll_bit: { asl.z _7 rol.z _7+1 // current_chargen = CHARGEN+c*8 - // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1 + // [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z current_chargen adc #scroll_bit::@3] - // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN#0+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 + // [31] phi (byte*) scroll_bit::sc#2 = (const byte*) SCREEN+(byte) $28+(byte) $27 [phi:scroll_bit::@7->scroll_bit::@3#0] -- pbuz1=pbuc1 lda #SCREEN+$28+$27 @@ -2811,7 +2790,7 @@ scroll_bit: { bne b3 // scroll_bit::@6 // *PROCPORT = $37 - // [41] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm @@ -2841,35 +2820,35 @@ scroll_hard: { // scroll_hard::@2 b2: // (SCREEN+40*0)[i]=(SCREEN+40*0)[i+1] - // [48] *((const byte*) SCREEN#0 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+1,x sta SCREEN,x // (SCREEN+40*1)[i]=(SCREEN+40*1)[i+1] - // [49] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*1+1,x sta SCREEN+$28*1,x // (SCREEN+40*2)[i]=(SCREEN+40*2)[i+1] - // [50] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*2+1,x sta SCREEN+$28*2,x // (SCREEN+40*3)[i]=(SCREEN+40*3)[i+1] - // [51] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [51] *((const byte*) SCREEN+(byte)(number) $28*(number) 3 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 3+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*3+1,x sta SCREEN+$28*3,x // (SCREEN+40*4)[i]=(SCREEN+40*4)[i+1] - // [52] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [52] *((const byte*) SCREEN+(byte)(number) $28*(number) 4 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 4+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*4+1,x sta SCREEN+$28*4,x // (SCREEN+40*5)[i]=(SCREEN+40*5)[i+1] - // [53] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [53] *((const byte*) SCREEN+(byte)(number) $28*(number) 5 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 5+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*5+1,x sta SCREEN+$28*5,x // (SCREEN+40*6)[i]=(SCREEN+40*6)[i+1] - // [54] *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [54] *((const byte*) SCREEN+(byte)(number) $28*(number) 6 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 6+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*6+1,x sta SCREEN+$28*6,x // (SCREEN+40*7)[i]=(SCREEN+40*7)[i+1] - // [55] *((const byte*) SCREEN#0+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN#0+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(word)(number) $28*(number) 7+(byte) 1 + (byte) scroll_hard::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28*7+1,x sta SCREEN+$28*7,x // for(byte i=0;i!=39;i++) @@ -2893,11 +2872,11 @@ next_char: { bne b1 // next_char::@2 // c = *nxt - // [59] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuxx=_deref_pbuc1 + // [59] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuxx=_deref_pbuc1 ldx TEXT // [60] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] // [60] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [60] phi (byte*) nxt#18 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [60] phi (byte*) nxt#18 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -2924,7 +2903,7 @@ fillscreen: { .const fill = $20 .label cursor = 7 // [64] phi from fillscreen to fillscreen::@1 [phi:fillscreen->fillscreen::@1] - // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 + // [64] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN [phi:fillscreen->fillscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2932,7 +2911,7 @@ fillscreen: { // fillscreen::@1 b1: // for( byte* cursor = screen; cursor < screen+1000; cursor++) - // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN#0+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b2 diff --git a/src/test/ref/examples/scrollbig/scrollbig.sym b/src/test/ref/examples/scrollbig/scrollbig.sym index 228ea70cf..5375bf69f 100644 --- a/src/test/ref/examples/scrollbig/scrollbig.sym +++ b/src/test/ref/examples/scrollbig/scrollbig.sym @@ -1,20 +1,13 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCROLL -(const byte*) SCROLL#0 SCROLL = (byte*) 53270 -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCROLL SCROLL = (byte*) 53270 +(const byte*) TEXT TEXT = (string) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- " (byte) current_bit (byte) current_bit#12 current_bit zp ZP_BYTE:2 3.0 (byte) current_bit#21 current_bit zp ZP_BYTE:2 5.833333333333333 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.cfg b/src/test/ref/examples/scrolllogo/scrolllogo.cfg index f836bf4af..f635d5485 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.cfg +++ b/src/test/ref/examples/scrolllogo/scrolllogo.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -38,7 +38,7 @@ main::@4: scope:[main] from main::@3 to:main::@1 main::@1: scope:[main] from main::@1 main::@4 [16] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@4/(byte) 0 ) - [17] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + [17] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 [18] (byte) main::ch#1 ← ++ (byte) main::ch#2 [19] if((byte) main::ch#1!=(byte) $f0) goto main::@1 to:main::@2 @@ -107,49 +107,49 @@ render_logo::@return: scope:[render_logo] from render_logo::@11 render_logo::@5 [50] return to:@return render_logo::@6: scope:[render_logo] from render_logo::@5 - [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 + [51] *((const byte*) SCREEN + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 to:render_logo::@15_1 render_logo::@15_1: scope:[render_logo] from render_logo::@6 [52] (byte~) render_logo::$33 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 1 - [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 + [53] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 to:render_logo::@15_2 render_logo::@15_2: scope:[render_logo] from render_logo::@15_1 [54] (byte~) render_logo::$36 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 2 - [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 + [55] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 to:render_logo::@15_3 render_logo::@15_3: scope:[render_logo] from render_logo::@15_2 [56] (byte~) render_logo::$39 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 3 - [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 + [57] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 to:render_logo::@15_4 render_logo::@15_4: scope:[render_logo] from render_logo::@15_3 [58] (byte~) render_logo::$42 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 4 - [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 + [59] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 to:render_logo::@15_5 render_logo::@15_5: scope:[render_logo] from render_logo::@15_4 [60] (byte~) render_logo::$45 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 5 - [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 + [61] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 to:render_logo::@7 render_logo::@7: scope:[render_logo] from render_logo::@15_5 [62] (byte) render_logo::screen_idx#4 ← ++ (byte) render_logo::screen_idx#10 [63] (byte) render_logo::logo_idx#3 ← ++ (byte) render_logo::logo_idx#10 to:render_logo::@5 render_logo::@3: scope:[render_logo] from render_logo::@2 - [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_1 render_logo::@7_1: scope:[render_logo] from render_logo::@3 - [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_2 render_logo::@7_2: scope:[render_logo] from render_logo::@7_1 - [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_3 render_logo::@7_3: scope:[render_logo] from render_logo::@7_2 - [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_4 render_logo::@7_4: scope:[render_logo] from render_logo::@7_3 - [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_5 render_logo::@7_5: scope:[render_logo] from render_logo::@7_4 - [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@4 render_logo::@4: scope:[render_logo] from render_logo::@7_5 [70] (byte) render_logo::screen_idx#3 ← ++ (byte) render_logo::screen_idx#18 @@ -168,48 +168,48 @@ render_logo::@11: scope:[render_logo] from render_logo::@13 render_logo::@8 [76] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@12 to:render_logo::@return render_logo::@12: scope:[render_logo] from render_logo::@11 - [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_1 render_logo::@32_1: scope:[render_logo] from render_logo::@12 - [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_2 render_logo::@32_2: scope:[render_logo] from render_logo::@32_1 - [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_3 render_logo::@32_3: scope:[render_logo] from render_logo::@32_2 - [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_4 render_logo::@32_4: scope:[render_logo] from render_logo::@32_3 - [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_5 render_logo::@32_5: scope:[render_logo] from render_logo::@32_4 - [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@13 render_logo::@13: scope:[render_logo] from render_logo::@32_5 [83] (byte) render_logo::screen_idx#6 ← ++ (byte) render_logo::screen_idx#15 to:render_logo::@11 render_logo::@9: scope:[render_logo] from render_logo::@8 - [84] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 + [84] *((const byte*) SCREEN + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 to:render_logo::@24_1 render_logo::@24_1: scope:[render_logo] from render_logo::@9 [85] (byte~) render_logo::$73 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 1 - [86] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 + [86] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 to:render_logo::@24_2 render_logo::@24_2: scope:[render_logo] from render_logo::@24_1 [87] (byte~) render_logo::$76 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 2 - [88] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 + [88] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 to:render_logo::@24_3 render_logo::@24_3: scope:[render_logo] from render_logo::@24_2 [89] (byte~) render_logo::$79 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 3 - [90] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 + [90] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 to:render_logo::@24_4 render_logo::@24_4: scope:[render_logo] from render_logo::@24_3 [91] (byte~) render_logo::$82 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 4 - [92] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 + [92] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 to:render_logo::@24_5 render_logo::@24_5: scope:[render_logo] from render_logo::@24_4 [93] (byte~) render_logo::$85 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 5 - [94] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 + [94] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 to:render_logo::@10 render_logo::@10: scope:[render_logo] from render_logo::@24_5 [95] (byte) render_logo::screen_idx#5 ← ++ (byte) render_logo::screen_idx#21 @@ -459,7 +459,7 @@ divr16u::@return: scope:[divr16u] from divr16u::@6 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from main::@3 main::@4 [214] (byte) memset::c#4 ← phi( main::@3/(const byte) BLACK main::@4/(const byte) WHITE|(byte) 8 ) - [214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS ) + [214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN main::@4/(void*)(const byte*) COLS ) to:memset::@1 memset::@1: scope:[memset] from memset [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.log b/src/test/ref/examples/scrolllogo/scrolllogo.log index b3482fccf..11b5f8619 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.log +++ b/src/test/ref/examples/scrolllogo/scrolllogo.log @@ -624,9 +624,9 @@ memset::@return: scope:[memset] from memset::@1 to:@return @28: scope:[] from @17 (word) rem16u#31 ← phi( @17/(word) rem16u#33 ) - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) LOGO#0 ← ((byte*)) (number) $2000 - kickasm(location (byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) LOGO ← ((byte*)) (number) $2000 + kickasm(location (byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -645,8 +645,8 @@ main: scope:[main] from @31 *((byte*) BGCOL2) ← (byte) DARK_GREY *((byte*) BGCOL) ← *((byte*) BGCOL2) *((byte*) BGCOL3) ← (byte) BLACK - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) LOGO to:main::toD0181 main::toD0181: scope:[main] from main (word) xsin_idx#25 ← phi( main/(word) xsin_idx#26 ) @@ -677,7 +677,7 @@ main::@3: scope:[main] from main::toD0181_@return (byte~) main::$0 ← (byte) main::toD0181_return#3 *((byte*) D018) ← (byte~) main::$0 *((byte*) D016) ← (byte) VIC_MCM - (void*) memset::str#0 ← (void*)(byte*) SCREEN#0 + (void*) memset::str#0 ← (void*)(byte*) SCREEN (byte) memset::c#0 ← (byte) BLACK (word) memset::num#0 ← (number) $3e8 call memset @@ -702,7 +702,7 @@ main::@1: scope:[main] from main::@1 main::@5 (word) xsin_idx#20 ← phi( main::@1/(word) xsin_idx#20 main::@5/(word) xsin_idx#21 ) (word) rem16u#27 ← phi( main::@1/(word) rem16u#27 main::@5/(word) rem16u#30 ) (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@5/(byte) main::ch#0 ) - *((byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + *((byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 (byte) main::ch#1 ← (byte) main::ch#2 + rangenext(0,$ef) (bool~) main::$6 ← (byte) main::ch#1 != rangelast(0,$ef) if((bool~) main::$6) goto main::@1 @@ -830,7 +830,7 @@ render_logo::@7: scope:[render_logo] from render_logo::@5 render_logo::@7 (byte) render_logo::screen_idx#8 ← phi( render_logo::@5/(byte) render_logo::screen_idx#18 render_logo::@7/(byte) render_logo::screen_idx#8 ) (byte) render_logo::line#9 ← phi( render_logo::@5/(byte) render_logo::line#1 render_logo::@7/(byte) render_logo::line#2 ) (number~) render_logo::$8 ← (number) $28 * (byte) render_logo::line#9 - (byte*~) render_logo::$9 ← (byte*) SCREEN#0 + (number~) render_logo::$8 + (byte*~) render_logo::$9 ← (byte*) SCREEN + (number~) render_logo::$8 *((byte*~) render_logo::$9 + (byte) render_logo::screen_idx#8) ← (number) 0 (byte) render_logo::line#2 ← (byte) render_logo::line#9 + rangenext(0,5) (bool~) render_logo::$10 ← (byte) render_logo::line#2 != rangelast(0,5) @@ -857,7 +857,7 @@ render_logo::@15: scope:[render_logo] from render_logo::@13 render_logo::@15 (byte) render_logo::logo_idx#5 ← phi( render_logo::@13/(byte) render_logo::logo_idx#10 render_logo::@15/(byte) render_logo::logo_idx#5 ) (byte) render_logo::line#10 ← phi( render_logo::@13/(byte) render_logo::line#3 render_logo::@15/(byte) render_logo::line#4 ) (number~) render_logo::$12 ← (number) $28 * (byte) render_logo::line#10 - (byte*~) render_logo::$13 ← (byte*) SCREEN#0 + (number~) render_logo::$12 + (byte*~) render_logo::$13 ← (byte*) SCREEN + (number~) render_logo::$12 (number~) render_logo::$14 ← (number) $28 * (byte) render_logo::line#10 (number~) render_logo::$15 ← (byte) render_logo::logo_idx#5 + (number~) render_logo::$14 *((byte*~) render_logo::$13 + (byte) render_logo::screen_idx#11) ← (number~) render_logo::$15 @@ -887,7 +887,7 @@ render_logo::@24: scope:[render_logo] from render_logo::@22 render_logo::@24 (byte) render_logo::logo_idx#8 ← phi( render_logo::@22/(byte) render_logo::logo_idx#11 render_logo::@24/(byte) render_logo::logo_idx#8 ) (byte) render_logo::line#11 ← phi( render_logo::@22/(byte) render_logo::line#5 render_logo::@24/(byte) render_logo::line#6 ) (number~) render_logo::$20 ← (number) $28 * (byte) render_logo::line#11 - (byte*~) render_logo::$21 ← (byte*) SCREEN#0 + (number~) render_logo::$20 + (byte*~) render_logo::$21 ← (byte*) SCREEN + (number~) render_logo::$20 (number~) render_logo::$22 ← (number) $28 * (byte) render_logo::line#11 (number~) render_logo::$23 ← (byte) render_logo::logo_idx#8 + (number~) render_logo::$22 *((byte*~) render_logo::$21 + (byte) render_logo::screen_idx#13) ← (number~) render_logo::$23 @@ -914,7 +914,7 @@ render_logo::@32: scope:[render_logo] from render_logo::@30 render_logo::@32 (byte) render_logo::screen_idx#16 ← phi( render_logo::@30/(byte) render_logo::screen_idx#23 render_logo::@32/(byte) render_logo::screen_idx#16 ) (byte) render_logo::line#12 ← phi( render_logo::@30/(byte) render_logo::line#7 render_logo::@32/(byte) render_logo::line#8 ) (number~) render_logo::$26 ← (number) $28 * (byte) render_logo::line#12 - (byte*~) render_logo::$27 ← (byte*) SCREEN#0 + (number~) render_logo::$26 + (byte*~) render_logo::$27 ← (byte*) SCREEN + (number~) render_logo::$26 *((byte*~) render_logo::$27 + (byte) render_logo::screen_idx#16) ← (number) 0 (byte) render_logo::line#8 ← (byte) render_logo::line#12 + rangenext(0,5) (bool~) render_logo::$28 ← (byte) render_logo::line#8 != rangelast(0,5) @@ -959,13 +959,11 @@ SYMBOL TABLE SSA (byte*) D018 (byte) DARK_GREY (byte*) LOGO -(byte*) LOGO#0 (dword) PI2_u4f28 (dword) PI_HALF_u4f28 (dword) PI_u4f28 (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (const byte) SIZEOF_SIGNED_WORD = (byte) 2 (byte) VIC_MCM (byte) WHITE @@ -1805,8 +1803,8 @@ Inlining cast (signed word~) sin16s::$14 ← (signed word)(word) sin16s::usinx#1 Inlining cast (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#3 Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) LOGO ← (byte*)(number) $2000 Inlining cast (word) XSIN_SIZE ← (unumber)(number) $200 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 @@ -2272,8 +2270,8 @@ Constant (const word) mulu16_sel::v2#2 = (unumber)$10000/6 Constant (const byte) mulu16_sel::select#2 = 1 Constant (const byte) mulu16_sel::select#3 = 0 Constant (const byte) mulu16_sel::select#4 = 0 -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) LOGO#0 = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) LOGO = (byte*) 8192 Constant (const word) XSIN_SIZE = $200 Constant (const word) memset::num#0 = $3e8 Constant (const word) memset::num#1 = $3e8 @@ -2294,8 +2292,8 @@ Constant (const byte) render_logo::line#5 = 0 Constant (const byte) render_logo::line#7 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = LOGO#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = LOGO Constant (const byte) memset::c#0 = BLACK Constant (const word) sin16s_gen2::wavelength#0 = XSIN_SIZE Successful SSA optimization Pass2ConstantIdentification @@ -2307,7 +2305,7 @@ Successful SSA optimization Pass2ConstantIdentification Constant value identified { fill( XSIN_SIZE, 0) } in [301] (signed word[XSIN_SIZE]) xsin ← { fill( XSIN_SIZE, 0) } Constant value identified (word)main::toD0181_screen#0 in [311] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [315] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (void*)SCREEN#0 in [327] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)SCREEN in [327] (void*) memset::str#0 ← (void*)(const byte*) SCREEN Constant value identified (void*)COLS in [334] (void*) memset::str#1 ← (void*)(const byte*) COLS Successful SSA optimization Pass2ConstantValues if() condition always true - replacing block destination [365] if(true) goto loop::@4 @@ -2368,7 +2366,7 @@ Constant (const signed word) sin16s_gen2::ampl#0 = sin16s_gen2::max#0-sin16s_gen Constant (const signed word[XSIN_SIZE]) xsin = { fill( XSIN_SIZE, 0) } Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 -Constant (const void*) memset::str#0 = (void*)SCREEN#0 +Constant (const void*) memset::str#0 = (void*)SCREEN Constant (const byte) memset::c#1 = WHITE|8 Constant (const void*) memset::str#1 = (void*)COLS Successful SSA optimization Pass2ConstantIdentification @@ -2442,11 +2440,11 @@ if() condition always false - eliminating [173] if((const byte) render_logo::lin Successful SSA optimization Pass2ConstantIfs Simplifying constant evaluating to zero (byte) $28*(const byte) render_logo::line#1 in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [170] (byte*~) render_logo::$9 ← (const byte*) SCREEN#0 + (const byte) render_logo::$8 +Simplifying expression containing zero SCREEN in [170] (byte*~) render_logo::$9 ← (const byte*) SCREEN + (const byte) render_logo::$8 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) render_logo::$8 Successful SSA optimization PassNEliminateUnusedVars -Constant (const byte*) render_logo::$9 = SCREEN#0 +Constant (const byte*) render_logo::$9 = SCREEN Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15 tails: render_logo::@15 blocks: render_logo::@15 Successful SSA optimization Pass2LoopUnroll @@ -2464,14 +2462,14 @@ if() condition always false - eliminating [49] if((const byte) render_logo::line Successful SSA optimization Pass2ConstantIfs Simplifying constant evaluating to zero (byte) $28*(const byte) render_logo::line#3 in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [45] (byte*~) render_logo::$13 ← (const byte*) SCREEN#0 + (const byte) render_logo::$14 +Simplifying expression containing zero SCREEN in [45] (byte*~) render_logo::$13 ← (const byte*) SCREEN + (const byte) render_logo::$14 Simplifying expression containing zero render_logo::logo_idx#10 in [46] (byte~) render_logo::$15 ← (byte) render_logo::logo_idx#10 + (const byte) render_logo::$14 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) render_logo::$14 Successful SSA optimization PassNEliminateUnusedVars Alias (byte) render_logo::logo_idx#10 = (byte~) render_logo::$15 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) render_logo::$13 = SCREEN#0 +Constant (const byte*) render_logo::$13 = SCREEN Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15_1 tails: render_logo::@15_1 blocks: render_logo::@15_1 Successful SSA optimization Pass2LoopUnroll @@ -2487,9 +2485,9 @@ Constant (const byte) render_logo::line#16 = ++render_logo::line#4 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [50] if((const byte) render_logo::line#16==(byte) 6) goto render_logo::@16 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [44] (byte*~) render_logo::$32 ← (const byte*) SCREEN#0 + (const byte) render_logo::$31 +Constant right-side identified [44] (byte*~) render_logo::$32 ← (const byte*) SCREEN + (const byte) render_logo::$31 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$32 = SCREEN#0+render_logo::$31 +Constant (const byte*) render_logo::$32 = SCREEN+render_logo::$31 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15_2 tails: render_logo::@15_2 blocks: render_logo::@15_2 Successful SSA optimization Pass2LoopUnroll @@ -2505,9 +2503,9 @@ Constant (const byte) render_logo::line#18 = ++render_logo::line#16 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [52] if((const byte) render_logo::line#18==(byte) 6) goto render_logo::@16 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [46] (byte*~) render_logo::$35 ← (const byte*) SCREEN#0 + (const byte) render_logo::$34 +Constant right-side identified [46] (byte*~) render_logo::$35 ← (const byte*) SCREEN + (const byte) render_logo::$34 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$35 = SCREEN#0+render_logo::$34 +Constant (const byte*) render_logo::$35 = SCREEN+render_logo::$34 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15_3 tails: render_logo::@15_3 blocks: render_logo::@15_3 Successful SSA optimization Pass2LoopUnroll @@ -2523,9 +2521,9 @@ Constant (const byte) render_logo::line#20 = ++render_logo::line#18 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [54] if((const byte) render_logo::line#20==(byte) 6) goto render_logo::@16 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [48] (byte*~) render_logo::$38 ← (const byte*) SCREEN#0 + (const byte) render_logo::$37 +Constant right-side identified [48] (byte*~) render_logo::$38 ← (const byte*) SCREEN + (const byte) render_logo::$37 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$38 = SCREEN#0+render_logo::$37 +Constant (const byte*) render_logo::$38 = SCREEN+render_logo::$37 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15_4 tails: render_logo::@15_4 blocks: render_logo::@15_4 Successful SSA optimization Pass2LoopUnroll @@ -2541,9 +2539,9 @@ Constant (const byte) render_logo::line#22 = ++render_logo::line#20 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [56] if((const byte) render_logo::line#22==(byte) 6) goto render_logo::@16 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [50] (byte*~) render_logo::$41 ← (const byte*) SCREEN#0 + (const byte) render_logo::$40 +Constant right-side identified [50] (byte*~) render_logo::$41 ← (const byte*) SCREEN + (const byte) render_logo::$40 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$41 = SCREEN#0+render_logo::$40 +Constant (const byte*) render_logo::$41 = SCREEN+render_logo::$40 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@15_5 tails: render_logo::@15_5 blocks: render_logo::@15_5 Successful SSA optimization Pass2LoopUnroll @@ -2569,9 +2567,9 @@ Eliminating variable (byte~) render_logo::$48 from unused block render_logo::@15 Eliminating variable (byte) render_logo::line#26 from unused block render_logo::@15_6 Removing unused block render_logo::@15_6 Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [52] (byte*~) render_logo::$44 ← (const byte*) SCREEN#0 + (const byte) render_logo::$43 +Constant right-side identified [52] (byte*~) render_logo::$44 ← (const byte*) SCREEN + (const byte) render_logo::$43 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$44 = SCREEN#0+render_logo::$43 +Constant (const byte*) render_logo::$44 = SCREEN+render_logo::$43 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@7_1 tails: render_logo::@7_1 blocks: render_logo::@7_1 Successful SSA optimization Pass2LoopUnroll @@ -2587,9 +2585,9 @@ Constant (const byte) render_logo::line#14 = ++render_logo::line#2 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [62] if((const byte) render_logo::line#14==(byte) 6) goto render_logo::@8 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [57] (byte*~) render_logo::$30 ← (const byte*) SCREEN#0 + (const byte) render_logo::$29 +Constant right-side identified [57] (byte*~) render_logo::$30 ← (const byte*) SCREEN + (const byte) render_logo::$29 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$30 = SCREEN#0+render_logo::$29 +Constant (const byte*) render_logo::$30 = SCREEN+render_logo::$29 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@7_2 tails: render_logo::@7_2 blocks: render_logo::@7_2 Successful SSA optimization Pass2LoopUnroll @@ -2605,9 +2603,9 @@ Constant (const byte) render_logo::line#28 = ++render_logo::line#14 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [63] if((const byte) render_logo::line#28==(byte) 6) goto render_logo::@8 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [58] (byte*~) render_logo::$50 ← (const byte*) SCREEN#0 + (const byte) render_logo::$49 +Constant right-side identified [58] (byte*~) render_logo::$50 ← (const byte*) SCREEN + (const byte) render_logo::$49 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$50 = SCREEN#0+render_logo::$49 +Constant (const byte*) render_logo::$50 = SCREEN+render_logo::$49 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@7_3 tails: render_logo::@7_3 blocks: render_logo::@7_3 Successful SSA optimization Pass2LoopUnroll @@ -2623,9 +2621,9 @@ Constant (const byte) render_logo::line#30 = ++render_logo::line#28 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [64] if((const byte) render_logo::line#30==(byte) 6) goto render_logo::@8 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [59] (byte*~) render_logo::$52 ← (const byte*) SCREEN#0 + (const byte) render_logo::$51 +Constant right-side identified [59] (byte*~) render_logo::$52 ← (const byte*) SCREEN + (const byte) render_logo::$51 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$52 = SCREEN#0+render_logo::$51 +Constant (const byte*) render_logo::$52 = SCREEN+render_logo::$51 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@7_4 tails: render_logo::@7_4 blocks: render_logo::@7_4 Successful SSA optimization Pass2LoopUnroll @@ -2641,9 +2639,9 @@ Constant (const byte) render_logo::line#32 = ++render_logo::line#30 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [65] if((const byte) render_logo::line#32==(byte) 6) goto render_logo::@8 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [60] (byte*~) render_logo::$54 ← (const byte*) SCREEN#0 + (const byte) render_logo::$53 +Constant right-side identified [60] (byte*~) render_logo::$54 ← (const byte*) SCREEN + (const byte) render_logo::$53 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$54 = SCREEN#0+render_logo::$53 +Constant (const byte*) render_logo::$54 = SCREEN+render_logo::$53 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@7_5 tails: render_logo::@7_5 blocks: render_logo::@7_5 Successful SSA optimization Pass2LoopUnroll @@ -2668,9 +2666,9 @@ Eliminating variable (byte*~) render_logo::$58 from unused block render_logo::@7 Eliminating variable (byte) render_logo::line#36 from unused block render_logo::@7_6 Removing unused block render_logo::@7_6 Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [61] (byte*~) render_logo::$56 ← (const byte*) SCREEN#0 + (const byte) render_logo::$55 +Constant right-side identified [61] (byte*~) render_logo::$56 ← (const byte*) SCREEN + (const byte) render_logo::$55 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$56 = SCREEN#0+render_logo::$55 +Constant (const byte*) render_logo::$56 = SCREEN+render_logo::$55 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32 tails: render_logo::@32 blocks: render_logo::@32 Successful SSA optimization Pass2LoopUnroll @@ -2688,11 +2686,11 @@ if() condition always false - eliminating [74] if((const byte) render_logo::line Successful SSA optimization Pass2ConstantIfs Simplifying constant evaluating to zero (byte) $28*(const byte) render_logo::line#7 in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [71] (byte*~) render_logo::$27 ← (const byte*) SCREEN#0 + (const byte) render_logo::$26 +Simplifying expression containing zero SCREEN in [71] (byte*~) render_logo::$27 ← (const byte*) SCREEN + (const byte) render_logo::$26 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) render_logo::$26 Successful SSA optimization PassNEliminateUnusedVars -Constant (const byte*) render_logo::$27 = SCREEN#0 +Constant (const byte*) render_logo::$27 = SCREEN Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32_1 tails: render_logo::@32_1 blocks: render_logo::@32_1 Successful SSA optimization Pass2LoopUnroll @@ -2708,9 +2706,9 @@ Constant (const byte) render_logo::line#38 = ++render_logo::line#8 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [75] if((const byte) render_logo::line#38==(byte) 6) goto render_logo::@33 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [70] (byte*~) render_logo::$60 ← (const byte*) SCREEN#0 + (const byte) render_logo::$59 +Constant right-side identified [70] (byte*~) render_logo::$60 ← (const byte*) SCREEN + (const byte) render_logo::$59 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$60 = SCREEN#0+render_logo::$59 +Constant (const byte*) render_logo::$60 = SCREEN+render_logo::$59 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32_2 tails: render_logo::@32_2 blocks: render_logo::@32_2 Successful SSA optimization Pass2LoopUnroll @@ -2726,9 +2724,9 @@ Constant (const byte) render_logo::line#40 = ++render_logo::line#38 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [76] if((const byte) render_logo::line#40==(byte) 6) goto render_logo::@33 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [71] (byte*~) render_logo::$62 ← (const byte*) SCREEN#0 + (const byte) render_logo::$61 +Constant right-side identified [71] (byte*~) render_logo::$62 ← (const byte*) SCREEN + (const byte) render_logo::$61 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$62 = SCREEN#0+render_logo::$61 +Constant (const byte*) render_logo::$62 = SCREEN+render_logo::$61 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32_3 tails: render_logo::@32_3 blocks: render_logo::@32_3 Successful SSA optimization Pass2LoopUnroll @@ -2744,9 +2742,9 @@ Constant (const byte) render_logo::line#42 = ++render_logo::line#40 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [77] if((const byte) render_logo::line#42==(byte) 6) goto render_logo::@33 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [72] (byte*~) render_logo::$64 ← (const byte*) SCREEN#0 + (const byte) render_logo::$63 +Constant right-side identified [72] (byte*~) render_logo::$64 ← (const byte*) SCREEN + (const byte) render_logo::$63 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$64 = SCREEN#0+render_logo::$63 +Constant (const byte*) render_logo::$64 = SCREEN+render_logo::$63 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32_4 tails: render_logo::@32_4 blocks: render_logo::@32_4 Successful SSA optimization Pass2LoopUnroll @@ -2762,9 +2760,9 @@ Constant (const byte) render_logo::line#44 = ++render_logo::line#42 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [78] if((const byte) render_logo::line#44==(byte) 6) goto render_logo::@33 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [73] (byte*~) render_logo::$66 ← (const byte*) SCREEN#0 + (const byte) render_logo::$65 +Constant right-side identified [73] (byte*~) render_logo::$66 ← (const byte*) SCREEN + (const byte) render_logo::$65 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$66 = SCREEN#0+render_logo::$65 +Constant (const byte*) render_logo::$66 = SCREEN+render_logo::$65 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@32_5 tails: render_logo::@32_5 blocks: render_logo::@32_5 Successful SSA optimization Pass2LoopUnroll @@ -2789,9 +2787,9 @@ Eliminating variable (byte*~) render_logo::$70 from unused block render_logo::@3 Eliminating variable (byte) render_logo::line#48 from unused block render_logo::@32_6 Removing unused block render_logo::@32_6 Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [74] (byte*~) render_logo::$68 ← (const byte*) SCREEN#0 + (const byte) render_logo::$67 +Constant right-side identified [74] (byte*~) render_logo::$68 ← (const byte*) SCREEN + (const byte) render_logo::$67 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$68 = SCREEN#0+render_logo::$67 +Constant (const byte*) render_logo::$68 = SCREEN+render_logo::$67 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24 tails: render_logo::@24 blocks: render_logo::@24 Successful SSA optimization Pass2LoopUnroll @@ -2809,14 +2807,14 @@ if() condition always false - eliminating [82] if((const byte) render_logo::line Successful SSA optimization Pass2ConstantIfs Simplifying constant evaluating to zero (byte) $28*(const byte) render_logo::line#5 in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero SCREEN#0 in [78] (byte*~) render_logo::$21 ← (const byte*) SCREEN#0 + (const byte) render_logo::$22 +Simplifying expression containing zero SCREEN in [78] (byte*~) render_logo::$21 ← (const byte*) SCREEN + (const byte) render_logo::$22 Simplifying expression containing zero render_logo::logo_idx#11 in [79] (byte~) render_logo::$23 ← (byte) render_logo::logo_idx#11 + (const byte) render_logo::$22 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) render_logo::$22 Successful SSA optimization PassNEliminateUnusedVars Alias (byte) render_logo::logo_idx#11 = (byte~) render_logo::$23 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) render_logo::$21 = SCREEN#0 +Constant (const byte*) render_logo::$21 = SCREEN Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24_1 tails: render_logo::@24_1 blocks: render_logo::@24_1 Successful SSA optimization Pass2LoopUnroll @@ -2832,9 +2830,9 @@ Constant (const byte) render_logo::line#50 = ++render_logo::line#6 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [83] if((const byte) render_logo::line#50==(byte) 6) goto render_logo::@25 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [77] (byte*~) render_logo::$72 ← (const byte*) SCREEN#0 + (const byte) render_logo::$71 +Constant right-side identified [77] (byte*~) render_logo::$72 ← (const byte*) SCREEN + (const byte) render_logo::$71 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$72 = SCREEN#0+render_logo::$71 +Constant (const byte*) render_logo::$72 = SCREEN+render_logo::$71 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24_2 tails: render_logo::@24_2 blocks: render_logo::@24_2 Successful SSA optimization Pass2LoopUnroll @@ -2850,9 +2848,9 @@ Constant (const byte) render_logo::line#52 = ++render_logo::line#50 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [85] if((const byte) render_logo::line#52==(byte) 6) goto render_logo::@25 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [79] (byte*~) render_logo::$75 ← (const byte*) SCREEN#0 + (const byte) render_logo::$74 +Constant right-side identified [79] (byte*~) render_logo::$75 ← (const byte*) SCREEN + (const byte) render_logo::$74 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$75 = SCREEN#0+render_logo::$74 +Constant (const byte*) render_logo::$75 = SCREEN+render_logo::$74 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24_3 tails: render_logo::@24_3 blocks: render_logo::@24_3 Successful SSA optimization Pass2LoopUnroll @@ -2868,9 +2866,9 @@ Constant (const byte) render_logo::line#54 = ++render_logo::line#52 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [87] if((const byte) render_logo::line#54==(byte) 6) goto render_logo::@25 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [81] (byte*~) render_logo::$78 ← (const byte*) SCREEN#0 + (const byte) render_logo::$77 +Constant right-side identified [81] (byte*~) render_logo::$78 ← (const byte*) SCREEN + (const byte) render_logo::$77 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$78 = SCREEN#0+render_logo::$77 +Constant (const byte*) render_logo::$78 = SCREEN+render_logo::$77 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24_4 tails: render_logo::@24_4 blocks: render_logo::@24_4 Successful SSA optimization Pass2LoopUnroll @@ -2886,9 +2884,9 @@ Constant (const byte) render_logo::line#56 = ++render_logo::line#54 Successful SSA optimization Pass2ConstantIdentification if() condition always false - eliminating [89] if((const byte) render_logo::line#56==(byte) 6) goto render_logo::@25 Successful SSA optimization Pass2ConstantIfs -Constant right-side identified [83] (byte*~) render_logo::$81 ← (const byte*) SCREEN#0 + (const byte) render_logo::$80 +Constant right-side identified [83] (byte*~) render_logo::$81 ← (const byte*) SCREEN + (const byte) render_logo::$80 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$81 = SCREEN#0+render_logo::$80 +Constant (const byte*) render_logo::$81 = SCREEN+render_logo::$80 Successful SSA optimization Pass2ConstantIdentification Unrolling loop Loop head: render_logo::@24_5 tails: render_logo::@24_5 blocks: render_logo::@24_5 Successful SSA optimization Pass2LoopUnroll @@ -2914,9 +2912,9 @@ Eliminating variable (byte~) render_logo::$88 from unused block render_logo::@24 Eliminating variable (byte) render_logo::line#60 from unused block render_logo::@24_6 Removing unused block render_logo::@24_6 Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [85] (byte*~) render_logo::$84 ← (const byte*) SCREEN#0 + (const byte) render_logo::$83 +Constant right-side identified [85] (byte*~) render_logo::$84 ← (const byte*) SCREEN + (const byte) render_logo::$83 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) render_logo::$84 = SCREEN#0+render_logo::$83 +Constant (const byte*) render_logo::$84 = SCREEN+render_logo::$83 Successful SSA optimization Pass2ConstantIdentification Inlining Noop Cast [37] (byte) render_logo::logo_start#0 ← (byte)(signed byte) render_logo::x_char#0 keeping render_logo::x_char#0 Inlining Noop Cast [164] (signed word) sin16s::sinx#0 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1 @@ -2988,9 +2986,9 @@ Inlining constant with var siblings (const word) xsin_idx#16 Inlining constant with var siblings (const word) xsin_idx#4 Constant inlined render_logo::line#56 = ++++++++++(byte) 0 Constant inlined divr16u::rem#3 = (byte) 0 -Constant inlined render_logo::$30 = (const byte*) SCREEN#0+(byte) $28*++(byte) 0 +Constant inlined render_logo::$30 = (const byte*) SCREEN+(byte) $28*++(byte) 0 Constant inlined render_logo::line#52 = ++++++(byte) 0 -Constant inlined render_logo::$32 = (const byte*) SCREEN#0+(byte) $28*++(byte) 0 +Constant inlined render_logo::$32 = (const byte*) SCREEN+(byte) $28*++(byte) 0 Constant inlined render_logo::line#54 = ++++++++(byte) 0 Constant inlined render_logo::$31 = (byte) $28*++(byte) 0 Constant inlined sin16s::isUpper#0 = (byte) 0 @@ -3002,47 +3000,47 @@ Constant inlined mulu16_sel::select#0 = (byte) 0 Constant inlined sin16s::isUpper#1 = (byte) 1 Constant inlined mulu16_sel::select#1 = (byte) 1 Constant inlined render_logo::$34 = (byte) $28*++++(byte) 0 -Constant inlined render_logo::$35 = (const byte*) SCREEN#0+(byte) $28*++++(byte) 0 -Constant inlined render_logo::$38 = (const byte*) SCREEN#0+(byte) $28*++++++(byte) 0 +Constant inlined render_logo::$35 = (const byte*) SCREEN+(byte) $28*++++(byte) 0 +Constant inlined render_logo::$38 = (const byte*) SCREEN+(byte) $28*++++++(byte) 0 Constant inlined render_logo::$37 = (byte) $28*++++++(byte) 0 Constant inlined main::ch#0 = (byte) 0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) LOGO#0/(byte) 4&(byte) $f -Constant inlined render_logo::$41 = (const byte*) SCREEN#0+(byte) $28*++++++++(byte) 0 +Constant inlined main::toD0181_$7 = >(word)(const byte*) LOGO/(byte) 4&(byte) $f +Constant inlined render_logo::$41 = (const byte*) SCREEN+(byte) $28*++++++++(byte) 0 Constant inlined render_logo::$40 = (byte) $28*++++++++(byte) 0 Constant inlined render_logo::$43 = (byte) $28*++++++++++(byte) 0 -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined sin16s_gen2::wavelength#0 = (const word) XSIN_SIZE -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) LOGO#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) LOGO#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) LOGO#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) LOGO/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) LOGO +Constant inlined main::toD0181_$4 = (word)(const byte*) LOGO +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined xsin_idx#16 = (byte) 0 Constant inlined sin16s_gen2::sintab#1 = (const signed word[XSIN_SIZE]) xsin -Constant inlined render_logo::$44 = (const byte*) SCREEN#0+(byte) $28*++++++++++(byte) 0 +Constant inlined render_logo::$44 = (const byte*) SCREEN+(byte) $28*++++++++++(byte) 0 Constant inlined memset::c#0 = (const byte) BLACK Constant inlined render_logo::$49 = (byte) $28*++++(byte) 0 Constant inlined memset::c#1 = (const byte) WHITE|(byte) 8 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined render_logo::$50 = (const byte*) SCREEN#0+(byte) $28*++++(byte) 0 -Constant inlined render_logo::$52 = (const byte*) SCREEN#0+(byte) $28*++++++(byte) 0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined render_logo::$50 = (const byte*) SCREEN+(byte) $28*++++(byte) 0 +Constant inlined render_logo::$52 = (const byte*) SCREEN+(byte) $28*++++++(byte) 0 Constant inlined divr16u::i#0 = (byte) 0 Constant inlined render_logo::$51 = (byte) $28*++++++(byte) 0 -Constant inlined render_logo::$54 = (const byte*) SCREEN#0+(byte) $28*++++++++(byte) 0 +Constant inlined render_logo::$54 = (const byte*) SCREEN+(byte) $28*++++++++(byte) 0 Constant inlined render_logo::$53 = (byte) $28*++++++++(byte) 0 Constant inlined sin16s_gen2::x#0 = (byte) 0 -Constant inlined render_logo::$56 = (const byte*) SCREEN#0+(byte) $28*++++++++++(byte) 0 +Constant inlined render_logo::$56 = (const byte*) SCREEN+(byte) $28*++++++++++(byte) 0 Constant inlined render_logo::$55 = (byte) $28*++++++++++(byte) 0 Constant inlined render_logo::screen_idx#1 = (byte) 0 Constant inlined render_logo::$59 = (byte) $28*++(byte) 0 Constant inlined render_logo::screen_idx#2 = (byte) 0 Constant inlined render_logo::$61 = (byte) $28*++++(byte) 0 -Constant inlined render_logo::$60 = (const byte*) SCREEN#0+(byte) $28*++(byte) 0 +Constant inlined render_logo::$60 = (const byte*) SCREEN+(byte) $28*++(byte) 0 Constant inlined render_logo::$63 = (byte) $28*++++++(byte) 0 -Constant inlined render_logo::$62 = (const byte*) SCREEN#0+(byte) $28*++++(byte) 0 +Constant inlined render_logo::$62 = (const byte*) SCREEN+(byte) $28*++++(byte) 0 Constant inlined render_logo::$65 = (byte) $28*++++++++(byte) 0 -Constant inlined render_logo::$64 = (const byte*) SCREEN#0+(byte) $28*++++++(byte) 0 +Constant inlined render_logo::$64 = (const byte*) SCREEN+(byte) $28*++++++(byte) 0 Constant inlined divr16u::dividend#1 = >(const dword) PI2_u4f28 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 Constant inlined render_logo::line#2 = ++(byte) 0 @@ -3050,55 +3048,55 @@ Constant inlined mulu16_sel::v2#2 = (word)(number) $10000/(number) 6 Constant inlined render_logo::line#1 = (byte) 0 Constant inlined render_logo::$67 = (byte) $28*++++++++++(byte) 0 Constant inlined render_logo::line#4 = ++(byte) 0 -Constant inlined render_logo::$66 = (const byte*) SCREEN#0+(byte) $28*++++++++(byte) 0 +Constant inlined render_logo::$66 = (const byte*) SCREEN+(byte) $28*++++++++(byte) 0 Constant inlined render_logo::line#3 = (byte) 0 Constant inlined render_logo::line#6 = ++(byte) 0 -Constant inlined render_logo::$68 = (const byte*) SCREEN#0+(byte) $28*++++++++++(byte) 0 +Constant inlined render_logo::$68 = (const byte*) SCREEN+(byte) $28*++++++++++(byte) 0 Constant inlined render_logo::line#5 = (byte) 0 Constant inlined render_logo::line#8 = ++(byte) 0 Constant inlined render_logo::line#7 = (byte) 0 -Constant inlined render_logo::$9 = (const byte*) SCREEN#0 -Constant inlined render_logo::$72 = (const byte*) SCREEN#0+(byte) $28*++(byte) 0 +Constant inlined render_logo::$9 = (const byte*) SCREEN +Constant inlined render_logo::$72 = (const byte*) SCREEN+(byte) $28*++(byte) 0 Constant inlined render_logo::line#14 = ++++(byte) 0 Constant inlined render_logo::$71 = (byte) $28*++(byte) 0 Constant inlined sin16s_gen2::i#0 = (byte) 0 Constant inlined render_logo::$74 = (byte) $28*++++(byte) 0 -Constant inlined render_logo::$75 = (const byte*) SCREEN#0+(byte) $28*++++(byte) 0 +Constant inlined render_logo::$75 = (const byte*) SCREEN+(byte) $28*++++(byte) 0 Constant inlined memset::num#1 = (word) $3e8 Constant inlined memset::num#0 = (word) $3e8 Constant inlined mul16u::b#0 = (word)(const signed word) sin16s_gen2::ampl#0 -Constant inlined render_logo::$78 = (const byte*) SCREEN#0+(byte) $28*++++++(byte) 0 +Constant inlined render_logo::$78 = (const byte*) SCREEN+(byte) $28*++++++(byte) 0 Constant inlined render_logo::$77 = (byte) $28*++++++(byte) 0 Constant inlined mul16s::$10 = (word)(const signed word) sin16s_gen2::ampl#0 -Constant inlined render_logo::$81 = (const byte*) SCREEN#0+(byte) $28*++++++++(byte) 0 +Constant inlined render_logo::$81 = (const byte*) SCREEN+(byte) $28*++++++++(byte) 0 Constant inlined mul16s::b#0 = (const signed word) sin16s_gen2::ampl#0 Constant inlined render_logo::$80 = (byte) $28*++++++++(byte) 0 Constant inlined render_logo::$83 = (byte) $28*++++++++++(byte) 0 -Constant inlined render_logo::$84 = (const byte*) SCREEN#0+(byte) $28*++++++++++(byte) 0 +Constant inlined render_logo::$84 = (const byte*) SCREEN+(byte) $28*++++++++++(byte) 0 Constant inlined render_logo::line#20 = ++++++++(byte) 0 Constant inlined render_logo::line#22 = ++++++++++(byte) 0 Constant inlined render_logo::line#16 = ++++(byte) 0 Constant inlined render_logo::line#18 = ++++++(byte) 0 Constant inlined render_logo::logo_idx#2 = (byte) 0 -Constant inlined main::toD0181_gfx#0 = (const byte*) LOGO#0 +Constant inlined main::toD0181_gfx#0 = (const byte*) LOGO Constant inlined render_logo::line#30 = ++++++++(byte) 0 Constant inlined render_logo::line#32 = ++++++++++(byte) 0 Constant inlined xsin_idx#4 = (byte) 0 Constant inlined div32u16u::dividend#0 = (const dword) PI2_u4f28 Constant inlined divr16u::quotient#0 = (byte) 0 Constant inlined mul16u::res#0 = (byte) 0 -Constant inlined render_logo::$13 = (const byte*) SCREEN#0 +Constant inlined render_logo::$13 = (const byte*) SCREEN Constant inlined divr16u::divisor#1 = (const word) XSIN_SIZE Constant inlined divr16u::divisor#0 = (const word) XSIN_SIZE Constant inlined render_logo::line#28 = ++++++(byte) 0 Constant inlined memset::str#1 = (void*)(const byte*) COLS -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN Constant inlined render_logo::line#42 = ++++++++(byte) 0 -Constant inlined render_logo::$21 = (const byte*) SCREEN#0 +Constant inlined render_logo::$21 = (const byte*) SCREEN Constant inlined render_logo::line#44 = ++++++++++(byte) 0 Constant inlined render_logo::line#40 = ++++++(byte) 0 Constant inlined div32u16u::divisor#0 = (const word) XSIN_SIZE -Constant inlined render_logo::$27 = (const byte*) SCREEN#0 +Constant inlined render_logo::$27 = (const byte*) SCREEN Constant inlined render_logo::line#38 = ++++(byte) 0 Constant inlined render_logo::$29 = (byte) $28*++(byte) 0 Successful SSA optimization Pass2ConstantInlining @@ -3328,7 +3326,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -3364,7 +3362,7 @@ main::@4: scope:[main] from main::@3 to:main::@1 main::@1: scope:[main] from main::@1 main::@4 [16] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@4/(byte) 0 ) - [17] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + [17] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 [18] (byte) main::ch#1 ← ++ (byte) main::ch#2 [19] if((byte) main::ch#1!=(byte) $f0) goto main::@1 to:main::@2 @@ -3433,49 +3431,49 @@ render_logo::@return: scope:[render_logo] from render_logo::@11 render_logo::@5 [50] return to:@return render_logo::@6: scope:[render_logo] from render_logo::@5 - [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 + [51] *((const byte*) SCREEN + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 to:render_logo::@15_1 render_logo::@15_1: scope:[render_logo] from render_logo::@6 [52] (byte~) render_logo::$33 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 1 - [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 + [53] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 to:render_logo::@15_2 render_logo::@15_2: scope:[render_logo] from render_logo::@15_1 [54] (byte~) render_logo::$36 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 2 - [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 + [55] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 to:render_logo::@15_3 render_logo::@15_3: scope:[render_logo] from render_logo::@15_2 [56] (byte~) render_logo::$39 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 3 - [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 + [57] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 to:render_logo::@15_4 render_logo::@15_4: scope:[render_logo] from render_logo::@15_3 [58] (byte~) render_logo::$42 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 4 - [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 + [59] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 to:render_logo::@15_5 render_logo::@15_5: scope:[render_logo] from render_logo::@15_4 [60] (byte~) render_logo::$45 ← (byte) render_logo::logo_idx#10 + (byte) $28*(byte) 5 - [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 + [61] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 to:render_logo::@7 render_logo::@7: scope:[render_logo] from render_logo::@15_5 [62] (byte) render_logo::screen_idx#4 ← ++ (byte) render_logo::screen_idx#10 [63] (byte) render_logo::logo_idx#3 ← ++ (byte) render_logo::logo_idx#10 to:render_logo::@5 render_logo::@3: scope:[render_logo] from render_logo::@2 - [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_1 render_logo::@7_1: scope:[render_logo] from render_logo::@3 - [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_2 render_logo::@7_2: scope:[render_logo] from render_logo::@7_1 - [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_3 render_logo::@7_3: scope:[render_logo] from render_logo::@7_2 - [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_4 render_logo::@7_4: scope:[render_logo] from render_logo::@7_3 - [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@7_5 render_logo::@7_5: scope:[render_logo] from render_logo::@7_4 - [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 + [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 to:render_logo::@4 render_logo::@4: scope:[render_logo] from render_logo::@7_5 [70] (byte) render_logo::screen_idx#3 ← ++ (byte) render_logo::screen_idx#18 @@ -3494,48 +3492,48 @@ render_logo::@11: scope:[render_logo] from render_logo::@13 render_logo::@8 [76] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@12 to:render_logo::@return render_logo::@12: scope:[render_logo] from render_logo::@11 - [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_1 render_logo::@32_1: scope:[render_logo] from render_logo::@12 - [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_2 render_logo::@32_2: scope:[render_logo] from render_logo::@32_1 - [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_3 render_logo::@32_3: scope:[render_logo] from render_logo::@32_2 - [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_4 render_logo::@32_4: scope:[render_logo] from render_logo::@32_3 - [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@32_5 render_logo::@32_5: scope:[render_logo] from render_logo::@32_4 - [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 + [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 to:render_logo::@13 render_logo::@13: scope:[render_logo] from render_logo::@32_5 [83] (byte) render_logo::screen_idx#6 ← ++ (byte) render_logo::screen_idx#15 to:render_logo::@11 render_logo::@9: scope:[render_logo] from render_logo::@8 - [84] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 + [84] *((const byte*) SCREEN + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 to:render_logo::@24_1 render_logo::@24_1: scope:[render_logo] from render_logo::@9 [85] (byte~) render_logo::$73 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 1 - [86] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 + [86] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 to:render_logo::@24_2 render_logo::@24_2: scope:[render_logo] from render_logo::@24_1 [87] (byte~) render_logo::$76 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 2 - [88] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 + [88] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 to:render_logo::@24_3 render_logo::@24_3: scope:[render_logo] from render_logo::@24_2 [89] (byte~) render_logo::$79 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 3 - [90] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 + [90] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 to:render_logo::@24_4 render_logo::@24_4: scope:[render_logo] from render_logo::@24_3 [91] (byte~) render_logo::$82 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 4 - [92] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 + [92] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 to:render_logo::@24_5 render_logo::@24_5: scope:[render_logo] from render_logo::@24_4 [93] (byte~) render_logo::$85 ← (byte) render_logo::logo_idx#11 + (byte) $28*(byte) 5 - [94] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 + [94] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 to:render_logo::@10 render_logo::@10: scope:[render_logo] from render_logo::@24_5 [95] (byte) render_logo::screen_idx#5 ← ++ (byte) render_logo::screen_idx#21 @@ -3785,7 +3783,7 @@ divr16u::@return: scope:[divr16u] from divr16u::@6 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from main::@3 main::@4 [214] (byte) memset::c#4 ← phi( main::@3/(const byte) BLACK main::@4/(const byte) WHITE|(byte) 8 ) - [214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS ) + [214] (void*) memset::str#3 ← phi( main::@3/(void*)(const byte*) SCREEN main::@4/(void*)(const byte*) COLS ) to:memset::@1 memset::@1: scope:[memset] from memset [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 @@ -3805,8 +3803,6 @@ memset::@3: scope:[memset] from memset::@2 VARIABLE REGISTER WEIGHTS -(byte*) LOGO -(byte*) SCREEN (dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor) (dword) div32u16u::dividend (word) div32u16u::divisor @@ -4330,7 +4326,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -4381,7 +4377,7 @@ main: { // [214] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuz1=vbuc1 lda #BLACK sta.z memset.c - // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -4416,7 +4412,7 @@ main: { jmp b1 // main::@1 b1: - // [17] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [17] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z ch tya sta SCREEN,y @@ -4646,7 +4642,7 @@ render_logo: { rts // render_logo::@6 b6: - // [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuz1=vbuz2 + // [51] *((const byte*) SCREEN + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z logo_idx_10 ldy.z screen_idx sta SCREEN,y @@ -4657,7 +4653,7 @@ render_logo: { lax.z logo_idx_10 axs #-[$28*1] stx.z _33 - // [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuz1=vbuz2 + // [53] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _33 ldy.z screen_idx sta SCREEN+$28*1,y @@ -4668,7 +4664,7 @@ render_logo: { lax.z logo_idx_10 axs #-[$28*2] stx.z _36 - // [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuz1=vbuz2 + // [55] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _36 ldy.z screen_idx sta SCREEN+$28*2,y @@ -4679,7 +4675,7 @@ render_logo: { lax.z logo_idx_10 axs #-[$28*3] stx.z _39 - // [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuz1=vbuz2 + // [57] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _39 ldy.z screen_idx sta SCREEN+$28*3,y @@ -4690,7 +4686,7 @@ render_logo: { lax.z logo_idx_10 axs #-[$28*4] stx.z _42 - // [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuz1=vbuz2 + // [59] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _42 ldy.z screen_idx sta SCREEN+$28*4,y @@ -4701,7 +4697,7 @@ render_logo: { lax.z logo_idx_10 axs #-[$28*5] stx.z _45 - // [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuz1=vbuz2 + // [61] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _45 ldy.z screen_idx sta SCREEN+$28*5,y @@ -4719,42 +4715,42 @@ render_logo: { jmp b5 // render_logo::@3 b3: - // [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN,y jmp b7_1 // render_logo::@7_1 b7_1: - // [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN+$28*1,y jmp b7_2 // render_logo::@7_2 b7_2: - // [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN+$28*2,y jmp b7_3 // render_logo::@7_3 b7_3: - // [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN+$28*3,y jmp b7_4 // render_logo::@7_4 b7_4: - // [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN+$28*4,y jmp b7_5 // render_logo::@7_5 b7_5: - // [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx sta SCREEN+$28*5,y @@ -4805,42 +4801,42 @@ render_logo: { jmp breturn // render_logo::@12 b12: - // [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN,y jmp b32_1 // render_logo::@32_1 b32_1: - // [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN+$28*1,y jmp b32_2 // render_logo::@32_2 b32_2: - // [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN+$28*2,y jmp b32_3 // render_logo::@32_3 b32_3: - // [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN+$28*3,y jmp b32_4 // render_logo::@32_4 b32_4: - // [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN+$28*4,y jmp b32_5 // render_logo::@32_5 b32_5: - // [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z screen_idx_15 sta SCREEN+$28*5,y @@ -4852,7 +4848,7 @@ render_logo: { jmp b11_from_b13 // render_logo::@9 b9: - // [84] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuz1=vbuz2 + // [84] *((const byte*) SCREEN + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z logo_idx_11 ldy.z screen_idx_21 sta SCREEN,y @@ -4863,7 +4859,7 @@ render_logo: { lax.z logo_idx_11 axs #-[$28*1] stx.z _73 - // [86] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuz1=vbuz2 + // [86] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _73 ldy.z screen_idx_21 sta SCREEN+$28*1,y @@ -4874,7 +4870,7 @@ render_logo: { lax.z logo_idx_11 axs #-[$28*2] stx.z _76 - // [88] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuz1=vbuz2 + // [88] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _76 ldy.z screen_idx_21 sta SCREEN+$28*2,y @@ -4885,7 +4881,7 @@ render_logo: { lax.z logo_idx_11 axs #-[$28*3] stx.z _79 - // [90] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuz1=vbuz2 + // [90] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _79 ldy.z screen_idx_21 sta SCREEN+$28*3,y @@ -4896,7 +4892,7 @@ render_logo: { lax.z logo_idx_11 axs #-[$28*4] stx.z _82 - // [92] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuz1=vbuz2 + // [92] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _82 ldy.z screen_idx_21 sta SCREEN+$28*4,y @@ -4907,7 +4903,7 @@ render_logo: { lax.z logo_idx_11 axs #-[$28*5] stx.z _85 - // [94] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuz1=vbuz2 + // [94] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _85 ldy.z screen_idx_21 sta SCREEN+$28*5,y @@ -6018,21 +6014,21 @@ Statement [43] (signed word~) render_logo::$3 ← (signed word) render_logo::xpo Statement [44] (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:33 [ xsin_idx#11 render_logo::xpos#0 render_logo::x_char#0 ] ) always clobbers reg byte a Statement [45] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1 [ render_logo::x_char#0 ] ( main:3::loop:23::render_logo:33 [ 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:70 [ render_logo::x_char#0 ] -Statement [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] -Statement [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a Statement [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 [ render_logo::logo_idx#1 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::logo_idx#1 ] ) always clobbers reg byte a -Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] -Statement [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a Statement [99] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:3::sin16s_gen2:21 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [100] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen2::step#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 ] ) always clobbers reg byte a Statement [102] if((word) sin16s_gen2::i#2<(const word) XSIN_SIZE) goto sin16s_gen2::@2 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 ] ) always clobbers reg byte a @@ -6130,19 +6126,19 @@ Statement [41] (byte~) render_logo::$2 ← (const byte) VIC_MCM | (byte~) render Statement [43] (signed word~) render_logo::$3 ← (signed word) render_logo::xpos#0 >> (byte) 3 [ render_logo::xpos#0 render_logo::$3 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::xpos#0 render_logo::$3 ] ) always clobbers reg byte a Statement [44] (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:33 [ xsin_idx#11 render_logo::xpos#0 render_logo::x_char#0 ] ) always clobbers reg byte a Statement [45] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1 [ render_logo::x_char#0 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 ] ) always clobbers reg byte a -Statement [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a -Statement [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a +Statement [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 [ render_logo::x_char#0 render_logo::screen_idx#18 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::x_char#0 render_logo::screen_idx#18 ] ) always clobbers reg byte a Statement [71] (signed byte) render_logo::logo_idx#1 ← - (signed byte) render_logo::x_char#0 [ render_logo::logo_idx#1 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::logo_idx#1 ] ) always clobbers reg byte a -Statement [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a -Statement [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a +Statement [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 [ render_logo::screen_idx#15 ] ( main:3::loop:23::render_logo:33 [ xsin_idx#11 render_logo::screen_idx#15 ] ) always clobbers reg byte a Statement [99] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:3::sin16s_gen2:21 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [100] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen2::step#0 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 ] ) always clobbers reg byte a Statement [102] if((word) sin16s_gen2::i#2<(const word) XSIN_SIZE) goto sin16s_gen2::@2 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 ] ( main:3::sin16s_gen2:21 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 ] ) always clobbers reg byte a @@ -6473,7 +6469,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -6522,7 +6518,7 @@ main: { memset_from_b3: // [214] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuxx=vbuc1 ldx #BLACK - // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -6555,7 +6551,7 @@ main: { jmp b1 // main::@1 b1: - // [17] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [17] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [18] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuxx=_inc_vbuxx @@ -6751,7 +6747,7 @@ render_logo: { rts // render_logo::@6 b6: - // [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuyy=vbuz1 + // [51] *((const byte*) SCREEN + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z logo_idx sta SCREEN,y jmp b15_1 @@ -6761,7 +6757,7 @@ render_logo: { lda #$28*1 clc adc.z logo_idx - // [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuyy=vbuaa + // [53] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*1,y jmp b15_2 // render_logo::@15_2 @@ -6770,7 +6766,7 @@ render_logo: { lda #$28*2 clc adc.z logo_idx - // [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuyy=vbuaa + // [55] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*2,y jmp b15_3 // render_logo::@15_3 @@ -6779,7 +6775,7 @@ render_logo: { lda #$28*3 clc adc.z logo_idx - // [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuyy=vbuaa + // [57] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*3,y jmp b15_4 // render_logo::@15_4 @@ -6788,7 +6784,7 @@ render_logo: { lda #$28*4 clc adc.z logo_idx - // [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuyy=vbuaa + // [59] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*4,y jmp b15_5 // render_logo::@15_5 @@ -6797,7 +6793,7 @@ render_logo: { lda #$28*5 clc adc.z logo_idx - // [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuyy=vbuaa + // [61] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*5,y jmp b7 // render_logo::@7 @@ -6813,37 +6809,37 @@ render_logo: { jmp b5 // render_logo::@3 b3: - // [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN,y jmp b7_1 // render_logo::@7_1 b7_1: - // [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*1,y jmp b7_2 // render_logo::@7_2 b7_2: - // [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*2,y jmp b7_3 // render_logo::@7_3 b7_3: - // [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*3,y jmp b7_4 // render_logo::@7_4 b7_4: - // [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*4,y jmp b7_5 // render_logo::@7_5 b7_5: - // [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*5,y jmp b4 @@ -6889,37 +6885,37 @@ render_logo: { jmp breturn // render_logo::@12 b12: - // [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN,y jmp b32_1 // render_logo::@32_1 b32_1: - // [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*1,y jmp b32_2 // render_logo::@32_2 b32_2: - // [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*2,y jmp b32_3 // render_logo::@32_3 b32_3: - // [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*3,y jmp b32_4 // render_logo::@32_4 b32_4: - // [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*4,y jmp b32_5 // render_logo::@32_5 b32_5: - // [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN+$28*5,y jmp b13 @@ -6930,7 +6926,7 @@ render_logo: { jmp b11_from_b13 // render_logo::@9 b9: - // [84] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuyy=vbuz1 + // [84] *((const byte*) SCREEN + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z logo_idx_11 sta SCREEN,y jmp b24_1 @@ -6940,7 +6936,7 @@ render_logo: { lda #$28*1 clc adc.z logo_idx_11 - // [86] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuyy=vbuaa + // [86] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*1,y jmp b24_2 // render_logo::@24_2 @@ -6949,7 +6945,7 @@ render_logo: { lda #$28*2 clc adc.z logo_idx_11 - // [88] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuyy=vbuaa + // [88] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*2,y jmp b24_3 // render_logo::@24_3 @@ -6958,7 +6954,7 @@ render_logo: { lda #$28*3 clc adc.z logo_idx_11 - // [90] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuyy=vbuaa + // [90] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*3,y jmp b24_4 // render_logo::@24_4 @@ -6967,7 +6963,7 @@ render_logo: { lda #$28*4 clc adc.z logo_idx_11 - // [92] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuyy=vbuaa + // [92] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*4,y jmp b24_5 // render_logo::@24_5 @@ -6976,7 +6972,7 @@ render_logo: { lda #$28*5 clc adc.z logo_idx_11 - // [94] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuyy=vbuaa + // [94] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*5,y jmp b10 // render_logo::@10 @@ -8144,14 +8140,12 @@ FINAL SYMBOL TABLE (const byte*) D016 D016 = (byte*) 53270 (const byte*) D018 D018 = (byte*) 53272 (const byte) DARK_GREY DARK_GREY = (byte) $b -(byte*) LOGO -(const byte*) LOGO#0 LOGO = (byte*) 8192 +(const byte*) LOGO LOGO = (byte*) 8192 (const dword) PI2_u4f28 PI2_u4f28 = (dword) $6487ed51 (const dword) PI_HALF_u4f28 PI_HALF_u4f28 = (dword) $1921fb54 (const dword) PI_u4f28 PI_u4f28 = (dword) $3243f6a9 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_MCM VIC_MCM = (byte) $10 (const byte) WHITE WHITE = (byte) 1 @@ -8229,7 +8223,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -8550,7 +8544,7 @@ Score: 46394 // @begin // @1 // kickasm - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] // @2 // [3] call main @@ -8593,7 +8587,7 @@ main: { // [214] phi from main::@3 to memset [phi:main::@3->memset] // [214] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuxx=vbuc1 ldx #BLACK - // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [214] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -8620,7 +8614,7 @@ main: { // main::@1 b1: // SCREEN[ch] = ch - // [17] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [17] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte ch: 0..239) @@ -8805,7 +8799,7 @@ render_logo: { // render_logo::@6 b6: // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [51] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuyy=vbuz1 + // [51] *((const byte*) SCREEN + (byte) render_logo::screen_idx#10) ← (byte) render_logo::logo_idx#10 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z logo_idx sta SCREEN,y // render_logo::@15_1 @@ -8815,7 +8809,7 @@ render_logo: { clc adc.z logo_idx // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [53] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuyy=vbuaa + // [53] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$33 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*1,y // render_logo::@15_2 // logo_idx+40*line @@ -8824,7 +8818,7 @@ render_logo: { clc adc.z logo_idx // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [55] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuyy=vbuaa + // [55] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$36 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*2,y // render_logo::@15_3 // logo_idx+40*line @@ -8833,7 +8827,7 @@ render_logo: { clc adc.z logo_idx // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [57] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuyy=vbuaa + // [57] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$39 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*3,y // render_logo::@15_4 // logo_idx+40*line @@ -8842,7 +8836,7 @@ render_logo: { clc adc.z logo_idx // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [59] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuyy=vbuaa + // [59] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$42 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*4,y // render_logo::@15_5 // logo_idx+40*line @@ -8851,7 +8845,7 @@ render_logo: { clc adc.z logo_idx // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [61] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuyy=vbuaa + // [61] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#10) ← (byte~) render_logo::$45 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*5,y // render_logo::@7 // screen_idx++; @@ -8867,23 +8861,23 @@ render_logo: { // render_logo::@3 b3: // (SCREEN+40*line)[screen_idx] = $00 - // [64] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [64] *((const byte*) SCREEN + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN,y // render_logo::@7_1 - // [65] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [65] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*1,y // render_logo::@7_2 - // [66] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [66] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*2,y // render_logo::@7_3 - // [67] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [67] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*3,y // render_logo::@7_4 - // [68] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [68] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*4,y // render_logo::@7_5 - // [69] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [69] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#18) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*5,y // render_logo::@4 // screen_idx++; @@ -8925,23 +8919,23 @@ render_logo: { // render_logo::@12 b12: // (SCREEN+40*line)[screen_idx] = $00 - // [77] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [77] *((const byte*) SCREEN + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 lda #0 sta SCREEN,y // render_logo::@32_1 - // [78] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [78] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*1,y // render_logo::@32_2 - // [79] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [79] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*2,y // render_logo::@32_3 - // [80] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [80] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*3,y // render_logo::@32_4 - // [81] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [81] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*4,y // render_logo::@32_5 - // [82] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 + // [82] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#15) ← (byte) 0 -- pbuc1_derefidx_vbuyy=vbuc2 sta SCREEN+$28*5,y // render_logo::@13 // screen_idx++; @@ -8951,7 +8945,7 @@ render_logo: { // render_logo::@9 b9: // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [84] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuyy=vbuz1 + // [84] *((const byte*) SCREEN + (byte) render_logo::screen_idx#21) ← (byte) render_logo::logo_idx#11 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z logo_idx_11 sta SCREEN,y // render_logo::@24_1 @@ -8961,7 +8955,7 @@ render_logo: { clc adc.z logo_idx_11 // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [86] *((const byte*) SCREEN#0+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuyy=vbuaa + // [86] *((const byte*) SCREEN+(byte) $28*(byte) 1 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$73 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*1,y // render_logo::@24_2 // logo_idx+40*line @@ -8970,7 +8964,7 @@ render_logo: { clc adc.z logo_idx_11 // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [88] *((const byte*) SCREEN#0+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuyy=vbuaa + // [88] *((const byte*) SCREEN+(byte) $28*(byte) 2 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$76 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*2,y // render_logo::@24_3 // logo_idx+40*line @@ -8979,7 +8973,7 @@ render_logo: { clc adc.z logo_idx_11 // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [90] *((const byte*) SCREEN#0+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuyy=vbuaa + // [90] *((const byte*) SCREEN+(byte) $28*(byte) 3 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$79 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*3,y // render_logo::@24_4 // logo_idx+40*line @@ -8988,7 +8982,7 @@ render_logo: { clc adc.z logo_idx_11 // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [92] *((const byte*) SCREEN#0+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuyy=vbuaa + // [92] *((const byte*) SCREEN+(byte) $28*(byte) 4 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$82 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*4,y // render_logo::@24_5 // logo_idx+40*line @@ -8997,7 +8991,7 @@ render_logo: { clc adc.z logo_idx_11 // (SCREEN+40*line)[screen_idx] = logo_idx+40*line - // [94] *((const byte*) SCREEN#0+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuyy=vbuaa + // [94] *((const byte*) SCREEN+(byte) $28*(byte) 5 + (byte) render_logo::screen_idx#21) ← (byte~) render_logo::$85 -- pbuc1_derefidx_vbuyy=vbuaa sta SCREEN+$28*5,y // render_logo::@10 // screen_idx++; diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.sym b/src/test/ref/examples/scrolllogo/scrolllogo.sym index 0cf533855..19d987884 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.sym +++ b/src/test/ref/examples/scrolllogo/scrolllogo.sym @@ -11,14 +11,12 @@ (const byte*) D016 D016 = (byte*) 53270 (const byte*) D018 D018 = (byte*) 53272 (const byte) DARK_GREY DARK_GREY = (byte) $b -(byte*) LOGO -(const byte*) LOGO#0 LOGO = (byte*) 8192 +(const byte*) LOGO LOGO = (byte*) 8192 (const dword) PI2_u4f28 PI2_u4f28 = (dword) $6487ed51 (const dword) PI_HALF_u4f28 PI_HALF_u4f28 = (dword) $1921fb54 (const dword) PI_u4f28 PI_u4f28 = (dword) $3243f6a9 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_MCM VIC_MCM = (byte) $10 (const byte) WHITE WHITE = (byte) 1 @@ -96,7 +94,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 diff --git a/src/test/ref/examples/showlogo/showlogo.cfg b/src/test/ref/examples/showlogo/showlogo.cfg index 6702cc7be..a7b63b42e 100644 --- a/src/test/ref/examples/showlogo/showlogo.cfg +++ b/src/test/ref/examples/showlogo/showlogo.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -37,19 +37,19 @@ main::@4: scope:[main] from main::@3 to:main::@1 main::@1: scope:[main] from main::@1 main::@4 [15] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@4/(byte) 0 ) - [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + [16] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + [19] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) kickasm() {{ inc $d020 }} to:main::@2 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from main::@3 main::@4 [21] (byte) memset::c#4 ← phi( main::@4/(const byte) WHITE|(byte) 8 main::@3/(const byte) BLACK ) - [21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS main::@3/(void*)(const byte*) SCREEN#0 ) + [21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS main::@3/(void*)(const byte*) SCREEN ) [21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 ) [22] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 diff --git a/src/test/ref/examples/showlogo/showlogo.log b/src/test/ref/examples/showlogo/showlogo.log index 22e06d200..77ce08025 100644 --- a/src/test/ref/examples/showlogo/showlogo.log +++ b/src/test/ref/examples/showlogo/showlogo.log @@ -82,9 +82,9 @@ memset::@return: scope:[memset] from memset::@1 return to:@return @8: scope:[] from @begin - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) LOGO#0 ← ((byte*)) (number) $2000 - kickasm(location (byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) LOGO ← ((byte*)) (number) $2000 + kickasm(location (byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -98,8 +98,8 @@ main: scope:[main] from @9 *((byte*) BGCOL2) ← (byte) DARK_GREY *((byte*) BGCOL) ← *((byte*) BGCOL2) *((byte*) BGCOL3) ← (byte) BLACK - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) LOGO to:main::toD0181 main::toD0181: scope:[main] from main (byte*) main::toD0181_gfx#1 ← phi( main/(byte*) main::toD0181_gfx#0 ) @@ -125,7 +125,7 @@ main::@9: scope:[main] from main::toD0181_@return *((byte*) D018) ← (byte~) main::$0 (byte~) main::$1 ← (byte) VIC_MCM | (byte) VIC_CSEL *((byte*) D016) ← (byte~) main::$1 - (void*) memset::str#0 ← (void*)(byte*) SCREEN#0 + (void*) memset::str#0 ← (void*)(byte*) SCREEN (byte) memset::c#0 ← (byte) BLACK (word) memset::num#0 ← (number) $28*(number) $19 call memset @@ -144,7 +144,7 @@ main::@11: scope:[main] from main::@10 to:main::@1 main::@1: scope:[main] from main::@1 main::@11 (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@11/(byte) main::ch#0 ) - *((byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + *((byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 (byte) main::ch#1 ← (byte) main::ch#2 + rangenext(0,$ef) (bool~) main::$5 ← (byte) main::ch#1 != rangelast(0,$ef) if((bool~) main::$5) goto main::@1 @@ -153,7 +153,7 @@ main::@3: scope:[main] from main::@1 main::@4 if(true) goto main::@4 to:main::@return main::@4: scope:[main] from main::@3 - (byte*~) main::$9 ← (byte*) SCREEN#0 + (number) $3e7 + (byte*~) main::$9 ← (byte*) SCREEN + (number) $3e7 *((byte*~) main::$9) ← ++ *((byte*~) main::$9) kickasm() {{ inc $d020 }} to:main::@3 @@ -183,9 +183,7 @@ SYMBOL TABLE SSA (byte*) D018 (byte) DARK_GREY (byte*) LOGO -(byte*) LOGO#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte) VIC_CSEL (byte) VIC_MCM (byte) WHITE @@ -295,7 +293,7 @@ Adding number conversion cast (unumber) $28*$19 in (word) memset::num#0 ← (num Adding number conversion cast (unumber) 8 in (number~) main::$3 ← (byte) WHITE | (number) 8 Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) WHITE | (unumber)(number) 8 Adding number conversion cast (unumber) $28*$19 in (word) memset::num#1 ← (number) $28*(number) $19 -Adding number conversion cast (unumber) $3e7 in (byte*~) main::$9 ← (byte*) SCREEN#0 + (number) $3e7 +Adding number conversion cast (unumber) $3e7 in (byte*~) main::$9 ← (byte*) SCREEN + (number) $3e7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) BORDERCOL ← (byte*)(number) $d020 Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 @@ -311,8 +309,8 @@ Inlining cast (byte) WHITE ← (unumber)(number) 1 Inlining cast (byte) DARK_GREY ← (unumber)(number) $b Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) LOGO ← (byte*)(number) $2000 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 Inlining cast (word) memset::num#0 ← (unumber)(number) $28*(number) $19 @@ -401,19 +399,19 @@ Constant (const byte*) COLS = (byte*) 55296 Constant (const byte) BLACK = 0 Constant (const byte) WHITE = 1 Constant (const byte) DARK_GREY = $b -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) LOGO#0 = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) LOGO = (byte*) 8192 Constant (const word) memset::num#0 = (unumber)$28*$19 Constant (const word) memset::num#1 = (unumber)$28*$19 Constant (const byte) main::ch#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = LOGO#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = LOGO Constant (const byte) memset::c#0 = BLACK Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [42] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [46] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (void*)SCREEN#0 in [59] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)SCREEN in [59] (void*) memset::str#0 ← (void*)(const byte*) SCREEN Constant value identified (void*)COLS in [65] (void*) memset::str#1 ← (void*)(const byte*) COLS Successful SSA optimization Pass2ConstantValues if() condition always true - replacing block destination [76] if(true) goto main::@4 @@ -433,15 +431,15 @@ Finalized unsigned number type (byte) $f0 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant right-side identified [25] (byte~) main::$1 ← (const byte) VIC_MCM | (const byte) VIC_CSEL Constant right-side identified [29] (byte) memset::c#1 ← (const byte) WHITE | (byte) 8 -Constant right-side identified [36] (byte*~) main::$9 ← (const byte*) SCREEN#0 + (word) $3e7 +Constant right-side identified [36] (byte*~) main::$9 ← (const byte*) SCREEN + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 Constant (const byte) main::$1 = VIC_MCM|VIC_CSEL -Constant (const void*) memset::str#0 = (void*)SCREEN#0 +Constant (const void*) memset::str#0 = (void*)SCREEN Constant (const byte) memset::c#1 = WHITE|8 Constant (const void*) memset::str#1 = (void*)COLS -Constant (const byte*) main::$9 = SCREEN#0+$3e7 +Constant (const byte*) main::$9 = SCREEN+$3e7 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [15] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff Constant right-side identified [18] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4 @@ -475,23 +473,23 @@ Inlining constant with var siblings (const void*) memset::str#0 Inlining constant with var siblings (const byte) memset::c#1 Inlining constant with var siblings (const void*) memset::str#1 Inlining constant with var siblings (const byte) main::ch#0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) LOGO#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) LOGO Constant inlined memset::str#1 = (void*)(const byte*) COLS -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) LOGO#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN +Constant inlined main::toD0181_$7 = >(word)(const byte*) LOGO/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN Constant inlined memset::num#1 = (word)(number) $28*(number) $19 Constant inlined memset::num#0 = (word)(number) $28*(number) $19 -Constant inlined main::toD0181_$6 = >(word)(const byte*) LOGO#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) LOGO#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) LOGO#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$6 = >(word)(const byte*) LOGO/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) LOGO +Constant inlined main::toD0181_$4 = (word)(const byte*) LOGO +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined main::$1 = (const byte) VIC_MCM|(const byte) VIC_CSEL Constant inlined memset::c#0 = (const byte) BLACK -Constant inlined main::$9 = (const byte*) SCREEN#0+(word) $3e7 +Constant inlined main::$9 = (const byte*) SCREEN+(word) $3e7 Constant inlined memset::c#1 = (const byte) WHITE|(byte) 8 Constant inlined main::ch#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining @@ -539,7 +537,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) + kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) @@ -574,19 +572,19 @@ main::@4: scope:[main] from main::@3 to:main::@1 main::@1: scope:[main] from main::@1 main::@4 [15] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@4/(byte) 0 ) - [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 + [16] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + [19] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) kickasm() {{ inc $d020 }} to:main::@2 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from main::@3 main::@4 [21] (byte) memset::c#4 ← phi( main::@4/(const byte) WHITE|(byte) 8 main::@3/(const byte) BLACK ) - [21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS main::@3/(void*)(const byte*) SCREEN#0 ) + [21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS main::@3/(void*)(const byte*) SCREEN ) [21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 ) [22] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -608,8 +606,6 @@ memset::@3: scope:[memset] from memset::@2 VARIABLE REGISTER WEIGHTS -(byte*) LOGO -(byte*) SCREEN (void()) main() (byte) main::ch (byte) main::ch#1 16.5 @@ -682,7 +678,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -731,7 +727,7 @@ main: { // [21] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuz1=vbuc1 lda #BLACK sta.z memset.c - // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -776,7 +772,7 @@ main: { jmp b1 // main::@1 b1: - // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [16] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z ch tya sta SCREEN,y @@ -789,7 +785,7 @@ main: { jmp b2 // main::@2 b2: - // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [19] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 // kickasm() {{ inc $d020 }} inc $d020 @@ -940,7 +936,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] b2_from_b1: jmp b2 @@ -987,7 +983,7 @@ main: { memset_from_b3: // [21] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuxx=vbuc1 ldx #BLACK - // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -1030,7 +1026,7 @@ main: { jmp b1 // main::@1 b1: - // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [16] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuxx=_inc_vbuxx @@ -1041,7 +1037,7 @@ main: { jmp b2 // main::@2 b2: - // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [19] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 // kickasm() {{ inc $d020 }} inc $d020 @@ -1172,10 +1168,8 @@ FINAL SYMBOL TABLE (const byte*) D016 D016 = (byte*) 53270 (const byte*) D018 D018 = (byte*) 53272 (const byte) DARK_GREY DARK_GREY = (byte) $b -(byte*) LOGO -(const byte*) LOGO#0 LOGO = (byte*) 8192 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) LOGO LOGO = (byte*) 8192 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) VIC_CSEL VIC_CSEL = (byte) 8 (const byte) VIC_MCM VIC_MCM = (byte) $10 (const byte) WHITE WHITE = (byte) 1 @@ -1190,7 +1184,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -1245,7 +1239,7 @@ Score: 5917 // @begin // @1 // kickasm - // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} + // kickasm(location (const byte*) LOGO) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }} // [2] phi from @1 to @2 [phi:@1->@2] // @2 // [3] call main @@ -1285,7 +1279,7 @@ main: { // [21] phi from main::@3 to memset [phi:main::@3->memset] // [21] phi (byte) memset::c#4 = (const byte) BLACK [phi:main::@3->memset#0] -- vbuxx=vbuc1 ldx #BLACK - // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 + // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:main::@3->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -1322,7 +1316,7 @@ main: { // main::@1 b1: // SCREEN[ch] = ch - // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [16] *((const byte*) SCREEN + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte ch: 0..239) @@ -1334,7 +1328,7 @@ main: { // main::@2 b2: // (*(SCREEN+999))++; - // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + // [19] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN+$3e7 // kickasm // kickasm() {{ inc $d020 }} diff --git a/src/test/ref/examples/showlogo/showlogo.sym b/src/test/ref/examples/showlogo/showlogo.sym index 918ad051c..9a0bc6f7a 100644 --- a/src/test/ref/examples/showlogo/showlogo.sym +++ b/src/test/ref/examples/showlogo/showlogo.sym @@ -11,10 +11,8 @@ (const byte*) D016 D016 = (byte*) 53270 (const byte*) D018 D018 = (byte*) 53272 (const byte) DARK_GREY DARK_GREY = (byte) $b -(byte*) LOGO -(const byte*) LOGO#0 LOGO = (byte*) 8192 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) LOGO LOGO = (byte*) 8192 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte) VIC_CSEL VIC_CSEL = (byte) 8 (const byte) VIC_MCM VIC_MCM = (byte) $10 (const byte) WHITE WHITE = (byte) 1 @@ -29,7 +27,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 diff --git a/src/test/ref/examples/sinplotter/sine-plotter.cfg b/src/test/ref/examples/sinplotter/sine-plotter.cfg index f093c2f91..297601c8e 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.cfg +++ b/src/test/ref/examples/sinplotter/sine-plotter.cfg @@ -397,7 +397,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [189] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [189] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [189] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [189] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [190] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -437,7 +437,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [206] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [207] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [207] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [207] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [208] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [209] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/examples/sinplotter/sine-plotter.log b/src/test/ref/examples/sinplotter/sine-plotter.log index 3181b927c..f57661b20 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.log +++ b/src/test/ref/examples/sinplotter/sine-plotter.log @@ -771,8 +771,8 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot (word) rem16u#30 ← phi( @28/(word) rem16u#32 ) (byte*) bitmap_screen#20 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#21 ← phi( @28/(byte*) bitmap_gfx#0 ) - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) BITMAP#0 ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) BITMAP ← ((byte*)) (number) $2000 (word) SIN_SIZE ← (number) $200 (signed word[$200]) sin ← { fill( $200, 0) } (signed word[$200]) sin2 ← kickasm {{ .for(var i=0; i<512; i++) { @@ -793,7 +793,7 @@ main: scope:[main] from @37 (byte~) main::$1 ← (byte~) main::$0 | (byte) VIC_RSEL (number~) main::$2 ← (byte~) main::$1 | (number) 3 *((byte*) D011) ← (number~) main::$2 - (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#0 + (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN to:main::vicSelectGfxBank1 main::vicSelectGfxBank1: scope:[main] from main (word) rem16u#42 ← phi( main/(word) rem16u#43 ) @@ -834,8 +834,8 @@ main::@7: scope:[main] from main::vicSelectGfxBank1_@1 (byte*) bitmap_screen#25 ← phi( main::vicSelectGfxBank1_@1/(byte*) bitmap_screen#29 ) (byte*) bitmap_gfx#26 ← phi( main::vicSelectGfxBank1_@1/(byte*) bitmap_gfx#30 ) *((byte*) D016) ← (byte) VIC_CSEL - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@7 (word) rem16u#37 ← phi( main::@7/(word) rem16u#38 ) @@ -868,8 +868,8 @@ main::@8: scope:[main] from main::toD0181_@return (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$4 ← (byte) main::toD0181_return#3 *((byte*) D018) ← (byte~) main::$4 - (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 - (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN call bitmap_init to:main::@9 main::@9: scope:[main] from main::@8 @@ -1058,7 +1058,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BITMAP -(byte*) BITMAP#0 (byte) BLACK (byte*) CIA2_PORT_A (byte*) CIA2_PORT_A_DDR @@ -1073,7 +1072,6 @@ SYMBOL TABLE SSA (byte) PROCPORT_DDR_MEMORY_MASK (byte) PROCPORT_RAM_IO (byte*) SCREEN -(byte*) SCREEN#0 (word) SIN_SIZE (const byte) SIZEOF_SIGNED_WORD = (byte) 2 (byte) VIC_BMM @@ -2025,8 +2023,8 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80 Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80 Inlining cast (byte) memset::c#1 ← (unumber)(number) 0 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP ← (byte*)(number) $2000 Inlining cast (word) SIN_SIZE ← (unumber)(number) $200 Inlining cast *((byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3 Inlining cast (word~) main::vicSelectGfxBank1_toDd001_$0 ← (word)(byte*) main::vicSelectGfxBank1_toDd001_gfx#1 @@ -2523,8 +2521,8 @@ Constant (const byte) bitmap_init::y#0 = 0 Constant (const word) memset::num#0 = $3e8 Constant (const byte) memset::c#1 = 0 Constant (const word) memset::num#1 = $1f40 -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) BITMAP#0 = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) BITMAP = (byte*) 8192 Constant (const word) SIN_SIZE = $200 Constant (const signed word[$200]) sin = { fill( $200, 0) } Constant (const signed word[$200]) sin2 = kickasm {{ .for(var i=0; i<512; i++) { @@ -2538,11 +2536,11 @@ Constant (const word) render_sine::sin_idx#0 = 0 Constant (const word) render_sine::xpos#2 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 -Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = SCREEN#0 -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = SCREEN +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP +Constant (const byte*) bitmap_init::gfx#0 = BITMAP +Constant (const byte*) bitmap_init::screen#0 = SCREEN Constant (const byte) bitmap_clear::bgcol#0 = BLACK Constant (const byte) bitmap_clear::fgcol#0 = WHITE Constant (const signed word*) sin16s_gen2::sintab#1 = sin @@ -2731,9 +2729,9 @@ Inlining constant with var siblings (const byte) bitmap_init::y#0 Inlining constant with var siblings (const word) render_sine::xpos#0 Inlining constant with var siblings (const word) render_sine::sin_idx#0 Inlining constant with var siblings (const word) render_sine::xpos#2 -Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN Constant inlined divr16u::rem#3 = (byte) 0 -Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP Constant inlined sin16s_gen2::i#0 = (byte) 0 Constant inlined sin16s::isUpper#0 = (byte) 0 Constant inlined memset::num#1 = (word) $1f40 @@ -2747,22 +2745,22 @@ Constant inlined sin16s::isUpper#1 = (byte) 1 Constant inlined mulu16_sel::select#1 = (byte) 1 Constant inlined mul16s::$10 = (word)(const signed word) sin16s_gen2::ampl#0 Constant inlined mul16s::b#0 = (const signed word) sin16s_gen2::ampl#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined sin16s_gen2::wavelength#0 = (const word) SIN_SIZE -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined sin16s_gen2::sintab#1 = (const signed word[$200]) sin Constant inlined memset::c#0 = (const byte) bitmap_clear::col#0 Constant inlined bitmap_init::x#0 = (byte) 0 Constant inlined memset::c#1 = (byte) 0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP Constant inlined divr16u::i#0 = (byte) 0 Constant inlined div32u16u::dividend#0 = (const dword) PI2_u4f28 Constant inlined bitmap_init::bits#0 = (byte) $80 @@ -2773,13 +2771,13 @@ Constant inlined sin16s_gen2::x#0 = (byte) 0 Constant inlined mul16u::res#0 = (byte) 0 Constant inlined divr16u::divisor#1 = (const word) SIN_SIZE Constant inlined divr16u::divisor#0 = (const word) SIN_SIZE -Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP Constant inlined render_sine::sin_idx#0 = (byte) 0 -Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE Constant inlined divr16u::dividend#1 = >(const dword) PI2_u4f28 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 -Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined bitmap_screen#1 = (const byte*) SCREEN Constant inlined main::$1 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL Constant inlined main::$2 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined render_sine::xpos#2 = (byte) 0 @@ -3391,7 +3389,7 @@ bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from bitmap_clear bitmap_clear::@1 [189] (byte) memset::c#4 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) - [189] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [189] (void*) memset::str#3 ← phi( bitmap_clear/(void*)(const byte*) SCREEN bitmap_clear::@1/(void*)(const byte*) BITMAP ) [189] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) [190] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -3431,7 +3429,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [206] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [207] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [207] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [207] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [208] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [209] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -3455,8 +3453,6 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP -(byte*) SCREEN (void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) (byte) bitmap_clear::bgcol (byte) bitmap_clear::col @@ -5461,7 +5457,7 @@ bitmap_clear: { // [189] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 lda #col sta.z memset.c - // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -5483,7 +5479,7 @@ bitmap_clear: { // [189] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -5625,7 +5621,7 @@ bitmap_init: { bne b1_from_b2 // [207] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -7384,7 +7380,7 @@ bitmap_clear: { memset_from_bitmap_clear: // [189] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -7405,7 +7401,7 @@ bitmap_clear: { memset_from_b1: // [189] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -7529,7 +7525,7 @@ bitmap_init: { bne b1_from_b2 // [207] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -7861,8 +7857,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte*) CIA2_PORT_A CIA2_PORT_A = (byte*) 56576 (const byte*) CIA2_PORT_A_DDR CIA2_PORT_A_DDR = (byte*) 56578 (const byte*) D011 D011 = (byte*) 53265 @@ -7875,8 +7870,7 @@ FINAL SYMBOL TABLE (const byte*) PROCPORT_DDR PROCPORT_DDR = (byte*) 0 (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const word) SIN_SIZE SIN_SIZE = (word) $200 (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -7998,7 +7992,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 @@ -9451,7 +9445,7 @@ bitmap_clear: { // [189] phi from bitmap_clear to memset [phi:bitmap_clear->memset] // [189] phi (byte) memset::c#4 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 ldx #col - // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN [phi:bitmap_clear->memset#1] -- pvoz1=pvoc1 lda #SCREEN @@ -9469,7 +9463,7 @@ bitmap_clear: { // [189] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] // [189] phi (byte) memset::c#4 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 ldx #0 - // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 + // [189] phi (void*) memset::str#3 = (void*)(const byte*) BITMAP [phi:bitmap_clear::@1->memset#1] -- pvoz1=pvoc1 lda #BITMAP @@ -9584,7 +9578,7 @@ bitmap_init: { cpx #0 bne b1 // [207] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [207] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/examples/sinplotter/sine-plotter.sym b/src/test/ref/examples/sinplotter/sine-plotter.sym index 88518a2db..12e705dde 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.sym +++ b/src/test/ref/examples/sinplotter/sine-plotter.sym @@ -2,8 +2,7 @@ (label) @begin (label) @end (const byte*) BGCOL BGCOL = (byte*) 53281 -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(const byte*) BITMAP BITMAP = (byte*) 8192 (const byte*) CIA2_PORT_A CIA2_PORT_A = (byte*) 56576 (const byte*) CIA2_PORT_A_DDR CIA2_PORT_A_DDR = (byte*) 56578 (const byte*) D011 D011 = (byte*) 53265 @@ -16,8 +15,7 @@ (const byte*) PROCPORT_DDR PROCPORT_DDR = (byte*) 0 (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const word) SIN_SIZE SIN_SIZE = (word) $200 (const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2 (const byte) VIC_BMM VIC_BMM = (byte) $20 @@ -139,7 +137,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.cfg b/src/test/ref/examples/sinsprites/sinus-sprites.cfg index 621fd568b..d8c94f95b 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.cfg +++ b/src/test/ref/examples/sinsprites/sinus-sprites.cfg @@ -295,7 +295,7 @@ addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 (void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) mulFACbyMEM: scope:[mulFACbyMEM] from gen_sintab::@13 gen_sintab::@18 - [136] (byte*) mulFACbyMEM::mem#2 ← phi( gen_sintab::@13/(const byte*) gen_sintab::f_2pi#0 gen_sintab::@18/(const byte[]) gen_sintab::f_amp ) + [136] (byte*) mulFACbyMEM::mem#2 ← phi( gen_sintab::@13/(const byte*) gen_sintab::f_2pi gen_sintab::@18/(const byte[]) gen_sintab::f_amp ) to:mulFACbyMEM::prepareMEM1 mulFACbyMEM::prepareMEM1: scope:[mulFACbyMEM] from mulFACbyMEM [137] (byte~) mulFACbyMEM::prepareMEM1_$0 ← < (word)(byte*) mulFACbyMEM::mem#2 diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.log b/src/test/ref/examples/sinsprites/sinus-sprites.log index cdb5366bf..fb62759e2 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.log +++ b/src/test/ref/examples/sinsprites/sinus-sprites.log @@ -826,7 +826,7 @@ gen_sintab: scope:[gen_sintab] from init::@6 init::@8 (byte[]) gen_sintab::f_i ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte[]) gen_sintab::f_min ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } (byte[]) gen_sintab::f_amp ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 } - (byte*) gen_sintab::f_2pi#0 ← ((byte*)) (number) $e2e5 + (byte*) gen_sintab::f_2pi ← ((byte*)) (number) $e2e5 (word~) gen_sintab::$0 ← ((word)) (byte) gen_sintab::max#2 (word) setFAC::w#0 ← (word~) gen_sintab::$0 call setFAC @@ -944,7 +944,7 @@ gen_sintab::@18: scope:[gen_sintab] from gen_sintab::@2 (byte) gen_sintab::i#13 ← phi( gen_sintab::@2/(byte) gen_sintab::i#3 ) (byte*) gen_sintab::sintab#10 ← phi( gen_sintab::@2/(byte*) gen_sintab::sintab#11 ) (byte) gen_sintab::length#8 ← phi( gen_sintab::@2/(byte) gen_sintab::length#11 ) - (byte*) mulFACbyMEM::mem#0 ← (byte*) gen_sintab::f_2pi#0 + (byte*) mulFACbyMEM::mem#0 ← (byte*) gen_sintab::f_2pi call mulFACbyMEM to:gen_sintab::@19 gen_sintab::@19: scope:[gen_sintab] from gen_sintab::@18 @@ -1354,7 +1354,6 @@ SYMBOL TABLE SSA (label) gen_sintab::@9 (label) gen_sintab::@return (byte*) gen_sintab::f_2pi -(byte*) gen_sintab::f_2pi#0 (byte[]) gen_sintab::f_amp (byte[]) gen_sintab::f_i (byte[]) gen_sintab::f_min @@ -1924,7 +1923,7 @@ Inlining cast (byte) gen_chargen_sprite::c#1 ← (unumber)(number) 1 Inlining cast (byte) gen_chargen_sprite::s_gen#2 ← (unumber)(number) 0 Inlining cast (byte) gen_chargen_sprite::s_gen_cnt#2 ← (unumber)(number) 0 Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $37 -Inlining cast (byte*) gen_sintab::f_2pi#0 ← (byte*)(number) $e2e5 +Inlining cast (byte*) gen_sintab::f_2pi ← (byte*)(number) $e2e5 Inlining cast (word~) gen_sintab::$0 ← (word)(byte) gen_sintab::max#2 Inlining cast (word~) gen_sintab::$3 ← (word)(byte) gen_sintab::min#2 Inlining cast (word) setFAC::w#2 ← (unumber)(number) 2 @@ -2389,7 +2388,7 @@ Constant (const byte) gen_chargen_sprite::s_gen_cnt#2 = 0 Constant (const byte[]) gen_sintab::f_i = { 0, 0, 0, 0, 0 } Constant (const byte[]) gen_sintab::f_min = { 0, 0, 0, 0, 0 } Constant (const byte[]) gen_sintab::f_amp = { 0, 0, 0, 0, 0 } -Constant (const byte*) gen_sintab::f_2pi#0 = (byte*) 58085 +Constant (const byte*) gen_sintab::f_2pi = (byte*) 58085 Constant (const word) setFAC::w#2 = 2 Constant (const byte) gen_sintab::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -2406,7 +2405,7 @@ Constant (const byte*) divMEMbyFAC::mem#0 = gen_sintab::f_amp Constant (const byte*) setMEMtoFAC::mem#2 = gen_sintab::f_amp Constant (const byte*) addMEMtoFAC::mem#0 = gen_sintab::f_min Constant (const byte*) setMEMtoFAC::mem#3 = gen_sintab::f_min -Constant (const byte*) mulFACbyMEM::mem#0 = gen_sintab::f_2pi#0 +Constant (const byte*) mulFACbyMEM::mem#0 = gen_sintab::f_2pi Constant (const byte*) setMEMtoFAC::mem#4 = gen_sintab::f_i Constant (const byte*) divMEMbyFAC::mem#1 = gen_sintab::f_i Constant (const byte*) mulFACbyMEM::mem#1 = gen_sintab::f_amp @@ -2564,7 +2563,7 @@ Constant inlined sin_idx_x#4 = (byte) 0 Constant inlined gen_sintab::length#0 = (const byte) sinlen_x Constant inlined gen_sintab::max#0 = (byte) $ff Constant inlined gen_sintab::max#1 = (byte) $d0 -Constant inlined mulFACbyMEM::mem#0 = (const byte*) gen_sintab::f_2pi#0 +Constant inlined mulFACbyMEM::mem#0 = (const byte*) gen_sintab::f_2pi Constant inlined mulFACbyMEM::mem#1 = (const byte[]) gen_sintab::f_amp Constant inlined gen_sintab::min#1 = (byte) $32 Constant inlined clear_screen::$0 = (const byte*) SCREEN+(word) $3e8 @@ -3130,7 +3129,7 @@ addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 (void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) mulFACbyMEM: scope:[mulFACbyMEM] from gen_sintab::@13 gen_sintab::@18 - [136] (byte*) mulFACbyMEM::mem#2 ← phi( gen_sintab::@13/(const byte*) gen_sintab::f_2pi#0 gen_sintab::@18/(const byte[]) gen_sintab::f_amp ) + [136] (byte*) mulFACbyMEM::mem#2 ← phi( gen_sintab::@13/(const byte*) gen_sintab::f_2pi gen_sintab::@18/(const byte[]) gen_sintab::f_amp ) to:mulFACbyMEM::prepareMEM1 mulFACbyMEM::prepareMEM1: scope:[mulFACbyMEM] from mulFACbyMEM [137] (byte~) mulFACbyMEM::prepareMEM1_$0 ← < (word)(byte*) mulFACbyMEM::mem#2 @@ -3432,7 +3431,6 @@ VARIABLE REGISTER WEIGHTS (void()) gen_sintab((byte*) gen_sintab::sintab , (byte) gen_sintab::length , (byte) gen_sintab::min , (byte) gen_sintab::max) (word~) gen_sintab::$24 11.0 (byte~) gen_sintab::$25 22.0 -(byte*) gen_sintab::f_2pi (byte) gen_sintab::i (byte) gen_sintab::i#1 22.0 (byte) gen_sintab::i#10 1.76 @@ -4346,7 +4344,7 @@ gen_sintab: { // [100] call mulFACbyMEM // [136] phi from gen_sintab::@13 to mulFACbyMEM [phi:gen_sintab::@13->mulFACbyMEM] mulFACbyMEM_from_b13: - // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi#0 [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 + // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 lda #f_2pi @@ -6220,7 +6218,7 @@ gen_sintab: { // [100] call mulFACbyMEM // [136] phi from gen_sintab::@13 to mulFACbyMEM [phi:gen_sintab::@13->mulFACbyMEM] mulFACbyMEM_from_b13: - // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi#0 [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 + // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 lda #f_2pi @@ -7439,8 +7437,7 @@ FINAL SYMBOL TABLE (label) gen_sintab::@8 (label) gen_sintab::@9 (label) gen_sintab::@return -(byte*) gen_sintab::f_2pi -(const byte*) gen_sintab::f_2pi#0 f_2pi = (byte*) 58085 +(const byte*) gen_sintab::f_2pi f_2pi = (byte*) 58085 (const byte[]) gen_sintab::f_amp f_amp = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (const byte[]) gen_sintab::f_i f_i = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (const byte[]) gen_sintab::f_min f_min = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } @@ -8156,7 +8153,7 @@ gen_sintab: { // mulFACbyMEM(f_2pi) // [100] call mulFACbyMEM // [136] phi from gen_sintab::@13 to mulFACbyMEM [phi:gen_sintab::@13->mulFACbyMEM] - // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi#0 [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 + // [136] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) gen_sintab::f_2pi [phi:gen_sintab::@13->mulFACbyMEM#0] -- pbuz1=pbuc1 lda #f_2pi diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.sym b/src/test/ref/examples/sinsprites/sinus-sprites.sym index 4c102cbc6..58f733f02 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.sym +++ b/src/test/ref/examples/sinsprites/sinus-sprites.sym @@ -157,8 +157,7 @@ (label) gen_sintab::@8 (label) gen_sintab::@9 (label) gen_sintab::@return -(byte*) gen_sintab::f_2pi -(const byte*) gen_sintab::f_2pi#0 f_2pi = (byte*) 58085 +(const byte*) gen_sintab::f_2pi f_2pi = (byte*) 58085 (const byte[]) gen_sintab::f_amp f_amp = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (const byte[]) gen_sintab::f_i f_i = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } (const byte[]) gen_sintab::f_min f_min = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 } diff --git a/src/test/ref/examples/zpcode/zpcode.cfg b/src/test/ref/examples/zpcode/zpcode.cfg index 2f5828662..a18f4ac61 100644 --- a/src/test/ref/examples/zpcode/zpcode.cfg +++ b/src/test/ref/examples/zpcode/zpcode.cfg @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@2 [6] if((byte) main::i#2<(byte) $14) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 main::@6 - [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 + [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 [8] phi() @@ -28,7 +28,7 @@ main::@5: scope:[main] from main::@4 [11] call zpLoop to:main::@6 main::@6: scope:[main] from main::@5 - [12] *((const byte*) BGCOL#0) ← (byte) 0 + [12] *((const byte*) BGCOL) ← (byte) 0 to:main::@3 main::@2: scope:[main] from main::@1 [13] *((const byte*) main::zpCode#0 + (byte) main::i#2) ← *((const byte[]) zpCodeData + (byte) main::i#2) @@ -41,7 +41,7 @@ zpLoop: scope:[zpLoop] from main::@5 to:zpLoop::@1 zpLoop::@1: scope:[zpLoop] from zpLoop zpLoop::@1 [16] (byte) zpLoop::i#2 ← phi( zpLoop/(byte) 0 zpLoop::@1/(byte) zpLoop::i#1 ) - [17] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [17] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [18] (byte) zpLoop::i#1 ← ++ (byte) zpLoop::i#2 [19] if((byte) zpLoop::i#1!=(byte) $65) goto zpLoop::@1 to:zpLoop::@return @@ -55,7 +55,7 @@ loop: scope:[loop] from main::@4 to:loop::@1 loop::@1: scope:[loop] from loop loop::@1 [22] (byte) loop::i#2 ← phi( loop/(byte) 0 loop::@1/(byte) loop::i#1 ) - [23] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [23] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) [24] (byte) loop::i#1 ← ++ (byte) loop::i#2 [25] if((byte) loop::i#1!=(byte) $65) goto loop::@1 to:loop::@return diff --git a/src/test/ref/examples/zpcode/zpcode.log b/src/test/ref/examples/zpcode/zpcode.log index f0b473ceb..d0cc84093 100644 --- a/src/test/ref/examples/zpcode/zpcode.log +++ b/src/test/ref/examples/zpcode/zpcode.log @@ -22,8 +22,8 @@ Culled Empty Block (label) zpLoop::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) BGCOL#0 ← ((byte*)) (number) $d020 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) BGCOL ← ((byte*)) (number) $d020 to:@2 (void()) main() @@ -50,7 +50,7 @@ main::@7: scope:[main] from main::@1 main::@20 if(true) goto main::@10 to:main::@return main::@10: scope:[main] from main::@10 main::@7 - (bool~) main::$3 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$3 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$3) goto main::@10 to:main::@12 main::@12: scope:[main] from main::@10 @@ -60,7 +60,7 @@ main::@19: scope:[main] from main::@12 call zpLoop to:main::@20 main::@20: scope:[main] from main::@19 - *((byte*) BGCOL#0) ← (number) 0 + *((byte*) BGCOL) ← (number) 0 to:main::@7 main::@return: scope:[main] from main::@7 return @@ -72,7 +72,7 @@ loop: scope:[loop] from main::@12 to:loop::@1 loop::@1: scope:[loop] from loop loop::@1 (byte) loop::i#2 ← phi( loop/(byte) loop::i#0 loop::@1/(byte) loop::i#1 ) - *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) + *((byte*) BGCOL) ← -- *((byte*) BGCOL) (byte) loop::i#1 ← (byte) loop::i#2 + rangenext(0,$64) (bool~) loop::$1 ← (byte) loop::i#1 != rangelast(0,$64) if((bool~) loop::$1) goto loop::@1 @@ -91,7 +91,7 @@ zpLoop: scope:[zpLoop] from main::@19 to:zpLoop::@1 zpLoop::@1: scope:[zpLoop] from zpLoop zpLoop::@1 (byte) zpLoop::i#2 ← phi( zpLoop/(byte) zpLoop::i#0 zpLoop::@1/(byte) zpLoop::i#1 ) - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) (byte) zpLoop::i#1 ← (byte) zpLoop::i#2 + rangenext(0,$64) (bool~) zpLoop::$1 ← (byte) zpLoop::i#1 != rangelast(0,$64) if((bool~) zpLoop::$1) goto zpLoop::@1 @@ -113,9 +113,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) RASTER -(byte*) RASTER#0 (void()) loop() (bool~) loop::$1 (label) loop::@1 @@ -158,14 +156,14 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) $14 in (bool~) main::$2 ← (byte) main::i#2 < (number) $14 -Adding number conversion cast (unumber) $ff in (bool~) main::$3 ← *((byte*) RASTER#0) != (number) $ff -Adding number conversion cast (unumber) 0 in *((byte*) BGCOL#0) ← (number) 0 +Adding number conversion cast (unumber) $ff in (bool~) main::$3 ← *((byte*) RASTER) != (number) $ff +Adding number conversion cast (unumber) 0 in *((byte*) BGCOL) ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d020 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d020 Inlining cast (byte*~) main::$1 ← (byte*)(void()*~) main::$0 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 0 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53266 Simplifying constant pointer cast (byte*) 53280 @@ -186,14 +184,14 @@ Successful SSA optimization Pass2AliasElimination Identical Phi Values (byte*) main::zpCode#1 (byte*) main::zpCode#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$2 [9] if((byte) main::i#2<(byte) $14) goto main::@2 -Simple Condition (bool~) main::$3 [15] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@10 +Simple Condition (bool~) main::$3 [15] if(*((byte*) RASTER)!=(byte) $ff) goto main::@10 Simple Condition (bool~) loop::$1 [25] if((byte) loop::i#1!=rangelast(0,$64)) goto loop::@1 Simple Condition (bool~) zpLoop::$1 [33] if((byte) zpLoop::i#1!=rangelast(0,$64)) goto zpLoop::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [3] (void()*~) main::$0 ← & (void()) zpLoop() Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) BGCOL#0 = (byte*) 53280 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) BGCOL = (byte*) 53280 Constant (const void()*) main::$0 = &zpLoop Constant (const byte) main::i#0 = 0 Constant (const byte) loop::i#0 = 0 @@ -289,7 +287,7 @@ main::@1: scope:[main] from main main::@2 [6] if((byte) main::i#2<(byte) $14) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 main::@6 - [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 + [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 [8] phi() @@ -300,7 +298,7 @@ main::@5: scope:[main] from main::@4 [11] call zpLoop to:main::@6 main::@6: scope:[main] from main::@5 - [12] *((const byte*) BGCOL#0) ← (byte) 0 + [12] *((const byte*) BGCOL) ← (byte) 0 to:main::@3 main::@2: scope:[main] from main::@1 [13] *((const byte*) main::zpCode#0 + (byte) main::i#2) ← *((const byte[]) zpCodeData + (byte) main::i#2) @@ -313,7 +311,7 @@ zpLoop: scope:[zpLoop] from main::@5 to:zpLoop::@1 zpLoop::@1: scope:[zpLoop] from zpLoop zpLoop::@1 [16] (byte) zpLoop::i#2 ← phi( zpLoop/(byte) 0 zpLoop::@1/(byte) zpLoop::i#1 ) - [17] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) + [17] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) [18] (byte) zpLoop::i#1 ← ++ (byte) zpLoop::i#2 [19] if((byte) zpLoop::i#1!=(byte) $65) goto zpLoop::@1 to:zpLoop::@return @@ -327,7 +325,7 @@ loop: scope:[loop] from main::@4 to:loop::@1 loop::@1: scope:[loop] from loop loop::@1 [22] (byte) loop::i#2 ← phi( loop/(byte) 0 loop::@1/(byte) loop::i#1 ) - [23] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [23] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) [24] (byte) loop::i#1 ← ++ (byte) loop::i#2 [25] if((byte) loop::i#1!=(byte) $65) goto loop::@1 to:loop::@return @@ -337,8 +335,6 @@ loop::@return: scope:[loop] from loop::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte*) RASTER (void()) loop() (byte) loop::i (byte) loop::i#1 151.5 @@ -421,7 +417,7 @@ main: { jmp b3 // main::@3 b3: - // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b3 @@ -446,7 +442,7 @@ main: { jmp b6 // main::@6 b6: - // [12] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL jmp b3 @@ -479,7 +475,7 @@ zpLoop: { jmp b1 // zpLoop::@1 b1: - // [17] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [18] (byte) zpLoop::i#1 ← ++ (byte) zpLoop::i#2 -- vbuz1=_inc_vbuz1 inc.z i @@ -510,7 +506,7 @@ loop: { jmp b1 // loop::@1 b1: - // [23] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [23] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL // [24] (byte) loop::i#1 ← ++ (byte) loop::i#2 -- vbuz1=_inc_vbuz1 inc.z i @@ -532,12 +528,12 @@ zpCodeData: REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [13] *((const byte*) main::zpCode#0 + (byte) main::i#2) ← *((const byte[]) zpCodeData + (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 [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [13] *((const byte*) main::zpCode#0 + (byte) main::i#2) ← *((const byte[]) zpCodeData + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , Potential registers zp ZP_BYTE:3 [ zpLoop::i#2 zpLoop::i#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -606,7 +602,7 @@ main: { jmp b3 // main::@3 b3: - // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b3 @@ -631,7 +627,7 @@ main: { jmp b6 // main::@6 b6: - // [12] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL jmp b3 @@ -661,7 +657,7 @@ zpLoop: { jmp b1 // zpLoop::@1 b1: - // [17] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // [18] (byte) zpLoop::i#1 ← ++ (byte) zpLoop::i#2 -- vbuxx=_inc_vbuxx inx @@ -689,7 +685,7 @@ loop: { jmp b1 // loop::@1 b1: - // [23] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [23] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL // [24] (byte) loop::i#1 ← ++ (byte) loop::i#2 -- vbuxx=_inc_vbuxx inx @@ -756,10 +752,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) RASTER RASTER = (byte*) 53266 (void()) loop() (label) loop::@1 (label) loop::@return @@ -838,7 +832,7 @@ main: { // main::@3 b3: // while(*RASTER!=0xff) - // [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b3 @@ -856,7 +850,7 @@ main: { jsr zpLoop // main::@6 // *BGCOL = 0 - // [12] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BGCOL jmp b3 @@ -884,7 +878,7 @@ zpLoop: { // zpLoop::@1 b1: // (*BGCOL)++; - // [17] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // for(char i:0..100) // [18] (byte) zpLoop::i#1 ← ++ (byte) zpLoop::i#2 -- vbuxx=_inc_vbuxx @@ -909,7 +903,7 @@ loop: { // loop::@1 b1: // (*BGCOL)--; - // [23] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [23] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL // for(char i:0..100) // [24] (byte) loop::i#1 ← ++ (byte) loop::i#2 -- vbuxx=_inc_vbuxx diff --git a/src/test/ref/examples/zpcode/zpcode.sym b/src/test/ref/examples/zpcode/zpcode.sym index c5fdae595..ca8ff89ee 100644 --- a/src/test/ref/examples/zpcode/zpcode.sym +++ b/src/test/ref/examples/zpcode/zpcode.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 +(const byte*) BGCOL BGCOL = (byte*) 53280 +(const byte*) RASTER RASTER = (byte*) 53266 (void()) loop() (label) loop::@1 (label) loop::@return diff --git a/src/test/ref/fill-square.cfg b/src/test/ref/fill-square.cfg index 78757fc34..7476d4e6b 100644 --- a/src/test/ref/fill-square.cfg +++ b/src/test/ref/fill-square.cfg @@ -18,7 +18,7 @@ main::@1: scope:[main] from main main::@3 [7] (word) main::$6 ← (word~) main::$0 << (byte) 2 [8] (word) main::$7 ← (word) main::$6 + (word~) main::$0 [9] (word~) main::$1 ← (word) main::$7 << (byte) 3 - [10] (byte*) main::line#0 ← (const byte*) SCREEN#0 + (word~) main::$1 + [10] (byte*) main::line#0 ← (const byte*) SCREEN + (word~) main::$1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [11] (byte) main::x#2 ← phi( main::@1/(byte) 5 main::@2/(byte) main::x#1 ) diff --git a/src/test/ref/fill-square.log b/src/test/ref/fill-square.log index a4affb914..181d89223 100644 --- a/src/test/ref/fill-square.log +++ b/src/test/ref/fill-square.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -14,7 +14,7 @@ main::@1: scope:[main] from main main::@3 (byte) main::y#2 ← phi( main/(byte) main::y#0 main::@3/(byte) main::y#1 ) (word~) main::$0 ← ((word)) (byte) main::y#2 (number~) main::$1 ← (word~) main::$0 * (number) $28 - (byte*~) main::$2 ← (byte*) SCREEN#0 + (number~) main::$1 + (byte*~) main::$2 ← (byte*) SCREEN + (number~) main::$1 (byte*) main::line#0 ← (byte*~) main::$2 (byte) main::x#0 ← (byte) 5 to:main::@2 @@ -50,7 +50,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (word~) main::$0 (number~) main::$1 @@ -79,7 +78,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $28 in (number~) main::$1 ← (word~) main::$0 * (number) $28 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (word~) main::$0 * (unumber)(number) $28 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word~) main::$0 ← (word)(byte) main::y#2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -97,7 +96,7 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$4 [13] if((byte) main::x#1!=rangelast(5,$f)) goto main::@2 Simple Condition (bool~) main::$5 [17] if((byte) main::y#1!=rangelast(5,$f)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::y#0 = 5 Constant (const byte) main::x#0 = 5 Successful SSA optimization Pass2ConstantIdentification @@ -165,7 +164,7 @@ main::@1: scope:[main] from main main::@3 [7] (word) main::$6 ← (word~) main::$0 << (byte) 2 [8] (word) main::$7 ← (word) main::$6 + (word~) main::$0 [9] (word~) main::$1 ← (word) main::$7 << (byte) 3 - [10] (byte*) main::line#0 ← (const byte*) SCREEN#0 + (word~) main::$1 + [10] (byte*) main::line#0 ← (const byte*) SCREEN + (word~) main::$1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [11] (byte) main::x#2 ← phi( main::@1/(byte) 5 main::@2/(byte) main::x#1 ) @@ -184,7 +183,6 @@ main::@return: scope:[main] from main::@3 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (word~) main::$0 16.5 (word~) main::$1 22.0 @@ -308,7 +306,7 @@ main: { rol.z _1+1 asl.z _1 rol.z _1+1 - // [10] (byte*) main::line#0 ← (const byte*) SCREEN#0 + (word~) main::$1 -- pbuz1=pbuc1_plus_vwuz2 + // [10] (byte*) main::line#0 ← (const byte*) SCREEN + (word~) main::$1 -- pbuz1=pbuc1_plus_vwuz2 lda.z _1 clc adc #plot::@1#0] -- vbuz1=vbuc1 lda #$10 sta.z y - // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 lda #SCREEN+5*$28+$c @@ -1018,9 +1014,9 @@ prepare: { buffer2: .fill $10*$10, 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::c#4 main::c#1 ] -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a Statement [19] (byte*) plot::line#1 ← (byte*) plot::line#5 + (byte) $28 [ plot::y#4 plot::i#2 plot::line#1 ] ( main:2::plot:14 [ plot::y#4 plot::i#2 plot::line#1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ plot::y#4 plot::y#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ plot::i#4 plot::i#2 plot::i#1 ] @@ -1034,8 +1030,8 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ f Statement [31] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) $10 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#1 flip::c#2 flip::dstIdx#1 ] ) always clobbers reg byte a Statement [38] *((const byte[$10*$10]) buffer1 + (byte) flip::i#2) ← *((const byte[$10*$10]) buffer2 + (byte) flip::i#2) [ flip::i#2 ] ( main:2::flip:12 [ flip::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ] -Statement [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a +Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::c#4 ] ( main:2 [ main::c#4 ] ) always clobbers reg byte a Statement [19] (byte*) plot::line#1 ← (byte*) plot::line#5 + (byte) $28 [ plot::y#4 plot::i#2 plot::line#1 ] ( main:2::plot:14 [ plot::y#4 plot::i#2 plot::line#1 ] ) always clobbers reg byte a Statement [23] *((byte*) plot::line#5 + (byte) plot::x#2) ← *((const byte[$10*$10]) buffer1 + (byte) plot::i#2) [ plot::line#5 plot::y#4 plot::i#2 plot::x#2 ] ( main:2::plot:14 [ plot::line#5 plot::y#4 plot::i#2 plot::x#2 ] ) always clobbers reg byte a Statement [29] *((const byte[$10*$10]) buffer2 + (byte) flip::dstIdx#3) ← *((const byte[$10*$10]) buffer1 + (byte) flip::srcIdx#2) [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ( main:2::flip:12 [ flip::r#4 flip::srcIdx#2 flip::dstIdx#3 flip::c#2 ] ) always clobbers reg byte a @@ -1121,14 +1117,14 @@ main: { jmp b1 // main::@1 b1: - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1_from_b1 jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 @@ -1170,7 +1166,7 @@ plot: { // [16] phi (byte) plot::y#4 = (byte) $10 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 lda #$10 sta.z y - // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 lda #SCREEN+5*$28+$c @@ -1436,10 +1432,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$10*$10]) buffer1 buffer1 = { fill( $10*$10, 0) } (const byte[$10*$10]) buffer2 buffer2 = { fill( $10*$10, 0) } (void()) flip() @@ -1546,14 +1540,14 @@ main: { // main::@1 b1: // while(*RASTER!=254) - // [7] if(*((const byte*) RASTER#0)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$fe cmp RASTER bne b1 // main::@2 b2: // while(*RASTER!=255) - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 @@ -1587,7 +1581,7 @@ plot: { // [16] phi (byte) plot::y#4 = (byte) $10 [phi:plot->plot::@1#0] -- vbuz1=vbuc1 lda #$10 sta.z y - // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN#0+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) plot::line#5 = (const byte*) SCREEN+(byte)(number) 5*(number) $28+(byte) $c [phi:plot->plot::@1#1] -- pbuz1=pbuc1 lda #SCREEN+5*$28+$c diff --git a/src/test/ref/flipper-rex2.sym b/src/test/ref/flipper-rex2.sym index b2813ff68..a1dab8441 100644 --- a/src/test/ref/flipper-rex2.sym +++ b/src/test/ref/flipper-rex2.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[$10*$10]) buffer1 buffer1 = { fill( $10*$10, 0) } (const byte[$10*$10]) buffer2 buffer2 = { fill( $10*$10, 0) } (void()) flip() diff --git a/src/test/ref/font-hex-show.cfg b/src/test/ref/font-hex-show.cfg index 1f8688cb6..5f3c0309f 100644 --- a/src/test/ref/font-hex-show.cfg +++ b/src/test/ref/font-hex-show.cfg @@ -21,7 +21,7 @@ main::@2: scope:[main] from main::toD0181 to:main::@1 main::@1: scope:[main] from main::@1 main::@2 [8] (byte) main::c#2 ← phi( main::@1/(byte) main::c#1 main::@2/(byte) 0 ) - [9] *((const byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 + [9] *((const byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 [10] (byte) main::c#1 ← ++ (byte) main::c#2 [11] if((byte) main::c#1!=(byte) 0) goto main::@1 to:main::@return @@ -36,7 +36,7 @@ init_font_hex: scope:[init_font_hex] from main::@2 init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5 [14] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 ) [14] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 ) - [14] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 ) + [14] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET init_font_hex::@5/(byte*) init_font_hex::charset#0 ) to:init_font_hex::@2 init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4 [15] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 ) diff --git a/src/test/ref/font-hex-show.log b/src/test/ref/font-hex-show.log index fae9bacd8..1d6719ce9 100644 --- a/src/test/ref/font-hex-show.log +++ b/src/test/ref/font-hex-show.log @@ -94,14 +94,14 @@ init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5 to:@return @9: scope:[] from @begin (byte[]) FONT_HEX_PROTO ← { (number) 2, (number) 5, (number) 5, (number) 5, (number) 2, (number) 6, (number) 2, (number) 2, (number) 2, (number) 7, (number) 6, (number) 1, (number) 2, (number) 4, (number) 7, (number) 6, (number) 1, (number) 2, (number) 1, (number) 6, (number) 5, (number) 5, (number) 7, (number) 1, (number) 1, (number) 7, (number) 4, (number) 6, (number) 1, (number) 6, (number) 3, (number) 4, (number) 6, (number) 5, (number) 2, (number) 7, (number) 1, (number) 1, (number) 1, (number) 1, (number) 2, (number) 5, (number) 2, (number) 5, (number) 2, (number) 2, (number) 5, (number) 3, (number) 1, (number) 1, (number) 2, (number) 5, (number) 7, (number) 5, (number) 5, (number) 6, (number) 5, (number) 6, (number) 5, (number) 6, (number) 2, (number) 5, (number) 4, (number) 5, (number) 2, (number) 6, (number) 5, (number) 5, (number) 5, (number) 6, (number) 7, (number) 4, (number) 6, (number) 4, (number) 7, (number) 7, (number) 4, (number) 6, (number) 4, (number) 4 } - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) CHARSET#0 ← ((byte*)) (number) $2000 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) CHARSET ← ((byte*)) (number) $2000 to:@10 (void()) main() main: scope:[main] from @10 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) CHARSET#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) CHARSET to:main::toD0181 main::toD0181: scope:[main] from main (byte*) main::toD0181_gfx#1 ← phi( main/(byte*) main::toD0181_gfx#0 ) @@ -125,7 +125,7 @@ main::@3: scope:[main] from main::toD0181_@return (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$0 ← (byte) main::toD0181_return#3 *((byte*) D018) ← (byte~) main::$0 - (byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0 + (byte*) init_font_hex::charset#1 ← (byte*) CHARSET call init_font_hex to:main::@4 main::@4: scope:[main] from main::@3 @@ -133,7 +133,7 @@ main::@4: scope:[main] from main::@3 to:main::@1 main::@1: scope:[main] from main::@1 main::@4 (byte) main::c#2 ← phi( main::@1/(byte) main::c#1 main::@4/(byte) main::c#0 ) - *((byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 + *((byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 (byte) main::c#1 ← (byte) main::c#2 + rangenext(0,$ff) (bool~) main::$2 ← (byte) main::c#1 != rangelast(0,$ff) if((bool~) main::$2) goto main::@1 @@ -155,11 +155,9 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) CHARSET -(byte*) CHARSET#0 (byte*) D018 (byte[]) FONT_HEX_PROTO (byte*) SCREEN -(byte*) SCREEN#0 (void()) init_font_hex((byte*) init_font_hex::charset) (byte~) init_font_hex::$0 (byte~) init_font_hex::$1 @@ -283,8 +281,8 @@ Inlining cast (byte) init_font_hex::idx#0 ← (unumber)(number) 0 Inlining cast *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0) ← (unumber)(number) 0 Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#6) ← (unumber)(number) 0 Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#3) ← (unumber)(number) 0 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) CHARSET#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) CHARSET ← (byte*)(number) $2000 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 Successful SSA optimization Pass2InlineCast @@ -439,15 +437,15 @@ Constant (const byte) init_font_hex::c1#0 = 0 Constant (const byte) init_font_hex::idx#0 = 0 Constant (const byte) init_font_hex::i#0 = 0 Constant (const byte[]) FONT_HEX_PROTO = { 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4 } -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) CHARSET#0 = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) CHARSET = (byte*) 8192 Constant (const byte) main::c#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) init_font_hex::proto_hi#0 = FONT_HEX_PROTO Constant (const byte*) init_font_hex::proto_lo#0 = FONT_HEX_PROTO -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0 -Constant (const byte*) init_font_hex::charset#1 = CHARSET#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = CHARSET +Constant (const byte*) init_font_hex::charset#1 = CHARSET Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [43] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [47] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 @@ -516,19 +514,19 @@ Inlining constant with var siblings (const byte*) init_font_hex::proto_lo#0 Inlining constant with var siblings (const byte*) init_font_hex::charset#1 Inlining constant with var siblings (const byte) init_font_hex::idx#1 Inlining constant with var siblings (const byte) main::c#0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET#0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET +Constant inlined main::toD0181_$7 = >(word)(const byte*) CHARSET/(byte) 4&(byte) $f Constant inlined init_font_hex::proto_hi#0 = (const byte[]) FONT_HEX_PROTO -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) CHARSET#0/(byte) 4 +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) CHARSET/(byte) 4 Constant inlined init_font_hex::i#0 = (byte) 0 -Constant inlined main::toD0181_$5 = >(word)(const byte*) CHARSET#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) CHARSET#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET#0 +Constant inlined main::toD0181_$5 = >(word)(const byte*) CHARSET +Constant inlined main::toD0181_$4 = (word)(const byte*) CHARSET +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET Constant inlined init_font_hex::idx#1 = ++(byte) 0 Constant inlined main::c#0 = (byte) 0 Constant inlined init_font_hex::idx#0 = (byte) 0 @@ -609,7 +607,7 @@ main::@2: scope:[main] from main::toD0181 to:main::@1 main::@1: scope:[main] from main::@1 main::@2 [8] (byte) main::c#2 ← phi( main::@1/(byte) main::c#1 main::@2/(byte) 0 ) - [9] *((const byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 + [9] *((const byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 [10] (byte) main::c#1 ← ++ (byte) main::c#2 [11] if((byte) main::c#1!=(byte) 0) goto main::@1 to:main::@return @@ -624,7 +622,7 @@ init_font_hex: scope:[init_font_hex] from main::@2 init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5 [14] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 ) [14] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 ) - [14] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 ) + [14] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET init_font_hex::@5/(byte*) init_font_hex::charset#0 ) to:init_font_hex::@2 init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4 [15] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 ) @@ -663,8 +661,6 @@ init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5 VARIABLE REGISTER WEIGHTS -(byte*) CHARSET -(byte*) SCREEN (void()) init_font_hex((byte*) init_font_hex::charset) (byte~) init_font_hex::$0 1001.0 (byte~) init_font_hex::$1 2002.0 @@ -799,7 +795,7 @@ main: { jmp b1 // main::@1 b1: - // [9] *((const byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [9] *((const byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z c tya sta SCREEN,y @@ -840,7 +836,7 @@ init_font_hex: { sta.z proto_hi lda #>FONT_HEX_PROTO sta.z proto_hi+1 - // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 + // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 lda #CHARSET @@ -1110,7 +1106,7 @@ main: { jmp b1 // main::@1 b1: - // [9] *((const byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [9] *((const byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [10] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx @@ -1145,7 +1141,7 @@ init_font_hex: { sta.z proto_hi lda #>FONT_HEX_PROTO sta.z proto_hi+1 - // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 + // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 lda #CHARSET @@ -1346,12 +1342,10 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) CHARSET -(const byte*) CHARSET#0 CHARSET = (byte*) 8192 +(const byte*) CHARSET CHARSET = (byte*) 8192 (const byte*) D018 D018 = (byte*) 53272 (const byte[]) FONT_HEX_PROTO FONT_HEX_PROTO = { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 } -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) init_font_hex((byte*) init_font_hex::charset) (byte~) init_font_hex::$0 $0 zp ZP_BYTE:11 1001.0 (byte~) init_font_hex::$1 reg byte a 2002.0 @@ -1395,7 +1389,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0181_screen reg byte x [ main::c#2 main::c#1 ] @@ -1455,7 +1449,7 @@ main: { // main::@1 b1: // SCREEN[c] = c - // [9] *((const byte*) SCREEN#0 + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [9] *((const byte*) SCREEN + (byte) main::c#2) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for (byte c: 0..255) @@ -1489,7 +1483,7 @@ init_font_hex: { sta.z proto_hi lda #>FONT_HEX_PROTO sta.z proto_hi+1 - // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 + // [14] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1 lda #CHARSET diff --git a/src/test/ref/font-hex-show.sym b/src/test/ref/font-hex-show.sym index 5ab6c7a3d..ba1fb4b48 100644 --- a/src/test/ref/font-hex-show.sym +++ b/src/test/ref/font-hex-show.sym @@ -1,12 +1,10 @@ (label) @1 (label) @begin (label) @end -(byte*) CHARSET -(const byte*) CHARSET#0 CHARSET = (byte*) 8192 +(const byte*) CHARSET CHARSET = (byte*) 8192 (const byte*) D018 D018 = (byte*) 53272 (const byte[]) FONT_HEX_PROTO FONT_HEX_PROTO = { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 } -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) init_font_hex((byte*) init_font_hex::charset) (byte~) init_font_hex::$0 $0 zp ZP_BYTE:11 1001.0 (byte~) init_font_hex::$1 reg byte a 2002.0 @@ -50,7 +48,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET/(byte) 4&(byte) $f (byte*) main::toD0181_screen reg byte x [ main::c#2 main::c#1 ] diff --git a/src/test/ref/forincrementassign.cfg b/src/test/ref/forincrementassign.cfg index 3dfcbc916..97c210dc3 100644 --- a/src/test/ref/forincrementassign.cfg +++ b/src/test/ref/forincrementassign.cfg @@ -20,6 +20,6 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [9] (byte) main::i#1 ← (byte) main::i#2 + (byte) 2 to:main::@1 diff --git a/src/test/ref/forincrementassign.log b/src/test/ref/forincrementassign.log index 0de30d73c..07a9825a0 100644 --- a/src/test/ref/forincrementassign.log +++ b/src/test/ref/forincrementassign.log @@ -6,7 +6,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -20,7 +20,7 @@ main::@1: scope:[main] from main main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#0 + (byte) main::i#3) ← (byte) main::i#3 + *((byte*) SCREEN + (byte) main::i#3) ← (byte) main::i#3 (number~) main::$1 ← (byte) main::i#3 + (number) 2 (byte) main::i#1 ← (number~) main::$1 to:main::@1 @@ -40,7 +40,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (number~) main::$1 @@ -58,7 +57,7 @@ Adding number conversion cast (unumber) $28 in (bool~) main::$0 ← (byte) main: Adding number conversion cast (unumber) 2 in (number~) main::$1 ← (byte) main::i#3 + (number) 2 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::i#3 + (unumber)(number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -76,7 +75,7 @@ Alias (byte) main::i#1 = (byte~) main::$1 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [4] if((byte) main::i#2<(byte) $28) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 @@ -122,13 +121,12 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [9] (byte) main::i#1 ← (byte) main::i#2 + (byte) 2 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 22.0 @@ -189,7 +187,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -260,7 +258,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuaa=vbuaa + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuaa=vbuaa tax sta SCREEN,x // [9] (byte) main::i#1 ← (byte) main::i#2 + (byte) 2 -- vbuaa=vbuaa_plus_2 @@ -299,8 +297,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -349,7 +346,7 @@ main: { // main::@2 b2: // SCREEN[i] = i - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuaa=vbuaa + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuaa=vbuaa tax sta SCREEN,x // i=i+2 diff --git a/src/test/ref/forincrementassign.sym b/src/test/ref/forincrementassign.sym index 4021b615b..26a51c72e 100644 --- a/src/test/ref/forincrementassign.sym +++ b/src/test/ref/forincrementassign.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/forrangedwords.cfg b/src/test/ref/forrangedwords.cfg index 17d00d543..1469836d9 100644 --- a/src/test/ref/forrangedwords.cfg +++ b/src/test/ref/forrangedwords.cfg @@ -15,18 +15,18 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (word) main::w#2 ← phi( main/(word) 0 main::@1/(word) main::w#1 ) [6] (byte~) main::$0 ← < (word) main::w#2 - [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 + [7] *((const byte*) main::SCREEN) ← (byte~) main::$0 [8] (byte~) main::$1 ← > (word) main::w#2 - [9] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte~) main::$1 + [9] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 [10] (word) main::w#1 ← ++ (word) main::w#2 [11] if((word) main::w#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [12] (signed word) main::sw#2 ← phi( main::@1/(signed word) -$7fff main::@2/(signed word) main::sw#1 ) [13] (byte~) main::$3 ← < (signed word) main::sw#2 - [14] *((const byte*) main::SCREEN#0+(byte) 3) ← (byte~) main::$3 + [14] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 [15] (byte~) main::$4 ← > (signed word) main::sw#2 - [16] *((const byte*) main::SCREEN#0+(byte) 4) ← (byte~) main::$4 + [16] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 [17] (signed word) main::sw#1 ← ++ (signed word) main::sw#2 [18] if((signed word) main::sw#1!=(signed word) $7fff) goto main::@2 to:main::@return diff --git a/src/test/ref/forrangedwords.log b/src/test/ref/forrangedwords.log index c3978bd4b..4e9a6a79d 100644 --- a/src/test/ref/forrangedwords.log +++ b/src/test/ref/forrangedwords.log @@ -7,15 +7,15 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (word) main::w#0 ← (word) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (word) main::w#2 ← phi( main/(word) main::w#0 main::@1/(word) main::w#1 ) (byte~) main::$0 ← < (word) main::w#2 - *((byte*) main::SCREEN#0 + (number) 0) ← (byte~) main::$0 + *((byte*) main::SCREEN + (number) 0) ← (byte~) main::$0 (byte~) main::$1 ← > (word) main::w#2 - *((byte*) main::SCREEN#0 + (number) 1) ← (byte~) main::$1 + *((byte*) main::SCREEN + (number) 1) ← (byte~) main::$1 (word) main::w#1 ← (word) main::w#2 + rangenext(0,$ffff) (bool~) main::$2 ← (word) main::w#1 != rangelast(0,$ffff) if((bool~) main::$2) goto main::@1 @@ -26,9 +26,9 @@ main::@2: scope:[main] from main::@1 main::@3: scope:[main] from main::@2 main::@3 (signed word) main::sw#2 ← phi( main::@2/(signed word) main::sw#0 main::@3/(signed word) main::sw#1 ) (byte~) main::$3 ← < (signed word) main::sw#2 - *((byte*) main::SCREEN#0 + (number) 3) ← (byte~) main::$3 + *((byte*) main::SCREEN + (number) 3) ← (byte~) main::$3 (byte~) main::$4 ← > (signed word) main::sw#2 - *((byte*) main::SCREEN#0 + (number) 4) ← (byte~) main::$4 + *((byte*) main::SCREEN + (number) 4) ← (byte~) main::$4 (signed word) main::sw#1 ← (signed word) main::sw#2 + rangenext(-$7fff,$7ffe) (bool~) main::$5 ← (signed word) main::sw#1 != rangelast(-$7fff,$7ffe) if((bool~) main::$5) goto main::@3 @@ -60,7 +60,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (signed word) main::sw (signed word) main::sw#0 (signed word) main::sw#1 @@ -70,12 +69,12 @@ SYMBOL TABLE SSA (word) main::w#1 (word) main::w#2 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte~) main::$0 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte~) main::$1 -Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN#0 + (number) 3) ← (byte~) main::$3 -Adding number conversion cast (unumber) 4 in *((byte*) main::SCREEN#0 + (number) 4) ← (byte~) main::$4 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte~) main::$0 +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte~) main::$1 +Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN + (number) 3) ← (byte~) main::$3 +Adding number conversion cast (unumber) 4 in *((byte*) main::SCREEN + (number) 4) ← (byte~) main::$4 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -91,7 +90,7 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Simple Condition (bool~) main::$2 [9] if((word) main::w#1!=rangelast(0,$ffff)) goto main::@1 Simple Condition (bool~) main::$5 [18] if((signed word) main::sw#1!=rangelast(-$7fff,$7ffe)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const word) main::w#0 = 0 Constant (const signed word) main::sw#0 = -$7fff Successful SSA optimization Pass2ConstantIdentification @@ -99,7 +98,7 @@ Resolved ranged next value [7] main::w#1 ← ++ main::w#2 to ++ Resolved ranged comparison value [9] if(main::w#1!=rangelast(0,$ffff)) goto main::@1 to (number) 0 Resolved ranged next value [16] main::sw#1 ← ++ main::sw#2 to ++ Resolved ranged comparison value [18] if(main::sw#1!=rangelast(-$7fff,$7ffe)) goto main::@3 to (number) $7fff -Simplifying expression containing zero main::SCREEN#0 in [4] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte~) main::$0 +Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (byte) 0) ← (byte~) main::$0 Successful SSA optimization PassNSimplifyExpressionWithZero Adding number conversion cast (unumber) 0 in if((word) main::w#1!=(number) 0) goto main::@1 Adding number conversion cast (snumber) $7fff in if((signed word) main::sw#1!=(number) $7fff) goto main::@3 @@ -115,9 +114,9 @@ Inlining constant with var siblings (const signed word) main::sw#0 Constant inlined main::w#0 = (word) 0 Constant inlined main::sw#0 = (signed word) -$7fff Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+1) -Consolidated array index constant in *(main::SCREEN#0+3) -Consolidated array index constant in *(main::SCREEN#0+4) +Consolidated array index constant in *(main::SCREEN+1) +Consolidated array index constant in *(main::SCREEN+3) +Consolidated array index constant in *(main::SCREEN+4) Successful SSA optimization Pass2ConstantAdditionElimination Added new block during phi lifting main::@5(between main::@1 and main::@1) Added new block during phi lifting main::@6(between main::@3 and main::@3) @@ -162,18 +161,18 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (word) main::w#2 ← phi( main/(word) 0 main::@1/(word) main::w#1 ) [6] (byte~) main::$0 ← < (word) main::w#2 - [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 + [7] *((const byte*) main::SCREEN) ← (byte~) main::$0 [8] (byte~) main::$1 ← > (word) main::w#2 - [9] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte~) main::$1 + [9] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 [10] (word) main::w#1 ← ++ (word) main::w#2 [11] if((word) main::w#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [12] (signed word) main::sw#2 ← phi( main::@1/(signed word) -$7fff main::@2/(signed word) main::sw#1 ) [13] (byte~) main::$3 ← < (signed word) main::sw#2 - [14] *((const byte*) main::SCREEN#0+(byte) 3) ← (byte~) main::$3 + [14] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 [15] (byte~) main::$4 ← > (signed word) main::sw#2 - [16] *((const byte*) main::SCREEN#0+(byte) 4) ← (byte~) main::$4 + [16] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 [17] (signed word) main::sw#1 ← ++ (signed word) main::sw#2 [18] if((signed word) main::sw#1!=(signed word) $7fff) goto main::@2 to:main::@return @@ -188,7 +187,6 @@ VARIABLE REGISTER WEIGHTS (byte~) main::$1 22.0 (byte~) main::$3 22.0 (byte~) main::$4 22.0 -(byte*) main::SCREEN (signed word) main::sw (signed word) main::sw#1 16.5 (signed word) main::sw#2 8.8 @@ -267,13 +265,13 @@ main: { // [6] (byte~) main::$0 ← < (word) main::w#2 -- vbuz1=_lo_vwuz2 lda.z w sta.z _0 - // [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 + // [7] *((const byte*) main::SCREEN) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1 lda.z _0 sta SCREEN // [8] (byte~) main::$1 ← > (word) main::w#2 -- vbuz1=_hi_vwuz2 lda.z w+1 sta.z _1 - // [9] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 + // [9] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1 lda.z _1 sta SCREEN+1 // [10] (word) main::w#1 ← ++ (word) main::w#2 -- vwuz1=_inc_vwuz1 @@ -303,13 +301,13 @@ main: { // [13] (byte~) main::$3 ← < (signed word) main::sw#2 -- vbuz1=_lo_vwsz2 lda.z sw sta.z _3 - // [14] *((const byte*) main::SCREEN#0+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1 lda.z _3 sta SCREEN+3 // [15] (byte~) main::$4 ← > (signed word) main::sw#2 -- vbuz1=_hi_vwsz2 lda.z sw+1 sta.z _4 - // [16] *((const byte*) main::SCREEN#0+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1 + // [16] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1 lda.z _4 sta SCREEN+4 // [17] (signed word) main::sw#1 ← ++ (signed word) main::sw#2 -- vwsz1=_inc_vwsz1 @@ -398,11 +396,11 @@ main: { b1: // [6] (byte~) main::$0 ← < (word) main::w#2 -- vbuaa=_lo_vwuz1 lda.z w - // [7] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa + // [7] *((const byte*) main::SCREEN) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa sta SCREEN // [8] (byte~) main::$1 ← > (word) main::w#2 -- vbuaa=_hi_vwuz1 lda.z w+1 - // [9] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [9] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta SCREEN+1 // [10] (word) main::w#1 ← ++ (word) main::w#2 -- vwuz1=_inc_vwuz1 inc.z w @@ -430,11 +428,11 @@ main: { b2: // [13] (byte~) main::$3 ← < (signed word) main::sw#2 -- vbuaa=_lo_vwsz1 lda.z sw - // [14] *((const byte*) main::SCREEN#0+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa + // [14] *((const byte*) main::SCREEN+(byte) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa sta SCREEN+3 // [15] (byte~) main::$4 ← > (signed word) main::sw#2 -- vbuaa=_hi_vwsz1 lda.z sw+1 - // [16] *((const byte*) main::SCREEN#0+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa sta SCREEN+4 // [17] (signed word) main::sw#1 ← ++ (signed word) main::sw#2 -- vwsz1=_inc_vwsz1 inc.z sw @@ -502,8 +500,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (signed word) main::sw (signed word) main::sw#1 sw zp ZP_WORD:4 16.5 (signed word) main::sw#2 sw zp ZP_WORD:4 8.8 @@ -553,13 +550,13 @@ main: { // [6] (byte~) main::$0 ← < (word) main::w#2 -- vbuaa=_lo_vwuz1 lda.z w // SCREEN[0] = w // [8] (byte~) main::$1 ← > (word) main::w#2 -- vbuaa=_hi_vwuz1 lda.z w+1 // SCREEN[1] = >w - // [9] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa + // [9] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa sta SCREEN+1 // for( word w: 0..$ffff) // [10] (word) main::w#1 ← ++ (word) main::w#2 -- vwuz1=_inc_vwuz1 @@ -586,13 +583,13 @@ main: { // [13] (byte~) main::$3 ← < (signed word) main::sw#2 -- vbuaa=_lo_vwsz1 lda.z sw // SCREEN[3] = sw // [15] (byte~) main::$4 ← > (signed word) main::sw#2 -- vbuaa=_hi_vwsz1 lda.z sw+1 // SCREEN[4] = >sw - // [16] *((const byte*) main::SCREEN#0+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) main::SCREEN+(byte) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa sta SCREEN+4 // for( signed word sw: -$7fff..$7ffe) // [17] (signed word) main::sw#1 ← ++ (signed word) main::sw#2 -- vwsz1=_inc_vwsz1 diff --git a/src/test/ref/forrangedwords.sym b/src/test/ref/forrangedwords.sym index 649c59a2c..d028b6bb1 100644 --- a/src/test/ref/forrangedwords.sym +++ b/src/test/ref/forrangedwords.sym @@ -9,8 +9,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (signed word) main::sw (signed word) main::sw#1 sw zp ZP_WORD:4 16.5 (signed word) main::sw#2 sw zp ZP_WORD:4 8.8 diff --git a/src/test/ref/forrangemin.cfg b/src/test/ref/forrangemin.cfg index 6b313d9eb..6401d824a 100644 --- a/src/test/ref/forrangemin.cfg +++ b/src/test/ref/forrangemin.cfg @@ -14,13 +14,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 + [6] *((const byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [9] (byte) main::j#3 ← phi( main::@1/(byte) $64 main::@2/(byte) main::j#2 ) - [10] *((const byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 + [10] *((const byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 [11] (byte) main::j#2 ← -- (byte) main::j#3 [12] if((byte) main::j#2!=(byte) $ff) goto main::@2 to:main::@return diff --git a/src/test/ref/forrangemin.log b/src/test/ref/forrangemin.log index 0991ee9a3..71d22a9ba 100644 --- a/src/test/ref/forrangemin.log +++ b/src/test/ref/forrangemin.log @@ -4,8 +4,8 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN1#0 ← ((byte*)) (number) $400 - (byte*) SCREEN2#0 ← ((byte*)) (number) $500 + (byte*) SCREEN1 ← ((byte*)) (number) $400 + (byte*) SCREEN2 ← ((byte*)) (number) $500 to:@1 (void()) main() @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$0) goto main::@1 @@ -25,7 +25,7 @@ main::@2: scope:[main] from main::@1 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 (byte) main::j#3 ← phi( main::@2/(byte) main::j#1 main::@3/(byte) main::j#2 ) - *((byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 + *((byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 (byte) main::j#2 ← (byte) main::j#3 + rangenext($64,0) (bool~) main::$1 ← (byte) main::j#2 != rangelast($64,0) if((bool~) main::$1) goto main::@3 @@ -46,9 +46,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN1 -(byte*) SCREEN1#0 (byte*) SCREEN2 -(byte*) SCREEN2#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -68,8 +66,8 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $64 in (byte) main::j#1 ← (number) $64 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN1#0 ← (byte*)(number) $400 -Inlining cast (byte*) SCREEN2#0 ← (byte*)(number) $500 +Inlining cast (byte*) SCREEN1 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN2 ← (byte*)(number) $500 Inlining cast (byte) main::j#1 ← (unumber)(number) $64 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -81,8 +79,8 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 Simple Condition (bool~) main::$1 [14] if((byte) main::j#2!=rangelast($64,0)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN1#0 = (byte*) 1024 -Constant (const byte*) SCREEN2#0 = (byte*) 1280 +Constant (const byte*) SCREEN1 = (byte*) 1024 +Constant (const byte*) SCREEN2 = (byte*) 1280 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#0 = 0 Constant (const byte) main::j#1 = $64 @@ -149,13 +147,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 + [6] *((const byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [9] (byte) main::j#3 ← phi( main::@1/(byte) $64 main::@2/(byte) main::j#2 ) - [10] *((const byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 + [10] *((const byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 [11] (byte) main::j#2 ← -- (byte) main::j#3 [12] if((byte) main::j#2!=(byte) $ff) goto main::@2 to:main::@return @@ -165,8 +163,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN1 -(byte*) SCREEN2 (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -227,7 +223,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [6] *((const byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN1,y @@ -249,7 +245,7 @@ main: { jmp b2 // main::@2 b2: - // [10] *((const byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuz1=vbuz1 + // [10] *((const byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z j tya sta SCREEN2,y @@ -317,7 +313,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [6] *((const byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN1,x // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -336,7 +332,7 @@ main: { jmp b2 // main::@2 b2: - // [10] *((const byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN2,x // [11] (byte) main::j#2 ← -- (byte) main::j#3 -- vbuxx=_dec_vbuxx @@ -386,10 +382,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN1 -(const byte*) SCREEN1#0 SCREEN1 = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*) 1280 +(const byte*) SCREEN1 SCREEN1 = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*) 1280 (void()) main() (label) main::@1 (label) main::@2 @@ -434,7 +428,7 @@ main: { // main::@1 b1: // SCREEN1[i] = i - // [6] *((const byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [6] *((const byte*) SCREEN1 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN1,x // for(byte i : 0..255) @@ -451,7 +445,7 @@ main: { // main::@2 b2: // SCREEN2[j] = j - // [10] *((const byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN2 + (byte) main::j#3) ← (byte) main::j#3 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN2,x // for(j : 100..0) diff --git a/src/test/ref/forrangemin.sym b/src/test/ref/forrangemin.sym index 1b9836051..0421e27d2 100644 --- a/src/test/ref/forrangemin.sym +++ b/src/test/ref/forrangemin.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN1 -(const byte*) SCREEN1#0 SCREEN1 = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*) 1280 +(const byte*) SCREEN1 SCREEN1 = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*) 1280 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/fragment-synth.cfg b/src/test/ref/fragment-synth.cfg index 20af9c8fc..5f33183c6 100644 --- a/src/test/ref/fragment-synth.cfg +++ b/src/test/ref/fragment-synth.cfg @@ -17,13 +17,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [8] (byte) main::a1#0 ← (byte) fct::return#0 - [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 + [9] *((const byte*) main::screen) ← (byte) main::a1#0 [10] call fct [11] (byte) fct::return#1 ← (byte) fct::return#2 to:main::@2 main::@2: scope:[main] from main::@1 [12] (byte) main::a2#0 ← (byte) fct::return#1 - [13] *((const byte*) main::screen#0+(byte) 1) ← (byte) main::a2#0 + [13] *((const byte*) main::screen+(byte) 1) ← (byte) main::a2#0 to:main::@return main::@return: scope:[main] from main::@2 [14] return diff --git a/src/test/ref/fragment-synth.log b/src/test/ref/fragment-synth.log index 3c4b54a19..fdd0922b2 100644 --- a/src/test/ref/fragment-synth.log +++ b/src/test/ref/fragment-synth.log @@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte*) main::z#0 ← ((byte*)) (number) $450 *((byte*) main::z#0 + (number) 2) ← (number) $f0 *((byte*) main::z#0 + (number) 3) ← (number) $f @@ -23,7 +23,7 @@ main::@1: scope:[main] from main (byte) fct::return#4 ← phi( main/(byte) fct::return#0 ) (byte~) main::$0 ← (byte) fct::return#4 (byte) main::a1#0 ← (byte~) main::$0 - *((byte*) main::screen#0 + (number) 0) ← (byte) main::a1#0 + *((byte*) main::screen + (number) 0) ← (byte) main::a1#0 (byte*) main::z#1 ← ++ (byte*) main::z#2 (byte) main::x#1 ← (number) $55 (byte) fct::x#1 ← (byte) main::x#1 @@ -35,7 +35,7 @@ main::@2: scope:[main] from main::@1 (byte) fct::return#5 ← phi( main::@1/(byte) fct::return#1 ) (byte~) main::$1 ← (byte) fct::return#5 (byte) main::a2#0 ← (byte~) main::$1 - *((byte*) main::screen#0 + (number) 1) ← (byte) main::a2#0 + *((byte*) main::screen + (number) 1) ← (byte) main::a2#0 to:main::@return main::@return: scope:[main] from main::@2 return @@ -98,7 +98,6 @@ SYMBOL TABLE SSA (byte) main::a2 (byte) main::a2#0 (byte*) main::screen -(byte*) main::screen#0 (byte) main::x (byte) main::x#0 (byte) main::x#1 @@ -112,12 +111,12 @@ Adding number conversion cast (unumber) 2 in *((byte*) main::z#0 + (number) 2) Adding number conversion cast (unumber) $f in *((byte*) main::z#0 + (number) 3) ← (number) $f Adding number conversion cast (unumber) 3 in *((byte*) main::z#0 + (number) 3) ← ((unumber)) (number) $f Adding number conversion cast (unumber) $aa in (byte) main::x#0 ← (number) $aa -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) main::a1#0 +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← (byte) main::a1#0 Adding number conversion cast (unumber) $55 in (byte) main::x#1 ← (number) $55 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte) main::a2#0 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← (byte) main::a2#0 Adding number conversion cast (unumber) 2 in (byte~) fct::$0 ← (byte) fct::x#2 & *((byte*) fct::z#2 + (number) 2) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte*) main::z#0 ← (byte*)(number) $450 Inlining cast *((byte*) main::z#0 + (unumber)(number) 2) ← (unumber)(number) $f0 Inlining cast *((byte*) main::z#0 + (unumber)(number) 3) ← (unumber)(number) $f @@ -153,7 +152,7 @@ Alias (byte) fct::return#1 = (byte) fct::return#5 Alias (byte) main::a2#0 = (byte~) main::$1 Alias (byte) fct::return#2 = (byte) fct::a#0 (byte~) fct::$0 (byte) fct::return#6 (byte) fct::return#3 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte*) main::z#0 = (byte*) 1104 Constant (const byte) main::x#0 = $aa Constant (const byte) main::x#1 = $55 @@ -162,7 +161,7 @@ Constant (const byte) fct::x#0 = main::x#0 Constant (const byte*) fct::z#0 = main::z#0 Constant (const byte) fct::x#1 = main::x#1 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::screen#0 in [12] *((const byte*) main::screen#0 + (byte) 0) ← (byte) main::a1#0 +Simplifying expression containing zero main::screen in [12] *((const byte*) main::screen + (byte) 0) ← (byte) main::a1#0 Successful SSA optimization PassNSimplifyExpressionWithZero Constant right-side identified [6] (byte*) main::z#1 ← ++ (const byte*) main::z#0 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -189,7 +188,7 @@ Constant inlined fct::x#1 = (byte) $55 Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *((byte*) 1104+2) Consolidated array index constant in *((byte*) 1104+3) -Consolidated array index constant in *(main::screen#0+1) +Consolidated array index constant in *(main::screen+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -227,13 +226,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [8] (byte) main::a1#0 ← (byte) fct::return#0 - [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 + [9] *((const byte*) main::screen) ← (byte) main::a1#0 [10] call fct [11] (byte) fct::return#1 ← (byte) fct::return#2 to:main::@2 main::@2: scope:[main] from main::@1 [12] (byte) main::a2#0 ← (byte) fct::return#1 - [13] *((const byte*) main::screen#0+(byte) 1) ← (byte) main::a2#0 + [13] *((const byte*) main::screen+(byte) 1) ← (byte) main::a2#0 to:main::@return main::@return: scope:[main] from main::@2 [14] return @@ -266,7 +265,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::a1#0 4.0 (byte) main::a2 (byte) main::a2#0 4.0 -(byte*) main::screen (byte) main::x (byte*) main::z @@ -348,7 +346,7 @@ main: { // [8] (byte) main::a1#0 ← (byte) fct::return#0 -- vbuz1=vbuz2 lda.z fct.return sta.z a1 - // [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 -- _deref_pbuc1=vbuz1 + // [9] *((const byte*) main::screen) ← (byte) main::a1#0 -- _deref_pbuc1=vbuz1 lda.z a1 sta screen // [10] call fct @@ -371,7 +369,7 @@ main: { // [12] (byte) main::a2#0 ← (byte) fct::return#1 -- vbuz1=vbuz2 lda.z fct.return_1 sta.z a2 - // [13] *((const byte*) main::screen#0+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::screen+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuz1 lda.z a2 sta screen+1 jmp breturn @@ -469,7 +467,7 @@ main: { // main::@1 b1: // [8] (byte) main::a1#0 ← (byte) fct::return#0 - // [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 -- _deref_pbuc1=vbuaa + // [9] *((const byte*) main::screen) ← (byte) main::a1#0 -- _deref_pbuc1=vbuaa sta screen // [10] call fct // [15] phi from main::@1 to fct [phi:main::@1->fct] @@ -487,7 +485,7 @@ main: { // main::@2 b2: // [12] (byte) main::a2#0 ← (byte) fct::return#1 - // [13] *((const byte*) main::screen#0+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuaa + // [13] *((const byte*) main::screen+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuaa sta screen+1 jmp breturn // main::@return @@ -560,8 +558,7 @@ FINAL SYMBOL TABLE (byte) main::a1#0 reg byte a 4.0 (byte) main::a2 (byte) main::a2#0 reg byte a 4.0 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (byte) main::x (byte*) main::z @@ -619,7 +616,7 @@ main: { // a1 = fct(x, z) // [8] (byte) main::a1#0 ← (byte) fct::return#0 // screen[0] = a1 - // [9] *((const byte*) main::screen#0) ← (byte) main::a1#0 -- _deref_pbuc1=vbuaa + // [9] *((const byte*) main::screen) ← (byte) main::a1#0 -- _deref_pbuc1=vbuaa sta screen // fct(x, z) // [10] call fct @@ -638,7 +635,7 @@ main: { // a2 = fct(x, z) // [12] (byte) main::a2#0 ← (byte) fct::return#1 // screen[1] = a2 - // [13] *((const byte*) main::screen#0+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuaa + // [13] *((const byte*) main::screen+(byte) 1) ← (byte) main::a2#0 -- _deref_pbuc1=vbuaa sta screen+1 // main::@return // } diff --git a/src/test/ref/fragment-synth.sym b/src/test/ref/fragment-synth.sym index 98744eecc..ccfba5730 100644 --- a/src/test/ref/fragment-synth.sym +++ b/src/test/ref/fragment-synth.sym @@ -20,8 +20,7 @@ (byte) main::a1#0 reg byte a 4.0 (byte) main::a2 (byte) main::a2#0 reg byte a 4.0 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (byte) main::x (byte*) main::z diff --git a/src/test/ref/fragment-variations.cfg b/src/test/ref/fragment-variations.cfg index ec379ba46..747c707cc 100644 --- a/src/test/ref/fragment-variations.cfg +++ b/src/test/ref/fragment-variations.cfg @@ -16,13 +16,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [7] (dword~) main::$0 ← (dword) mul16u::return#0 - [8] *((const dword*) main::screen#0) ← (dword~) main::$0 + [8] *((const dword*) main::screen) ← (dword~) main::$0 [9] call mul16u [10] (dword) mul16u::return#1 ← (dword) mul16u::return#2 to:main::@2 main::@2: scope:[main] from main::@1 [11] (dword~) main::$1 ← (dword) mul16u::return#1 - [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 + [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 [13] return diff --git a/src/test/ref/fragment-variations.log b/src/test/ref/fragment-variations.log index 253a9ebbf..49b566517 100644 --- a/src/test/ref/fragment-variations.log +++ b/src/test/ref/fragment-variations.log @@ -10,7 +10,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 - (dword*) main::screen#0 ← ((dword*)) (number) $400 + (dword*) main::screen ← ((dword*)) (number) $400 (word) main::w#0 ← (number) $a (word) mul16u::b#0 ← (word) main::w#0 (word) mul16u::a#0 ← (word) main::w#0 @@ -21,7 +21,7 @@ main::@1: scope:[main] from main (dword) mul16u::return#4 ← phi( main/(dword) mul16u::return#0 ) (dword~) main::$0 ← (dword) mul16u::return#4 (number~) main::$2 ← (number) 0 * (const byte) SIZEOF_DWORD - *((dword*) main::screen#0 + (number~) main::$2) ← (dword~) main::$0 + *((dword*) main::screen + (number~) main::$2) ← (dword~) main::$0 (word) main::w#1 ← (number) $3e8 (word) mul16u::b#1 ← (word) main::w#1 (word) mul16u::a#1 ← (word) main::w#1 @@ -32,7 +32,7 @@ main::@2: scope:[main] from main::@1 (dword) mul16u::return#5 ← phi( main::@1/(dword) mul16u::return#1 ) (dword~) main::$1 ← (dword) mul16u::return#5 (number~) main::$3 ← (number) 1 * (const byte) SIZEOF_DWORD - *((dword*) main::screen#0 + (number~) main::$3) ← (dword~) main::$1 + *((dword*) main::screen + (number~) main::$3) ← (dword~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 return @@ -73,7 +73,6 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (dword*) main::screen -(dword*) main::screen#0 (word) main::w (word) main::w#0 (word) main::w#1 @@ -106,7 +105,7 @@ Adding number conversion cast (unumber) $3e8 in (word) main::w#1 ← (number) $3 Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (number) 1 * (const byte) SIZEOF_DWORD Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber)(number) 1 * (const byte) SIZEOF_DWORD Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (dword*) main::screen#0 ← (dword*)(number) $400 +Inlining cast (dword*) main::screen ← (dword*)(number) $400 Inlining cast (word) main::w#0 ← (unumber)(number) $a Inlining cast (word) main::w#1 ← (unumber)(number) $3e8 Successful SSA optimization Pass2InlineCast @@ -131,7 +130,7 @@ Successful SSA optimization Pass2AliasElimination Constant right-side identified [8] (byte~) main::$2 ← (byte) 0 * (const byte) SIZEOF_DWORD Constant right-side identified [17] (byte~) main::$3 ← (byte) 1 * (const byte) SIZEOF_DWORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const dword*) main::screen#0 = (dword*) 1024 +Constant (const dword*) main::screen = (dword*) 1024 Constant (const word) main::w#0 = $a Constant (const byte) main::$2 = 0*SIZEOF_DWORD Constant (const word) main::w#1 = $3e8 @@ -144,7 +143,7 @@ Constant (const word) mul16u::a#1 = main::w#1 Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_DWORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero main::screen#0 in [9] *((const dword*) main::screen#0 + (const byte) main::$2) ← (dword~) main::$0 +Simplifying expression containing zero main::screen in [9] *((const dword*) main::screen + (const byte) main::$2) ← (dword~) main::$0 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$2 Successful SSA optimization PassNEliminateUnusedVars @@ -160,7 +159,7 @@ Constant inlined mul16u::b#0 = (byte) $a Constant inlined mul16u::a#1 = (word) $3e8 Constant inlined mul16u::a#0 = (byte) $a Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::screen#0+1*SIZEOF_DWORD) +Consolidated array index constant in *(main::screen+1*SIZEOF_DWORD) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -199,13 +198,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main [7] (dword~) main::$0 ← (dword) mul16u::return#0 - [8] *((const dword*) main::screen#0) ← (dword~) main::$0 + [8] *((const dword*) main::screen) ← (dword~) main::$0 [9] call mul16u [10] (dword) mul16u::return#1 ← (dword) mul16u::return#2 to:main::@2 main::@2: scope:[main] from main::@1 [11] (dword~) main::$1 ← (dword) mul16u::return#1 - [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 + [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 [13] return @@ -226,7 +225,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (dword~) main::$0 4.0 (dword~) main::$1 4.0 -(dword*) main::screen (word) main::w (dword()) mul16u((word) mul16u::b , (word) mul16u::a) (word) mul16u::a @@ -332,7 +330,7 @@ main: { sta.z _0+2 lda.z mul16u.return+3 sta.z _0+3 - // [8] *((const dword*) main::screen#0) ← (dword~) main::$0 -- _deref_pduc1=vduz1 + // [8] *((const dword*) main::screen) ← (dword~) main::$0 -- _deref_pduc1=vduz1 lda.z _0 sta screen lda.z _0+1 @@ -380,7 +378,7 @@ main: { sta.z _1+2 lda.z mul16u.return_1+3 sta.z _1+3 - // [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 + // [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 lda.z _1 sta screen+1*SIZEOF_DWORD lda.z _1+1 @@ -428,10 +426,10 @@ mul16u: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (dword) mul16u::return#0 ← (dword) mul16u::return#2 [ mul16u::return#0 ] ( main:2 [ mul16u::return#0 ] ) always clobbers reg byte a Statement [7] (dword~) main::$0 ← (dword) mul16u::return#0 [ main::$0 ] ( main:2 [ main::$0 ] ) always clobbers reg byte a -Statement [8] *((const dword*) main::screen#0) ← (dword~) main::$0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const dword*) main::screen) ← (dword~) main::$0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [10] (dword) mul16u::return#1 ← (dword) mul16u::return#2 [ mul16u::return#1 ] ( main:2 [ mul16u::return#1 ] ) always clobbers reg byte a Statement [11] (dword~) main::$1 ← (dword) mul16u::return#1 [ main::$1 ] ( main:2 [ main::$1 ] ) always clobbers reg byte a -Statement [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [15] (dword) mul16u::return#2 ← (dword) mul16u::mb#0 + (word) mul16u::a#2 [ mul16u::return#2 ] ( main:2::mul16u:5 [ mul16u::return#2 ] main:2::mul16u:9 [ mul16u::return#2 ] ) always clobbers reg byte a Potential registers zp ZP_DWORD:2 [ mul16u::mb#0 ] : zp ZP_DWORD:2 , Potential registers zp ZP_WORD:6 [ mul16u::a#2 ] : zp ZP_WORD:6 , @@ -507,7 +505,7 @@ main: { // main::@1 b1: // [7] (dword~) main::$0 ← (dword) mul16u::return#0 - // [8] *((const dword*) main::screen#0) ← (dword~) main::$0 -- _deref_pduc1=vduz1 + // [8] *((const dword*) main::screen) ← (dword~) main::$0 -- _deref_pduc1=vduz1 lda.z _0 sta screen lda.z _0+1 @@ -539,7 +537,7 @@ main: { // main::@2 b2: // [11] (dword~) main::$1 ← (dword) mul16u::return#1 - // [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 + // [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 lda.z _1 sta screen+1*SIZEOF_DWORD lda.z _1+1 @@ -620,8 +618,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(dword*) main::screen -(const dword*) main::screen#0 screen = (dword*) 1024 +(const dword*) main::screen screen = (dword*) 1024 (word) main::w (dword()) mul16u((word) mul16u::b , (word) mul16u::a) (label) mul16u::@return @@ -684,7 +681,7 @@ main: { // main::@1 // [7] (dword~) main::$0 ← (dword) mul16u::return#0 // screen[0] = mul16u(w, w) - // [8] *((const dword*) main::screen#0) ← (dword~) main::$0 -- _deref_pduc1=vduz1 + // [8] *((const dword*) main::screen) ← (dword~) main::$0 -- _deref_pduc1=vduz1 lda.z _0 sta screen lda.z _0+1 @@ -716,7 +713,7 @@ main: { // main::@2 // [11] (dword~) main::$1 ← (dword) mul16u::return#1 // screen[1] = mul16u(w, w) - // [12] *((const dword*) main::screen#0+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 + // [12] *((const dword*) main::screen+(byte) 1*(const byte) SIZEOF_DWORD) ← (dword~) main::$1 -- _deref_pduc1=vduz1 lda.z _1 sta screen+1*SIZEOF_DWORD lda.z _1+1 diff --git a/src/test/ref/fragment-variations.sym b/src/test/ref/fragment-variations.sym index e3b066049..21e25a1c5 100644 --- a/src/test/ref/fragment-variations.sym +++ b/src/test/ref/fragment-variations.sym @@ -8,8 +8,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(dword*) main::screen -(const dword*) main::screen#0 screen = (dword*) 1024 +(const dword*) main::screen screen = (dword*) 1024 (word) main::w (dword()) mul16u((word) mul16u::b , (word) mul16u::a) (label) mul16u::@return diff --git a/src/test/ref/halfscii.cfg b/src/test/ref/halfscii.cfg index 7b45e0c9b..d0b2ebe5e 100644 --- a/src/test/ref/halfscii.cfg +++ b/src/test/ref/halfscii.cfg @@ -11,11 +11,11 @@ (void()) main() main: scope:[main] from @1 asm { sei } - [5] *((const byte*) PROCPORT#0) ← (byte) $32 + [5] *((const byte*) PROCPORT) ← (byte) $32 to:main::@1 main::@1: scope:[main] from main main::@5 - [6] (byte*) main::charset4#10 ← phi( main/(const byte*) CHARSET4#0 main::@5/(byte*) main::charset4#1 ) - [6] (byte*) main::chargen#10 ← phi( main/(const byte*) CHARGEN#0 main::@5/(byte*) main::chargen#1 ) + [6] (byte*) main::charset4#10 ← phi( main/(const byte*) CHARSET4 main::@5/(byte*) main::charset4#1 ) + [6] (byte*) main::chargen#10 ← phi( main/(const byte*) CHARGEN main::@5/(byte*) main::chargen#1 ) [7] (byte*) main::chargen1#0 ← (byte*) main::chargen#10 + (byte) 1 [8] (byte~) main::$1 ← *((byte*) main::chargen#10) & (byte) $60 [9] (byte~) main::$2 ← *((byte*) main::chargen1#0) & (byte) $60 @@ -76,20 +76,20 @@ main::@5: scope:[main] from main::@4 main::@9 [48] *((byte*) main::charset4#10) ← (byte) main::bits_gen#7 [49] (byte*) main::charset4#1 ← ++ (byte*) main::charset4#10 [50] (byte*) main::chargen#1 ← (byte*) main::chargen#10 + (byte) 2 - [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 + [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 to:main::@10 main::@10: scope:[main] from main::@5 - [52] *((const byte*) PROCPORT#0) ← (byte) $37 + [52] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:main::@11 main::@11: scope:[main] from main::@10 main::@11 [54] (byte) main::i#2 ← phi( main::@10/(byte) 0 main::@11/(byte) main::i#1 ) - [55] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [55] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [56] (byte) main::i#1 ← ++ (byte) main::i#2 [57] if((byte) main::i#1!=(byte) 0) goto main::@11 to:main::@12 main::@12: scope:[main] from main::@11 - [58] *((const byte*) D018#0) ← (byte) $19 + [58] *((const byte*) D018) ← (byte) $19 to:main::@return main::@return: scope:[main] from main::@12 [59] return diff --git a/src/test/ref/halfscii.log b/src/test/ref/halfscii.log index 74262f7ab..385fdaa92 100644 --- a/src/test/ref/halfscii.log +++ b/src/test/ref/halfscii.log @@ -7,20 +7,20 @@ Identified constant variable (byte*) CHARSET4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) CHARGEN#0 ← ((byte*)) (number) $d000 - (byte*) PROCPORT#0 ← ((byte*)) (number) 1 - (byte*) D018#0 ← ((byte*)) (number) $d018 - (byte*) CHARSET4#0 ← ((byte*)) (number) $2800 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) CHARGEN ← ((byte*)) (number) $d000 + (byte*) PROCPORT ← ((byte*)) (number) 1 + (byte*) D018 ← ((byte*)) (number) $d018 + (byte*) CHARSET4 ← ((byte*)) (number) $2800 (byte[]) bits_count ← { (number) 0, (number) 1, (number) 1, (number) 2, (number) 1, (number) 2, (number) 2, (number) 3, (number) 1, (number) 2, (number) 2, (number) 3, (number) 2, (number) 3, (number) 3, (number) 4 } to:@1 (void()) main() main: scope:[main] from @1 asm { sei } - *((byte*) PROCPORT#0) ← (number) $32 - (byte*) main::chargen#0 ← (byte*) CHARGEN#0 - (byte*) main::charset4#0 ← (byte*) CHARSET4#0 + *((byte*) PROCPORT) ← (number) $32 + (byte*) main::chargen#0 ← (byte*) CHARGEN + (byte*) main::charset4#0 ← (byte*) CHARSET4 to:main::@1 main::@1: scope:[main] from main main::@5 (byte*) main::charset4#9 ← phi( main/(byte*) main::charset4#0 main::@5/(byte*) main::charset4#1 ) @@ -123,7 +123,7 @@ main::@5: scope:[main] from main::@4 main::@9 (byte*) main::charset4#1 ← ++ (byte*) main::charset4#2 (byte*~) main::$37 ← (byte*) main::chargen#6 + (number) 2 (byte*) main::chargen#1 ← (byte*~) main::$37 - (byte*~) main::$38 ← (byte*) CHARGEN#0 + (number) $800 + (byte*~) main::$38 ← (byte*) CHARGEN + (number) $800 (bool~) main::$39 ← (byte*) main::chargen#1 < (byte*~) main::$38 if((bool~) main::$39) goto main::@1 to:main::@10 @@ -135,19 +135,19 @@ main::@9: scope:[main] from main::@4 (byte) main::bits_gen#8 ← (number~) main::$35 to:main::@5 main::@10: scope:[main] from main::@5 - *((byte*) PROCPORT#0) ← (number) $37 + *((byte*) PROCPORT) ← (number) $37 asm { cli } (byte) main::i#0 ← (byte) 0 to:main::@11 main::@11: scope:[main] from main::@10 main::@11 (byte) main::i#2 ← phi( main::@10/(byte) main::i#0 main::@11/(byte) main::i#1 ) - *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$40 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$40) goto main::@11 to:main::@12 main::@12: scope:[main] from main::@11 - *((byte*) D018#0) ← (number) $19 + *((byte*) D018) ← (number) $19 to:main::@return main::@return: scope:[main] from main::@12 return @@ -165,15 +165,10 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) CHARGEN -(byte*) CHARGEN#0 (byte*) CHARSET4 -(byte*) CHARSET4#0 (byte*) D018 -(byte*) D018#0 (byte*) PROCPORT -(byte*) PROCPORT#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte[]) bits_count (void()) main() (byte*~) main::$0 @@ -290,7 +285,7 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 -Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT#0) ← (number) $32 +Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT) ← (number) $32 Adding number conversion cast (unumber) 0 in (byte) main::bits_gen#0 ← (number) 0 Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) main::chargen#2 + (number) 1 Adding number conversion cast (unumber) $60 in (number~) main::$1 ← *((byte*) main::chargen#2) & (number) $60 @@ -348,23 +343,23 @@ Adding number conversion cast (unumber) main::$27 in (number~) main::$27 ← (by Adding number conversion cast (unumber) 2 in (number~) main::$36 ← (byte) main::bits_gen#15 * (number) 2 Adding number conversion cast (unumber) main::$36 in (number~) main::$36 ← (byte) main::bits_gen#15 * (unumber)(number) 2 Adding number conversion cast (unumber) 2 in (byte*~) main::$37 ← (byte*) main::chargen#6 + (number) 2 -Adding number conversion cast (unumber) $800 in (byte*~) main::$38 ← (byte*) CHARGEN#0 + (number) $800 +Adding number conversion cast (unumber) $800 in (byte*~) main::$38 ← (byte*) CHARGEN + (number) $800 Adding number conversion cast (unumber) 1 in (number~) main::$35 ← (byte) main::bits_gen#16 + (number) 1 Adding number conversion cast (unumber) main::$35 in (number~) main::$35 ← (byte) main::bits_gen#16 + (unumber)(number) 1 -Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT#0) ← (number) $37 -Adding number conversion cast (unumber) $19 in *((byte*) D018#0) ← (number) $19 +Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT) ← (number) $37 +Adding number conversion cast (unumber) $19 in *((byte*) D018) ← (number) $19 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) bits_count ← (byte[]){ (byte)(number) 0, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 1, (byte)(number) 2, (byte)(number) 2, (byte)(number) 3, (byte)(number) 1, (byte)(number) 2, (byte)(number) 2, (byte)(number) 3, (byte)(number) 2, (byte)(number) 3, (byte)(number) 3, (byte)(number) 4 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) CHARGEN#0 ← (byte*)(number) $d000 -Inlining cast (byte*) PROCPORT#0 ← (byte*)(number) 1 -Inlining cast (byte*) D018#0 ← (byte*)(number) $d018 -Inlining cast (byte*) CHARSET4#0 ← (byte*)(number) $2800 -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $32 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) CHARGEN ← (byte*)(number) $d000 +Inlining cast (byte*) PROCPORT ← (byte*)(number) 1 +Inlining cast (byte*) D018 ← (byte*)(number) $d018 +Inlining cast (byte*) CHARSET4 ← (byte*)(number) $2800 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $32 Inlining cast (byte) main::bits_gen#0 ← (unumber)(number) 0 -Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $37 -Inlining cast *((byte*) D018#0) ← (unumber)(number) $19 +Inlining cast *((byte*) PROCPORT) ← (unumber)(number) $37 +Inlining cast *((byte*) D018) ← (unumber)(number) $19 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant pointer cast (byte*) 53248 @@ -527,17 +522,17 @@ Simple Condition (bool~) main::$40 [88] if((byte) main::i#1!=rangelast(0,$ff)) g Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (byte[]) { (byte) 0, (byte) 1, (byte) 1, (byte) 2, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 2, (byte) 3, (byte) 3, (byte) 4 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) CHARGEN#0 = (byte*) 53248 -Constant (const byte*) PROCPORT#0 = (byte*) 1 -Constant (const byte*) D018#0 = (byte*) 53272 -Constant (const byte*) CHARSET4#0 = (byte*) 10240 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) CHARGEN = (byte*) 53248 +Constant (const byte*) PROCPORT = (byte*) 1 +Constant (const byte*) D018 = (byte*) 53272 +Constant (const byte*) CHARSET4 = (byte*) 10240 Constant (const byte[]) bits_count = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 } Constant (const byte) main::bits_gen#0 = 0 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::chargen#0 = CHARGEN#0 -Constant (const byte*) main::charset4#0 = CHARSET4#0 +Constant (const byte*) main::chargen#0 = CHARGEN +Constant (const byte*) main::charset4#0 = CHARSET4 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [86] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [88] if(main::i#1!=rangelast(0,$ff)) goto main::@11 to (number) 0 @@ -549,10 +544,10 @@ Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [46] (byte*~) main::$38 ← (const byte*) CHARGEN#0 + (word) $800 +Constant right-side identified [46] (byte*~) main::$38 ← (const byte*) CHARGEN + (word) $800 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) main::bits_gen#2 = 1 -Constant (const byte*) main::$38 = CHARGEN#0+$800 +Constant (const byte*) main::$38 = CHARGEN+$800 Successful SSA optimization Pass2ConstantIdentification Rewriting division to use shift [6] (byte~) main::$3 ← (byte~) main::$2 / (byte) 4 Rewriting division to use shift [8] (byte~) main::$5 ← (byte~) main::$4 / (byte) 2 @@ -574,10 +569,10 @@ Inlining constant with var siblings (const byte*) main::charset4#0 Inlining constant with var siblings (const byte) main::bits_gen#2 Constant inlined main::i#0 = (byte) 0 Constant inlined main::bits_gen#2 = (byte) 1 -Constant inlined main::chargen#0 = (const byte*) CHARGEN#0 +Constant inlined main::chargen#0 = (const byte*) CHARGEN Constant inlined main::bits_gen#0 = (byte) 0 -Constant inlined main::$38 = (const byte*) CHARGEN#0+(word) $800 -Constant inlined main::charset4#0 = (const byte*) CHARSET4#0 +Constant inlined main::$38 = (const byte*) CHARGEN+(word) $800 +Constant inlined main::charset4#0 = (const byte*) CHARSET4 Successful SSA optimization Pass2ConstantInlining 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) @@ -628,11 +623,11 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 asm { sei } - [5] *((const byte*) PROCPORT#0) ← (byte) $32 + [5] *((const byte*) PROCPORT) ← (byte) $32 to:main::@1 main::@1: scope:[main] from main main::@5 - [6] (byte*) main::charset4#10 ← phi( main/(const byte*) CHARSET4#0 main::@5/(byte*) main::charset4#1 ) - [6] (byte*) main::chargen#10 ← phi( main/(const byte*) CHARGEN#0 main::@5/(byte*) main::chargen#1 ) + [6] (byte*) main::charset4#10 ← phi( main/(const byte*) CHARSET4 main::@5/(byte*) main::charset4#1 ) + [6] (byte*) main::chargen#10 ← phi( main/(const byte*) CHARGEN main::@5/(byte*) main::chargen#1 ) [7] (byte*) main::chargen1#0 ← (byte*) main::chargen#10 + (byte) 1 [8] (byte~) main::$1 ← *((byte*) main::chargen#10) & (byte) $60 [9] (byte~) main::$2 ← *((byte*) main::chargen1#0) & (byte) $60 @@ -693,20 +688,20 @@ main::@5: scope:[main] from main::@4 main::@9 [48] *((byte*) main::charset4#10) ← (byte) main::bits_gen#7 [49] (byte*) main::charset4#1 ← ++ (byte*) main::charset4#10 [50] (byte*) main::chargen#1 ← (byte*) main::chargen#10 + (byte) 2 - [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 + [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 to:main::@10 main::@10: scope:[main] from main::@5 - [52] *((const byte*) PROCPORT#0) ← (byte) $37 + [52] *((const byte*) PROCPORT) ← (byte) $37 asm { cli } to:main::@11 main::@11: scope:[main] from main::@10 main::@11 [54] (byte) main::i#2 ← phi( main::@10/(byte) 0 main::@11/(byte) main::i#1 ) - [55] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [55] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [56] (byte) main::i#1 ← ++ (byte) main::i#2 [57] if((byte) main::i#1!=(byte) 0) goto main::@11 to:main::@12 main::@12: scope:[main] from main::@11 - [58] *((const byte*) D018#0) ← (byte) $19 + [58] *((const byte*) D018) ← (byte) $19 to:main::@return main::@return: scope:[main] from main::@12 [59] return @@ -714,11 +709,6 @@ main::@return: scope:[main] from main::@12 VARIABLE REGISTER WEIGHTS -(byte*) CHARGEN -(byte*) CHARSET4 -(byte*) D018 -(byte*) PROCPORT -(byte*) SCREEN (void()) main() (byte~) main::$1 7.333333333333333 (byte~) main::$11 7.333333333333333 @@ -939,17 +929,17 @@ main: { .label bits_gen_16 = 9 // asm { sei } sei - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET4 sta.z charset4+1 - // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #CHARGEN @@ -1182,7 +1172,7 @@ main: { bcc !+ inc.z chargen+1 !: - // [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 + // [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 lda.z chargen+1 cmp #>CHARGEN+$800 bcc b1_from_b5 @@ -1194,7 +1184,7 @@ main: { jmp b10 // main::@10 b10: - // [52] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [52] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -1211,7 +1201,7 @@ main: { jmp b11 // main::@11 b11: - // [55] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [55] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -1224,7 +1214,7 @@ main: { jmp b12 // main::@12 b12: - // [58] *((const byte*) D018#0) ← (byte) $19 -- _deref_pbuc1=vbuc2 + // [58] *((const byte*) D018) ← (byte) $19 -- _deref_pbuc1=vbuc2 lda #$19 sta D018 jmp breturn @@ -1237,7 +1227,7 @@ main: { bits_count: .byte 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) PROCPORT) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] (byte*) main::chargen1#0 ← (byte*) main::chargen#10 + (byte) 1 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ) always clobbers reg byte a Statement [8] (byte~) main::$1 ← *((byte*) main::chargen#10) & (byte) $60 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 ] ) always clobbers reg byte a reg byte y Statement [9] (byte~) main::$2 ← *((byte*) main::chargen1#0) & (byte) $60 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 main::$2 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 main::$2 ] ) always clobbers reg byte a reg byte y @@ -1275,10 +1265,10 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:33 [ m Statement [47] (byte) main::bits_gen#7 ← (byte) main::bits_gen#15 << (byte) 1 [ main::chargen#10 main::charset4#10 main::bits_gen#7 ] ( main:2 [ main::chargen#10 main::charset4#10 main::bits_gen#7 ] ) always clobbers reg byte a Statement [48] *((byte*) main::charset4#10) ← (byte) main::bits_gen#7 [ main::chargen#10 main::charset4#10 ] ( main:2 [ main::chargen#10 main::charset4#10 ] ) always clobbers reg byte y Statement [50] (byte*) main::chargen#1 ← (byte*) main::chargen#10 + (byte) 2 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a -Statement [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a -Statement [52] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [58] *((const byte*) D018#0) ← (byte) $19 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a +Statement [52] *((const byte*) PROCPORT) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [58] *((const byte*) D018) ← (byte) $19 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) PROCPORT) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] (byte*) main::chargen1#0 ← (byte*) main::chargen#10 + (byte) 1 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 ] ) always clobbers reg byte a Statement [8] (byte~) main::$1 ← *((byte*) main::chargen#10) & (byte) $60 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 ] ) always clobbers reg byte a reg byte y Statement [9] (byte~) main::$2 ← *((byte*) main::chargen1#0) & (byte) $60 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 main::$2 ] ( main:2 [ main::chargen#10 main::charset4#10 main::chargen1#0 main::$1 main::$2 ] ) always clobbers reg byte a reg byte y @@ -1302,9 +1292,9 @@ Statement [41] (byte~) main::$31 ← *((byte*) main::chargen1#0) & (byte) 1 [ ma Statement [47] (byte) main::bits_gen#7 ← (byte) main::bits_gen#15 << (byte) 1 [ main::chargen#10 main::charset4#10 main::bits_gen#7 ] ( main:2 [ main::chargen#10 main::charset4#10 main::bits_gen#7 ] ) always clobbers reg byte a Statement [48] *((byte*) main::charset4#10) ← (byte) main::bits_gen#7 [ main::chargen#10 main::charset4#10 ] ( main:2 [ main::chargen#10 main::charset4#10 ] ) always clobbers reg byte y Statement [50] (byte*) main::chargen#1 ← (byte*) main::chargen#10 + (byte) 2 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a -Statement [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a -Statement [52] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [58] *((const byte*) D018#0) ← (byte) $19 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 [ main::chargen#1 main::charset4#1 ] ( main:2 [ main::chargen#1 main::charset4#1 ] ) always clobbers reg byte a +Statement [52] *((const byte*) PROCPORT) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [58] *((const byte*) D018) ← (byte) $19 [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::chargen#10 main::chargen#1 ] : zp ZP_WORD:2 , Potential registers zp ZP_WORD:4 [ main::charset4#10 main::charset4#1 ] : zp ZP_WORD:4 , Potential registers zp ZP_BYTE:6 [ main::bits_gen#9 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , @@ -1447,17 +1437,17 @@ main: { .label chargen = 2 // asm { sei } sei - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET4 sta.z charset4+1 - // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #CHARGEN @@ -1649,7 +1639,7 @@ main: { bcc !+ inc.z chargen+1 !: - // [51] if((byte*) main::chargen#1<(const byte*) CHARGEN#0+(word) $800) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 + // [51] if((byte*) main::chargen#1<(const byte*) CHARGEN+(word) $800) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 lda.z chargen+1 cmp #>CHARGEN+$800 bcc b1_from_b5 @@ -1661,7 +1651,7 @@ main: { jmp b10 // main::@10 b10: - // [52] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [52] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm { cli } @@ -1677,7 +1667,7 @@ main: { jmp b11 // main::@11 b11: - // [55] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [55] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [56] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -1688,7 +1678,7 @@ main: { jmp b12 // main::@12 b12: - // [58] *((const byte*) D018#0) ← (byte) $19 -- _deref_pbuc1=vbuc2 + // [58] *((const byte*) D018) ← (byte) $19 -- _deref_pbuc1=vbuc2 lda #$19 sta D018 jmp breturn @@ -1770,16 +1760,11 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) CHARSET4 -(const byte*) CHARSET4#0 CHARSET4 = (byte*) 10240 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) CHARSET4 CHARSET4 = (byte*) 10240 +(const byte*) D018 D018 = (byte*) 53272 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) bits_count bits_count = { (byte) 0, (byte) 1, (byte) 1, (byte) 2, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 2, (byte) 3, (byte) 3, (byte) 4 } (void()) main() (byte~) main::$1 $1 zp ZP_BYTE:8 7.333333333333333 @@ -1912,16 +1897,16 @@ main: { // asm { sei } sei // *PROCPORT = $32 - // [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2 lda #$32 sta PROCPORT // [6] phi from main to main::@1 [phi:main->main::@1] - // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::charset4#10 = (const byte*) CHARSET4 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET4 sta.z charset4+1 - // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [6] phi (byte*) main::chargen#10 = (const byte*) CHARGEN [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #CHARGEN @@ -2126,7 +2111,7 @@ main: { inc.z chargen+1 !: // while (chargenCHARGEN+$800 bcs !b1+ @@ -2141,7 +2126,7 @@ main: { !: // main::@10 // *PROCPORT = $37 - // [52] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2 + // [52] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2 lda #$37 sta PROCPORT // asm @@ -2155,7 +2140,7 @@ main: { // main::@11 b11: // SCREEN[i] = i - // [55] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [55] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte i : 0..255) @@ -2166,7 +2151,7 @@ main: { bne b11 // main::@12 // *D018 = $19 - // [58] *((const byte*) D018#0) ← (byte) $19 -- _deref_pbuc1=vbuc2 + // [58] *((const byte*) D018) ← (byte) $19 -- _deref_pbuc1=vbuc2 lda #$19 sta D018 // main::@return diff --git a/src/test/ref/halfscii.sym b/src/test/ref/halfscii.sym index 4ec28b6c9..761a2c8d2 100644 --- a/src/test/ref/halfscii.sym +++ b/src/test/ref/halfscii.sym @@ -1,16 +1,11 @@ (label) @1 (label) @begin (label) @end -(byte*) CHARGEN -(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248 -(byte*) CHARSET4 -(const byte*) CHARSET4#0 CHARSET4 = (byte*) 10240 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte*) PROCPORT -(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) CHARGEN CHARGEN = (byte*) 53248 +(const byte*) CHARSET4 CHARSET4 = (byte*) 10240 +(const byte*) D018 D018 = (byte*) 53272 +(const byte*) PROCPORT PROCPORT = (byte*) 1 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) bits_count bits_count = { (byte) 0, (byte) 1, (byte) 1, (byte) 2, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 1, (byte) 2, (byte) 2, (byte) 3, (byte) 2, (byte) 3, (byte) 3, (byte) 4 } (void()) main() (byte~) main::$1 $1 zp ZP_BYTE:8 7.333333333333333 diff --git a/src/test/ref/helloworld0.cfg b/src/test/ref/helloworld0.cfg index b5ce30202..3301c95be 100644 --- a/src/test/ref/helloworld0.cfg +++ b/src/test/ref/helloworld0.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) $c) goto main::@1 to:main::@return diff --git a/src/test/ref/helloworld0.log b/src/test/ref/helloworld0.log index 5f3ad0499..242a40da1 100644 --- a/src/test/ref/helloworld0.log +++ b/src/test/ref/helloworld0.log @@ -4,7 +4,7 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte[]) msg ← (const string) $0 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -13,7 +13,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#0 + (byte) main::i#2) ← *((byte[]) msg + (byte) main::i#2) + *((byte*) SCREEN + (byte) main::i#2) ← *((byte[]) msg + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$b) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,$b) if((bool~) main::$0) goto main::@1 @@ -35,7 +35,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -46,14 +45,14 @@ SYMBOL TABLE SSA (byte) main::i#2 (byte[]) msg -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,$b)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte[]) msg = $0 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::i#1 ← ++ main::i#2 to ++ @@ -104,7 +103,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) $c) goto main::@1 to:main::@return @@ -114,7 +113,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -167,7 +165,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda msg,y sta SCREEN,y @@ -188,9 +186,9 @@ main: { .byte 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (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 [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -238,7 +236,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta SCREEN,x // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -285,8 +283,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return @@ -326,7 +323,7 @@ main: { // main::@1 b1: // SCREEN[i] = msg[i] - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta SCREEN,x // for( byte i: 0..11) diff --git a/src/test/ref/helloworld0.sym b/src/test/ref/helloworld0.sym index 6fc33281d..87d7379ce 100644 --- a/src/test/ref/helloworld0.sym +++ b/src/test/ref/helloworld0.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/helloworld2-inline.cfg b/src/test/ref/helloworld2-inline.cfg index 7d9e7f250..03526f761 100644 --- a/src/test/ref/helloworld2-inline.cfg +++ b/src/test/ref/helloworld2-inline.cfg @@ -18,7 +18,7 @@ main::print21: scope:[main] from main main::print21_@1: scope:[main] from main::print21 main::print21_@2 [6] (byte) main::print21_j#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_j#1 ) [6] (byte) main::print21_i#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_i#1 ) - [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 + [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 to:main::print22 main::print22: scope:[main] from main::print21_@1 [8] phi() @@ -26,18 +26,18 @@ main::print22: scope:[main] from main::print21_@1 main::print22_@1: scope:[main] from main::print22 main::print22_@2 [9] (byte) main::print22_j#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_j#1 ) [9] (byte) main::print22_i#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_i#1 ) - [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 + [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 to:main::@return main::@return: scope:[main] from main::print22_@1 [11] return to:@return main::print22_@2: scope:[main] from main::print22_@1 - [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) + [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 to:main::print22_@1 main::print21_@2: scope:[main] from main::print21_@1 - [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) + [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 to:main::print21_@1 diff --git a/src/test/ref/helloworld2-inline.log b/src/test/ref/helloworld2-inline.log index becac6f05..14df26fdf 100644 --- a/src/test/ref/helloworld2-inline.log +++ b/src/test/ref/helloworld2-inline.log @@ -18,14 +18,14 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() main: scope:[main] from @2 - (byte*) main::hello#0 ← (const string) main::$3 - (byte*) main::print21_at#0 ← (byte*) screen#0 - (byte*) main::print21_msg#0 ← (byte*) main::hello#0 + (byte*) main::hello ← (const string) main::$3 + (byte*) main::print21_at#0 ← (byte*) screen + (byte*) main::print21_msg#0 ← (byte*) main::hello to:main::print21 main::print21: scope:[main] from main (byte*) main::print21_at#3 ← phi( main/(byte*) main::print21_at#0 ) @@ -51,9 +51,9 @@ main::print21_@2: scope:[main] from main::print21_@1 (byte) main::print21_i#1 ← ++ (byte) main::print21_i#3 to:main::print21_@1 main::@1: scope:[main] from main::print21_@1 - (byte*~) main::$1 ← (byte*) screen#0 + (number) $50 + (byte*~) main::$1 ← (byte*) screen + (number) $50 (byte*) main::print22_at#0 ← (byte*~) main::$1 - (byte*) main::print22_msg#0 ← (byte*) main::hello#0 + (byte*) main::print22_msg#0 ← (byte*) main::hello to:main::print22 main::print22: scope:[main] from main::@1 (byte*) main::print22_at#3 ← phi( main::@1/(byte*) main::print22_at#0 ) @@ -99,7 +99,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::hello -(byte*) main::hello#0 (label) main::print21 (bool~) main::print21_$0 (label) main::print21_@1 @@ -149,19 +148,18 @@ SYMBOL TABLE SSA (byte*) main::print22_msg#2 (byte*) main::print22_msg#3 (byte*) screen -(byte*) screen#0 Adding number conversion cast (unumber) 0 in (byte) main::print21_j#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::print21_i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::print21_$0 ← (number) 0 != *((byte*) main::print21_msg#1 + (byte) main::print21_i#2) Adding number conversion cast (unumber) 2 in (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (number) 2 -Adding number conversion cast (unumber) $50 in (byte*~) main::$1 ← (byte*) screen#0 + (number) $50 +Adding number conversion cast (unumber) $50 in (byte*~) main::$1 ← (byte*) screen + (number) $50 Adding number conversion cast (unumber) 0 in (byte) main::print22_j#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::print22_i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::print22_$0 ← (number) 0 != *((byte*) main::print22_msg#1 + (byte) main::print22_i#2) Adding number conversion cast (unumber) 2 in (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Inlining cast (byte) main::print21_j#0 ← (unumber)(number) 0 Inlining cast (byte) main::print21_i#0 ← (unumber)(number) 0 Inlining cast (byte) main::print22_j#0 ← (unumber)(number) 0 @@ -188,7 +186,7 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte*) main::hello#0 = (byte*) main::print21_msg#0 (byte*) main::print21_msg#3 (byte*) main::print22_msg#0 (byte*) main::print22_msg#3 +Alias (byte*) main::hello = (byte*) main::print21_msg#0 (byte*) main::print21_msg#3 (byte*) main::print22_msg#0 (byte*) main::print22_msg#3 Alias (byte*) main::print21_at#0 = (byte*) main::print21_at#3 Alias (byte*) main::print21_msg#1 = (byte*) main::print21_msg#2 Alias (byte) main::print21_i#2 = (byte) main::print21_i#3 @@ -200,34 +198,34 @@ Alias (byte) main::print22_i#2 = (byte) main::print22_i#3 Alias (byte*) main::print22_at#1 = (byte*) main::print22_at#2 Alias (byte) main::print22_j#2 = (byte) main::print22_j#3 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) main::print21_msg#1 (byte*) main::hello#0 +Identical Phi Values (byte*) main::print21_msg#1 (byte*) main::hello Identical Phi Values (byte*) main::print21_at#1 (byte*) main::print21_at#0 -Identical Phi Values (byte*) main::print22_msg#1 (byte*) main::hello#0 +Identical Phi Values (byte*) main::print22_msg#1 (byte*) main::hello Identical Phi Values (byte*) main::print22_at#1 (byte*) main::print22_at#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::print21_$0 [9] if((byte) 0!=*((byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 -Simple Condition (bool~) main::print22_$0 [22] if((byte) 0!=*((byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 +Simple Condition (bool~) main::print21_$0 [9] if((byte) 0!=*((byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 +Simple Condition (bool~) main::print22_$0 [22] if((byte) 0!=*((byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) screen#0 = (byte*) 1024 -Constant (const byte*) main::hello#0 = main::$3 +Constant (const byte*) screen = (byte*) 1024 +Constant (const byte*) main::hello = main::$3 Constant (const byte) main::print21_j#0 = 0 Constant (const byte) main::print21_i#0 = 0 Constant (const byte) main::print22_j#0 = 0 Constant (const byte) main::print22_i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::print21_at#0 = screen#0 +Constant (const byte*) main::print21_at#0 = screen Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [5] (byte*) main::print22_at#0 ← (const byte*) screen#0 + (byte) $50 +Constant right-side identified [5] (byte*) main::print22_at#0 ← (const byte*) screen + (byte) $50 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::print22_at#0 = screen#0+$50 +Constant (const byte*) main::print22_at#0 = screen+$50 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::print21_j#0 Inlining constant with var siblings (const byte) main::print21_i#0 Inlining constant with var siblings (const byte) main::print22_j#0 Inlining constant with var siblings (const byte) main::print22_i#0 Constant inlined main::print22_i#0 = (byte) 0 -Constant inlined main::$3 = (const byte*) main::hello#0 -Constant inlined main::print21_at#0 = (const byte*) screen#0 +Constant inlined main::$3 = (const byte*) main::hello +Constant inlined main::print21_at#0 = (const byte*) screen Constant inlined main::print21_i#0 = (byte) 0 Constant inlined main::print22_j#0 = (byte) 0 Constant inlined main::print21_j#0 = (byte) 0 @@ -280,7 +278,7 @@ main::print21: scope:[main] from main main::print21_@1: scope:[main] from main::print21 main::print21_@2 [6] (byte) main::print21_j#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_j#1 ) [6] (byte) main::print21_i#2 ← phi( main::print21/(byte) 0 main::print21_@2/(byte) main::print21_i#1 ) - [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 + [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 to:main::print22 main::print22: scope:[main] from main::print21_@1 [8] phi() @@ -288,18 +286,18 @@ main::print22: scope:[main] from main::print21_@1 main::print22_@1: scope:[main] from main::print22 main::print22_@2 [9] (byte) main::print22_j#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_j#1 ) [9] (byte) main::print22_i#2 ← phi( main::print22/(byte) 0 main::print22_@2/(byte) main::print22_i#1 ) - [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 + [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 to:main::@return main::@return: scope:[main] from main::print22_@1 [11] return to:@return main::print22_@2: scope:[main] from main::print22_@1 - [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) + [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 [14] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 to:main::print22_@1 main::print21_@2: scope:[main] from main::print21_@1 - [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) + [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 [17] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 to:main::print21_@1 @@ -307,7 +305,6 @@ main::print21_@2: scope:[main] from main::print21_@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::hello (byte*) main::print21_at (byte) main::print21_i (byte) main::print21_i#1 22.0 @@ -324,7 +321,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::print22_j#1 11.0 (byte) main::print22_j#2 11.0 (byte*) main::print22_msg -(byte*) screen Initial phi equivalence classes [ main::print21_i#2 main::print21_i#1 ] @@ -389,7 +385,7 @@ main: { jmp print21_b1 // main::print21_@1 print21_b1: - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda #0 ldy.z print21_i cmp hello,y @@ -410,7 +406,7 @@ main: { jmp print22_b1 // main::print22_@1 print22_b1: - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda #0 ldy.z print22_i cmp hello,y @@ -422,7 +418,7 @@ main: { rts // main::print22_@2 print22_b2: - // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z print22_i lda hello,y ldy.z print22_j @@ -441,7 +437,7 @@ main: { jmp print22_b1 // main::print21_@2 print21_b2: - // [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z print21_i lda hello,y ldy.z print21_j @@ -464,18 +460,18 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::print21_i#2 main::print21_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::print21_j#2 main::print21_j#1 ] -Statement [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::print22_i#2 main::print22_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::print22_j#2 main::print22_j#1 ] -Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a -Statement [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a -Statement [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a -Statement [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a -Statement [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::print21_i#2 main::print21_i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::print21_j#2 main::print21_j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::print22_i#2 main::print22_i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -529,7 +525,7 @@ main: { jmp print21_b1 // main::print21_@1 print21_b1: - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print21_b2 @@ -547,7 +543,7 @@ main: { jmp print22_b1 // main::print22_@1 print22_b1: - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print22_b2 @@ -558,7 +554,7 @@ main: { rts // main::print22_@2 print22_b2: - // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta print22_at,x // [13] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 @@ -573,7 +569,7 @@ main: { jmp print22_b1 // main::print21_@2 print21_b2: - // [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta screen,x // [16] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 @@ -630,8 +626,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (label) main::print21 (label) main::print21_@1 (label) main::print21_@2 @@ -647,7 +642,7 @@ FINAL SYMBOL TABLE (label) main::print22_@1 (label) main::print22_@2 (byte*) main::print22_at -(const byte*) main::print22_at#0 print22_at = (const byte*) screen#0+(byte) $50 +(const byte*) main::print22_at#0 print22_at = (const byte*) screen+(byte) $50 (byte) main::print22_i (byte) main::print22_i#1 reg byte y 22.0 (byte) main::print22_i#2 reg byte y 11.0 @@ -655,8 +650,7 @@ FINAL SYMBOL TABLE (byte) main::print22_j#1 reg byte x 11.0 (byte) main::print22_j#2 reg byte x 11.0 (byte*) main::print22_msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 reg byte y [ main::print21_i#2 main::print21_i#1 ] reg byte x [ main::print21_j#2 main::print21_j#1 ] @@ -694,7 +688,7 @@ main: { // main::print21_@1 print21_b1: // for(byte i=0; msg[i]; i++) - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print21_i#2)) goto main::print21_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print21_b2 @@ -708,7 +702,7 @@ main: { // main::print22_@1 print22_b1: // for(byte i=0; msg[i]; i++) - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print22_i#2)) goto main::print22_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print22_b2 @@ -719,7 +713,7 @@ main: { // main::print22_@2 print22_b2: // at[j] = msg[i] - // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [12] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta print22_at,x // j += 2 @@ -736,7 +730,7 @@ main: { // main::print21_@2 print21_b2: // at[j] = msg[i] - // [15] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [15] *((const byte*) screen + (byte) main::print21_j#2) ← *((const byte*) main::hello + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta screen,x // j += 2 diff --git a/src/test/ref/helloworld2-inline.sym b/src/test/ref/helloworld2-inline.sym index 387c349ec..ecdeb25b5 100644 --- a/src/test/ref/helloworld2-inline.sym +++ b/src/test/ref/helloworld2-inline.sym @@ -3,8 +3,7 @@ (label) @end (void()) main() (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (label) main::print21 (label) main::print21_@1 (label) main::print21_@2 @@ -20,7 +19,7 @@ (label) main::print22_@1 (label) main::print22_@2 (byte*) main::print22_at -(const byte*) main::print22_at#0 print22_at = (const byte*) screen#0+(byte) $50 +(const byte*) main::print22_at#0 print22_at = (const byte*) screen+(byte) $50 (byte) main::print22_i (byte) main::print22_i#1 reg byte y 22.0 (byte) main::print22_i#2 reg byte y 11.0 @@ -28,8 +27,7 @@ (byte) main::print22_j#1 reg byte x 11.0 (byte) main::print22_j#2 reg byte x 11.0 (byte*) main::print22_msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 reg byte y [ main::print21_i#2 main::print21_i#1 ] reg byte x [ main::print21_j#2 main::print21_j#1 ] diff --git a/src/test/ref/helloworld2.cfg b/src/test/ref/helloworld2.cfg index bad7ddc65..9576b7e0d 100644 --- a/src/test/ref/helloworld2.cfg +++ b/src/test/ref/helloworld2.cfg @@ -23,18 +23,18 @@ main::@return: scope:[main] from main::@1 (void()) print2((byte*) print2::at , (byte*) print2::msg) print2: scope:[print2] from main main::@1 - [9] (byte*) print2::at#4 ← phi( main/(const byte*) screen#0 main::@1/(const byte*) screen#0+(byte) $50 ) + [9] (byte*) print2::at#4 ← phi( main/(const byte*) screen main::@1/(const byte*) screen+(byte) $50 ) to:print2::@1 print2::@1: scope:[print2] from print2 print2::@2 [10] (byte) print2::j#2 ← phi( print2/(byte) 0 print2::@2/(byte) print2::j#1 ) [10] (byte) print2::i#2 ← phi( print2/(byte) 0 print2::@2/(byte) print2::i#1 ) - [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 + [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 to:print2::@return print2::@return: scope:[print2] from print2::@1 [12] return to:@return print2::@2: scope:[print2] from print2::@1 - [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) + [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) [14] (byte) print2::j#1 ← (byte) print2::j#2 + (byte) 2 [15] (byte) print2::i#1 ← ++ (byte) print2::i#2 to:print2::@1 diff --git a/src/test/ref/helloworld2.log b/src/test/ref/helloworld2.log index 5f9059049..6fac35d7c 100644 --- a/src/test/ref/helloworld2.log +++ b/src/test/ref/helloworld2.log @@ -9,20 +9,20 @@ Culled Empty Block (label) print2::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() main: scope:[main] from @2 - (byte*) main::hello#0 ← (const string) main::$3 - (byte*) print2::at#0 ← (byte*) screen#0 - (byte*) print2::msg#0 ← (byte*) main::hello#0 + (byte*) main::hello ← (const string) main::$3 + (byte*) print2::at#0 ← (byte*) screen + (byte*) print2::msg#0 ← (byte*) main::hello call print2 to:main::@1 main::@1: scope:[main] from main - (byte*~) main::$1 ← (byte*) screen#0 + (number) $50 + (byte*~) main::$1 ← (byte*) screen + (number) $50 (byte*) print2::at#1 ← (byte*~) main::$1 - (byte*) print2::msg#1 ← (byte*) main::hello#0 + (byte*) print2::msg#1 ← (byte*) main::hello call print2 to:main::@2 main::@2: scope:[main] from main::@1 @@ -77,7 +77,6 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte*) main::hello -(byte*) main::hello#0 (void()) print2((byte*) print2::at , (byte*) print2::msg) (bool~) print2::$0 (label) print2::@1 @@ -106,15 +105,14 @@ SYMBOL TABLE SSA (byte*) print2::msg#3 (byte*) print2::msg#4 (byte*) screen -(byte*) screen#0 -Adding number conversion cast (unumber) $50 in (byte*~) main::$1 ← (byte*) screen#0 + (number) $50 +Adding number conversion cast (unumber) $50 in (byte*~) main::$1 ← (byte*) screen + (number) $50 Adding number conversion cast (unumber) 0 in (byte) print2::j#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) print2::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) print2::$0 ← (number) 0 != *((byte*) print2::msg#2 + (byte) print2::i#2) Adding number conversion cast (unumber) 2 in (byte) print2::j#1 ← (byte) print2::j#2 + (number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Inlining cast (byte) print2::j#0 ← (unumber)(number) 0 Inlining cast (byte) print2::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -142,18 +140,18 @@ Identical Phi Values (byte*) print2::at#2 (byte*) print2::at#4 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) print2::$0 [15] if((byte) 0!=*((byte*) print2::msg#4 + (byte) print2::i#2)) goto print2::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) screen#0 = (byte*) 1024 -Constant (const byte*) main::hello#0 = main::$3 +Constant (const byte*) screen = (byte*) 1024 +Constant (const byte*) main::hello = main::$3 Constant (const byte) print2::j#0 = 0 Constant (const byte) print2::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) print2::at#0 = screen#0 -Constant (const byte*) print2::msg#0 = main::hello#0 -Constant (const byte*) print2::msg#1 = main::hello#0 +Constant (const byte*) print2::at#0 = screen +Constant (const byte*) print2::msg#0 = main::hello +Constant (const byte*) print2::msg#1 = main::hello Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [1] (byte*) print2::at#1 ← (const byte*) screen#0 + (byte) $50 +Constant right-side identified [1] (byte*) print2::at#1 ← (const byte*) screen + (byte) $50 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) print2::at#1 = screen#0+$50 +Constant (const byte*) print2::at#1 = screen+$50 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) print2::j#0 Inlining constant with var siblings (const byte) print2::i#0 @@ -161,15 +159,15 @@ Inlining constant with var siblings (const byte*) print2::at#0 Inlining constant with var siblings (const byte*) print2::msg#0 Inlining constant with var siblings (const byte*) print2::msg#1 Inlining constant with var siblings (const byte*) print2::at#1 -Constant inlined print2::msg#1 = (const byte*) main::hello#0 +Constant inlined print2::msg#1 = (const byte*) main::hello Constant inlined print2::j#0 = (byte) 0 -Constant inlined print2::msg#0 = (const byte*) main::hello#0 +Constant inlined print2::msg#0 = (const byte*) main::hello Constant inlined print2::i#0 = (byte) 0 -Constant inlined print2::at#1 = (const byte*) screen#0+(byte) $50 -Constant inlined main::$3 = (const byte*) main::hello#0 -Constant inlined print2::at#0 = (const byte*) screen#0 +Constant inlined print2::at#1 = (const byte*) screen+(byte) $50 +Constant inlined main::$3 = (const byte*) main::hello +Constant inlined print2::at#0 = (const byte*) screen Successful SSA optimization Pass2ConstantInlining -Identical Phi Values (byte*) print2::msg#4 (const byte*) main::hello#0 +Identical Phi Values (byte*) print2::msg#4 (const byte*) main::hello Successful SSA optimization Pass2IdenticalPhiElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -221,18 +219,18 @@ main::@return: scope:[main] from main::@1 (void()) print2((byte*) print2::at , (byte*) print2::msg) print2: scope:[print2] from main main::@1 - [9] (byte*) print2::at#4 ← phi( main/(const byte*) screen#0 main::@1/(const byte*) screen#0+(byte) $50 ) + [9] (byte*) print2::at#4 ← phi( main/(const byte*) screen main::@1/(const byte*) screen+(byte) $50 ) to:print2::@1 print2::@1: scope:[print2] from print2 print2::@2 [10] (byte) print2::j#2 ← phi( print2/(byte) 0 print2::@2/(byte) print2::j#1 ) [10] (byte) print2::i#2 ← phi( print2/(byte) 0 print2::@2/(byte) print2::i#1 ) - [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 + [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 to:print2::@return print2::@return: scope:[print2] from print2::@1 [12] return to:@return print2::@2: scope:[print2] from print2::@1 - [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) + [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) [14] (byte) print2::j#1 ← (byte) print2::j#2 + (byte) 2 [15] (byte) print2::i#1 ← ++ (byte) print2::i#2 to:print2::@1 @@ -240,7 +238,6 @@ print2::@2: scope:[print2] from print2::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::hello (void()) print2((byte*) print2::at , (byte*) print2::msg) (byte*) print2::at (byte*) print2::at#4 1.8333333333333333 @@ -251,7 +248,6 @@ VARIABLE REGISTER WEIGHTS (byte) print2::j#1 11.0 (byte) print2::j#2 11.0 (byte*) print2::msg -(byte*) screen Initial phi equivalence classes [ print2::at#4 ] @@ -295,7 +291,7 @@ main: { // [5] call print2 // [9] phi from main to print2 [phi:main->print2] print2_from_main: - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0 [phi:main->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen [phi:main->print2#0] -- pbuz1=pbuc1 lda #screen @@ -309,7 +305,7 @@ main: { // [7] call print2 // [9] phi from main::@1 to print2 [phi:main::@1->print2] print2_from_b1: - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 lda #screen+$50 @@ -340,7 +336,7 @@ print2: { jmp b1 // print2::@1 b1: - // [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 + // [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda #0 ldy.z i cmp main.hello,y @@ -352,7 +348,7 @@ print2: { rts // print2::@2 b2: - // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) -- pbuz1_derefidx_vbuz2=pbuc1_derefidx_vbuz3 + // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) -- pbuz1_derefidx_vbuz2=pbuc1_derefidx_vbuz3 ldy.z i lda main.hello,y ldy.z j @@ -373,12 +369,12 @@ print2: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a +Statement [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ print2::i#2 print2::i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ print2::j#2 print2::j#1 ] -Statement [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a -Statement [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a -Statement [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a +Statement [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a +Statement [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a +Statement [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) [ print2::at#4 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#4 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#4 print2::i#2 print2::j#2 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ print2::at#4 ] : zp ZP_WORD:2 , Potential registers zp ZP_BYTE:4 [ print2::i#2 print2::i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:5 [ print2::j#2 print2::j#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , @@ -421,7 +417,7 @@ main: { // [5] call print2 // [9] phi from main to print2 [phi:main->print2] print2_from_main: - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0 [phi:main->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen [phi:main->print2#0] -- pbuz1=pbuc1 lda #screen @@ -435,7 +431,7 @@ main: { // [7] call print2 // [9] phi from main::@1 to print2 [phi:main::@1->print2] print2_from_b1: - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 lda #screen+$50 @@ -462,7 +458,7 @@ print2: { jmp b1 // print2::@1 b1: - // [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 + // [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 lda main.hello,x cmp #0 bne b2 @@ -473,7 +469,7 @@ print2: { rts // print2::@2 b2: - // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx + // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx lda main.hello,x sta (at),y // [14] (byte) print2::j#1 ← (byte) print2::j#2 + (byte) 2 -- vbuyy=vbuyy_plus_2 @@ -525,8 +521,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (void()) print2((byte*) print2::at , (byte*) print2::msg) (label) print2::@1 (label) print2::@2 @@ -540,8 +535,7 @@ FINAL SYMBOL TABLE (byte) print2::j#1 reg byte y 11.0 (byte) print2::j#2 reg byte y 11.0 (byte*) print2::msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 zp ZP_WORD:2 [ print2::at#4 ] reg byte x [ print2::i#2 print2::i#1 ] @@ -570,7 +564,7 @@ main: { // print2(screen, hello) // [5] call print2 // [9] phi from main to print2 [phi:main->print2] - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0 [phi:main->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen [phi:main->print2#0] -- pbuz1=pbuc1 lda #screen @@ -581,7 +575,7 @@ main: { // print2(screen+80, hello) // [7] call print2 // [9] phi from main::@1 to print2 [phi:main::@1->print2] - // [9] phi (byte*) print2::at#4 = (const byte*) screen#0+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 + // [9] phi (byte*) print2::at#4 = (const byte*) screen+(byte) $50 [phi:main::@1->print2#0] -- pbuz1=pbuc1 lda #screen+$50 @@ -606,7 +600,7 @@ print2: { // print2::@1 b1: // for(byte i=0; msg[i]; i++) - // [11] if((byte) 0!=*((const byte*) main::hello#0 + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 + // [11] if((byte) 0!=*((const byte*) main::hello + (byte) print2::i#2)) goto print2::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 lda main.hello,x cmp #0 bne b2 @@ -617,7 +611,7 @@ print2: { // print2::@2 b2: // at[j] = msg[i] - // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx + // [13] *((byte*) print2::at#4 + (byte) print2::j#2) ← *((const byte*) main::hello + (byte) print2::i#2) -- pbuz1_derefidx_vbuyy=pbuc1_derefidx_vbuxx lda main.hello,x sta (at),y // j += 2 diff --git a/src/test/ref/helloworld2.sym b/src/test/ref/helloworld2.sym index 0ec1e51c6..5dfdb36aa 100644 --- a/src/test/ref/helloworld2.sym +++ b/src/test/ref/helloworld2.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (void()) print2((byte*) print2::at , (byte*) print2::msg) (label) print2::@1 (label) print2::@2 @@ -19,8 +18,7 @@ (byte) print2::j#1 reg byte y 11.0 (byte) print2::j#2 reg byte y 11.0 (byte*) print2::msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 zp ZP_WORD:2 [ print2::at#4 ] reg byte x [ print2::i#2 print2::i#1 ] diff --git a/src/test/ref/hex2dec-ptrptr.cfg b/src/test/ref/hex2dec-ptrptr.cfg index 335f69760..29fb0e0c2 100644 --- a/src/test/ref/hex2dec-ptrptr.cfg +++ b/src/test/ref/hex2dec-ptrptr.cfg @@ -99,10 +99,10 @@ cls: scope:[cls] from main [46] phi() to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 - [47] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 ) + [47] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen cls::@1/(byte*) cls::sc#1 ) [48] *((byte*) cls::sc#2) ← (byte) ' ' [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 - [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 + [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 [51] return diff --git a/src/test/ref/hex2dec-ptrptr.log b/src/test/ref/hex2dec-ptrptr.log index a3dee88cb..a4e19c5b1 100644 --- a/src/test/ref/hex2dec-ptrptr.log +++ b/src/test/ref/hex2dec-ptrptr.log @@ -58,15 +58,15 @@ main::@return: scope:[main] from main::@6 (void()) cls() cls: scope:[cls] from main - (byte*) cls::screen#0 ← ((byte*)) (number) $400 - (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7 - (byte*) cls::sc#0 ← (byte*) cls::screen#0 + (byte*) cls::screen ← ((byte*)) (number) $400 + (byte*~) cls::$0 ← (byte*) cls::screen + (number) $3e7 + (byte*) cls::sc#0 ← (byte*) cls::screen to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 (byte*) cls::sc#2 ← phi( cls/(byte*) cls::sc#0 cls::@1/(byte*) cls::sc#1 ) *((byte*) cls::sc#2) ← (byte) ' ' - (byte*) cls::sc#1 ← (byte*) cls::sc#2 + rangenext(cls::screen#0,cls::$0) - (bool~) cls::$1 ← (byte*) cls::sc#1 != rangelast(cls::screen#0,cls::$0) + (byte*) cls::sc#1 ← (byte*) cls::sc#2 + rangenext(cls::screen,cls::$0) + (bool~) cls::$1 ← (byte*) cls::sc#1 != rangelast(cls::screen,cls::$0) if((bool~) cls::$1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 @@ -206,7 +206,6 @@ SYMBOL TABLE SSA (byte*) cls::sc#1 (byte*) cls::sc#2 (byte*) cls::screen -(byte*) cls::screen#0 (void()) main() (label) main::@1 (label) main::@2 @@ -331,7 +330,7 @@ Adding number conversion cast (unumber) $28 in (byte*) main::screen#3 ← (byte* Adding number conversion cast (unumber) $270f in (word) utoa16w::value#3 ← (number) $270f Adding number conversion cast (unumber) $28 in (byte*) main::screen#4 ← (byte*) main::screen#8 + (number) $28 Adding number conversion cast (unumber) $e608 in (word) utoa16w::value#4 ← (number) $e608 -Adding number conversion cast (unumber) $3e7 in (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7 +Adding number conversion cast (unumber) $3e7 in (byte*~) cls::$0 ← (byte*) cls::screen + (number) $3e7 Adding number conversion cast (unumber) 0 in (byte) utoa16w::started#0 ← (number) 0 Adding number conversion cast (unumber) 4 in (byte~) utoa16w::$1 ← (byte~) utoa16w::$0 >> (number) 4 Adding number conversion cast (unumber) $f in (number~) utoa16w::$5 ← (byte~) utoa16w::$4 & (number) $f @@ -351,7 +350,7 @@ Inlining cast (word) utoa16w::value#1 ← (unumber)(number) $4d2 Inlining cast (word) utoa16w::value#2 ← (unumber)(number) $162e Inlining cast (word) utoa16w::value#3 ← (unumber)(number) $270f Inlining cast (word) utoa16w::value#4 ← (unumber)(number) $e608 -Inlining cast (byte*) cls::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) cls::screen ← (byte*)(number) $400 Inlining cast (byte) utoa16w::started#0 ← (unumber)(number) 0 Inlining cast (byte) utoa16n::started#3 ← (unumber)(number) 1 Inlining cast *((byte*) utoa16w::dst#9) ← (unumber)(number) 0 @@ -410,7 +409,7 @@ Alias (byte*) main::screen#0 = (byte*) main::screen#5 Alias (byte*) main::screen#1 = (byte*) main::screen#6 Alias (byte*) main::screen#2 = (byte*) main::screen#7 Alias (byte*) main::screen#3 = (byte*) main::screen#8 -Alias (byte*) cls::screen#0 = (byte*) cls::sc#0 +Alias (byte*) cls::screen = (byte*) cls::sc#0 Alias (byte) utoa16n::nybble#0 = (byte~) utoa16w::$1 Alias (word**) utoa16n::dst#0 = (byte**~) utoa16w::$2 Alias (byte) utoa16n::return#0 = (byte) utoa16n::return#6 @@ -438,7 +437,7 @@ Alias (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#5 Alias (word**) utoa16n::dst#4 = (word**) utoa16n::dst#6 Alias (byte) utoa16n::return#4 = (byte) utoa16n::started#5 Successful SSA optimization Pass2AliasElimination -Simple Condition (bool~) cls::$1 [33] if((byte*) cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 +Simple Condition (bool~) cls::$1 [33] if((byte*) cls::sc#1!=rangelast(cls::screen,cls::$0)) goto cls::@1 Simple Condition (bool~) utoa16n::$1 [85] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@1 Simple Condition (bool~) utoa16n::$3 [89] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@2 Successful SSA optimization Pass2ConditionalJumpSimplification @@ -453,7 +452,7 @@ Constant (const word) utoa16w::value#1 = $4d2 Constant (const word) utoa16w::value#2 = $162e Constant (const word) utoa16w::value#3 = $270f Constant (const word) utoa16w::value#4 = $e608 -Constant (const byte*) cls::screen#0 = (byte*) 1024 +Constant (const byte*) cls::screen = (byte*) 1024 Constant (const byte[]) DIGITS = $0 Constant (const byte) utoa16w::started#0 = 0 Constant (const word**) utoa16n::dst#0 = &utoa16w::dst#5 @@ -471,13 +470,13 @@ Successful SSA optimization PassNEliminateUnusedVars Eliminating unused variable (byte) utoa16n::return#2 and assignment [38] (byte) utoa16n::return#2 ← (byte) utoa16n::return#4 Successful SSA optimization PassNEliminateUnusedVars Constant right-side identified [3] (byte*) main::screen#1 ← (const byte*) main::screen#0 + (byte) $28 -Constant right-side identified [16] (byte*~) cls::$0 ← (const byte*) cls::screen#0 + (word) $3e7 +Constant right-side identified [16] (byte*~) cls::$0 ← (const byte*) cls::screen + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) main::screen#1 = main::screen#0+$28 -Constant (const byte*) cls::$0 = cls::screen#0+$3e7 +Constant (const byte*) cls::$0 = cls::screen+$3e7 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [19] cls::sc#1 ← ++ cls::sc#2 to ++ -Resolved ranged comparison value [20] if(cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1 +Resolved ranged comparison value [20] if(cls::sc#1!=rangelast(cls::screen,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1 Adding number conversion cast (unumber) 1 in if((byte*) cls::sc#1!=(byte*)(const byte*) cls::$0+(number) 1) goto cls::@1 Successful SSA optimization PassNAddNumberTypeConversions Simplifying constant integer cast (const byte*) cls::$0+(unumber)(number) 1 @@ -526,7 +525,7 @@ Constant inlined main::screen#3 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 Constant inlined $0 = (const byte[]) DIGITS Constant inlined utoa16w::started#0 = (byte) 0 Constant inlined utoa16n::started#0 = (byte) 0 -Constant inlined cls::$0 = (const byte*) cls::screen#0+(word) $3e7 +Constant inlined cls::$0 = (const byte*) cls::screen+(word) $3e7 Constant inlined utoa16n::dst#1 = &(byte*) utoa16w::dst#5 Constant inlined utoa16n::dst#0 = &(byte*) utoa16w::dst#5 Constant inlined utoa16w::value#4 = (word) $e608 @@ -688,10 +687,10 @@ cls: scope:[cls] from main [46] phi() to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 - [47] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 ) + [47] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen cls::@1/(byte*) cls::sc#1 ) [48] *((byte*) cls::sc#2) ← (byte) ' ' [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 - [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 + [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 [51] return @@ -703,7 +702,6 @@ VARIABLE REGISTER WEIGHTS (byte*) cls::sc (byte*) cls::sc#1 16.5 (byte*) cls::sc#2 16.5 -(byte*) cls::screen (void()) main() (byte*) main::screen (byte()) utoa16n((byte) utoa16n::nybble , (word**) utoa16n::dst , (byte) utoa16n::started) @@ -1086,7 +1084,7 @@ cls: { .label sc = 8 // [47] phi from cls to cls::@1 [phi:cls->cls::@1] b1_from_cls: - // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -1107,7 +1105,7 @@ cls: { bne !+ inc.z sc+1 !: - // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1_from_b1 @@ -1144,7 +1142,7 @@ Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS + (byte Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y -Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a +Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a Statement [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 [ utoa16w::dst#0 ] ( main:2 [ utoa16w::dst#0 ] ) always clobbers reg byte a Statement [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 [ utoa16w::dst#1 ] ( main:2 [ utoa16w::dst#1 ] ) always clobbers reg byte a Statement [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst#2 ] ( main:2 [ utoa16w::dst#2 ] ) always clobbers reg byte a @@ -1159,7 +1157,7 @@ Statement [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 [ utoa16w::dst Statement [36] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y -Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a +Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ utoa16w::value#5 ] : zp ZP_WORD:2 , Potential registers zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] : zp ZP_WORD:4 , Potential registers zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , @@ -1459,7 +1457,7 @@ cls: { .label sc = 4 // [47] phi from cls to cls::@1 [phi:cls->cls::@1] b1_from_cls: - // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -1480,7 +1478,7 @@ cls: { bne !+ inc.z sc+1 !: - // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1_from_b1 @@ -1581,8 +1579,7 @@ FINAL SYMBOL TABLE (byte*) cls::sc (byte*) cls::sc#1 sc zp ZP_WORD:4 16.5 (byte*) cls::sc#2 sc zp ZP_WORD:4 16.5 -(byte*) cls::screen -(const byte*) cls::screen#0 screen = (byte*) 1024 +(const byte*) cls::screen screen = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -1886,7 +1883,7 @@ cls: { .label screen = $400 .label sc = 4 // [47] phi from cls to cls::@1 [phi:cls->cls::@1] - // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -1906,7 +1903,7 @@ cls: { bne !+ inc.z sc+1 !: - // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1 diff --git a/src/test/ref/hex2dec-ptrptr.sym b/src/test/ref/hex2dec-ptrptr.sym index 6f499d5e2..4955ad5bf 100644 --- a/src/test/ref/hex2dec-ptrptr.sym +++ b/src/test/ref/hex2dec-ptrptr.sym @@ -8,8 +8,7 @@ (byte*) cls::sc (byte*) cls::sc#1 sc zp ZP_WORD:4 16.5 (byte*) cls::sc#2 sc zp ZP_WORD:4 16.5 -(byte*) cls::screen -(const byte*) cls::screen#0 screen = (byte*) 1024 +(const byte*) cls::screen screen = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/hex2dec.cfg b/src/test/ref/hex2dec.cfg index 481378080..f994951c9 100644 --- a/src/test/ref/hex2dec.cfg +++ b/src/test/ref/hex2dec.cfg @@ -171,10 +171,10 @@ cls: scope:[cls] from main [85] phi() to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 - [86] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 ) + [86] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen cls::@1/(byte*) cls::sc#1 ) [87] *((byte*) cls::sc#2) ← (byte) ' ' [88] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 - [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 + [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 [90] return diff --git a/src/test/ref/hex2dec.log b/src/test/ref/hex2dec.log index 7eeda77a6..18f77b049 100644 --- a/src/test/ref/hex2dec.log +++ b/src/test/ref/hex2dec.log @@ -131,15 +131,15 @@ main::@return: scope:[main] from main::@1 (void()) cls() cls: scope:[cls] from main - (byte*) cls::screen#0 ← ((byte*)) (number) $400 - (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7 - (byte*) cls::sc#0 ← (byte*) cls::screen#0 + (byte*) cls::screen ← ((byte*)) (number) $400 + (byte*~) cls::$0 ← (byte*) cls::screen + (number) $3e7 + (byte*) cls::sc#0 ← (byte*) cls::screen to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 (byte*) cls::sc#2 ← phi( cls/(byte*) cls::sc#0 cls::@1/(byte*) cls::sc#1 ) *((byte*) cls::sc#2) ← (byte) ' ' - (byte*) cls::sc#1 ← (byte*) cls::sc#2 + rangenext(cls::screen#0,cls::$0) - (bool~) cls::$1 ← (byte*) cls::sc#1 != rangelast(cls::screen#0,cls::$0) + (byte*) cls::sc#1 ← (byte*) cls::sc#2 + rangenext(cls::screen,cls::$0) + (bool~) cls::$1 ← (byte*) cls::sc#1 != rangelast(cls::screen,cls::$0) if((bool~) cls::$1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 @@ -372,7 +372,6 @@ SYMBOL TABLE SSA (byte*) cls::sc#1 (byte*) cls::sc#2 (byte*) cls::screen -(byte*) cls::screen#0 (byte*) control (void()) main() (number~) main::$1 @@ -626,7 +625,7 @@ Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::$18 ← *((byte[]) main::msg#0 + (byte) main::i#2) != (number) 0 Adding number conversion cast (unumber) $50 in (byte*~) main::$19 ← (byte*) main::screen#10 + (number) $50 Adding number conversion cast (unumber) 3 in (byte*~) main::$20 ← (byte*~) main::$19 + (number) 3 -Adding number conversion cast (unumber) $3e7 in (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7 +Adding number conversion cast (unumber) $3e7 in (byte*~) cls::$0 ← (byte*) cls::screen + (number) $3e7 Adding number conversion cast (unumber) 0 in (byte) utoa10w::bStarted#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) utoa10w::digit#0 ← (number) 0 Adding number conversion cast (unumber) 1 in (byte) utoa10w::bStarted#1 ← (number) 1 @@ -665,7 +664,7 @@ Inlining cast (word) utoa16w::value#4 ← (unumber)(number) $e608 Inlining cast *((byte*) bordercol) ← (unumber)(number) 0 Inlining cast (word~) main::$15 ← (word)(byte) main::time#0 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 -Inlining cast (byte*) cls::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) cls::screen ← (byte*)(number) $400 Inlining cast (byte) utoa10w::bStarted#0 ← (unumber)(number) 0 Inlining cast (byte) utoa10w::digit#0 ← (unumber)(number) 0 Inlining cast (byte) utoa10w::bStarted#1 ← (unumber)(number) 1 @@ -798,7 +797,7 @@ Alias (word) utoa10w::value#0 = (word~) main::$15 Alias (byte*) utoa10w::dst#0 = (byte*~) main::$16 Alias (byte*) main::screen#10 = (byte*) main::screen#11 Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) cls::screen#0 = (byte*) cls::sc#0 +Alias (byte*) cls::screen = (byte*) cls::sc#0 Alias (byte) utoa10w::digit#3 = (byte) utoa10w::digit#5 (byte) utoa10w::digit#8 (byte) utoa10w::digit#6 (byte) utoa10w::digit#4 Alias (byte) utoa10w::i#2 = (byte) utoa10w::i#3 (byte) utoa10w::i#4 (byte) utoa10w::i#7 (byte) utoa10w::i#8 Alias (word) utoa10w::value#10 = (word) utoa10w::value#3 (word) utoa10w::value#2 (word) utoa10w::value#8 (word) utoa10w::value#9 @@ -846,7 +845,7 @@ Identical Phi Values (byte*) utoa10w::dst#10 (byte*) utoa10w::dst#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$4 [11] if((byte) main::rst#0!=(byte) $30) goto main::@4 Simple Condition (bool~) main::$18 [57] if(*((byte[]) main::msg#0 + (byte) main::i#2)!=(byte) 0) goto main::@7 -Simple Condition (bool~) cls::$1 [71] if((byte*) cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 +Simple Condition (bool~) cls::$1 [71] if((byte*) cls::sc#1!=rangelast(cls::screen,cls::$0)) goto cls::@1 Simple Condition (bool~) utoa10w::$1 [83] if((word) utoa10w::value#10>=*((word[]) UTOA10_SUB + (byte~) utoa10w::$8)) goto utoa10w::@3 Simple Condition (bool~) utoa10w::$4 [93] if((byte~) utoa10w::$2==(byte) 0) goto utoa10w::@10 Simple Condition (bool~) utoa10w::$7 [97] if((byte) utoa10w::i#1!=rangelast(0,7)) goto utoa10w::@2 @@ -873,7 +872,7 @@ Constant (const word) utoa16w::value#3 = $270f Constant (const word) utoa16w::value#4 = $e608 Constant (const byte[]) main::msg#0 = main::$21 Constant (const byte) main::i#0 = 0 -Constant (const byte*) cls::screen#0 = (byte*) 1024 +Constant (const byte*) cls::screen = (byte*) 1024 Constant (const byte[]) DIGITS = $0 Constant (const word[]) UTOA10_SUB = { $7530, $2710, $bb8, $3e8, $12c, $64, $1e, $a } Constant (const byte[]) UTOA10_VAL = { 3, 1, 3, 1, 3, 1, 3, 1 } @@ -910,13 +909,13 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 8 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant right-side identified [11] (byte*) main::screen#1 ← (const byte*) main::screen#0 + (byte) $28 -Constant right-side identified [38] (byte*~) cls::$0 ← (const byte*) cls::screen#0 + (word) $3e7 +Constant right-side identified [38] (byte*~) cls::$0 ← (const byte*) cls::screen + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) main::screen#1 = main::screen#0+$28 -Constant (const byte*) cls::$0 = cls::screen#0+$3e7 +Constant (const byte*) cls::$0 = cls::screen+$3e7 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [41] cls::sc#1 ← ++ cls::sc#2 to ++ -Resolved ranged comparison value [42] if(cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1 +Resolved ranged comparison value [42] if(cls::sc#1!=rangelast(cls::screen,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1 Adding number conversion cast (unumber) 1 in if((byte*) cls::sc#1!=(byte*)(const byte*) cls::$0+(number) 1) goto cls::@1 Successful SSA optimization PassNAddNumberTypeConversions Simplifying constant integer cast (const byte*) cls::$0+(unumber)(number) 1 @@ -997,7 +996,7 @@ Constant inlined utoa16n::dst#2 = &(byte*) utoa16w::dst#5 Constant inlined main::$20 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50+(byte) 3 Constant inlined main::$21 = (const byte[]) main::msg#0 Constant inlined utoa16w::started#0 = (byte) 0 -Constant inlined cls::$0 = (const byte*) cls::screen#0+(word) $3e7 +Constant inlined cls::$0 = (const byte*) cls::screen+(word) $3e7 Constant inlined utoa10w::i#0 = (byte) 0 Constant inlined utoa10w::dst#0 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28+(byte) $50 Constant inlined utoa10w::digit#0 = (byte) 0 @@ -1273,10 +1272,10 @@ cls: scope:[cls] from main [85] phi() to:cls::@1 cls::@1: scope:[cls] from cls cls::@1 - [86] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 ) + [86] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen cls::@1/(byte*) cls::sc#1 ) [87] *((byte*) cls::sc#2) ← (byte) ' ' [88] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 - [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 + [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 to:cls::@return cls::@return: scope:[cls] from cls::@1 [90] return @@ -1288,7 +1287,6 @@ VARIABLE REGISTER WEIGHTS (byte*) cls::sc (byte*) cls::sc#1 16.5 (byte*) cls::sc#2 16.5 -(byte*) cls::screen (void()) main() (byte~) main::$1 101.0 (byte~) main::$2 202.0 @@ -2023,7 +2021,7 @@ cls: { .label sc = $10 // [86] phi from cls to cls::@1 [phi:cls->cls::@1] b1_from_cls: - // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -2044,7 +2042,7 @@ cls: { bne !+ inc.z sc+1 !: - // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1_from_b1 @@ -2114,7 +2112,7 @@ Statement [82] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS + (byte Removing always clobbered register reg byte a as potential for zp ZP_BYTE:15 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:15 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] Statement [87] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y -Statement [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a +Statement [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a Statement [6] (byte~) main::$1 ← *((const byte*) control) & (byte) $80 [ main::$1 ] ( main:2 [ main::$1 ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← *((const byte*) raster) >> (byte) 1 [ main::$1 main::$2 ] ( main:2 [ main::$1 main::$2 ] ) always clobbers reg byte a Statement [10] *((const byte*) bordercol) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2148,7 +2146,7 @@ Statement [72] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 [ utoa16w::dst Statement [75] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:13 [ main::time_start#0 ] main:2::utoa16w:16 [ main::time_start#0 ] main:2::utoa16w:19 [ main::time_start#0 ] main:2::utoa16w:22 [ main::time_start#0 ] main:2::utoa16w:25 [ main::time_start#0 ] ) always clobbers reg byte a reg byte y Statement [82] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:13::utoa16n:59 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:16::utoa16n:59 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:19::utoa16n:59 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:22::utoa16n:59 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:25::utoa16n:59 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:65 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:16::utoa16n:65 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:19::utoa16n:65 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:22::utoa16n:65 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:25::utoa16n:65 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:71 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:16::utoa16n:71 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:19::utoa16n:71 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:22::utoa16n:71 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:25::utoa16n:71 [ main::time_start#0 utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:74 [ main::time_start#0 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:16::utoa16n:74 [ main::time_start#0 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:19::utoa16n:74 [ main::time_start#0 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:22::utoa16n:74 [ main::time_start#0 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:25::utoa16n:74 [ main::time_start#0 utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y Statement [87] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y -Statement [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a +Statement [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) 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 , Potential registers zp ZP_BYTE:3 [ utoa10w::i#2 utoa10w::i#1 ] : zp ZP_BYTE:3 , reg byte x , Potential registers zp ZP_WORD:4 [ utoa10w::value#10 utoa10w::value#0 utoa10w::value#1 ] : zp ZP_WORD:4 , @@ -2723,7 +2721,7 @@ cls: { .label sc = 6 // [86] phi from cls to cls::@1 [phi:cls->cls::@1] b1_from_cls: - // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -2744,7 +2742,7 @@ cls: { bne !+ inc.z sc+1 !: - // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1_from_b1 @@ -2884,8 +2882,7 @@ FINAL SYMBOL TABLE (byte*) cls::sc (byte*) cls::sc#1 sc zp ZP_WORD:6 16.5 (byte*) cls::sc#2 sc zp ZP_WORD:6 16.5 -(byte*) cls::screen -(const byte*) cls::screen#0 screen = (byte*) 1024 +(const byte*) cls::screen screen = (byte*) 1024 (const byte*) control control = (byte*) 53265 (void()) main() (byte~) main::$1 $1 zp ZP_BYTE:8 101.0 @@ -3491,7 +3488,7 @@ cls: { .label screen = $400 .label sc = 6 // [86] phi from cls to cls::@1 [phi:cls->cls::@1] - // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 + // [86] phi (byte*) cls::sc#2 = (const byte*) cls::screen [phi:cls->cls::@1#0] -- pbuz1=pbuc1 lda #screen @@ -3511,7 +3508,7 @@ cls: { bne !+ inc.z sc+1 !: - // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 + // [89] if((byte*) cls::sc#1!=(const byte*) cls::screen+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 lda.z sc+1 cmp #>screen+$3e7+1 bne b1 diff --git a/src/test/ref/hex2dec.sym b/src/test/ref/hex2dec.sym index f724f2fd9..48210e2c5 100644 --- a/src/test/ref/hex2dec.sym +++ b/src/test/ref/hex2dec.sym @@ -11,8 +11,7 @@ (byte*) cls::sc (byte*) cls::sc#1 sc zp ZP_WORD:6 16.5 (byte*) cls::sc#2 sc zp ZP_WORD:6 16.5 -(byte*) cls::screen -(const byte*) cls::screen#0 screen = (byte*) 1024 +(const byte*) cls::screen screen = (byte*) 1024 (const byte*) control control = (byte*) 53265 (void()) main() (byte~) main::$1 $1 zp ZP_BYTE:8 101.0 diff --git a/src/test/ref/ifmin.cfg b/src/test/ref/ifmin.cfg index e65519be1..79e133bad 100644 --- a/src/test/ref/ifmin.cfg +++ b/src/test/ref/ifmin.cfg @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@2 [6] if((byte) main::i#2>=(byte) $32) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [7] *((const byte*) SCREEN#0) ← (byte) main::i#2 + [7] *((const byte*) SCREEN) ← (byte) main::i#2 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 [8] (byte) main::i#1 ← ++ (byte) main::i#2 diff --git a/src/test/ref/ifmin.log b/src/test/ref/ifmin.log index fab2af682..af902d93b 100644 --- a/src/test/ref/ifmin.log +++ b/src/test/ref/ifmin.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -24,7 +24,7 @@ main::@2: scope:[main] from main::@1 main::@3 to:main::@return main::@3: scope:[main] from main::@1 (byte) main::i#4 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#0) ← (byte) main::i#4 + *((byte*) SCREEN) ← (byte) main::i#4 to:main::@2 main::@return: scope:[main] from main::@2 return @@ -42,7 +42,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -62,7 +61,7 @@ Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) $32 in (bool~) main::$0 ← (byte) main::i#2 < (number) $32 Adding number conversion cast (unumber) $64 in (bool~) main::$2 ← (byte) main::i#1 < (number) $64 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -83,7 +82,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [5] if((byte) main::i#2>=(byte) $32) goto main::@2 Simple Condition (bool~) main::$2 [9] if((byte) main::i#1<(byte) $64) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 @@ -128,7 +127,7 @@ main::@1: scope:[main] from main main::@2 [6] if((byte) main::i#2>=(byte) $32) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [7] *((const byte*) SCREEN#0) ← (byte) main::i#2 + [7] *((const byte*) SCREEN) ← (byte) main::i#2 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 [8] (byte) main::i#1 ← ++ (byte) main::i#2 @@ -140,7 +139,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -200,7 +198,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) SCREEN#0) ← (byte) main::i#2 -- _deref_pbuc1=vbuz1 + // [7] *((const byte*) SCREEN) ← (byte) main::i#2 -- _deref_pbuc1=vbuz1 lda.z i sta SCREEN jmp b2 @@ -274,7 +272,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) SCREEN#0) ← (byte) main::i#2 -- _deref_pbuc1=vbuxx + // [7] *((const byte*) SCREEN) ← (byte) main::i#2 -- _deref_pbuc1=vbuxx stx SCREEN jmp b2 // main::@2 @@ -324,8 +322,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -371,7 +368,7 @@ main: { bcs b2 // main::@3 // *SCREEN = i - // [7] *((const byte*) SCREEN#0) ← (byte) main::i#2 -- _deref_pbuc1=vbuxx + // [7] *((const byte*) SCREEN) ← (byte) main::i#2 -- _deref_pbuc1=vbuxx stx SCREEN // main::@2 b2: diff --git a/src/test/ref/ifmin.sym b/src/test/ref/ifmin.sym index efcd1b0d0..73c9cc07e 100644 --- a/src/test/ref/ifmin.sym +++ b/src/test/ref/ifmin.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/importing.cfg b/src/test/ref/importing.cfg index dea44286e..93f2c9d35 100644 --- a/src/test/ref/importing.cfg +++ b/src/test/ref/importing.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (byte) 1 + [4] *((const byte*) main::screen) ← (byte) 1 [5] *((const byte*) BGCOL) ← (const byte) RED to:main::@return main::@return: scope:[main] from main diff --git a/src/test/ref/importing.log b/src/test/ref/importing.log index ab9ec1c1f..a28aa8f03 100644 --- a/src/test/ref/importing.log +++ b/src/test/ref/importing.log @@ -8,8 +8,8 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 - *((byte*) main::screen#0) ← (number) 1 + (byte*) main::screen ← ((byte*)) (number) $400 + *((byte*) main::screen) ← (number) 1 *((byte*) BGCOL) ← (byte) RED to:main::@return main::@return: scope:[main] from main @@ -32,15 +32,14 @@ SYMBOL TABLE SSA (void()) main() (label) main::@return (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) 2 in (byte) RED ← (number) 2 -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0) ← (number) 1 +Adding number conversion cast (unumber) 1 in *((byte*) main::screen) ← (number) 1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 Inlining cast (byte) RED ← (unumber)(number) 2 -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 -Inlining cast *((byte*) main::screen#0) ← (unumber)(number) 1 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 +Inlining cast *((byte*) main::screen) ← (unumber)(number) 1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53281 Simplifying constant integer cast 2 @@ -52,7 +51,7 @@ Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant (const byte*) BGCOL = (byte*) 53281 Constant (const byte) RED = 2 -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -81,7 +80,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::screen#0) ← (byte) 1 + [4] *((const byte*) main::screen) ← (byte) 1 [5] *((const byte*) BGCOL) ← (const byte) RED to:main::@return main::@return: scope:[main] from main @@ -91,7 +90,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::screen Initial phi equivalence classes Complete equivalence classes @@ -123,7 +121,7 @@ bend: // main main: { .label screen = $400 - // [4] *((const byte*) main::screen#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta screen // [5] *((const byte*) BGCOL) ← (const byte) RED -- _deref_pbuc1=vbuc2 @@ -138,7 +136,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::screen#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::screen) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) BGCOL) ← (const byte) RED [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -174,7 +172,7 @@ bend: // main main: { .label screen = $400 - // [4] *((const byte*) main::screen#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta screen // [5] *((const byte*) BGCOL) ← (const byte) RED -- _deref_pbuc1=vbuc2 @@ -214,8 +212,7 @@ FINAL SYMBOL TABLE (const byte) RED RED = (byte) 2 (void()) main() (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 @@ -240,7 +237,7 @@ Score: 18 main: { .label screen = $400 // *screen = 1 - // [4] *((const byte*) main::screen#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::screen) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta screen // *BGCOL = RED diff --git a/src/test/ref/importing.sym b/src/test/ref/importing.sym index 215a8032a..f9b948176 100644 --- a/src/test/ref/importing.sym +++ b/src/test/ref/importing.sym @@ -5,6 +5,5 @@ (const byte) RED RED = (byte) 2 (void()) main() (label) main::@return -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 diff --git a/src/test/ref/incd020.cfg b/src/test/ref/incd020.cfg index 5b6f9955c..14ae2d2c7 100644 --- a/src/test/ref/incd020.cfg +++ b/src/test/ref/incd020.cfg @@ -13,6 +13,6 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@1 - [5] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) - [6] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [5] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) + [6] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 diff --git a/src/test/ref/incd020.log b/src/test/ref/incd020.log index 8d5a458e5..1090c6cba 100644 --- a/src/test/ref/incd020.log +++ b/src/test/ref/incd020.log @@ -3,15 +3,15 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) BGCOL#0 ← ((byte*)) (number) $d020 + (byte*) BGCOL ← ((byte*)) (number) $d020 to:@1 (void()) main() main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 - *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) - *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) + *((byte*) BGCOL) ← ++ *((byte*) BGCOL) + *((byte*) BGCOL) ← -- *((byte*) BGCOL) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 @@ -30,16 +30,15 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (void()) main() (label) main::@1 (label) main::@return -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d020 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d020 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53280 Successful SSA optimization PassNCastSimplification -Constant (const byte*) BGCOL#0 = (byte*) 53280 +Constant (const byte*) BGCOL = (byte*) 53280 Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [3] if(true) goto main::@1 Successful SSA optimization Pass2ConstantIfs @@ -77,13 +76,12 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@1 - [5] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) - [6] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) + [5] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) + [6] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL (void()) main() Initial phi equivalence classes @@ -121,9 +119,9 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [5] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL - // [6] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [6] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -169,9 +167,9 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [5] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL - // [6] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [6] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } @@ -199,8 +197,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) BGCOL BGCOL = (byte*) 53280 (void()) main() (label) main::@1 @@ -230,10 +227,10 @@ main: { // main::@1 b1: // ++*BGCOL; - // [5] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [5] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // (*BGCOL)--; - // [6] *((const byte*) BGCOL#0) ← -- *((const byte*) BGCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [6] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BGCOL jmp b1 } diff --git a/src/test/ref/incd020.sym b/src/test/ref/incd020.sym index 1dcc7f20a..c759186f0 100644 --- a/src/test/ref/incd020.sym +++ b/src/test/ref/incd020.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) BGCOL BGCOL = (byte*) 53280 (void()) main() (label) main::@1 diff --git a/src/test/ref/infloop-error.cfg b/src/test/ref/infloop-error.cfg index edf98d46b..13f373e75 100644 --- a/src/test/ref/infloop-error.cfg +++ b/src/test/ref/infloop-error.cfg @@ -33,7 +33,7 @@ main::@6: scope:[main] from main::@3 to:main::@4 main::@4: scope:[main] from main::@3 main::@6 [12] (byte) main::max#3 ← phi( main::@3/(byte) main::max#2 main::@6/(byte~) main::max#9 ) - [13] *((const byte*) SCREEN#0) ← (byte) main::min#3 - [14] *((const byte*) SCREEN#0+(byte) 1) ← (byte) main::max#3 - [15] *((const byte*) SCREEN#0+(byte) 2) ← (byte) main::pos#1 + [13] *((const byte*) SCREEN) ← (byte) main::min#3 + [14] *((const byte*) SCREEN+(byte) 1) ← (byte) main::max#3 + [15] *((const byte*) SCREEN+(byte) 2) ← (byte) main::pos#1 to:main::@1 diff --git a/src/test/ref/infloop-error.log b/src/test/ref/infloop-error.log index ea720e9e2..25d0b4dfa 100644 --- a/src/test/ref/infloop-error.log +++ b/src/test/ref/infloop-error.log @@ -6,7 +6,7 @@ Culled Empty Block (label) main::@10 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -47,9 +47,9 @@ main::@5: scope:[main] from main::@4 main::@9 (byte) main::pos#5 ← phi( main::@4/(byte) main::pos#3 main::@9/(byte) main::pos#6 ) (byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::max#1 ) (byte) main::min#3 ← phi( main::@4/(byte) main::min#5 main::@9/(byte) main::min#6 ) - *((byte*) SCREEN#0 + (number) 0) ← (byte) main::min#3 - *((byte*) SCREEN#0 + (number) 1) ← (byte) main::max#3 - *((byte*) SCREEN#0 + (number) 2) ← (byte) main::pos#5 + *((byte*) SCREEN + (number) 0) ← (byte) main::min#3 + *((byte*) SCREEN + (number) 1) ← (byte) main::max#3 + *((byte*) SCREEN + (number) 2) ← (byte) main::pos#5 to:main::@1 main::@9: scope:[main] from main::@4 (byte) main::min#6 ← phi( main::@4/(byte) main::min#5 ) @@ -72,7 +72,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -114,11 +113,11 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $ff in (byte) main::min#0 ← (number) $ff Adding number conversion cast (unumber) 0 in (byte) main::max#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::pos#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) main::min#3 -Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (number) 1) ← (byte) main::max#3 -Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← (byte) main::pos#5 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) main::min#3 +Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte) main::max#3 +Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte) main::pos#5 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::min#0 ← (unumber)(number) $ff Inlining cast (byte) main::max#0 ← (unumber)(number) 0 Inlining cast (byte) main::pos#0 ← (unumber)(number) 0 @@ -159,14 +158,14 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$1 [10] if((byte) main::pos#1>=(byte) main::min#2) goto main::@4 Simple Condition (bool~) main::$3 [14] if((byte) main::pos#1<=(byte) main::max#2) goto main::@5 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::min#0 = $ff Constant (const byte) main::max#0 = 0 Constant (const byte) main::pos#0 = 0 Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [5] if(true) goto main::@2 Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero SCREEN#0 in [18] *((const byte*) SCREEN#0 + (byte) 0) ← (byte) main::min#3 +Simplifying expression containing zero SCREEN in [18] *((const byte*) SCREEN + (byte) 0) ← (byte) main::min#3 Successful SSA optimization PassNSimplifyExpressionWithZero Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks @@ -177,8 +176,8 @@ Constant inlined main::min#0 = (byte) $ff Constant inlined main::max#0 = (byte) 0 Constant inlined main::pos#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(SCREEN#0+1) -Consolidated array index constant in *(SCREEN#0+2) +Consolidated array index constant in *(SCREEN+1) +Consolidated array index constant in *(SCREEN+2) Successful SSA optimization Pass2ConstantAdditionElimination Added new block during phi lifting main::@11(between main::@2 and main::@4) Added new block during phi lifting main::@12(between main::@4 and main::@5) @@ -247,14 +246,13 @@ main::@6: scope:[main] from main::@3 to:main::@4 main::@4: scope:[main] from main::@3 main::@6 [12] (byte) main::max#3 ← phi( main::@3/(byte) main::max#2 main::@6/(byte~) main::max#9 ) - [13] *((const byte*) SCREEN#0) ← (byte) main::min#3 - [14] *((const byte*) SCREEN#0+(byte) 1) ← (byte) main::max#3 - [15] *((const byte*) SCREEN#0+(byte) 2) ← (byte) main::pos#1 + [13] *((const byte*) SCREEN) ← (byte) main::min#3 + [14] *((const byte*) SCREEN+(byte) 1) ← (byte) main::max#3 + [15] *((const byte*) SCREEN+(byte) 2) ← (byte) main::pos#1 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::max (byte) main::max#2 5.5 @@ -364,13 +362,13 @@ main: { jmp b4 // main::@4 b4: - // [13] *((const byte*) SCREEN#0) ← (byte) main::min#3 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) SCREEN) ← (byte) main::min#3 -- _deref_pbuc1=vbuz1 lda.z min sta SCREEN - // [14] *((const byte*) SCREEN#0+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) SCREEN+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuz1 lda.z max sta SCREEN+1 - // [15] *((const byte*) SCREEN#0+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuz1 + // [15] *((const byte*) SCREEN+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuz1 lda.z pos sta SCREEN+2 // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] @@ -470,11 +468,11 @@ main: { jmp b4 // main::@4 b4: - // [13] *((const byte*) SCREEN#0) ← (byte) main::min#3 -- _deref_pbuc1=vbuxx + // [13] *((const byte*) SCREEN) ← (byte) main::min#3 -- _deref_pbuc1=vbuxx stx SCREEN - // [14] *((const byte*) SCREEN#0+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuyy + // [14] *((const byte*) SCREEN+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuyy sty SCREEN+1 - // [15] *((const byte*) SCREEN#0+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuaa + // [15] *((const byte*) SCREEN+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuaa sta SCREEN+2 // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] b1_from_b4: @@ -525,8 +523,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -610,13 +607,13 @@ main: { // main::@4 b4: // SCREEN[0] = min - // [13] *((const byte*) SCREEN#0) ← (byte) main::min#3 -- _deref_pbuc1=vbuxx + // [13] *((const byte*) SCREEN) ← (byte) main::min#3 -- _deref_pbuc1=vbuxx stx SCREEN // SCREEN[1] = max - // [14] *((const byte*) SCREEN#0+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuyy + // [14] *((const byte*) SCREEN+(byte) 1) ← (byte) main::max#3 -- _deref_pbuc1=vbuyy sty SCREEN+1 // SCREEN[2] = pos - // [15] *((const byte*) SCREEN#0+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuaa + // [15] *((const byte*) SCREEN+(byte) 2) ← (byte) main::pos#1 -- _deref_pbuc1=vbuaa sta SCREEN+2 // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] // [5] phi (byte) main::max#2 = (byte) main::max#3 [phi:main::@4->main::@1#0] -- register_copy diff --git a/src/test/ref/infloop-error.sym b/src/test/ref/infloop-error.sym index 24a939518..0ca0c7154 100644 --- a/src/test/ref/infloop-error.sym +++ b/src/test/ref/infloop-error.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/inline-asm-clobber.cfg b/src/test/ref/inline-asm-clobber.cfg index 623409563..1da73313f 100644 --- a/src/test/ref/inline-asm-clobber.cfg +++ b/src/test/ref/inline-asm-clobber.cfg @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [6] (byte) main::j#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::j#1 ) - [7] *((const byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::j#2 + [7] *((const byte*) SCREEN + (byte) main::i#4) ← (byte) main::j#2 [8] (byte) main::j#1 ← ++ (byte) main::j#2 [9] if((byte) main::j#1!=(byte) $65) goto main::@2 to:main::@3 @@ -31,7 +31,7 @@ main::@4: scope:[main] from main::@3 main::@6 main::@5: scope:[main] from main::@4 main::@5 [13] (byte) main::l#2 ← phi( main::@4/(byte) 0 main::@5/(byte) main::l#1 ) asm { eor#$55 tax } - [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 + [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [17] if((byte) main::l#1!=(byte) $65) goto main::@5 to:main::@6 diff --git a/src/test/ref/inline-asm-clobber.log b/src/test/ref/inline-asm-clobber.log index ea1fab185..181f2668a 100644 --- a/src/test/ref/inline-asm-clobber.log +++ b/src/test/ref/inline-asm-clobber.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@8 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@3 main::@2: scope:[main] from main::@1 main::@2 (byte) main::i#2 ← phi( main::@1/(byte) main::i#4 main::@2/(byte) main::i#2 ) (byte) main::j#2 ← phi( main::@1/(byte) main::j#0 main::@2/(byte) main::j#1 ) - *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 + *((byte*) SCREEN + (byte) main::i#2) ← (byte) main::j#2 (byte) main::j#1 ← (byte) main::j#2 + rangenext(0,$64) (bool~) main::$0 ← (byte) main::j#1 != rangelast(0,$64) if((bool~) main::$0) goto main::@2 @@ -39,7 +39,7 @@ main::@6: scope:[main] from main::@5 main::@6 (byte) main::k#2 ← phi( main::@5/(byte) main::k#4 main::@6/(byte) main::k#2 ) (byte) main::l#2 ← phi( main::@5/(byte) main::l#0 main::@6/(byte) main::l#1 ) asm { eor#$55 tax } - *((byte*) SCREEN#0 + (byte) main::k#2) ← (byte) main::l#2 + *((byte*) SCREEN + (byte) main::k#2) ← (byte) main::l#2 (byte) main::l#1 ← (byte) main::l#2 + rangenext(0,$64) (bool~) main::$2 ← (byte) main::l#1 != rangelast(0,$64) if((bool~) main::$2) goto main::@6 @@ -66,7 +66,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -101,7 +100,7 @@ SYMBOL TABLE SSA (byte) main::l#1 (byte) main::l#2 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification @@ -116,7 +115,7 @@ Simple Condition (bool~) main::$1 [12] if((byte) main::i#1!=rangelast(0,$64)) go Simple Condition (bool~) main::$2 [21] if((byte) main::l#1!=rangelast(0,$64)) goto main::@6 Simple Condition (bool~) main::$3 [25] if((byte) main::k#1!=rangelast(0,$64)) goto main::@5 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#0 = 0 Constant (const byte) main::k#0 = 0 @@ -207,7 +206,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 [6] (byte) main::j#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::j#1 ) - [7] *((const byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::j#2 + [7] *((const byte*) SCREEN + (byte) main::i#4) ← (byte) main::j#2 [8] (byte) main::j#1 ← ++ (byte) main::j#2 [9] if((byte) main::j#1!=(byte) $65) goto main::@2 to:main::@3 @@ -221,7 +220,7 @@ main::@4: scope:[main] from main::@3 main::@6 main::@5: scope:[main] from main::@4 main::@5 [13] (byte) main::l#2 ← phi( main::@4/(byte) 0 main::@5/(byte) main::l#1 ) asm { eor#$55 tax } - [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 + [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [17] if((byte) main::l#1!=(byte) $65) goto main::@5 to:main::@6 @@ -235,7 +234,6 @@ main::@return: scope:[main] from main::@6 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -322,7 +320,7 @@ main: { jmp b2 // main::@2 b2: - // [7] *((const byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuz1=vbuz2 + // [7] *((const byte*) SCREEN + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z j ldy.z i sta SCREEN,y @@ -369,7 +367,7 @@ main: { // asm { eor#$55 tax } eor #$55 tax - // [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuz1=vbuz2 + // [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z l ldy.z k sta SCREEN,y @@ -402,9 +400,9 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ ma Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::k#4 main::k#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::l#2 main::l#1 ] Removing always clobbered register reg byte x as potential for zp ZP_BYTE:5 [ main::l#2 main::l#1 ] -Statement [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) always clobbers reg byte a Statement asm { eor#$55 tax } always clobbers reg byte a reg byte x -Statement [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#4 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::k#4 main::k#1 ] : zp ZP_BYTE:4 , reg byte y , @@ -471,7 +469,7 @@ main: { jmp b2 // main::@2 b2: - // [7] *((const byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) SCREEN + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // [8] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa clc @@ -514,7 +512,7 @@ main: { // asm { eor#$55 tax } eor #$55 tax - // [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuyy=vbuz1 + // [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z l sta SCREEN,y // [16] (byte) main::l#1 ← ++ (byte) main::l#2 -- vbuz1=_inc_vbuz1 @@ -587,8 +585,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -653,7 +650,7 @@ main: { // main::@2 b2: // SCREEN[i] = j - // [7] *((const byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa + // [7] *((const byte*) SCREEN + (byte) main::i#4) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // for(byte j: 0..100) // [8] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa @@ -690,7 +687,7 @@ main: { eor #$55 tax // SCREEN[k] = l - // [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuyy=vbuz1 + // [15] *((const byte*) SCREEN + (byte) main::k#4) ← (byte) main::l#2 -- pbuc1_derefidx_vbuyy=vbuz1 lda.z l sta SCREEN,y // for(byte l: 0..100) diff --git a/src/test/ref/inline-asm-clobber.sym b/src/test/ref/inline-asm-clobber.sym index 974091f76..c6d875d89 100644 --- a/src/test/ref/inline-asm-clobber.sym +++ b/src/test/ref/inline-asm-clobber.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/inline-asm-param.log b/src/test/ref/inline-asm-param.log index b39482995..1855b27e7 100644 --- a/src/test/ref/inline-asm-param.log +++ b/src/test/ref/inline-asm-param.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -33,7 +33,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -43,13 +42,13 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$0 [6] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [4] main::i#1 ← ++ main::i#2 to ++ @@ -109,7 +108,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -273,8 +271,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/inline-asm-param.sym b/src/test/ref/inline-asm-param.sym index 1c18669a4..35c81cf69 100644 --- a/src/test/ref/inline-asm-param.sym +++ b/src/test/ref/inline-asm-param.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/inline-function-if.cfg b/src/test/ref/inline-function-if.cfg index 3922788ea..e10219bb4 100644 --- a/src/test/ref/inline-function-if.cfg +++ b/src/test/ref/inline-function-if.cfg @@ -16,13 +16,13 @@ main::toUpper1: scope:[main] from main [5] phi() to:main::@1 main::@1: scope:[main] from main::toUpper1 - [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 + [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 to:main::toUpper2 main::toUpper2: scope:[main] from main::@1 [7] phi() to:main::@2 main::@2: scope:[main] from main::toUpper2 - [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 + [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 to:main::@return main::@return: scope:[main] from main::@2 [9] return diff --git a/src/test/ref/inline-function-if.log b/src/test/ref/inline-function-if.log index d22a42254..8c45b4e19 100644 --- a/src/test/ref/inline-function-if.log +++ b/src/test/ref/inline-function-if.log @@ -7,7 +7,7 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() @@ -37,7 +37,7 @@ main::toUpper1_@return: scope:[main] from main::toUpper1_@1 main::@1: scope:[main] from main::toUpper1_@return (byte) main::toUpper1_return#3 ← phi( main::toUpper1_@return/(byte) main::toUpper1_return#1 ) (byte~) main::$0 ← (byte) main::toUpper1_return#3 - *((byte*) screen#0 + (number) 0) ← (byte~) main::$0 + *((byte*) screen + (number) 0) ← (byte~) main::$0 (byte) main::toUpper2_ch#0 ← (byte) 'm' (bool) main::toUpper2_bo#0 ← false to:main::toUpper2 @@ -63,7 +63,7 @@ main::toUpper2_@return: scope:[main] from main::toUpper2_@1 main::@2: scope:[main] from main::toUpper2_@return (byte) main::toUpper2_return#3 ← phi( main::toUpper2_@return/(byte) main::toUpper2_return#1 ) (byte~) main::$1 ← (byte) main::toUpper2_return#3 - *((byte*) screen#0 + (number) 1) ← (byte~) main::$1 + *((byte*) screen + (number) 1) ← (byte~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 return @@ -129,14 +129,13 @@ SYMBOL TABLE SSA (byte) main::toUpper2_return#2 (byte) main::toUpper2_return#3 (byte*) screen -(byte*) screen#0 Adding number conversion cast (unumber) $40 in (byte) main::toUpper1_res#1 ← (byte) main::toUpper1_res#3 + (number) $40 -Adding number conversion cast (unumber) 0 in *((byte*) screen#0 + (number) 0) ← (byte~) main::$0 +Adding number conversion cast (unumber) 0 in *((byte*) screen + (number) 0) ← (byte~) main::$0 Adding number conversion cast (unumber) $40 in (byte) main::toUpper2_res#1 ← (byte) main::toUpper2_res#3 + (number) $40 -Adding number conversion cast (unumber) 1 in *((byte*) screen#0 + (number) 1) ← (byte~) main::$1 +Adding number conversion cast (unumber) 1 in *((byte*) screen + (number) 1) ← (byte~) main::$1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $40 @@ -159,7 +158,7 @@ Successful SSA optimization Pass2AliasElimination Rewriting ! if()-condition to reversed if() [5] (bool~) main::toUpper1_$0 ← ! (bool) main::toUpper1_bo#0 Rewriting ! if()-condition to reversed if() [20] (bool~) main::toUpper2_$0 ← ! (bool) main::toUpper2_bo#0 Successful SSA optimization Pass2ConditionalAndOrRewriting -Constant (const byte*) screen#0 = (byte*) 1024 +Constant (const byte*) screen = (byte*) 1024 Constant (const byte) main::toUpper1_ch#0 = 'c' Constant (const bool) main::toUpper1_bo#0 = true Constant (const byte) main::toUpper2_ch#0 = 'm' @@ -169,7 +168,7 @@ Removing PHI-reference to removed block (main::toUpper1) in block main::toUpper1 if() condition always true - replacing block destination [6] if((const bool) main::toUpper1_bo#0) goto main::toUpper1_@2 if() condition always false - eliminating [21] if((const bool) main::toUpper2_bo#0) goto main::toUpper2_@2 Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero screen#0 in [15] *((const byte*) screen#0 + (byte) 0) ← (byte) main::toUpper1_return#0 +Simplifying expression containing zero screen in [15] *((const byte*) screen + (byte) 0) ← (byte) main::toUpper1_return#0 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const bool) main::toUpper1_bo#0 Eliminating unused constant (const bool) main::toUpper2_bo#0 @@ -186,7 +185,7 @@ Constant right-side identified [1] (byte) main::toUpper1_return#0 ← (const byt Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) main::toUpper1_return#0 = main::toUpper1_ch#0+$40 Successful SSA optimization Pass2ConstantIdentification -Consolidated array index constant in *(screen#0+1) +Consolidated array index constant in *(screen+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -238,13 +237,13 @@ main::toUpper1: scope:[main] from main [5] phi() to:main::@1 main::@1: scope:[main] from main::toUpper1 - [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 + [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 to:main::toUpper2 main::toUpper2: scope:[main] from main::@1 [7] phi() to:main::@2 main::@2: scope:[main] from main::toUpper2 - [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 + [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 to:main::@return main::@return: scope:[main] from main::@2 [9] return @@ -261,7 +260,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::toUpper2_ch (byte) main::toUpper2_res (byte) main::toUpper2_return -(byte*) screen Initial phi equivalence classes Complete equivalence classes @@ -305,7 +303,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 lda #toUpper1_return sta screen // [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] @@ -316,7 +314,7 @@ main: { jmp b2 // main::@2 b2: - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 lda #toUpper2_ch sta screen+1 jmp breturn @@ -328,8 +326,8 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -376,7 +374,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 lda #toUpper1_return sta screen // [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] @@ -387,7 +385,7 @@ main: { jmp b2 // main::@2 b2: - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 lda #toUpper2_ch sta screen+1 jmp breturn @@ -448,8 +446,7 @@ FINAL SYMBOL TABLE (const byte) main::toUpper2_ch#0 toUpper2_ch = (byte) 'm' (byte) main::toUpper2_res (byte) main::toUpper2_return -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 @@ -480,14 +477,14 @@ main: { // main::toUpper1 // main::@1 // screen[0] = toUpper('c',true) - // [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::toUpper1_return#0 -- _deref_pbuc1=vbuc2 lda #toUpper1_return sta screen // [7] phi from main::@1 to main::toUpper2 [phi:main::@1->main::toUpper2] // main::toUpper2 // main::@2 // screen[1] = toUpper('m',false) - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::toUpper2_ch#0 -- _deref_pbuc1=vbuc2 lda #toUpper2_ch sta screen+1 // main::@return diff --git a/src/test/ref/inline-function-if.sym b/src/test/ref/inline-function-if.sym index 160b7542f..ca609f6c0 100644 --- a/src/test/ref/inline-function-if.sym +++ b/src/test/ref/inline-function-if.sym @@ -18,6 +18,5 @@ (const byte) main::toUpper2_ch#0 toUpper2_ch = (byte) 'm' (byte) main::toUpper2_res (byte) main::toUpper2_return -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 diff --git a/src/test/ref/inline-function-min.cfg b/src/test/ref/inline-function-min.cfg index 807c39a00..497f88aa3 100644 --- a/src/test/ref/inline-function-min.cfg +++ b/src/test/ref/inline-function-min.cfg @@ -16,19 +16,19 @@ main::sum1: scope:[main] from main [5] phi() to:main::@1 main::@1: scope:[main] from main::sum1 - [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 + [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 to:main::sum2 main::sum2: scope:[main] from main::@1 [7] phi() to:main::@2 main::@2: scope:[main] from main::sum2 - [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::sum2_return#0 + [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 to:main::sum3 main::sum3: scope:[main] from main::@2 [9] phi() to:main::@3 main::@3: scope:[main] from main::sum3 - [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 + [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 to:main::@return main::@return: scope:[main] from main::@3 [11] return diff --git a/src/test/ref/inline-function-min.log b/src/test/ref/inline-function-min.log index 2d293d018..197102cdf 100644 --- a/src/test/ref/inline-function-min.log +++ b/src/test/ref/inline-function-min.log @@ -9,7 +9,7 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() @@ -30,7 +30,7 @@ main::sum1_@return: scope:[main] from main::sum1 main::@1: scope:[main] from main::sum1_@return (byte) main::sum1_return#3 ← phi( main::sum1_@return/(byte) main::sum1_return#1 ) (byte~) main::$0 ← (byte) main::sum1_return#3 - *((byte*) screen#0 + (number) 0) ← (byte~) main::$0 + *((byte*) screen + (number) 0) ← (byte~) main::$0 (byte) main::sum2_a#0 ← (number) $a (byte) main::sum2_b#0 ← (number) 3 to:main::sum2 @@ -47,7 +47,7 @@ main::sum2_@return: scope:[main] from main::sum2 main::@2: scope:[main] from main::sum2_@return (byte) main::sum2_return#3 ← phi( main::sum2_@return/(byte) main::sum2_return#1 ) (byte~) main::$1 ← (byte) main::sum2_return#3 - *((byte*) screen#0 + (number) 1) ← (byte~) main::$1 + *((byte*) screen + (number) 1) ← (byte~) main::$1 (byte) main::sum3_a#0 ← (number) 4 (byte) main::sum3_b#0 ← (number) 8 to:main::sum3 @@ -64,7 +64,7 @@ main::sum3_@return: scope:[main] from main::sum3 main::@3: scope:[main] from main::sum3_@return (byte) main::sum3_return#3 ← phi( main::sum3_@return/(byte) main::sum3_return#1 ) (byte~) main::$2 ← (byte) main::sum3_return#3 - *((byte*) screen#0 + (number) 2) ← (byte~) main::$2 + *((byte*) screen + (number) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 return @@ -132,19 +132,18 @@ SYMBOL TABLE SSA (byte) main::sum3_return#2 (byte) main::sum3_return#3 (byte*) screen -(byte*) screen#0 Adding number conversion cast (unumber) 2 in (byte) main::sum1_a#0 ← (number) 2 Adding number conversion cast (unumber) 1 in (byte) main::sum1_b#0 ← (number) 1 -Adding number conversion cast (unumber) 0 in *((byte*) screen#0 + (number) 0) ← (byte~) main::$0 +Adding number conversion cast (unumber) 0 in *((byte*) screen + (number) 0) ← (byte~) main::$0 Adding number conversion cast (unumber) $a in (byte) main::sum2_a#0 ← (number) $a Adding number conversion cast (unumber) 3 in (byte) main::sum2_b#0 ← (number) 3 -Adding number conversion cast (unumber) 1 in *((byte*) screen#0 + (number) 1) ← (byte~) main::$1 +Adding number conversion cast (unumber) 1 in *((byte*) screen + (number) 1) ← (byte~) main::$1 Adding number conversion cast (unumber) 4 in (byte) main::sum3_a#0 ← (number) 4 Adding number conversion cast (unumber) 8 in (byte) main::sum3_b#0 ← (number) 8 -Adding number conversion cast (unumber) 2 in *((byte*) screen#0 + (number) 2) ← (byte~) main::$2 +Adding number conversion cast (unumber) 2 in *((byte*) screen + (number) 2) ← (byte~) main::$2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Inlining cast (byte) main::sum1_a#0 ← (unumber)(number) 2 Inlining cast (byte) main::sum1_b#0 ← (unumber)(number) 1 Inlining cast (byte) main::sum2_a#0 ← (unumber)(number) $a @@ -183,7 +182,7 @@ Alias (byte) main::sum3_a#0 = (byte) main::sum3_a#1 Alias (byte) main::sum3_b#0 = (byte) main::sum3_b#1 Alias (byte) main::sum3_return#0 = (byte~) main::sum3_$0 (byte) main::sum3_return#2 (byte) main::sum3_return#1 (byte) main::sum3_return#3 (byte~) main::$2 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) screen#0 = (byte*) 1024 +Constant (const byte*) screen = (byte*) 1024 Constant (const byte) main::sum1_a#0 = 2 Constant (const byte) main::sum1_b#0 = 1 Constant (const byte) main::sum2_a#0 = $a @@ -191,7 +190,7 @@ Constant (const byte) main::sum2_b#0 = 3 Constant (const byte) main::sum3_a#0 = 4 Constant (const byte) main::sum3_b#0 = 8 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero screen#0 in [10] *((const byte*) screen#0 + (byte) 0) ← (byte) main::sum1_return#0 +Simplifying expression containing zero screen in [10] *((const byte*) screen + (byte) 0) ← (byte) main::sum1_return#0 Successful SSA optimization PassNSimplifyExpressionWithZero Constant right-side identified [0] (byte) main::sum1_return#0 ← (const byte) main::sum1_a#0 + (const byte) main::sum1_b#0 Constant right-side identified [2] (byte) main::sum2_return#0 ← (const byte) main::sum2_a#0 + (const byte) main::sum2_b#0 @@ -201,8 +200,8 @@ Constant (const byte) main::sum1_return#0 = main::sum1_a#0+main::sum1_b#0 Constant (const byte) main::sum2_return#0 = main::sum2_a#0+main::sum2_b#0 Constant (const byte) main::sum3_return#0 = main::sum3_a#0+main::sum3_b#0 Successful SSA optimization Pass2ConstantIdentification -Consolidated array index constant in *(screen#0+1) -Consolidated array index constant in *(screen#0+2) +Consolidated array index constant in *(screen+1) +Consolidated array index constant in *(screen+2) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -252,19 +251,19 @@ main::sum1: scope:[main] from main [5] phi() to:main::@1 main::@1: scope:[main] from main::sum1 - [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 + [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 to:main::sum2 main::sum2: scope:[main] from main::@1 [7] phi() to:main::@2 main::@2: scope:[main] from main::sum2 - [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::sum2_return#0 + [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 to:main::sum3 main::sum3: scope:[main] from main::@2 [9] phi() to:main::@3 main::@3: scope:[main] from main::sum3 - [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 + [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 to:main::@return main::@return: scope:[main] from main::@3 [11] return @@ -282,7 +281,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::sum3_a (byte) main::sum3_b (byte) main::sum3_return -(byte*) screen Initial phi equivalence classes Complete equivalence classes @@ -332,7 +330,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 lda #sum1_return sta screen // [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] @@ -343,7 +341,7 @@ main: { jmp b2 // main::@2 b2: - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 lda #sum2_return sta screen+1 // [9] phi from main::@2 to main::sum3 [phi:main::@2->main::sum3] @@ -354,7 +352,7 @@ main: { jmp b3 // main::@3 b3: - // [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 lda #sum3_return sta screen+2 jmp breturn @@ -366,9 +364,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -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) 1) ← (const byte) main::sum2_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -421,7 +419,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 lda #sum1_return sta screen // [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] @@ -432,7 +430,7 @@ main: { jmp b2 // main::@2 b2: - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 lda #sum2_return sta screen+1 // [9] phi from main::@2 to main::sum3 [phi:main::@2->main::sum3] @@ -443,7 +441,7 @@ main: { jmp b3 // main::@3 b3: - // [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 lda #sum3_return sta screen+2 jmp breturn @@ -518,8 +516,7 @@ FINAL SYMBOL TABLE (const byte) main::sum3_b#0 sum3_b = (byte) 8 (byte) main::sum3_return (const byte) main::sum3_return#0 sum3_return = (const byte) main::sum3_a#0+(const byte) main::sum3_b#0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 @@ -556,21 +553,21 @@ main: { // main::sum1 // main::@1 // screen[0] = sum(2, 1) - // [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) screen) ← (const byte) main::sum1_return#0 -- _deref_pbuc1=vbuc2 lda #sum1_return sta screen // [7] phi from main::@1 to main::sum2 [phi:main::@1->main::sum2] // main::sum2 // main::@2 // screen[1] = sum(10, 3) - // [8] *((const byte*) screen#0+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) screen+(byte) 1) ← (const byte) main::sum2_return#0 -- _deref_pbuc1=vbuc2 lda #sum2_return sta screen+1 // [9] phi from main::@2 to main::sum3 [phi:main::@2->main::sum3] // main::sum3 // main::@3 // screen[2] = sum(4, 8) - // [10] *((const byte*) screen#0+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 + // [10] *((const byte*) screen+(byte) 2) ← (const byte) main::sum3_return#0 -- _deref_pbuc1=vbuc2 lda #sum3_return sta screen+2 // main::@return diff --git a/src/test/ref/inline-function-min.sym b/src/test/ref/inline-function-min.sym index 192ff2f06..7b9d636dd 100644 --- a/src/test/ref/inline-function-min.sym +++ b/src/test/ref/inline-function-min.sym @@ -27,6 +27,5 @@ (const byte) main::sum3_b#0 sum3_b = (byte) 8 (byte) main::sum3_return (const byte) main::sum3_return#0 sum3_return = (const byte) main::sum3_a#0+(const byte) main::sum3_b#0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 diff --git a/src/test/ref/inline-function-print.cfg b/src/test/ref/inline-function-print.cfg index 4e9d70dfd..75ed1799b 100644 --- a/src/test/ref/inline-function-print.cfg +++ b/src/test/ref/inline-function-print.cfg @@ -18,7 +18,7 @@ main::print1: scope:[main] from main main::print1_@1: scope:[main] from main::print1 main::print1_@2 [6] (byte) main::print1_j#2 ← phi( main::print1/(byte) 0 main::print1_@2/(byte) main::print1_j#1 ) [6] (byte) main::print1_i#2 ← phi( main::print1/(byte) 0 main::print1_@2/(byte) main::print1_i#1 ) - [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 + [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 to:main::print2 main::print2: scope:[main] from main::print1_@1 [8] phi() @@ -26,18 +26,18 @@ main::print2: scope:[main] from main::print1_@1 main::print2_@1: scope:[main] from main::print2 main::print2_@2 [9] (byte) main::print2_j#2 ← phi( main::print2/(byte) 0 main::print2_@2/(byte) main::print2_j#1 ) [9] (byte) main::print2_i#2 ← phi( main::print2/(byte) 0 main::print2_@2/(byte) main::print2_i#1 ) - [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 + [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 to:main::@return main::@return: scope:[main] from main::print2_@1 [11] return to:@return main::print2_@2: scope:[main] from main::print2_@1 - [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) + [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) [13] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte) 2 [14] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 to:main::print2_@1 main::print1_@2: scope:[main] from main::print1_@1 - [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) + [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) [16] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte) 2 [17] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 to:main::print1_@1 diff --git a/src/test/ref/inline-function-print.log b/src/test/ref/inline-function-print.log index cfd88cd9d..0aef36484 100644 --- a/src/test/ref/inline-function-print.log +++ b/src/test/ref/inline-function-print.log @@ -18,14 +18,14 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() main: scope:[main] from @2 - (byte*) main::hello#0 ← (const string) main::$3 - (byte*) main::print1_at#0 ← (byte*) screen#0 - (byte*) main::print1_msg#0 ← (byte*) main::hello#0 + (byte*) main::hello ← (const string) main::$3 + (byte*) main::print1_at#0 ← (byte*) screen + (byte*) main::print1_msg#0 ← (byte*) main::hello to:main::print1 main::print1: scope:[main] from main (byte*) main::print1_at#3 ← phi( main/(byte*) main::print1_at#0 ) @@ -51,9 +51,9 @@ main::print1_@2: scope:[main] from main::print1_@1 (byte) main::print1_i#1 ← ++ (byte) main::print1_i#3 to:main::print1_@1 main::@1: scope:[main] from main::print1_@1 - (byte*~) main::$1 ← (byte*) screen#0 + (number) 2*(number) $28 + (byte*~) main::$1 ← (byte*) screen + (number) 2*(number) $28 (byte*) main::print2_at#0 ← (byte*~) main::$1 - (byte*) main::print2_msg#0 ← (byte*) main::hello#0 + (byte*) main::print2_msg#0 ← (byte*) main::hello to:main::print2 main::print2: scope:[main] from main::@1 (byte*) main::print2_at#3 ← phi( main::@1/(byte*) main::print2_at#0 ) @@ -99,7 +99,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::hello -(byte*) main::hello#0 (label) main::print1 (bool~) main::print1_$0 (label) main::print1_@1 @@ -149,19 +148,18 @@ SYMBOL TABLE SSA (byte*) main::print2_msg#2 (byte*) main::print2_msg#3 (byte*) screen -(byte*) screen#0 Adding number conversion cast (unumber) 0 in (byte) main::print1_j#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::print1_i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::print1_$0 ← (number) 0 != *((byte*) main::print1_msg#1 + (byte) main::print1_i#2) Adding number conversion cast (unumber) 2 in (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (number) 2 -Adding number conversion cast (unumber) 2*$28 in (byte*~) main::$1 ← (byte*) screen#0 + (number) 2*(number) $28 +Adding number conversion cast (unumber) 2*$28 in (byte*~) main::$1 ← (byte*) screen + (number) 2*(number) $28 Adding number conversion cast (unumber) 0 in (byte) main::print2_j#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) main::print2_i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::print2_$0 ← (number) 0 != *((byte*) main::print2_msg#1 + (byte) main::print2_i#2) Adding number conversion cast (unumber) 2 in (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Inlining cast (byte) main::print1_j#0 ← (unumber)(number) 0 Inlining cast (byte) main::print1_i#0 ← (unumber)(number) 0 Inlining cast (byte) main::print2_j#0 ← (unumber)(number) 0 @@ -186,7 +184,7 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte*) main::hello#0 = (byte*) main::print1_msg#0 (byte*) main::print1_msg#3 (byte*) main::print2_msg#0 (byte*) main::print2_msg#3 +Alias (byte*) main::hello = (byte*) main::print1_msg#0 (byte*) main::print1_msg#3 (byte*) main::print2_msg#0 (byte*) main::print2_msg#3 Alias (byte*) main::print1_at#0 = (byte*) main::print1_at#3 Alias (byte*) main::print1_msg#1 = (byte*) main::print1_msg#2 Alias (byte) main::print1_i#2 = (byte) main::print1_i#3 @@ -198,34 +196,34 @@ Alias (byte) main::print2_i#2 = (byte) main::print2_i#3 Alias (byte*) main::print2_at#1 = (byte*) main::print2_at#2 Alias (byte) main::print2_j#2 = (byte) main::print2_j#3 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) main::print1_msg#1 (byte*) main::hello#0 +Identical Phi Values (byte*) main::print1_msg#1 (byte*) main::hello Identical Phi Values (byte*) main::print1_at#1 (byte*) main::print1_at#0 -Identical Phi Values (byte*) main::print2_msg#1 (byte*) main::hello#0 +Identical Phi Values (byte*) main::print2_msg#1 (byte*) main::hello Identical Phi Values (byte*) main::print2_at#1 (byte*) main::print2_at#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::print1_$0 [9] if((byte) 0!=*((byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 -Simple Condition (bool~) main::print2_$0 [22] if((byte) 0!=*((byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 +Simple Condition (bool~) main::print1_$0 [9] if((byte) 0!=*((byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 +Simple Condition (bool~) main::print2_$0 [22] if((byte) 0!=*((byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) screen#0 = (byte*) 1024 -Constant (const byte*) main::hello#0 = main::$3 +Constant (const byte*) screen = (byte*) 1024 +Constant (const byte*) main::hello = main::$3 Constant (const byte) main::print1_j#0 = 0 Constant (const byte) main::print1_i#0 = 0 Constant (const byte) main::print2_j#0 = 0 Constant (const byte) main::print2_i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::print1_at#0 = screen#0 +Constant (const byte*) main::print1_at#0 = screen Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [5] (byte*) main::print2_at#0 ← (const byte*) screen#0 + (byte)(number) 2*(number) $28 +Constant right-side identified [5] (byte*) main::print2_at#0 ← (const byte*) screen + (byte)(number) 2*(number) $28 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::print2_at#0 = screen#0+(byte)2*$28 +Constant (const byte*) main::print2_at#0 = screen+(byte)2*$28 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::print1_j#0 Inlining constant with var siblings (const byte) main::print1_i#0 Inlining constant with var siblings (const byte) main::print2_j#0 Inlining constant with var siblings (const byte) main::print2_i#0 Constant inlined main::print2_j#0 = (byte) 0 -Constant inlined main::print1_at#0 = (const byte*) screen#0 -Constant inlined main::$3 = (const byte*) main::hello#0 +Constant inlined main::print1_at#0 = (const byte*) screen +Constant inlined main::$3 = (const byte*) main::hello Constant inlined main::print2_i#0 = (byte) 0 Constant inlined main::print1_i#0 = (byte) 0 Constant inlined main::print1_j#0 = (byte) 0 @@ -278,7 +276,7 @@ main::print1: scope:[main] from main main::print1_@1: scope:[main] from main::print1 main::print1_@2 [6] (byte) main::print1_j#2 ← phi( main::print1/(byte) 0 main::print1_@2/(byte) main::print1_j#1 ) [6] (byte) main::print1_i#2 ← phi( main::print1/(byte) 0 main::print1_@2/(byte) main::print1_i#1 ) - [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 + [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 to:main::print2 main::print2: scope:[main] from main::print1_@1 [8] phi() @@ -286,18 +284,18 @@ main::print2: scope:[main] from main::print1_@1 main::print2_@1: scope:[main] from main::print2 main::print2_@2 [9] (byte) main::print2_j#2 ← phi( main::print2/(byte) 0 main::print2_@2/(byte) main::print2_j#1 ) [9] (byte) main::print2_i#2 ← phi( main::print2/(byte) 0 main::print2_@2/(byte) main::print2_i#1 ) - [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 + [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 to:main::@return main::@return: scope:[main] from main::print2_@1 [11] return to:@return main::print2_@2: scope:[main] from main::print2_@1 - [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) + [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) [13] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte) 2 [14] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 to:main::print2_@1 main::print1_@2: scope:[main] from main::print1_@1 - [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) + [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) [16] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte) 2 [17] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 to:main::print1_@1 @@ -305,7 +303,6 @@ main::print1_@2: scope:[main] from main::print1_@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::hello (byte*) main::print1_at (byte) main::print1_i (byte) main::print1_i#1 22.0 @@ -322,7 +319,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::print2_j#1 11.0 (byte) main::print2_j#2 11.0 (byte*) main::print2_msg -(byte*) screen Initial phi equivalence classes [ main::print1_i#2 main::print1_i#1 ] @@ -388,7 +384,7 @@ main: { jmp print1_b1 // main::print1_@1 print1_b1: - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda #0 ldy.z print1_i cmp hello,y @@ -409,7 +405,7 @@ main: { jmp print2_b1 // main::print2_@1 print2_b1: - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda #0 ldy.z print2_i cmp hello,y @@ -421,7 +417,7 @@ main: { rts // main::print2_@2 print2_b2: - // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z print2_i lda hello,y ldy.z print2_j @@ -440,7 +436,7 @@ main: { jmp print2_b1 // main::print1_@2 print1_b2: - // [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z print1_i lda hello,y ldy.z print1_j @@ -463,18 +459,18 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::print1_i#2 main::print1_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::print1_j#2 main::print1_j#1 ] -Statement [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::print2_i#2 main::print2_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::print2_j#2 main::print2_j#1 ] -Statement [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a -Statement [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a -Statement [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a -Statement [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a -Statement [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::print1_i#2 main::print1_i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::print1_j#2 main::print1_j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::print2_i#2 main::print2_i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -529,7 +525,7 @@ main: { jmp print1_b1 // main::print1_@1 print1_b1: - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print1_b2 @@ -547,7 +543,7 @@ main: { jmp print2_b1 // main::print2_@1 print2_b1: - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print2_b2 @@ -558,7 +554,7 @@ main: { rts // main::print2_@2 print2_b2: - // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta print2_at,x // [13] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 @@ -573,7 +569,7 @@ main: { jmp print2_b1 // main::print1_@2 print1_b2: - // [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta screen,x // [16] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte) 2 -- vbuxx=vbuxx_plus_2 @@ -630,8 +626,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (label) main::print1 (label) main::print1_@1 (label) main::print1_@2 @@ -647,7 +642,7 @@ FINAL SYMBOL TABLE (label) main::print2_@1 (label) main::print2_@2 (byte*) main::print2_at -(const byte*) main::print2_at#0 print2_at = (const byte*) screen#0+(byte)(number) 2*(number) $28 +(const byte*) main::print2_at#0 print2_at = (const byte*) screen+(byte)(number) 2*(number) $28 (byte) main::print2_i (byte) main::print2_i#1 reg byte y 22.0 (byte) main::print2_i#2 reg byte y 11.0 @@ -655,8 +650,7 @@ FINAL SYMBOL TABLE (byte) main::print2_j#1 reg byte x 11.0 (byte) main::print2_j#2 reg byte x 11.0 (byte*) main::print2_msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 reg byte y [ main::print1_i#2 main::print1_i#1 ] reg byte x [ main::print1_j#2 main::print1_j#1 ] @@ -695,7 +689,7 @@ main: { // main::print1_@1 print1_b1: // for(byte i=0; msg[i]; i++) - // [7] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [7] if((byte) 0!=*((const byte*) main::hello + (byte) main::print1_i#2)) goto main::print1_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print1_b2 @@ -709,7 +703,7 @@ main: { // main::print2_@1 print2_b1: // for(byte i=0; msg[i]; i++) - // [10] if((byte) 0!=*((const byte*) main::hello#0 + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 + // [10] if((byte) 0!=*((const byte*) main::hello + (byte) main::print2_i#2)) goto main::print2_@2 -- vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 lda #0 cmp hello,y bne print2_b2 @@ -720,7 +714,7 @@ main: { // main::print2_@2 print2_b2: // at[j] = msg[i] - // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [12] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta print2_at,x // j += 2 @@ -737,7 +731,7 @@ main: { // main::print1_@2 print1_b2: // at[j] = msg[i] - // [15] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [15] *((const byte*) screen + (byte) main::print1_j#2) ← *((const byte*) main::hello + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda hello,y sta screen,x // j += 2 diff --git a/src/test/ref/inline-function-print.sym b/src/test/ref/inline-function-print.sym index c8c987515..f7bae9c6f 100644 --- a/src/test/ref/inline-function-print.sym +++ b/src/test/ref/inline-function-print.sym @@ -3,8 +3,7 @@ (label) @end (void()) main() (label) main::@return -(byte*) main::hello -(const byte*) main::hello#0 hello = (string) "hello world!" +(const byte*) main::hello hello = (string) "hello world!" (label) main::print1 (label) main::print1_@1 (label) main::print1_@2 @@ -20,7 +19,7 @@ (label) main::print2_@1 (label) main::print2_@2 (byte*) main::print2_at -(const byte*) main::print2_at#0 print2_at = (const byte*) screen#0+(byte)(number) 2*(number) $28 +(const byte*) main::print2_at#0 print2_at = (const byte*) screen+(byte)(number) 2*(number) $28 (byte) main::print2_i (byte) main::print2_i#1 reg byte y 22.0 (byte) main::print2_i#2 reg byte y 11.0 @@ -28,8 +27,7 @@ (byte) main::print2_j#1 reg byte x 11.0 (byte) main::print2_j#2 reg byte x 11.0 (byte*) main::print2_msg -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 reg byte y [ main::print1_i#2 main::print1_i#1 ] reg byte x [ main::print1_j#2 main::print1_j#1 ] diff --git a/src/test/ref/inline-function.cfg b/src/test/ref/inline-function.cfg index dee6e8708..a468f7fb2 100644 --- a/src/test/ref/inline-function.cfg +++ b/src/test/ref/inline-function.cfg @@ -13,22 +13,22 @@ main: scope:[main] from @1 asm { sei } to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 + [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 to:main::toD0181 main::toD0181: scope:[main] from main::@1 [6] phi() to:main::@3 main::@3: scope:[main] from main::toD0181 - [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 - [8] *((const byte*) BGCOL#0) ← (byte) 6 + [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 + [8] *((const byte*) BGCOL) ← (byte) 6 to:main::@2 main::@2: scope:[main] from main::@2 main::@3 - [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 + [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 to:main::toD0182 main::toD0182: scope:[main] from main::@2 [10] phi() to:main::@4 main::@4: scope:[main] from main::toD0182 - [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 - [12] *((const byte*) BGCOL#0) ← (byte) $b + [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 + [12] *((const byte*) BGCOL) ← (byte) $b to:main::@1 diff --git a/src/test/ref/inline-function.log b/src/test/ref/inline-function.log index 92549335d..5477e13ca 100644 --- a/src/test/ref/inline-function.log +++ b/src/test/ref/inline-function.log @@ -25,12 +25,12 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) D018#0 ← ((byte*)) (number) $d018 - (byte*) BGCOL#0 ← ((byte*)) (number) $d021 - (byte*) screen#0 ← ((byte*)) (number) $400 - (byte*) charset1#0 ← ((byte*)) (number) $1000 - (byte*) charset2#0 ← ((byte*)) (number) $1800 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) D018 ← ((byte*)) (number) $d018 + (byte*) BGCOL ← ((byte*)) (number) $d021 + (byte*) screen ← ((byte*)) (number) $400 + (byte*) charset1 ← ((byte*)) (number) $1000 + (byte*) charset2 ← ((byte*)) (number) $1800 to:@2 (void()) main() @@ -41,12 +41,12 @@ main::@1: scope:[main] from main main::@20 if(true) goto main::@4 to:main::@return main::@4: scope:[main] from main::@1 main::@4 - (bool~) main::$0 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$0 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$0) goto main::@4 to:main::@6 main::@6: scope:[main] from main::@4 - (byte*) main::toD0181_screen#0 ← (byte*) screen#0 - (byte*) main::toD0181_charset#0 ← (byte*) charset1#0 + (byte*) main::toD0181_screen#0 ← (byte*) screen + (byte*) main::toD0181_charset#0 ← (byte*) charset1 to:main::toD0181 main::toD0181: scope:[main] from main::@6 (byte*) main::toD0181_charset#1 ← phi( main::@6/(byte*) main::toD0181_charset#0 ) @@ -66,16 +66,16 @@ main::toD0181_@return: scope:[main] from main::toD0181 main::@19: scope:[main] from main::toD0181_@return (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$1 ← (byte) main::toD0181_return#3 - *((byte*) D018#0) ← (byte~) main::$1 - *((byte*) BGCOL#0) ← (number) 6 + *((byte*) D018) ← (byte~) main::$1 + *((byte*) BGCOL) ← (number) 6 to:main::@10 main::@10: scope:[main] from main::@10 main::@19 - (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $62 + (bool~) main::$2 ← *((byte*) RASTER) != (number) $62 if((bool~) main::$2) goto main::@10 to:main::@12 main::@12: scope:[main] from main::@10 - (byte*) main::toD0182_screen#0 ← (byte*) screen#0 - (byte*) main::toD0182_charset#0 ← (byte*) charset2#0 + (byte*) main::toD0182_screen#0 ← (byte*) screen + (byte*) main::toD0182_charset#0 ← (byte*) charset2 to:main::toD0182 main::toD0182: scope:[main] from main::@12 (byte*) main::toD0182_charset#1 ← phi( main::@12/(byte*) main::toD0182_charset#0 ) @@ -95,8 +95,8 @@ main::toD0182_@return: scope:[main] from main::toD0182 main::@20: scope:[main] from main::toD0182_@return (byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 ) (byte~) main::$3 ← (byte) main::toD0182_return#3 - *((byte*) D018#0) ← (byte~) main::$3 - *((byte*) BGCOL#0) ← (number) $b + *((byte*) D018) ← (byte~) main::$3 + *((byte*) BGCOL) ← (number) $b to:main::@1 main::@return: scope:[main] from main::@1 return @@ -114,15 +114,10 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BGCOL -(byte*) BGCOL#0 (byte*) D018 -(byte*) D018#0 (byte*) RASTER -(byte*) RASTER#0 (byte*) charset1 -(byte*) charset1#0 (byte*) charset2 -(byte*) charset2#0 (void()) main() (bool~) main::$0 (byte~) main::$1 @@ -175,37 +170,36 @@ SYMBOL TABLE SSA (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1 (byte*) screen -(byte*) screen#0 -Adding number conversion cast (unumber) $ff in (bool~) main::$0 ← *((byte*) RASTER#0) != (number) $ff +Adding number conversion cast (unumber) $ff in (bool~) main::$0 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) $40 in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 / (number) $40 Adding number conversion cast (unumber) main::toD0181_$1 in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 / (unumber)(number) $40 Adding number conversion cast (unumber) $400 in (number~) main::toD0181_$3 ← (word~) main::toD0181_$2 / (number) $400 Adding number conversion cast (unumber) main::toD0181_$3 in (number~) main::toD0181_$3 ← (word~) main::toD0181_$2 / (unumber)(number) $400 Adding number conversion cast (unumber) main::toD0181_$4 in (number~) main::toD0181_$4 ← (unumber~) main::toD0181_$1 | (unumber~) main::toD0181_$3 -Adding number conversion cast (unumber) 6 in *((byte*) BGCOL#0) ← (number) 6 -Adding number conversion cast (unumber) $62 in (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $62 +Adding number conversion cast (unumber) 6 in *((byte*) BGCOL) ← (number) 6 +Adding number conversion cast (unumber) $62 in (bool~) main::$2 ← *((byte*) RASTER) != (number) $62 Adding number conversion cast (unumber) $40 in (number~) main::toD0182_$1 ← (word~) main::toD0182_$0 / (number) $40 Adding number conversion cast (unumber) main::toD0182_$1 in (number~) main::toD0182_$1 ← (word~) main::toD0182_$0 / (unumber)(number) $40 Adding number conversion cast (unumber) $400 in (number~) main::toD0182_$3 ← (word~) main::toD0182_$2 / (number) $400 Adding number conversion cast (unumber) main::toD0182_$3 in (number~) main::toD0182_$3 ← (word~) main::toD0182_$2 / (unumber)(number) $400 Adding number conversion cast (unumber) main::toD0182_$4 in (number~) main::toD0182_$4 ← (unumber~) main::toD0182_$1 | (unumber~) main::toD0182_$3 -Adding number conversion cast (unumber) $b in *((byte*) BGCOL#0) ← (number) $b +Adding number conversion cast (unumber) $b in *((byte*) BGCOL) ← (number) $b Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) D018#0 ← (byte*)(number) $d018 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021 -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 -Inlining cast (byte*) charset1#0 ← (byte*)(number) $1000 -Inlining cast (byte*) charset2#0 ← (byte*)(number) $1800 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) D018 ← (byte*)(number) $d018 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 +Inlining cast (byte*) screen ← (byte*)(number) $400 +Inlining cast (byte*) charset1 ← (byte*)(number) $1000 +Inlining cast (byte*) charset2 ← (byte*)(number) $1800 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$2 ← (word)(byte*) main::toD0181_charset#1 Inlining cast (byte~) main::toD0181_$5 ← (byte)(unumber~) main::toD0181_$4 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 6 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 6 Inlining cast (word~) main::toD0182_$0 ← (word)(byte*) main::toD0182_screen#1 Inlining cast (word~) main::toD0182_$2 ← (word)(byte*) main::toD0182_charset#1 Inlining cast (byte~) main::toD0182_$5 ← (byte)(unumber~) main::toD0182_$4 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) $b +Inlining cast *((byte*) BGCOL) ← (unumber)(number) $b Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53266 Simplifying constant pointer cast (byte*) 53272 @@ -244,20 +238,20 @@ Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 Alias (byte*) main::toD0182_charset#0 = (byte*) main::toD0182_charset#1 Alias (byte) main::toD0182_return#0 = (byte~) main::toD0182_$5 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$3 Successful SSA optimization Pass2AliasElimination -Simple Condition (bool~) main::$0 [9] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@4 -Simple Condition (bool~) main::$2 [27] if(*((byte*) RASTER#0)!=(byte) $62) goto main::@10 +Simple Condition (bool~) main::$0 [9] if(*((byte*) RASTER)!=(byte) $ff) goto main::@4 +Simple Condition (bool~) main::$2 [27] if(*((byte*) RASTER)!=(byte) $62) goto main::@10 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) D018#0 = (byte*) 53272 -Constant (const byte*) BGCOL#0 = (byte*) 53281 -Constant (const byte*) screen#0 = (byte*) 1024 -Constant (const byte*) charset1#0 = (byte*) 4096 -Constant (const byte*) charset2#0 = (byte*) 6144 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) D018 = (byte*) 53272 +Constant (const byte*) BGCOL = (byte*) 53281 +Constant (const byte*) screen = (byte*) 1024 +Constant (const byte*) charset1 = (byte*) 4096 +Constant (const byte*) charset2 = (byte*) 6144 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::toD0181_screen#0 = screen#0 -Constant (const byte*) main::toD0181_charset#0 = charset1#0 -Constant (const byte*) main::toD0182_screen#0 = screen#0 -Constant (const byte*) main::toD0182_charset#0 = charset2#0 +Constant (const byte*) main::toD0181_screen#0 = screen +Constant (const byte*) main::toD0181_charset#0 = charset1 +Constant (const byte*) main::toD0182_screen#0 = screen +Constant (const byte*) main::toD0182_charset#0 = charset2 Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [13] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_charset#0 in [15] (word~) main::toD0181_$2 ← (word)(const byte*) main::toD0181_charset#0 @@ -295,20 +289,20 @@ Successful SSA optimization Pass2ConstantValues Constant (const byte) main::toD0181_return#0 = (byte)main::toD0181_$4 Constant (const byte) main::toD0182_return#0 = (byte)main::toD0182_$4 Successful SSA optimization Pass2ConstantIdentification -Constant inlined main::toD0181_screen#0 = (const byte*) screen#0 -Constant inlined main::toD0182_charset#0 = (const byte*) charset2#0 -Constant inlined main::toD0181_$2 = (word)(const byte*) charset1#0 -Constant inlined main::toD0182_$4 = (word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset2#0/(word) $400 -Constant inlined main::toD0181_$1 = (word)(const byte*) screen#0/(byte) $40 -Constant inlined main::toD0181_$0 = (word)(const byte*) screen#0 -Constant inlined main::toD0182_$0 = (word)(const byte*) screen#0 -Constant inlined main::toD0182_$1 = (word)(const byte*) screen#0/(byte) $40 -Constant inlined main::toD0182_$2 = (word)(const byte*) charset2#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset1#0/(word) $400 -Constant inlined main::toD0181_$3 = (word)(const byte*) charset1#0/(word) $400 -Constant inlined main::toD0182_$3 = (word)(const byte*) charset2#0/(word) $400 -Constant inlined main::toD0182_screen#0 = (const byte*) screen#0 -Constant inlined main::toD0181_charset#0 = (const byte*) charset1#0 +Constant inlined main::toD0181_screen#0 = (const byte*) screen +Constant inlined main::toD0182_charset#0 = (const byte*) charset2 +Constant inlined main::toD0181_$2 = (word)(const byte*) charset1 +Constant inlined main::toD0182_$4 = (word)(const byte*) screen/(byte) $40|(word)(const byte*) charset2/(word) $400 +Constant inlined main::toD0181_$1 = (word)(const byte*) screen/(byte) $40 +Constant inlined main::toD0181_$0 = (word)(const byte*) screen +Constant inlined main::toD0182_$0 = (word)(const byte*) screen +Constant inlined main::toD0182_$1 = (word)(const byte*) screen/(byte) $40 +Constant inlined main::toD0182_$2 = (word)(const byte*) charset2 +Constant inlined main::toD0181_$4 = (word)(const byte*) screen/(byte) $40|(word)(const byte*) charset1/(word) $400 +Constant inlined main::toD0181_$3 = (word)(const byte*) charset1/(word) $400 +Constant inlined main::toD0182_$3 = (word)(const byte*) charset2/(word) $400 +Constant inlined main::toD0182_screen#0 = (const byte*) screen +Constant inlined main::toD0181_charset#0 = (const byte*) charset1 Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -359,33 +353,28 @@ main: scope:[main] from @1 asm { sei } to:main::@1 main::@1: scope:[main] from main main::@1 main::@4 - [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 + [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 to:main::toD0181 main::toD0181: scope:[main] from main::@1 [6] phi() to:main::@3 main::@3: scope:[main] from main::toD0181 - [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 - [8] *((const byte*) BGCOL#0) ← (byte) 6 + [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 + [8] *((const byte*) BGCOL) ← (byte) 6 to:main::@2 main::@2: scope:[main] from main::@2 main::@3 - [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 + [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 to:main::toD0182 main::toD0182: scope:[main] from main::@2 [10] phi() to:main::@4 main::@4: scope:[main] from main::toD0182 - [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 - [12] *((const byte*) BGCOL#0) ← (byte) $b + [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 + [12] *((const byte*) BGCOL) ← (byte) $b to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL -(byte*) D018 -(byte*) RASTER -(byte*) charset1 -(byte*) charset2 (void()) main() (byte*) main::toD0181_charset (byte) main::toD0181_return @@ -393,7 +382,6 @@ VARIABLE REGISTER WEIGHTS (byte*) main::toD0182_charset (byte) main::toD0182_return (byte*) main::toD0182_screen -(byte*) screen Initial phi equivalence classes Complete equivalence classes @@ -437,7 +425,7 @@ main: { jmp b1 // main::@1 b1: - // [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 @@ -449,16 +437,16 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 lda #toD0181_return sta D018 - // [8] *((const byte*) BGCOL#0) ← (byte) 6 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) BGCOL) ← (byte) 6 -- _deref_pbuc1=vbuc2 lda #6 sta BGCOL jmp b2 // main::@2 b2: - // [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$62 cmp RASTER bne b2 @@ -470,10 +458,10 @@ main: { jmp b4 // main::@4 b4: - // [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + // [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 lda #toD0182_return sta D018 - // [12] *((const byte*) BGCOL#0) ← (byte) $b -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) $b -- _deref_pbuc1=vbuc2 lda #$b sta BGCOL jmp b1 @@ -481,12 +469,12 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) BGCOL#0) ← (byte) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) BGCOL#0) ← (byte) $b [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) BGCOL) ← (byte) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) BGCOL) ← (byte) $b [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -533,7 +521,7 @@ main: { jmp b1 // main::@1 b1: - // [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 @@ -545,16 +533,16 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 lda #toD0181_return sta D018 - // [8] *((const byte*) BGCOL#0) ← (byte) 6 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) BGCOL) ← (byte) 6 -- _deref_pbuc1=vbuc2 lda #6 sta BGCOL jmp b2 // main::@2 b2: - // [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$62 cmp RASTER bne b2 @@ -566,10 +554,10 @@ main: { jmp b4 // main::@4 b4: - // [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + // [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 lda #toD0182_return sta D018 - // [12] *((const byte*) BGCOL#0) ← (byte) $b -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) $b -- _deref_pbuc1=vbuc2 lda #$b sta BGCOL jmp b1 @@ -608,16 +596,11 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) charset1 -(const byte*) charset1#0 charset1 = (byte*) 4096 -(byte*) charset2 -(const byte*) charset2#0 charset2 = (byte*) 6144 +(const byte*) BGCOL BGCOL = (byte*) 53281 +(const byte*) D018 D018 = (byte*) 53272 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) charset1 charset1 = (byte*) 4096 +(const byte*) charset2 charset2 = (byte*) 6144 (void()) main() (label) main::@1 (label) main::@2 @@ -626,15 +609,14 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_charset (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = (byte)(word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset1#0/(word) $400 +(const byte) main::toD0181_return#0 toD0181_return = (byte)(word)(const byte*) screen/(byte) $40|(word)(const byte*) charset1/(word) $400 (byte*) main::toD0181_screen (label) main::toD0182 (byte*) main::toD0182_charset (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = (byte)(word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset2#0/(word) $400 +(const byte) main::toD0182_return#0 toD0182_return = (byte)(word)(const byte*) screen/(byte) $40|(word)(const byte*) charset2/(word) $400 (byte*) main::toD0182_screen -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 @@ -671,7 +653,7 @@ main: { // main::@1 b1: // while(*RASTER!=$ff) - // [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [5] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b1 @@ -679,17 +661,17 @@ main: { // main::toD0181 // main::@3 // *D018 = toD018(screen, charset1) - // [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 lda #toD0181_return sta D018 // *BGCOL = $6 - // [8] *((const byte*) BGCOL#0) ← (byte) 6 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) BGCOL) ← (byte) 6 -- _deref_pbuc1=vbuc2 lda #6 sta BGCOL // main::@2 b2: // while(*RASTER!=$62) - // [9] if(*((const byte*) RASTER#0)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [9] if(*((const byte*) RASTER)!=(byte) $62) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$62 cmp RASTER bne b2 @@ -697,11 +679,11 @@ main: { // main::toD0182 // main::@4 // *D018 = toD018(screen, charset2) - // [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + // [11] *((const byte*) D018) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 lda #toD0182_return sta D018 // *BGCOL = $b - // [12] *((const byte*) BGCOL#0) ← (byte) $b -- _deref_pbuc1=vbuc2 + // [12] *((const byte*) BGCOL) ← (byte) $b -- _deref_pbuc1=vbuc2 lda #$b sta BGCOL jmp b1 diff --git a/src/test/ref/inline-function.sym b/src/test/ref/inline-function.sym index f8b4141f8..649ff2aec 100644 --- a/src/test/ref/inline-function.sym +++ b/src/test/ref/inline-function.sym @@ -1,16 +1,11 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 -(byte*) D018 -(const byte*) D018#0 D018 = (byte*) 53272 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) charset1 -(const byte*) charset1#0 charset1 = (byte*) 4096 -(byte*) charset2 -(const byte*) charset2#0 charset2 = (byte*) 6144 +(const byte*) BGCOL BGCOL = (byte*) 53281 +(const byte*) D018 D018 = (byte*) 53272 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) charset1 charset1 = (byte*) 4096 +(const byte*) charset2 charset2 = (byte*) 6144 (void()) main() (label) main::@1 (label) main::@2 @@ -19,13 +14,12 @@ (label) main::toD0181 (byte*) main::toD0181_charset (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = (byte)(word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset1#0/(word) $400 +(const byte) main::toD0181_return#0 toD0181_return = (byte)(word)(const byte*) screen/(byte) $40|(word)(const byte*) charset1/(word) $400 (byte*) main::toD0181_screen (label) main::toD0182 (byte*) main::toD0182_charset (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = (byte)(word)(const byte*) screen#0/(byte) $40|(word)(const byte*) charset2#0/(word) $400 +(const byte) main::toD0182_return#0 toD0182_return = (byte)(word)(const byte*) screen/(byte) $40|(word)(const byte*) charset2/(word) $400 (byte*) main::toD0182_screen -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 diff --git a/src/test/ref/inline-kasm-clobber.cfg b/src/test/ref/inline-kasm-clobber.cfg index e878d6c3d..5d4812452 100644 --- a/src/test/ref/inline-kasm-clobber.cfg +++ b/src/test/ref/inline-kasm-clobber.cfg @@ -20,7 +20,7 @@ main::@2: scope:[main] from main::@1 main::@4 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [7] (byte) main::m#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::m#1 ) - kickasm( uses SCREEN#0) {{ lda #0 + kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} diff --git a/src/test/ref/inline-kasm-clobber.log b/src/test/ref/inline-kasm-clobber.log index 27268509d..ada9f428c 100644 --- a/src/test/ref/inline-kasm-clobber.log +++ b/src/test/ref/inline-kasm-clobber.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -23,7 +23,7 @@ main::@3: scope:[main] from main::@2 main::@3 (byte) main::k#4 ← phi( main::@2/(byte) main::k#5 main::@3/(byte) main::k#4 ) (byte) main::l#3 ← phi( main::@2/(byte) main::l#4 main::@3/(byte) main::l#3 ) (byte) main::m#2 ← phi( main::@2/(byte) main::m#0 main::@3/(byte) main::m#1 ) - kickasm( uses SCREEN#0) {{ lda #0 + kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} @@ -60,7 +60,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -90,7 +89,7 @@ SYMBOL TABLE SSA (byte) main::m#1 (byte) main::m#2 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification @@ -106,7 +105,7 @@ Simple Condition (bool~) main::$0 [10] if((byte) main::m#1!=rangelast(0,$a)) got Simple Condition (bool~) main::$1 [14] if((byte) main::l#1!=rangelast(0,$a)) goto main::@2 Simple Condition (bool~) main::$2 [18] if((byte) main::k#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::k#0 = 0 Constant (const byte) main::l#0 = 0 Constant (const byte) main::m#0 = 0 @@ -184,7 +183,7 @@ main::@2: scope:[main] from main::@1 main::@4 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [7] (byte) main::m#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::m#1 ) - kickasm( uses SCREEN#0) {{ lda #0 + kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} @@ -205,7 +204,6 @@ main::@return: scope:[main] from main::@5 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::k (byte) main::k#1 16.5 @@ -296,7 +294,7 @@ main: { jmp b3 // main::@3 b3: - // kickasm( uses SCREEN#0) {{ lda #0 ldx #0 sta SCREEN,x }} + // kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} lda #0 ldx #0 sta SCREEN,x @@ -334,7 +332,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement kickasm( uses SCREEN#0) {{ lda #0 +Statement kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} always clobbers reg byte a reg byte x @@ -344,7 +342,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ ma Removing always clobbered register reg byte x as potential for zp ZP_BYTE:3 [ main::l#4 main::l#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::m#2 main::m#1 ] Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::m#2 main::m#1 ] -Statement kickasm( uses SCREEN#0) {{ lda #0 +Statement kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} always clobbers reg byte a reg byte x @@ -427,7 +425,7 @@ main: { jmp b3 // main::@3 b3: - // kickasm( uses SCREEN#0) {{ lda #0 ldx #0 sta SCREEN,x }} + // kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} lda #0 ldx #0 sta SCREEN,x @@ -508,8 +506,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -578,7 +575,7 @@ main: { // main::@3 b3: // kickasm - // kickasm( uses SCREEN#0) {{ lda #0 ldx #0 sta SCREEN,x }} + // kickasm( uses SCREEN) {{ lda #0 ldx #0 sta SCREEN,x }} lda #0 ldx #0 sta SCREEN,x diff --git a/src/test/ref/inline-kasm-clobber.sym b/src/test/ref/inline-kasm-clobber.sym index ca2ed830f..5387d4c6a 100644 --- a/src/test/ref/inline-kasm-clobber.sym +++ b/src/test/ref/inline-kasm-clobber.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/inline-word-0.cfg b/src/test/ref/inline-word-0.cfg index 69951ec56..83f5b90a8 100644 --- a/src/test/ref/inline-word-0.cfg +++ b/src/test/ref/inline-word-0.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/inline-word-0.log b/src/test/ref/inline-word-0.log index 4f511aa73..2a6daba1b 100644 --- a/src/test/ref/inline-word-0.log +++ b/src/test/ref/inline-word-0.log @@ -8,9 +8,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (word) main::w#0 ← ((word)) { (byte) 2, (byte) 1 } - (word*) main::screen#0 ← ((word*)) (number) $400 + (word*) main::screen ← ((word*)) (number) $400 (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD - *((word*) main::screen#0 + (number~) main::$0) ← (word) main::w#0 + *((word*) main::screen + (number~) main::$0) ← (word) main::w#0 to:main::@return main::@return: scope:[main] from main return @@ -32,7 +32,6 @@ SYMBOL TABLE SSA (number~) main::$0 (label) main::@return (word*) main::screen -(word*) main::screen#0 (word) main::w (word) main::w#0 @@ -41,7 +40,7 @@ Successful SSA optimization Pass2FixInlineConstructors Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) main::screen#0 ← (word*)(number) $400 +Inlining cast (word*) main::screen ← (word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast (byte) 2 Simplifying constant integer cast (byte) 1 @@ -56,12 +55,12 @@ Successful SSA optimization Pass2AliasElimination Constant right-side identified [0] (word) main::w#0 ← (byte) 2 w= (byte) 1 Constant right-side identified [3] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word*) main::screen#0 = (word*) 1024 +Constant (const word*) main::screen = (word*) 1024 Constant (const byte) main::$0 = 0*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero main::screen#0 in [4] *((const word*) main::screen#0 + (const byte) main::$0) ← (word) main::w#0 +Simplifying expression containing zero main::screen in [4] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$0 Eliminating unused constant (const byte) SIZEOF_WORD @@ -107,7 +106,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return @@ -116,7 +115,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(word*) main::screen (word) main::w Initial phi equivalence classes @@ -149,7 +147,7 @@ bend: main: { .label screen = $400 .const w = 2*$100+1 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -163,7 +161,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -198,7 +196,7 @@ bend: main: { .label screen = $400 .const w = 2*$100+1 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -235,8 +233,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 2*(word) $100+(byte) 1 @@ -263,7 +260,7 @@ main: { .label screen = $400 .const w = 2*$100+1 // screen[0] = w - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w diff --git a/src/test/ref/inline-word-0.sym b/src/test/ref/inline-word-0.sym index 9ebe3074b..fa5019b77 100644 --- a/src/test/ref/inline-word-0.sym +++ b/src/test/ref/inline-word-0.sym @@ -3,8 +3,7 @@ (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 2*(word) $100+(byte) 1 diff --git a/src/test/ref/inline-word-1.cfg b/src/test/ref/inline-word-1.cfg index 69951ec56..83f5b90a8 100644 --- a/src/test/ref/inline-word-1.cfg +++ b/src/test/ref/inline-word-1.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/inline-word-1.log b/src/test/ref/inline-word-1.log index e9b8be7d8..e0e7885f8 100644 --- a/src/test/ref/inline-word-1.log +++ b/src/test/ref/inline-word-1.log @@ -8,9 +8,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (word) main::w#0 ← ((word)) { (number) 1, (number) 2 } - (word*) main::screen#0 ← ((word*)) (number) $400 + (word*) main::screen ← ((word*)) (number) $400 (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD - *((word*) main::screen#0 + (number~) main::$0) ← (word) main::w#0 + *((word*) main::screen + (number~) main::$0) ← (word) main::w#0 to:main::@return main::@return: scope:[main] from main return @@ -32,7 +32,6 @@ SYMBOL TABLE SSA (number~) main::$0 (label) main::@return (word*) main::screen -(word*) main::screen#0 (word) main::w (word) main::w#0 @@ -41,7 +40,7 @@ Successful SSA optimization Pass2FixInlineConstructors Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) main::screen#0 ← (word*)(number) $400 +Inlining cast (word*) main::screen ← (word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 1 Simplifying constant integer cast 2 @@ -56,12 +55,12 @@ Successful SSA optimization Pass2AliasElimination Constant right-side identified [0] (word) main::w#0 ← (byte) 1 w= (byte) 2 Constant right-side identified [3] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word*) main::screen#0 = (word*) 1024 +Constant (const word*) main::screen = (word*) 1024 Constant (const byte) main::$0 = 0*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero main::screen#0 in [4] *((const word*) main::screen#0 + (const byte) main::$0) ← (word) main::w#0 +Simplifying expression containing zero main::screen in [4] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$0 Eliminating unused constant (const byte) SIZEOF_WORD @@ -107,7 +106,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return @@ -116,7 +115,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(word*) main::screen (word) main::w Initial phi equivalence classes @@ -149,7 +147,7 @@ bend: main: { .label screen = $400 .const w = 1*$100+2 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -163,7 +161,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -198,7 +196,7 @@ bend: main: { .label screen = $400 .const w = 1*$100+2 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -235,8 +233,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2 @@ -263,7 +260,7 @@ main: { .label screen = $400 .const w = 1*$100+2 // screen[0] = w - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w diff --git a/src/test/ref/inline-word-1.sym b/src/test/ref/inline-word-1.sym index 29a74e377..9733c4dd3 100644 --- a/src/test/ref/inline-word-1.sym +++ b/src/test/ref/inline-word-1.sym @@ -3,8 +3,7 @@ (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2 diff --git a/src/test/ref/inline-word-2.cfg b/src/test/ref/inline-word-2.cfg index 69951ec56..83f5b90a8 100644 --- a/src/test/ref/inline-word-2.cfg +++ b/src/test/ref/inline-word-2.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/inline-word-2.log b/src/test/ref/inline-word-2.log index 9573cc6e1..5fa1f87b4 100644 --- a/src/test/ref/inline-word-2.log +++ b/src/test/ref/inline-word-2.log @@ -8,9 +8,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (word) main::w#0 ← ((word)) { (number) 1, (byte) 2 } - (word*) main::screen#0 ← ((word*)) (number) $400 + (word*) main::screen ← ((word*)) (number) $400 (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD - *((word*) main::screen#0 + (number~) main::$0) ← (word) main::w#0 + *((word*) main::screen + (number~) main::$0) ← (word) main::w#0 to:main::@return main::@return: scope:[main] from main return @@ -32,7 +32,6 @@ SYMBOL TABLE SSA (number~) main::$0 (label) main::@return (word*) main::screen -(word*) main::screen#0 (word) main::w (word) main::w#0 @@ -41,7 +40,7 @@ Successful SSA optimization Pass2FixInlineConstructors Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) main::screen#0 ← (word*)(number) $400 +Inlining cast (word*) main::screen ← (word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 1 Simplifying constant integer cast (byte) 2 @@ -56,12 +55,12 @@ Successful SSA optimization Pass2AliasElimination Constant right-side identified [0] (word) main::w#0 ← (byte) 1 w= (byte) 2 Constant right-side identified [3] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word*) main::screen#0 = (word*) 1024 +Constant (const word*) main::screen = (word*) 1024 Constant (const byte) main::$0 = 0*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero main::screen#0 in [4] *((const word*) main::screen#0 + (const byte) main::$0) ← (word) main::w#0 +Simplifying expression containing zero main::screen in [4] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$0 Eliminating unused constant (const byte) SIZEOF_WORD @@ -107,7 +106,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const word*) main::screen#0) ← (const word) main::w#0 + [4] *((const word*) main::screen) ← (const word) main::w#0 to:main::@return main::@return: scope:[main] from main [5] return @@ -116,7 +115,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(word*) main::screen (word) main::w Initial phi equivalence classes @@ -149,7 +147,7 @@ bend: main: { .label screen = $400 .const w = 1*$100+2 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -163,7 +161,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -198,7 +196,7 @@ bend: main: { .label screen = $400 .const w = 1*$100+2 - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w @@ -235,8 +233,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2 @@ -263,7 +260,7 @@ main: { .label screen = $400 .const w = 1*$100+2 // screen[0] = w - // [4] *((const word*) main::screen#0) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 + // [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2 lda #w diff --git a/src/test/ref/inline-word-2.sym b/src/test/ref/inline-word-2.sym index 29a74e377..9733c4dd3 100644 --- a/src/test/ref/inline-word-2.sym +++ b/src/test/ref/inline-word-2.sym @@ -3,8 +3,7 @@ (label) @end (void()) main() (label) main::@return -(word*) main::screen -(const word*) main::screen#0 screen = (word*) 1024 +(const word*) main::screen screen = (word*) 1024 (word) main::w (const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2 diff --git a/src/test/ref/inlinearrayproblem.cfg b/src/test/ref/inlinearrayproblem.cfg index 23ecaae58..75dcd11cf 100644 --- a/src/test/ref/inlinearrayproblem.cfg +++ b/src/test/ref/inlinearrayproblem.cfg @@ -14,8 +14,8 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) - [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) + [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [8] (byte) main::i#1 ← ++ (byte) main::i#2 [9] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return diff --git a/src/test/ref/inlinearrayproblem.log b/src/test/ref/inlinearrayproblem.log index ff4aa87b6..be5fd3af0 100644 --- a/src/test/ref/inlinearrayproblem.log +++ b/src/test/ref/inlinearrayproblem.log @@ -4,8 +4,8 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) SCREEN2#0 ← ((byte*)) (number) $400+(number) $28 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) SCREEN2 ← ((byte*)) (number) $400+(number) $28 to:@1 (void()) main() @@ -16,8 +16,8 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#0 + (byte) main::i#2) ← *((byte[]) main::txt + (byte) main::i#2) - *((byte*) SCREEN2#0 + (byte) main::i#2) ← *((byte[]) main::data + (byte) main::i#2) + *((byte*) SCREEN + (byte) main::i#2) ← *((byte[]) main::txt + (byte) main::i#2) + *((byte*) SCREEN2 + (byte) main::i#2) ← *((byte[]) main::data + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$0) goto main::@1 @@ -38,9 +38,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte*) SCREEN2 -(byte*) SCREEN2#0 (void()) main() (bool~) main::$0 (const string) main::$1 = (string) "qwe"z @@ -55,8 +53,8 @@ SYMBOL TABLE SSA Added casts to value list in (byte[]) main::data ← (byte[]){ (byte)(number) 1, (byte)(number) 2, (byte)(number) 3 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) SCREEN2#0 ← (byte*)(number) $400+(number) $28 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN2 ← (byte*)(number) $400+(number) $28 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -65,12 +63,12 @@ Simplifying constant integer cast 3 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$0 [10] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant right-side identified [1] (byte*) SCREEN2#0 ← (byte*)(number) $400+(number) $28 +Constant right-side identified [1] (byte*) SCREEN2 ← (byte*)(number) $400+(number) $28 Successful SSA optimization Pass2ConstantRValueConsolidation Identified constant from value list (byte[]) { (byte) 1, (byte) 2, (byte) 3 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) SCREEN2#0 = (byte*)$400+$28 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) SCREEN2 = (byte*)$400+$28 Constant (const byte[]) main::txt = main::$1 Constant (const byte[]) main::data = { 1, 2, 3 } Constant (const byte) main::i#0 = 0 @@ -123,8 +121,8 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) - [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) + [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [8] (byte) main::i#1 ← ++ (byte) main::i#2 [9] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return @@ -134,8 +132,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN -(byte*) SCREEN2 (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -190,11 +186,11 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda txt,y sta SCREEN,y - // [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda data,y sta SCREEN2,y @@ -215,11 +211,11 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (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 [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -269,10 +265,10 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda txt,x sta SCREEN,x - // [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda data,x sta SCREEN2,x // [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -319,10 +315,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*)(number) $400+(number) $28 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*)(number) $400+(number) $28 (void()) main() (label) main::@1 (label) main::@return @@ -365,11 +359,11 @@ main: { // main::@1 b1: // SCREEN[i] = txt[i] - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) main::txt + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda txt,x sta SCREEN,x // SCREEN2[i] = data[i] - // [7] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) SCREEN2 + (byte) main::i#2) ← *((const byte[]) main::data + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda data,x sta SCREEN2,x // for( byte i : 0..3) diff --git a/src/test/ref/inlinearrayproblem.sym b/src/test/ref/inlinearrayproblem.sym index da679db4e..a66ba86b1 100644 --- a/src/test/ref/inlinearrayproblem.sym +++ b/src/test/ref/inlinearrayproblem.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*)(number) $400+(number) $28 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*)(number) $400+(number) $28 (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/inmem-const-array.cfg b/src/test/ref/inmem-const-array.cfg index 522b4252c..3c2bb8519 100644 --- a/src/test/ref/inmem-const-array.cfg +++ b/src/test/ref/inmem-const-array.cfg @@ -15,8 +15,8 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@2 [5] (byte) main::j#3 ← phi( main/(byte) 0 main::@2/(byte) main::j#4 ) [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) - [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' - [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) + [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' + [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [8] (byte) main::j#1 ← ++ (byte) main::j#3 [9] if((byte) main::j#1!=(byte) 3) goto main::@3 to:main::@2 diff --git a/src/test/ref/inmem-const-array.log b/src/test/ref/inmem-const-array.log index dfcd440fc..c804caacb 100644 --- a/src/test/ref/inmem-const-array.log +++ b/src/test/ref/inmem-const-array.log @@ -7,24 +7,24 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) WHITE#0 ← (number) 1 - (byte) RED#0 ← (number) 2 - (byte) GREEN#0 ← (number) 5 + (byte) WHITE ← (number) 1 + (byte) RED ← (number) 2 + (byte) GREEN ← (number) 5 to:@1 (void()) main() main: scope:[main] from @1 - (byte[]) main::colseq ← { (byte) WHITE#0, (byte) RED#0, (byte) GREEN#0 } - (byte*) main::screen#0 ← ((byte*)) (number) $400 - (byte*) main::cols#0 ← ((byte*)) (number) $d800 + (byte[]) main::colseq ← { (byte) WHITE, (byte) RED, (byte) GREEN } + (byte*) main::screen ← ((byte*)) (number) $400 + (byte*) main::cols ← ((byte*)) (number) $d800 (byte) main::j#0 ← (number) 0 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@2 (byte) main::j#3 ← phi( main/(byte) main::j#0 main::@2/(byte) main::j#4 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) - *((byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' - *((byte*) main::cols#0 + (byte) main::i#2) ← *((byte[]) main::colseq + (byte) main::j#3) + *((byte*) main::screen + (byte) main::i#2) ← (byte) '*' + *((byte*) main::cols + (byte) main::i#2) ← *((byte[]) main::colseq + (byte) main::j#3) (byte) main::j#1 ← ++ (byte) main::j#3 (bool~) main::$0 ← (byte) main::j#1 == (number) 3 (bool~) main::$1 ← ! (bool~) main::$0 @@ -57,11 +57,8 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) GREEN -(byte) GREEN#0 (byte) RED -(byte) RED#0 (byte) WHITE -(byte) WHITE#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -71,7 +68,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::cols -(byte*) main::cols#0 (byte[]) main::colseq (byte) main::i (byte) main::i#0 @@ -86,20 +82,19 @@ SYMBOL TABLE SSA (byte) main::j#3 (byte) main::j#4 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) 1 in (byte) WHITE#0 ← (number) 1 -Adding number conversion cast (unumber) 2 in (byte) RED#0 ← (number) 2 -Adding number conversion cast (unumber) 5 in (byte) GREEN#0 ← (number) 5 +Adding number conversion cast (unumber) 1 in (byte) WHITE ← (number) 1 +Adding number conversion cast (unumber) 2 in (byte) RED ← (number) 2 +Adding number conversion cast (unumber) 5 in (byte) GREEN ← (number) 5 Adding number conversion cast (unumber) 0 in (byte) main::j#0 ← (number) 0 Adding number conversion cast (unumber) 3 in (bool~) main::$0 ← (byte) main::j#1 == (number) 3 Adding number conversion cast (unumber) 0 in (byte) main::j#2 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) WHITE#0 ← (unumber)(number) 1 -Inlining cast (byte) RED#0 ← (unumber)(number) 2 -Inlining cast (byte) GREEN#0 ← (unumber)(number) 5 -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 -Inlining cast (byte*) main::cols#0 ← (byte*)(number) $d800 +Inlining cast (byte) WHITE ← (unumber)(number) 1 +Inlining cast (byte) RED ← (unumber)(number) 2 +Inlining cast (byte) GREEN ← (unumber)(number) 5 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 +Inlining cast (byte*) main::cols ← (byte*)(number) $d800 Inlining cast (byte) main::j#0 ← (unumber)(number) 0 Inlining cast (byte) main::j#2 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -128,11 +123,11 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [14] if((byte) main::j#1!=(byte) 3) goto main::@2 Simple Condition (bool~) main::$2 [18] if((byte) main::i#1!=rangelast(0,$27)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) WHITE#0 = 1 -Constant (const byte) RED#0 = 2 -Constant (const byte) GREEN#0 = 5 -Constant (const byte*) main::screen#0 = (byte*) 1024 -Constant (const byte*) main::cols#0 = (byte*) 55296 +Constant (const byte) WHITE = 1 +Constant (const byte) RED = 2 +Constant (const byte) GREEN = 5 +Constant (const byte*) main::screen = (byte*) 1024 +Constant (const byte*) main::cols = (byte*) 55296 Constant (const byte) main::j#0 = 0 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#2 = 0 @@ -145,9 +140,9 @@ Simplifying constant integer cast $28 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $28 Successful SSA optimization PassNFinalizeNumberTypeConversions -Identified constant from value list (byte[]) { (const byte) WHITE#0, (const byte) RED#0, (const byte) GREEN#0 } +Identified constant from value list (byte[]) { (const byte) WHITE, (const byte) RED, (const byte) GREEN } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte[]) main::colseq = { WHITE#0, RED#0, GREEN#0 } +Constant (const byte[]) main::colseq = { WHITE, RED, GREEN } Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::j#0 Inlining constant with var siblings (const byte) main::i#0 @@ -200,8 +195,8 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@2 [5] (byte) main::j#3 ← phi( main/(byte) 0 main::@2/(byte) main::j#4 ) [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) - [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' - [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) + [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' + [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [8] (byte) main::j#1 ← ++ (byte) main::j#3 [9] if((byte) main::j#1!=(byte) 3) goto main::@3 to:main::@2 @@ -219,11 +214,7 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte) GREEN -(byte) RED -(byte) WHITE (void()) main() -(byte*) main::cols (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 6.285714285714286 @@ -231,7 +222,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::j#1 11.0 (byte) main::j#3 11.0 (byte) main::j#4 7.333333333333333 -(byte*) main::screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -291,11 +281,11 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 + // [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'*' ldy.z i sta screen,y - // [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z j lda colseq,y ldy.z i @@ -339,12 +329,12 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) 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 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::j#3 main::j#4 main::j#1 ] -Statement [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) 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 , Potential registers zp ZP_BYTE:3 [ main::j#3 main::j#4 main::j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -399,10 +389,10 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta screen,x - // [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda colseq,y sta cols,x // [8] (byte) main::j#1 ← ++ (byte) main::j#3 -- vbuyy=_inc_vbuyy @@ -477,20 +467,16 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte) GREEN -(const byte) GREEN#0 GREEN = (byte) 5 -(byte) RED -(const byte) RED#0 RED = (byte) 2 -(byte) WHITE -(const byte) WHITE#0 WHITE = (byte) 1 +(const byte) GREEN GREEN = (byte) 5 +(const byte) RED RED = (byte) 2 +(const byte) WHITE WHITE = (byte) 1 (void()) main() (label) main::@1 (label) main::@2 (label) main::@3 (label) main::@return -(byte*) main::cols -(const byte*) main::cols#0 cols = (byte*) 55296 -(const byte[]) main::colseq colseq = { (const byte) WHITE#0, (const byte) RED#0, (const byte) GREEN#0 } +(const byte*) main::cols cols = (byte*) 55296 +(const byte[]) main::colseq colseq = { (const byte) WHITE, (const byte) RED, (const byte) GREEN } (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.285714285714286 @@ -498,8 +484,7 @@ FINAL SYMBOL TABLE (byte) main::j#1 reg byte y 11.0 (byte) main::j#3 reg byte y 11.0 (byte) main::j#4 reg byte y 7.333333333333333 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte y [ main::j#3 main::j#4 main::j#1 ] @@ -539,11 +524,11 @@ main: { // main::@1 b1: // screen[i] = '*' - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [6] *((const byte*) main::screen + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta screen,x // cols[i] = colseq[j] - // [7] *((const byte*) main::cols#0 + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [7] *((const byte*) main::cols + (byte) main::i#2) ← *((const byte[]) main::colseq + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda colseq,y sta cols,x // if(++j==3) diff --git a/src/test/ref/inmem-const-array.sym b/src/test/ref/inmem-const-array.sym index 959c4ddae..97a90e53c 100644 --- a/src/test/ref/inmem-const-array.sym +++ b/src/test/ref/inmem-const-array.sym @@ -1,20 +1,16 @@ (label) @1 (label) @begin (label) @end -(byte) GREEN -(const byte) GREEN#0 GREEN = (byte) 5 -(byte) RED -(const byte) RED#0 RED = (byte) 2 -(byte) WHITE -(const byte) WHITE#0 WHITE = (byte) 1 +(const byte) GREEN GREEN = (byte) 5 +(const byte) RED RED = (byte) 2 +(const byte) WHITE WHITE = (byte) 1 (void()) main() (label) main::@1 (label) main::@2 (label) main::@3 (label) main::@return -(byte*) main::cols -(const byte*) main::cols#0 cols = (byte*) 55296 -(const byte[]) main::colseq colseq = { (const byte) WHITE#0, (const byte) RED#0, (const byte) GREEN#0 } +(const byte*) main::cols cols = (byte*) 55296 +(const byte[]) main::colseq colseq = { (const byte) WHITE, (const byte) RED, (const byte) GREEN } (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.285714285714286 @@ -22,8 +18,7 @@ (byte) main::j#1 reg byte y 11.0 (byte) main::j#3 reg byte y 11.0 (byte) main::j#4 reg byte y 7.333333333333333 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte y [ main::j#3 main::j#4 main::j#1 ] diff --git a/src/test/ref/inmemarray.cfg b/src/test/ref/inmemarray.cfg index a133d1002..8559ee20a 100644 --- a/src/test/ref/inmemarray.cfg +++ b/src/test/ref/inmemarray.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) [5] (byte) main::j#3 ← phi( main/(byte) 0 main::@2/(byte) main::j#4 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [7] (byte) main::j#1 ← ++ (byte) main::j#3 [8] if((byte) main::j#1!=(byte) 8) goto main::@3 to:main::@2 diff --git a/src/test/ref/inmemarray.log b/src/test/ref/inmemarray.log index 3aade010f..dfb72a8fb 100644 --- a/src/test/ref/inmemarray.log +++ b/src/test/ref/inmemarray.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[]) TXT ← { (number) 3, (number) 1, (number) $d, (number) 5, (number) $c, (number) $f, (number) $14, (number) $20 } to:@1 @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@2 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) (byte) main::j#3 ← phi( main/(byte) main::j#0 main::@2/(byte) main::j#4 ) - *((byte*) SCREEN#0 + (byte) main::i#2) ← *((byte[]) TXT + (byte) main::j#3) + *((byte*) SCREEN + (byte) main::i#2) ← *((byte[]) TXT + (byte) main::j#3) (byte) main::j#1 ← ++ (byte) main::j#3 (bool~) main::$0 ← (byte) main::j#1 == (number) 8 (bool~) main::$1 ← ! (bool~) main::$0 @@ -48,7 +48,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte[]) TXT (void()) main() (bool~) main::$0 @@ -77,7 +76,7 @@ Adding number conversion cast (unumber) 0 in (byte) main::j#2 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) TXT ← (byte[]){ (byte)(number) 3, (byte)(number) 1, (byte)(number) $d, (byte)(number) 5, (byte)(number) $c, (byte)(number) $f, (byte)(number) $14, (byte)(number) $20 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::j#0 ← (unumber)(number) 0 Inlining cast (byte) main::j#2 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -109,7 +108,7 @@ Simple Condition (bool~) main::$2 [13] if((byte) main::i#1!=rangelast(0,$64)) go Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (byte[]) { (byte) 3, (byte) 1, (byte) $d, (byte) 5, (byte) $c, (byte) $f, (byte) $14, (byte) $20 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[]) TXT = { 3, 1, $d, 5, $c, $f, $14, $20 } Constant (const byte) main::j#0 = 0 Constant (const byte) main::i#0 = 0 @@ -174,7 +173,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) [5] (byte) main::j#3 ← phi( main/(byte) 0 main::@2/(byte) main::j#4 ) - [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) + [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [7] (byte) main::j#1 ← ++ (byte) main::j#3 [8] if((byte) main::j#1!=(byte) 8) goto main::@3 to:main::@2 @@ -192,7 +191,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -256,7 +254,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy.z j lda TXT,y ldy.z i @@ -300,10 +298,10 @@ main: { TXT: .byte 3, 1, $d, 5, $c, $f, $14, $20 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [ main::j#3 main::i#2 ] ( main:2 [ main::j#3 main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [ main::j#3 main::i#2 ] ( main:2 [ main::j#3 main::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::j#3 main::j#4 main::j#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ] -Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [ main::j#3 main::i#2 ] ( main:2 [ main::j#3 main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) [ main::j#3 main::i#2 ] ( main:2 [ main::j#3 main::i#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::j#3 main::j#4 main::j#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::i#2 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -354,7 +352,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda TXT,y sta SCREEN,x // [7] (byte) main::j#1 ← ++ (byte) main::j#3 -- vbuyy=_inc_vbuyy @@ -429,8 +427,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TXT TXT = { (byte) 3, (byte) 1, (byte) $d, (byte) 5, (byte) $c, (byte) $f, (byte) $14, (byte) $20 } (void()) main() (label) main::@1 @@ -479,7 +476,7 @@ main: { // main::@1 b1: // SCREEN[i] = TXT[j] - // [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + // [6] *((const byte*) SCREEN + (byte) main::i#2) ← *((const byte[]) TXT + (byte) main::j#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy lda TXT,y sta SCREEN,x // if(++j==8) diff --git a/src/test/ref/inmemarray.sym b/src/test/ref/inmemarray.sym index 8dcbdfe8c..83f99c6e7 100644 --- a/src/test/ref/inmemarray.sym +++ b/src/test/ref/inmemarray.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TXT TXT = { (byte) 3, (byte) 1, (byte) $d, (byte) 5, (byte) $c, (byte) $f, (byte) $14, (byte) $20 } (void()) main() (label) main::@1 diff --git a/src/test/ref/inmemstring.cfg b/src/test/ref/inmemstring.cfg index dede99157..0a1531d37 100644 --- a/src/test/ref/inmemstring.cfg +++ b/src/test/ref/inmemstring.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte*) main::cursor#2 ← phi( main/(const byte*) SCREEN#0 main::@2/(byte*) main::cursor#1 ) + [5] (byte*) main::cursor#2 ← phi( main/(const byte*) SCREEN main::@2/(byte*) main::cursor#1 ) [5] (byte) main::i#3 ← phi( main/(byte) 0 main::@2/(byte) main::i#4 ) [6] *((byte*) main::cursor#2) ← *((const byte[]) TEXT + (byte) main::i#3) [7] (byte) main::i#1 ← ++ (byte) main::i#3 @@ -25,7 +25,7 @@ main::@3: scope:[main] from main::@1 main::@2: scope:[main] from main::@1 main::@3 [10] (byte) main::i#4 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 ) [11] (byte*) main::cursor#1 ← ++ (byte*) main::cursor#2 - [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 + [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [13] return diff --git a/src/test/ref/inmemstring.log b/src/test/ref/inmemstring.log index 1d20d7fa0..1e8e99ee7 100644 --- a/src/test/ref/inmemstring.log +++ b/src/test/ref/inmemstring.log @@ -3,13 +3,13 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[]) TEXT ← (const string) $0 to:@1 (void()) main() main: scope:[main] from @1 - (byte*) main::cursor#0 ← (byte*) SCREEN#0 + (byte*) main::cursor#0 ← (byte*) SCREEN (byte) main::i#0 ← (number) 0 to:main::@1 main::@1: scope:[main] from main main::@2 @@ -25,7 +25,7 @@ main::@2: scope:[main] from main::@1 main::@3 (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main::@3/(byte) main::i#2 ) (byte*) main::cursor#3 ← phi( main::@1/(byte*) main::cursor#2 main::@3/(byte*) main::cursor#4 ) (byte*) main::cursor#1 ← ++ (byte*) main::cursor#3 - (byte*~) main::$2 ← (byte*) SCREEN#0 + (number) $3e8 + (byte*~) main::$2 ← (byte*) SCREEN + (number) $3e8 (bool~) main::$3 ← (byte*) main::cursor#1 < (byte*~) main::$2 if((bool~) main::$3) goto main::@1 to:main::@return @@ -50,7 +50,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte[]) TEXT (void()) main() (bool~) main::$0 @@ -76,10 +75,10 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 8 in (bool~) main::$0 ← (byte) main::i#1 == (number) 8 -Adding number conversion cast (unumber) $3e8 in (byte*~) main::$2 ← (byte*) SCREEN#0 + (number) $3e8 +Adding number conversion cast (unumber) $3e8 in (byte*~) main::$2 ← (byte*) SCREEN + (number) $3e8 Adding number conversion cast (unumber) 0 in (byte) main::i#2 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Inlining cast (byte) main::i#2 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -103,16 +102,16 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [9] if((byte) main::i#1!=(byte) 8) goto main::@2 Simple Condition (bool~) main::$3 [14] if((byte*) main::cursor#1<(byte*~) main::$2) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[]) TEXT = $0 Constant (const byte) main::i#0 = 0 Constant (const byte) main::i#2 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::cursor#0 = SCREEN#0 +Constant (const byte*) main::cursor#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [6] (byte*~) main::$2 ← (const byte*) SCREEN#0 + (word) $3e8 +Constant right-side identified [6] (byte*~) main::$2 ← (const byte*) SCREEN + (word) $3e8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::$2 = SCREEN#0+$3e8 +Constant (const byte*) main::$2 = SCREEN+$3e8 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::i#2 @@ -120,8 +119,8 @@ Inlining constant with var siblings (const byte*) main::cursor#0 Constant inlined main::i#0 = (byte) 0 Constant inlined main::i#2 = (byte) 0 Constant inlined $0 = (const byte[]) TEXT -Constant inlined main::cursor#0 = (const byte*) SCREEN#0 -Constant inlined main::$2 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined main::cursor#0 = (const byte*) SCREEN +Constant inlined main::$2 = (const byte*) SCREEN+(word) $3e8 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@2 and main::@1) Added new block during phi lifting main::@6(between main::@1 and main::@2) @@ -165,7 +164,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte*) main::cursor#2 ← phi( main/(const byte*) SCREEN#0 main::@2/(byte*) main::cursor#1 ) + [5] (byte*) main::cursor#2 ← phi( main/(const byte*) SCREEN main::@2/(byte*) main::cursor#1 ) [5] (byte) main::i#3 ← phi( main/(byte) 0 main::@2/(byte) main::i#4 ) [6] *((byte*) main::cursor#2) ← *((const byte[]) TEXT + (byte) main::i#3) [7] (byte) main::i#1 ← ++ (byte) main::i#3 @@ -177,7 +176,7 @@ main::@3: scope:[main] from main::@1 main::@2: scope:[main] from main::@1 main::@3 [10] (byte) main::i#4 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 ) [11] (byte*) main::cursor#1 ← ++ (byte*) main::cursor#2 - [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 + [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 to:main::@return main::@return: scope:[main] from main::@2 [13] return @@ -185,7 +184,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte*) main::cursor (byte*) main::cursor#1 16.5 @@ -235,7 +233,7 @@ main: { .label cursor = 3 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -284,7 +282,7 @@ main: { bne !+ inc.z cursor+1 !: - // [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 + // [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b1_from_b2 @@ -306,9 +304,9 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::cursor#2) ← *((const byte[]) TEXT + (byte) main::i#3) [ main::i#3 main::cursor#2 ] ( main:2 [ main::i#3 main::cursor#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#3 main::i#4 main::i#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::i#3 main::i#4 main::i#1 ] -Statement [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 [ main::i#4 main::cursor#1 ] ( main:2 [ main::i#4 main::cursor#1 ] ) always clobbers reg byte a +Statement [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 [ main::i#4 main::cursor#1 ] ( main:2 [ main::i#4 main::cursor#1 ] ) always clobbers reg byte a Statement [6] *((byte*) main::cursor#2) ← *((const byte[]) TEXT + (byte) main::i#3) [ main::i#3 main::cursor#2 ] ( main:2 [ main::i#3 main::cursor#2 ] ) always clobbers reg byte a reg byte y -Statement [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 [ main::i#4 main::cursor#1 ] ( main:2 [ main::i#4 main::cursor#1 ] ) always clobbers reg byte a +Statement [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 [ main::i#4 main::cursor#1 ] ( main:2 [ main::i#4 main::cursor#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#3 main::i#4 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , Potential registers zp ZP_WORD:3 [ main::cursor#2 main::cursor#1 ] : zp ZP_WORD:3 , @@ -349,7 +347,7 @@ main: { .label cursor = 2 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -394,7 +392,7 @@ main: { bne !+ inc.z cursor+1 !: - // [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 + // [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b1_from_b2 @@ -450,8 +448,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TEXT TEXT = (string) "camelot "z (void()) main() (label) main::@1 @@ -491,7 +488,7 @@ Score: 636 main: { .label cursor = 2 // [5] phi from main to main::@1 [phi:main->main::@1] - // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN#0 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::cursor#2 = (const byte*) SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -529,7 +526,7 @@ main: { bne !+ inc.z cursor+1 !: - // [12] if((byte*) main::cursor#1<(const byte*) SCREEN#0+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 + // [12] if((byte*) main::cursor#1<(const byte*) SCREEN+(word) $3e8) goto main::@1 -- pbuz1_lt_pbuc1_then_la1 lda.z cursor+1 cmp #>SCREEN+$3e8 bcc b1 diff --git a/src/test/ref/inmemstring.sym b/src/test/ref/inmemstring.sym index 8e32bcd8c..f8d6efbd1 100644 --- a/src/test/ref/inmemstring.sym +++ b/src/test/ref/inmemstring.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TEXT TEXT = (string) "camelot "z (void()) main() (label) main::@1 diff --git a/src/test/ref/keyboard-glitch.cfg b/src/test/ref/keyboard-glitch.cfg index e833fd36b..ff032fe24 100644 --- a/src/test/ref/keyboard-glitch.cfg +++ b/src/test/ref/keyboard-glitch.cfg @@ -64,7 +64,7 @@ menu::@7: scope:[menu] from menu::@10 asm { cli } to:menu::@return menu::@4: scope:[menu] from menu::@10 - [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) + [30] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) to:menu::@1 (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) diff --git a/src/test/ref/keyboard-glitch.log b/src/test/ref/keyboard-glitch.log index 3c4fab381..0eb26c90a 100644 --- a/src/test/ref/keyboard-glitch.log +++ b/src/test/ref/keyboard-glitch.log @@ -104,7 +104,7 @@ main::@return: scope:[main] from main::@1 return to:@return @12: scope:[] from @4 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@14 (void()) menu() @@ -162,7 +162,7 @@ menu::@11: scope:[menu] from menu::@17 asm { sei } to:menu::@return menu::@6: scope:[menu] from menu::@19 - *((byte*) SCREEN#0) ← ++ *((byte*) SCREEN#0) + *((byte*) SCREEN) ← ++ *((byte*) SCREEN) to:menu::@1 menu::@13: scope:[menu] from menu::@19 *((byte*) BORDERCOL) ← (byte) GREEN @@ -216,7 +216,6 @@ SYMBOL TABLE SSA (byte) KEY_SPACE (byte) RED (byte*) SCREEN -(byte*) SCREEN#0 (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) (number~) keyboard_key_pressed::$0 (byte~) keyboard_key_pressed::$1 @@ -327,7 +326,7 @@ Inlining cast (byte) KEY_E ← (unumber)(number) $e Inlining cast (byte) KEY_C ← (unumber)(number) $14 Inlining cast (byte) KEY_I ← (unumber)(number) $21 Inlining cast (byte) KEY_SPACE ← (unumber)(number) $3c -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53280 Simplifying constant pointer cast (byte*) 53281 @@ -416,7 +415,7 @@ Constant (const byte) KEY_I = $21 Constant (const byte) KEY_SPACE = $3c Constant (const byte[8]) keyboard_matrix_row_bitmask = { $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f } Constant (const byte[8]) keyboard_matrix_col_bitmask = { 1, 2, 4, 8, $10, $20, $40, $80 } -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) keyboard_key_pressed::key#0 = KEY_C Constant (const byte) keyboard_key_pressed::key#1 = KEY_I @@ -566,7 +565,7 @@ menu::@7: scope:[menu] from menu::@10 asm { cli } to:menu::@return menu::@4: scope:[menu] from menu::@10 - [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) + [30] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) to:menu::@1 (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) @@ -615,7 +614,6 @@ pressed::@return: scope:[pressed] from pressed::@2 null depth in calling loop Loop head: pressed::@1 tails: pressed::@2 blocks: pressed::@2 pressed::@1 in scope keyboard_key_pressed VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) (byte~) keyboard_key_pressed::$2 4.0 (byte) keyboard_key_pressed::colidx @@ -868,7 +866,7 @@ menu: { jmp breturn // menu::@4 b4: - // [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [30] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN jmp b1_from_b4 } @@ -1198,7 +1196,7 @@ menu: { jmp breturn // menu::@4 b4: - // [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [30] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN jmp b1_from_b4 } @@ -1370,8 +1368,7 @@ FINAL SYMBOL TABLE (const byte) KEY_I KEY_I = (byte) $21 (const byte) KEY_SPACE KEY_SPACE = (byte) $3c (const byte) RED RED = (byte) 2 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) (byte~) keyboard_key_pressed::$2 reg byte a 4.0 (label) keyboard_key_pressed::@1 @@ -1572,7 +1569,7 @@ menu: { // menu::@4 b4: // (*SCREEN)++; - // [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [30] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN jmp b1 } diff --git a/src/test/ref/keyboard-glitch.sym b/src/test/ref/keyboard-glitch.sym index ab6a73232..e5bcd2750 100644 --- a/src/test/ref/keyboard-glitch.sym +++ b/src/test/ref/keyboard-glitch.sym @@ -11,8 +11,7 @@ (const byte) KEY_I KEY_I = (byte) $21 (const byte) KEY_SPACE KEY_SPACE = (byte) $3c (const byte) RED RED = (byte) 2 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) (byte~) keyboard_key_pressed::$2 reg byte a 4.0 (label) keyboard_key_pressed::@1 diff --git a/src/test/ref/line-anim.cfg b/src/test/ref/line-anim.cfg index b1f682aac..607417360 100644 --- a/src/test/ref/line-anim.cfg +++ b/src/test/ref/line-anim.cfg @@ -237,7 +237,7 @@ screen_fill: scope:[screen_fill] from main::@6 to:screen_fill::@1 screen_fill::@1: scope:[screen_fill] from screen_fill screen_fill::@3 [110] (byte) screen_fill::y#4 ← phi( screen_fill/(byte) 0 screen_fill::@3/(byte) screen_fill::y#1 ) - [110] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN#0 screen_fill::@3/(byte*) screen_fill::screen#1 ) + [110] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN screen_fill::@3/(byte*) screen_fill::screen#1 ) to:screen_fill::@2 screen_fill::@2: scope:[screen_fill] from screen_fill::@1 screen_fill::@2 [111] (byte) screen_fill::x#2 ← phi( screen_fill::@1/(byte) 0 screen_fill::@2/(byte) screen_fill::x#1 ) @@ -300,7 +300,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [138] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [139] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [139] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [139] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [140] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [141] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 diff --git a/src/test/ref/line-anim.log b/src/test/ref/line-anim.log index ac380cbb0..c229064a9 100644 --- a/src/test/ref/line-anim.log +++ b/src/test/ref/line-anim.log @@ -253,8 +253,8 @@ divr16s::@return: scope:[divr16s] from divr16s::@11 divr16s::@5 return to:@return @12: scope:[] from @begin - (byte*) BITMAP#0 ← ((byte*)) (number) $a000 - (byte*) SCREEN#0 ← ((byte*)) (number) $8800 + (byte*) BITMAP ← ((byte*)) (number) $a000 + (byte*) SCREEN ← ((byte*)) (number) $8800 (byte) SIZE ← (number) 4 (byte) DELAY ← (number) 8 (word[SIZE]) x_start ← { (number) $a, (number) $14, (number) $1e, (number) $1e } @@ -277,7 +277,7 @@ main: scope:[main] from @19 (byte~) main::$1 ← (byte~) main::$0 | (byte) VIC_RSEL (number~) main::$2 ← (byte~) main::$1 | (number) 3 *((byte*) D011) ← (number~) main::$2 - (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#0 + (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN to:main::vicSelectGfxBank1 main::vicSelectGfxBank1: scope:[main] from main (byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main/(byte*) main::vicSelectGfxBank1_gfx#0 ) @@ -302,8 +302,8 @@ main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@ *((byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0 to:main::@15 main::@15: scope:[main] from main::vicSelectGfxBank1_@1 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP to:main::toD0181 main::toD0181: scope:[main] from main::@15 (byte*) main::toD0181_gfx#1 ← phi( main::@15/(byte*) main::toD0181_gfx#0 ) @@ -327,14 +327,14 @@ main::@16: scope:[main] from main::toD0181_@return (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$4 ← (byte) main::toD0181_return#3 *((byte*) D018) ← (byte~) main::$4 - (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP#0 + (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP call bitmap_init to:main::@17 main::@17: scope:[main] from main::@16 call bitmap_clear to:main::@18 main::@18: scope:[main] from main::@17 - (byte*) screen_fill::screen#0 ← (byte*) SCREEN#0 + (byte*) screen_fill::screen#0 ← (byte*) SCREEN (byte) screen_fill::ch#0 ← (number) $10 call screen_fill to:main::@19 @@ -691,7 +691,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BITMAP -(byte*) BITMAP#0 (byte*) BORDERCOL (byte*) CIA2_PORT_A (byte*) CIA2_PORT_A_DDR @@ -704,7 +703,6 @@ SYMBOL TABLE SSA (byte) PROCPORT_RAM_IO (byte*) RASTER (byte*) SCREEN -(byte*) SCREEN#0 (byte) SIZE (const byte) SIZEOF_WORD = (byte) 2 (byte) VIC_BMM @@ -1309,8 +1307,8 @@ Inlining cast (word~) divr16s::$14 ← (word)(signed word~) divr16s::$13 Inlining cast (word~) divr16s::$12 ← (word)(signed word) divr16s::divisor#3 Inlining cast (signed word~) divr16s::$21 ← (signed word)(word) divr16s::resultu#1 Inlining cast (signed word~) divr16s::$18 ← (signed word)(word) divr16s::resultu#2 -Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $a000 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $8800 +Inlining cast (byte*) BITMAP ← (byte*)(number) $a000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $8800 Inlining cast (byte) SIZE ← (unumber)(number) 4 Inlining cast (byte) DELAY ← (unumber)(number) 8 Inlining cast *((byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3 @@ -1670,8 +1668,8 @@ Constant (const word) divr16s::dividendu#0 = 0 Constant (const word) divr16s::remu#0 = 0 Constant (const byte) divr16s::neg#1 = 1 Constant (const word) divr16s::divisoru#0 = 0 -Constant (const byte*) BITMAP#0 = (byte*) 40960 -Constant (const byte*) SCREEN#0 = (byte*) 34816 +Constant (const byte*) BITMAP = (byte*) 40960 +Constant (const byte*) SCREEN = (byte*) 34816 Constant (const byte) SIZE = 4 Constant (const byte) DELAY = 8 Constant (const word[SIZE]) x_start = { $a, $14, $1e, $1e } @@ -1693,11 +1691,11 @@ Constant (const byte) bitmap_init::y#0 = 0 Constant (const byte) bitmap_clear::y#0 = 0 Constant (const byte) bitmap_clear::x#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = SCREEN#0 -Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 -Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 -Constant (const byte*) bitmap_init::bitmap#0 = BITMAP#0 -Constant (const byte*) screen_fill::screen#0 = SCREEN#0 +Constant (const byte*) main::vicSelectGfxBank1_gfx#0 = SCREEN +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = BITMAP +Constant (const byte*) bitmap_init::bitmap#0 = BITMAP +Constant (const byte*) screen_fill::screen#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)divr16s::dividend#0 in [65] (word) divr16s::dividendu#2 ← (word)(const signed word) divr16s::dividend#0 Constant value identified { fill( SIZE, 0) } in [111] (word[SIZE]) x_cur ← { fill( SIZE, 0) } @@ -1880,8 +1878,8 @@ Inlining constant with var siblings (const byte) bitmap_init::bits#2 Inlining constant with var siblings (const byte) bitmap_init::y#0 Inlining constant with var siblings (const byte) bitmap_clear::y#0 Inlining constant with var siblings (const byte) bitmap_clear::x#0 -Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 -Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP Constant inlined divr16u::i#0 = (byte) 0 Constant inlined divr16s::dividendu#1 = (word) 0 Constant inlined divr16s::dividendu#2 = (word) 0 @@ -1891,29 +1889,29 @@ Constant inlined divr16s::neg#1 = (byte) 1 Constant inlined divr16s::neg#0 = (byte) 0 Constant inlined divr16u::quotient#0 = (byte) 0 Constant inlined main::i#0 = (byte) 0 -Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +Constant inlined main::toD0181_$7 = >(word)(const byte*) BITMAP/(byte) 4&(byte) $f Constant inlined screen_fill::x#0 = (byte) 0 -Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$2 = (word)(const byte*) SCREEN&(word) $3fff*(byte) 4 Constant inlined bitmap_clear::x#0 = (byte) 0 -Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN#0&(word) $3fff +Constant inlined main::toD0181_$1 = (word)(const byte*) SCREEN&(word) $3fff Constant inlined bitmap_clear::y#0 = (byte) 0 -Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::vicSelectGfxBank1_toDd001_$0 = (word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP#0/(byte) 4 -Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP#0 -Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP#0 -Constant inlined main::vicSelectGfxBank1_toDd001_$2 = >(word)(const byte*) SCREEN#0/(byte) $40 -Constant inlined main::vicSelectGfxBank1_toDd001_$1 = >(word)(const byte*) SCREEN#0 -Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined screen_fill::screen#0 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_$0 = (word)(const byte*) SCREEN +Constant inlined main::vicSelectGfxBank1_toDd001_$0 = (word)(const byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP +Constant inlined main::toD0181_$4 = (word)(const byte*) BITMAP +Constant inlined main::vicSelectGfxBank1_toDd001_$2 = >(word)(const byte*) SCREEN/(byte) $40 +Constant inlined main::vicSelectGfxBank1_toDd001_$1 = >(word)(const byte*) SCREEN +Constant inlined main::toD0181_$3 = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined screen_fill::screen#0 = (const byte*) SCREEN Constant inlined main::$1 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL Constant inlined main::$2 = (const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined main::$0 = (const byte) VIC_BMM|(const byte) VIC_DEN -Constant inlined main::vicSelectGfxBank1_gfx#0 = (const byte*) SCREEN#0 +Constant inlined main::vicSelectGfxBank1_gfx#0 = (const byte*) SCREEN Constant inlined bitmap_init::y#0 = (byte) 0 Constant inlined screen_fill::y#0 = (byte) 0 Constant inlined bitmap_init::x#0 = (byte) 0 -Constant inlined bitmap_init::bitmap#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::bitmap#0 = (const byte*) BITMAP Constant inlined main::$8 = (const byte) SIZE-(byte) 1 Successful SSA optimization Pass2ConstantInlining Identical Phi Values (word) divr16s::dividendu#3 (word) 0 @@ -2297,7 +2295,7 @@ screen_fill: scope:[screen_fill] from main::@6 to:screen_fill::@1 screen_fill::@1: scope:[screen_fill] from screen_fill screen_fill::@3 [110] (byte) screen_fill::y#4 ← phi( screen_fill/(byte) 0 screen_fill::@3/(byte) screen_fill::y#1 ) - [110] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN#0 screen_fill::@3/(byte*) screen_fill::screen#1 ) + [110] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN screen_fill::@3/(byte*) screen_fill::screen#1 ) to:screen_fill::@2 screen_fill::@2: scope:[screen_fill] from screen_fill::@1 screen_fill::@2 [111] (byte) screen_fill::x#2 ← phi( screen_fill::@1/(byte) 0 screen_fill::@2/(byte) screen_fill::x#1 ) @@ -2360,7 +2358,7 @@ bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 [138] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 to:bitmap_init::@3 bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 - [139] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [139] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) [139] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) [140] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [141] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 @@ -2384,8 +2382,6 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4 VARIABLE REGISTER WEIGHTS -(byte*) BITMAP -(byte*) SCREEN (void()) bitmap_clear() (byte*) bitmap_clear::bitmap (word) bitmap_clear::bitmap#0 2.0 @@ -3508,7 +3504,7 @@ screen_fill: { // [110] phi (byte) screen_fill::y#4 = (byte) 0 [phi:screen_fill->screen_fill::@1#0] -- vbuz1=vbuc1 lda #0 sta.z y - // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN#0 [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 + // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -3704,7 +3700,7 @@ bitmap_init: { bne b1_from_b2 // [139] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -4765,7 +4761,7 @@ screen_fill: { // [110] phi (byte) screen_fill::y#4 = (byte) 0 [phi:screen_fill->screen_fill::@1#0] -- vbuz1=vbuc1 lda #0 sta.z y - // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN#0 [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 + // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -4935,7 +4931,7 @@ bitmap_init: { bne b1_from_b2 // [139] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] b3_from_b2: - // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP @@ -5212,8 +5208,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 40960 +(const byte*) BITMAP BITMAP = (byte*) 40960 (const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte*) CIA2_PORT_A CIA2_PORT_A = (byte*) 56576 (const byte*) CIA2_PORT_A_DDR CIA2_PORT_A_DDR = (byte*) 56578 @@ -5225,8 +5220,7 @@ FINAL SYMBOL TABLE (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 34816 +(const byte*) SCREEN SCREEN = (byte*) 34816 (const byte) SIZE SIZE = (byte) 4 (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -5377,7 +5371,7 @@ FINAL SYMBOL TABLE (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 @@ -5385,7 +5379,7 @@ FINAL SYMBOL TABLE (label) main::vicSelectGfxBank1_toDd001 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3^>(word)(const byte*) SCREEN#0/(byte) $40 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3^>(word)(const byte*) SCREEN/(byte) $40 (void()) point_init((byte) point_init::point_idx) (word~) point_init::$10 $10 zp ZP_WORD:16 4.0 (word~) point_init::$11 $11 zp ZP_WORD:16 4.0 @@ -6132,7 +6126,7 @@ screen_fill: { // [110] phi (byte) screen_fill::y#4 = (byte) 0 [phi:screen_fill->screen_fill::@1#0] -- vbuz1=vbuc1 lda #0 sta.z y - // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN#0 [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 + // [110] phi (byte*) screen_fill::screen#3 = (const byte*) SCREEN [phi:screen_fill->screen_fill::@1#1] -- pbuz1=pbuc1 lda #SCREEN @@ -6282,7 +6276,7 @@ bitmap_init: { cpx #0 bne b1 // [139] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] - // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + // [139] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 lda #BITMAP diff --git a/src/test/ref/line-anim.sym b/src/test/ref/line-anim.sym index 2f24bc926..633ec39e2 100644 --- a/src/test/ref/line-anim.sym +++ b/src/test/ref/line-anim.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) BITMAP -(const byte*) BITMAP#0 BITMAP = (byte*) 40960 +(const byte*) BITMAP BITMAP = (byte*) 40960 (const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte*) CIA2_PORT_A CIA2_PORT_A = (byte*) 56576 (const byte*) CIA2_PORT_A_DDR CIA2_PORT_A_DDR = (byte*) 56578 @@ -14,8 +13,7 @@ (const byte) PROCPORT_DDR_MEMORY_MASK PROCPORT_DDR_MEMORY_MASK = (byte) 7 (const byte) PROCPORT_RAM_IO PROCPORT_RAM_IO = (byte) 5 (const byte*) RASTER RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 34816 +(const byte*) SCREEN SCREEN = (byte*) 34816 (const byte) SIZE SIZE = (byte) 4 (const byte) VIC_BMM VIC_BMM = (byte) $20 (const byte) VIC_DEN VIC_DEN = (byte) $10 @@ -166,7 +164,7 @@ (label) main::toD0181 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (label) main::vicSelectGfxBank1_@1 @@ -174,7 +172,7 @@ (label) main::vicSelectGfxBank1_toDd001 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3^>(word)(const byte*) SCREEN#0/(byte) $40 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte) 3^>(word)(const byte*) SCREEN/(byte) $40 (void()) point_init((byte) point_init::point_idx) (word~) point_init::$10 $10 zp ZP_WORD:16 4.0 (word~) point_init::$11 $11 zp ZP_WORD:16 4.0 diff --git a/src/test/ref/literals.cfg b/src/test/ref/literals.cfg index 23b61545f..8962a02ab 100644 --- a/src/test/ref/literals.cfg +++ b/src/test/ref/literals.cfg @@ -10,13 +10,13 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 - [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 + [4] *((const byte*) SCREEN) ← (const byte) ch + [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num to:main::@1 main::@1: scope:[main] from main main::@1 [6] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) - [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) + [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) + [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return diff --git a/src/test/ref/literals.log b/src/test/ref/literals.log index e648c2366..77906ea19 100644 --- a/src/test/ref/literals.log +++ b/src/test/ref/literals.log @@ -5,25 +5,25 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte) ch#0 ← (byte) 'a' - (byte) num#0 ← (number) 1 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte) ch ← (byte) 'a' + (byte) num ← (number) 1 (byte[]) str ← (const string) $0 (byte[]) nums ← { (number) 2, (number) 3, (number) 4, (number) 5 } to:@1 (void()) main() main: scope:[main] from @1 - *((byte*) SCREEN#0 + (number) 0) ← (byte) ch#0 - *((byte*) SCREEN#0 + (number) 2) ← (byte) num#0 + *((byte*) SCREEN + (number) 0) ← (byte) ch + *((byte*) SCREEN + (number) 2) ← (byte) num (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) (number~) main::$0 ← (number) 4 + (byte) main::i#2 - *((byte*) SCREEN#0 + (number~) main::$0) ← *((byte[]) str + (byte) main::i#2) + *((byte*) SCREEN + (number~) main::$0) ← *((byte[]) str + (byte) main::i#2) (number~) main::$1 ← (number) 9 + (byte) main::i#2 - *((byte*) SCREEN#0 + (number~) main::$1) ← *((byte[]) nums + (byte) main::i#2) + *((byte*) SCREEN + (number~) main::$1) ← *((byte[]) nums + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$2) goto main::@1 @@ -45,9 +45,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte) ch -(byte) ch#0 (void()) main() (number~) main::$0 (number~) main::$1 @@ -59,13 +57,12 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 (byte) num -(byte) num#0 (byte[]) nums (byte[]) str -Adding number conversion cast (unumber) 1 in (byte) num#0 ← (number) 1 -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) ch#0 -Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← (byte) num#0 +Adding number conversion cast (unumber) 1 in (byte) num ← (number) 1 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) ch +Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte) num Adding number conversion cast (unumber) 4 in (number~) main::$0 ← (number) 4 + (byte) main::i#2 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 4 + (byte) main::i#2 Adding number conversion cast (unumber) 9 in (number~) main::$1 ← (number) 9 + (byte) main::i#2 @@ -73,8 +70,8 @@ Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unum Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) nums ← (byte[]){ (byte)(number) 2, (byte)(number) 3, (byte)(number) 4, (byte)(number) 5 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte) num#0 ← (unumber)(number) 1 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte) num ← (unumber)(number) 1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -99,16 +96,16 @@ Simple Condition (bool~) main::$2 [15] if((byte) main::i#1!=rangelast(0,3)) goto Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (byte[]) { (byte) 2, (byte) 3, (byte) 4, (byte) 5 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte) ch#0 = 'a' -Constant (const byte) num#0 = 1 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte) ch = 'a' +Constant (const byte) num = 1 Constant (const byte[]) str = $0 Constant (const byte[]) nums = { 2, 3, 4, 5 } Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [13] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [15] if(main::i#1!=rangelast(0,3)) goto main::@1 to (number) 4 -Simplifying expression containing zero SCREEN#0 in [5] *((const byte*) SCREEN#0 + (byte) 0) ← (const byte) ch#0 +Simplifying expression containing zero SCREEN in [5] *((const byte*) SCREEN + (byte) 0) ← (const byte) ch Successful SSA optimization PassNSimplifyExpressionWithZero Adding number conversion cast (unumber) 4 in if((byte) main::i#1!=(number) 4) goto main::@1 Successful SSA optimization PassNAddNumberTypeConversions @@ -120,9 +117,9 @@ Inlining constant with var siblings (const byte) main::i#0 Constant inlined $0 = (const byte[]) str Constant inlined main::i#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(SCREEN#0+2) -Consolidated array index constant in assignment *(SCREEN#0+4 + main::$0) -Consolidated array index constant in assignment *(SCREEN#0+9 + main::$1) +Consolidated array index constant in *(SCREEN+2) +Consolidated array index constant in assignment *(SCREEN+4 + main::$0) +Consolidated array index constant in assignment *(SCREEN+9 + main::$1) Successful SSA optimization Pass2ConstantAdditionElimination Alias (byte) main::i#2 = (byte~) main::$0 (byte~) main::$1 Successful SSA optimization Pass2AliasElimination @@ -156,13 +153,13 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 - [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 + [4] *((const byte*) SCREEN) ← (const byte) ch + [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num to:main::@1 main::@1: scope:[main] from main main::@1 [6] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) - [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) + [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) + [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) 4) goto main::@1 to:main::@return @@ -172,13 +169,10 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN -(byte) ch (void()) main() (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 22.0 -(byte) num Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -214,10 +208,10 @@ bend: // main main: { .label i = 2 - // [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) ch -- _deref_pbuc1=vbuc2 lda #ch sta SCREEN - // [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 // [6] phi from main to main::@1 [phi:main->main::@1] @@ -232,11 +226,11 @@ main: { jmp b1 // main::@1 b1: - // [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda str,y sta SCREEN+4,y - // [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda nums,y sta SCREEN+9,y @@ -258,15 +252,15 @@ main: { nums: .byte 2, 3, 4, 5 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← (const byte) ch [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (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) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← (const byte) ch [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -302,10 +296,10 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) ch -- _deref_pbuc1=vbuc2 lda #ch sta SCREEN - // [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 // [6] phi from main to main::@1 [phi:main->main::@1] @@ -319,10 +313,10 @@ main: { jmp b1 // main::@1 b1: - // [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda str,x sta SCREEN+4,x - // [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda nums,x sta SCREEN+9,x // [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -369,18 +363,15 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte) ch -(const byte) ch#0 ch = (byte) 'a' +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte) ch ch = (byte) 'a' (void()) main() (label) main::@1 (label) main::@return (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 -(byte) num -(const byte) num#0 num = (byte) 1 +(const byte) num num = (byte) 1 (const byte[]) nums nums = { (byte) 2, (byte) 3, (byte) 4, (byte) 5 } (const byte[]) str str = (string) "bcde" @@ -408,11 +399,11 @@ Score: 293 // main main: { // SCREEN[0] = ch - // [4] *((const byte*) SCREEN#0) ← (const byte) ch#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) ch -- _deref_pbuc1=vbuc2 lda #ch sta SCREEN // SCREEN[2] = num - // [5] *((const byte*) SCREEN#0+(byte) 2) ← (const byte) num#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) SCREEN+(byte) 2) ← (const byte) num -- _deref_pbuc1=vbuc2 lda #num sta SCREEN+2 // [6] phi from main to main::@1 [phi:main->main::@1] @@ -423,11 +414,11 @@ main: { // main::@1 b1: // SCREEN[4+i] = str[i] - // [7] *((const byte*) SCREEN#0+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) SCREEN+(byte) 4 + (byte) main::i#2) ← *((const byte[]) str + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda str,x sta SCREEN+4,x // SCREEN[9+i] = nums[i] - // [8] *((const byte*) SCREEN#0+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) SCREEN+(byte) 9 + (byte) main::i#2) ← *((const byte[]) nums + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda nums,x sta SCREEN+9,x // for(byte i : 0..3) diff --git a/src/test/ref/literals.sym b/src/test/ref/literals.sym index 0131ac535..52c51864b 100644 --- a/src/test/ref/literals.sym +++ b/src/test/ref/literals.sym @@ -1,18 +1,15 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte) ch -(const byte) ch#0 ch = (byte) 'a' +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte) ch ch = (byte) 'a' (void()) main() (label) main::@1 (label) main::@return (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 -(byte) num -(const byte) num#0 num = (byte) 1 +(const byte) num num = (byte) 1 (const byte[]) nums nums = { (byte) 2, (byte) 3, (byte) 4, (byte) 5 } (const byte[]) str str = (string) "bcde" diff --git a/src/test/ref/liverange-call-problem.cfg b/src/test/ref/liverange-call-problem.cfg index 6b9d9dc81..377f0dcbe 100644 --- a/src/test/ref/liverange-call-problem.cfg +++ b/src/test/ref/liverange-call-problem.cfg @@ -26,8 +26,8 @@ main::@3: scope:[main] from main::@2 [11] call incw2 to:main::@4 main::@4: scope:[main] from main::@3 - [12] *((const word*) main::SCREEN#0) ← (word) w1#12 - [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 + [12] *((const word*) main::SCREEN) ← (word) w1#12 + [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 to:main::@return main::@return: scope:[main] from main::@4 [14] return diff --git a/src/test/ref/liverange-call-problem.log b/src/test/ref/liverange-call-problem.log index fbf5b3fb6..527a67e40 100644 --- a/src/test/ref/liverange-call-problem.log +++ b/src/test/ref/liverange-call-problem.log @@ -38,11 +38,11 @@ main::@4: scope:[main] from main::@3 (word) w1#9 ← phi( main::@3/(word) w1#2 ) (word) w2#8 ← phi( main::@3/(word) w2#5 ) (word) w2#2 ← (word) w2#8 - (word*) main::SCREEN#0 ← ((word*)) (number) $400 + (word*) main::SCREEN ← ((word*)) (number) $400 (number~) main::$4 ← (number) 0 * (const byte) SIZEOF_WORD - *((word*) main::SCREEN#0 + (number~) main::$4) ← (word) w1#9 + *((word*) main::SCREEN + (number~) main::$4) ← (word) w1#9 (number~) main::$5 ← (number) 2 * (const byte) SIZEOF_WORD - *((word*) main::SCREEN#0 + (number~) main::$5) ← (word) w2#2 + *((word*) main::SCREEN + (number~) main::$5) ← (word) w2#2 to:main::@return main::@return: scope:[main] from main::@4 (word) w2#9 ← phi( main::@4/(word) w2#2 ) @@ -105,7 +105,6 @@ SYMBOL TABLE SSA (label) main::@4 (label) main::@return (word*) main::SCREEN -(word*) main::SCREEN#0 (word) w1 (word) w1#0 (word) w1#1 @@ -152,7 +151,7 @@ Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (unum Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (word) w1#0 ← (unumber)(number) 0 Inlining cast (word) w2#0 ← (unumber)(number) 0 -Inlining cast (word*) main::SCREEN#0 ← (word*)(number) $400 +Inlining cast (word*) main::SCREEN ← (word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant integer cast 0 @@ -193,13 +192,13 @@ Constant right-side identified [18] (byte~) main::$5 ← (byte) 2 * (const byte) Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) w1#0 = 0 Constant (const word) w2#0 = 0 -Constant (const word*) main::SCREEN#0 = (word*) 1024 +Constant (const word*) main::SCREEN = (word*) 1024 Constant (const byte) main::$4 = 0*SIZEOF_WORD Constant (const byte) main::$5 = 2*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in Successful SSA optimization PassNSimplifyConstantZero -Simplifying expression containing zero main::SCREEN#0 in [17] *((const word*) main::SCREEN#0 + (const byte) main::$4) ← (word) w1#12 +Simplifying expression containing zero main::SCREEN in [17] *((const word*) main::SCREEN + (const byte) main::$4) ← (word) w1#12 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$4 Successful SSA optimization PassNEliminateUnusedVars @@ -209,7 +208,7 @@ Constant inlined main::$5 = (byte) 2*(const byte) SIZEOF_WORD Constant inlined w1#0 = (byte) 0 Constant inlined w2#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+2*SIZEOF_WORD) +Consolidated array index constant in *(main::SCREEN+2*SIZEOF_WORD) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @3 @@ -264,8 +263,8 @@ main::@3: scope:[main] from main::@2 [11] call incw2 to:main::@4 main::@4: scope:[main] from main::@3 - [12] *((const word*) main::SCREEN#0) ← (word) w1#12 - [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 + [12] *((const word*) main::SCREEN) ← (word) w1#12 + [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 to:main::@return main::@return: scope:[main] from main::@4 [14] return @@ -294,7 +293,6 @@ VARIABLE REGISTER WEIGHTS (void()) incw1() (void()) incw2() (void()) main() -(word*) main::SCREEN (word) w1 (word) w1#11 4.0 (word) w1#12 0.6666666666666666 @@ -389,12 +387,12 @@ main: { jmp b4 // main::@4 b4: - // [12] *((const word*) main::SCREEN#0) ← (word) w1#12 -- _deref_pwuc1=vwuz1 + // [12] *((const word*) main::SCREEN) ← (word) w1#12 -- _deref_pwuc1=vwuz1 lda.z w1 sta SCREEN lda.z w1+1 sta SCREEN+1 - // [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 + // [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 lda.z w2 sta SCREEN+2*SIZEOF_WORD lda.z w2+1 @@ -434,8 +432,8 @@ incw1: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [12] *((const word*) main::SCREEN#0) ← (word) w1#12 [ w2#11 ] ( main:2 [ w2#11 ] ) always clobbers reg byte a -Statement [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const word*) main::SCREEN) ← (word) w1#12 [ w2#11 ] ( main:2 [ w2#11 ] ) always clobbers reg byte a +Statement [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ w2#10 w2#11 ] : zp ZP_WORD:2 , Potential registers zp ZP_WORD:4 [ w1#11 w1#12 ] : zp ZP_WORD:4 , @@ -527,12 +525,12 @@ main: { jmp b4 // main::@4 b4: - // [12] *((const word*) main::SCREEN#0) ← (word) w1#12 -- _deref_pwuc1=vwuz1 + // [12] *((const word*) main::SCREEN) ← (word) w1#12 -- _deref_pwuc1=vwuz1 lda.z w1 sta SCREEN lda.z w1+1 sta SCREEN+1 - // [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 + // [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 lda.z w2 sta SCREEN+2*SIZEOF_WORD lda.z w2+1 @@ -627,8 +625,7 @@ FINAL SYMBOL TABLE (label) main::@3 (label) main::@4 (label) main::@return -(word*) main::SCREEN -(const word*) main::SCREEN#0 SCREEN = (word*) 1024 +(const word*) main::SCREEN SCREEN = (word*) 1024 (word) w1 (word) w1#11 w1 zp ZP_WORD:4 4.0 (word) w1#12 w1 zp ZP_WORD:4 0.6666666666666666 @@ -698,13 +695,13 @@ main: { jsr incw2 // main::@4 // SCREEN[0] = w1 - // [12] *((const word*) main::SCREEN#0) ← (word) w1#12 -- _deref_pwuc1=vwuz1 + // [12] *((const word*) main::SCREEN) ← (word) w1#12 -- _deref_pwuc1=vwuz1 lda.z w1 sta SCREEN lda.z w1+1 sta SCREEN+1 // SCREEN[2] = w2 - // [13] *((const word*) main::SCREEN#0+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 + // [13] *((const word*) main::SCREEN+(byte) 2*(const byte) SIZEOF_WORD) ← (word) w2#11 -- _deref_pwuc1=vwuz1 lda.z w2 sta SCREEN+2*SIZEOF_WORD lda.z w2+1 diff --git a/src/test/ref/liverange-call-problem.sym b/src/test/ref/liverange-call-problem.sym index f87ee4942..a39f32332 100644 --- a/src/test/ref/liverange-call-problem.sym +++ b/src/test/ref/liverange-call-problem.sym @@ -12,8 +12,7 @@ (label) main::@3 (label) main::@4 (label) main::@return -(word*) main::SCREEN -(const word*) main::SCREEN#0 SCREEN = (word*) 1024 +(const word*) main::SCREEN SCREEN = (word*) 1024 (word) w1 (word) w1#11 w1 zp ZP_WORD:4 4.0 (word) w1#12 w1 zp ZP_WORD:4 0.6666666666666666 diff --git a/src/test/ref/liverange.cfg b/src/test/ref/liverange.cfg index 8ed52a793..18f9be255 100644 --- a/src/test/ref/liverange.cfg +++ b/src/test/ref/liverange.cfg @@ -23,8 +23,8 @@ main::@1: scope:[main] from main main::@2: scope:[main] from main::@1 [11] (byte~) main::$2 ← (byte) inci::return#1 [12] (byte) main::a#2 ← (byte) main::a#1 + (byte~) main::$2 - [13] *((const byte*) main::SCREEN#0) ← (byte) i#11 - [14] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::a#2 + [13] *((const byte*) main::SCREEN) ← (byte) i#11 + [14] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::a#2 to:main::@return main::@return: scope:[main] from main::@2 [15] return diff --git a/src/test/ref/liverange.log b/src/test/ref/liverange.log index 4c87ffb8e..f739ee2b1 100644 --- a/src/test/ref/liverange.log +++ b/src/test/ref/liverange.log @@ -33,9 +33,9 @@ main::@2: scope:[main] from main::@1 (byte) i#2 ← (byte) i#8 (byte~) main::$3 ← (byte) main::a#4 + (byte~) main::$2 (byte) main::a#2 ← (byte~) main::$3 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 - *((byte*) main::SCREEN#0) ← (byte) i#2 - (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) 1 + (byte*) main::SCREEN ← ((byte*)) (number) $400 + *((byte*) main::SCREEN) ← (byte) i#2 + (byte*~) main::$4 ← (byte*) main::SCREEN + (number) 1 *((byte*~) main::$4) ← (byte) main::a#2 to:main::@return main::@return: scope:[main] from main::@2 @@ -110,7 +110,6 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::a (byte) main::a#0 (byte) main::a#1 @@ -120,13 +119,13 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) i#0 ← (number) 0 Adding number conversion cast (unumber) 4 in (byte) main::a#0 ← (number) 4 -Adding number conversion cast (unumber) 1 in (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) 1 +Adding number conversion cast (unumber) 1 in (byte*~) main::$4 ← (byte*) main::SCREEN + (number) 1 Adding number conversion cast (unumber) 7 in (number~) inci::$0 ← (byte) i#10 + (number) 7 Adding number conversion cast (unumber) inci::$0 in (number~) inci::$0 ← (byte) i#10 + (unumber)(number) 7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte) i#0 ← (unumber)(number) 0 Inlining cast (byte) main::a#0 ← (unumber)(number) 4 -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant integer cast 4 @@ -159,18 +158,18 @@ Identical Phi Values (byte) i#12 (byte) i#2 Successful SSA optimization Pass2IdenticalPhiElimination Constant (const byte) i#0 = 0 Constant (const byte) main::a#0 = 4 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Converting *(pointer+n) to pointer[n] [20] *((byte*~) main::$4) ← (byte) main::a#2 -- *(main::SCREEN#0 + 1) +Converting *(pointer+n) to pointer[n] [20] *((byte*~) main::$4) ← (byte) main::a#2 -- *(main::SCREEN + 1) Successful SSA optimization Pass2InlineDerefIdx -Eliminating unused variable (byte*~) main::$4 and assignment [9] (byte*~) main::$4 ← (const byte*) main::SCREEN#0 + (byte) 1 +Eliminating unused variable (byte*~) main::$4 and assignment [9] (byte*~) main::$4 ← (const byte*) main::SCREEN + (byte) 1 Successful SSA optimization PassNEliminateUnusedVars Inlining constant with var siblings (const byte) main::a#0 Inlining constant with var siblings (const byte) i#0 Constant inlined main::a#0 = (byte) 4 Constant inlined i#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+1) +Consolidated array index constant in *(main::SCREEN+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -217,8 +216,8 @@ main::@1: scope:[main] from main main::@2: scope:[main] from main::@1 [11] (byte~) main::$2 ← (byte) inci::return#1 [12] (byte) main::a#2 ← (byte) main::a#1 + (byte~) main::$2 - [13] *((const byte*) main::SCREEN#0) ← (byte) i#11 - [14] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::a#2 + [13] *((const byte*) main::SCREEN) ← (byte) i#11 + [14] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::a#2 to:main::@return main::@return: scope:[main] from main::@2 [15] return @@ -247,7 +246,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte~) main::$0 4.0 (byte~) main::$2 4.0 -(byte*) main::SCREEN (byte) main::a (byte) main::a#1 1.0 (byte) main::a#2 2.0 @@ -350,10 +348,10 @@ main: { clc adc.z _2 sta.z a_2 - // [13] *((const byte*) main::SCREEN#0) ← (byte) i#11 -- _deref_pbuc1=vbuz1 + // [13] *((const byte*) main::SCREEN) ← (byte) i#11 -- _deref_pbuc1=vbuz1 lda.z i sta SCREEN - // [14] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 + // [14] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1 lda.z a_2 sta SCREEN+1 jmp breturn @@ -467,9 +465,9 @@ main: { clc adc.z a tax - // [13] *((const byte*) main::SCREEN#0) ← (byte) i#11 -- _deref_pbuc1=vbuyy + // [13] *((const byte*) main::SCREEN) ← (byte) i#11 -- _deref_pbuc1=vbuyy sty SCREEN - // [14] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuxx + // [14] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuxx stx SCREEN+1 jmp breturn // main::@return @@ -540,8 +538,7 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::a (byte) main::a#1 a zp ZP_BYTE:2 1.0 (byte) main::a#2 reg byte x 2.0 @@ -606,10 +603,10 @@ main: { adc.z a tax // *SCREEN = i - // [13] *((const byte*) main::SCREEN#0) ← (byte) i#11 -- _deref_pbuc1=vbuyy + // [13] *((const byte*) main::SCREEN) ← (byte) i#11 -- _deref_pbuc1=vbuyy sty SCREEN // *(SCREEN+1) = a - // [14] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuxx + // [14] *((const byte*) main::SCREEN+(byte) 1) ← (byte) main::a#2 -- _deref_pbuc1=vbuxx stx SCREEN+1 // main::@return // } diff --git a/src/test/ref/liverange.sym b/src/test/ref/liverange.sym index 139c0f099..3dc8615ea 100644 --- a/src/test/ref/liverange.sym +++ b/src/test/ref/liverange.sym @@ -16,8 +16,7 @@ (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::a (byte) main::a#1 a zp ZP_BYTE:2 1.0 (byte) main::a#2 reg byte x 2.0 diff --git a/src/test/ref/local-string.cfg b/src/test/ref/local-string.cfg index 8a372460d..c59c738fb 100644 --- a/src/test/ref/local-string.cfg +++ b/src/test/ref/local-string.cfg @@ -20,6 +20,6 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) + [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 diff --git a/src/test/ref/local-string.log b/src/test/ref/local-string.log index e0a976d70..7ab042f20 100644 --- a/src/test/ref/local-string.log +++ b/src/test/ref/local-string.log @@ -11,7 +11,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte[]) main::msg ← (const string) main::$1 (byte) main::i#0 ← (number) 0 to:main::@1 @@ -22,7 +22,7 @@ main::@1: scope:[main] from main main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) main::screen#0 + (byte) main::i#3) ← *((byte[]) main::msg + (byte) main::i#3) + *((byte*) main::screen + (byte) main::i#3) ← *((byte[]) main::msg + (byte) main::i#3) (byte) main::i#1 ← ++ (byte) main::i#3 to:main::@1 main::@return: scope:[main] from main::@1 @@ -53,12 +53,11 @@ SYMBOL TABLE SSA (byte) main::i#3 (byte[]) main::msg (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← (number) 0 != *((byte[]) main::msg + (byte) main::i#2) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -72,7 +71,7 @@ Alias (byte) main::i#2 = (byte) main::i#3 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [5] if((byte) 0!=*((byte[]) main::msg + (byte) main::i#2)) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte[]) main::msg = main::$1 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -120,7 +119,7 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) + [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 @@ -130,7 +129,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 22.0 (byte) main::i#2 18.333333333333332 -(byte*) main::screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -187,7 +185,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda msg,y sta screen,y @@ -205,9 +203,9 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if((byte) 0!=*((const byte[]) main::msg + (byte) main::i#2)) goto main::@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*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [6] if((byte) 0!=*((const byte[]) main::msg + (byte) main::i#2)) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -262,7 +260,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta screen,x // [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -310,8 +308,7 @@ FINAL SYMBOL TABLE (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 18.333333333333332 (const byte[]) main::msg msg = (string) "message 2 " -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] @@ -353,7 +350,7 @@ main: { // main::@2 b2: // screen[i++] = msg[i] - // [8] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte[]) main::msg + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda msg,x sta screen,x // screen[i++] = msg[i]; diff --git a/src/test/ref/local-string.sym b/src/test/ref/local-string.sym index b26954505..b152cdbd9 100644 --- a/src/test/ref/local-string.sym +++ b/src/test/ref/local-string.sym @@ -9,7 +9,6 @@ (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 18.333333333333332 (const byte[]) main::msg msg = (string) "message 2 " -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] diff --git a/src/test/ref/localscope-simple.cfg b/src/test/ref/localscope-simple.cfg index ce7b7095d..2f2c396df 100644 --- a/src/test/ref/localscope-simple.cfg +++ b/src/test/ref/localscope-simple.cfg @@ -10,8 +10,8 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) BGCOL) ← (const byte) main::i#0 - [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 + [4] *((const byte*) BGCOL) ← (const byte) main::i + [5] *((const byte*) BGCOL) ← (const byte) main::i1 to:main::@return main::@return: scope:[main] from main [6] return diff --git a/src/test/ref/localscope-simple.log b/src/test/ref/localscope-simple.log index e3542b5a6..6234cd111 100644 --- a/src/test/ref/localscope-simple.log +++ b/src/test/ref/localscope-simple.log @@ -8,10 +8,10 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::i#0 ← (number) 0 - *((byte*) BGCOL) ← (byte) main::i#0 - (byte) main::i1#0 ← (number) 1 - *((byte*) BGCOL) ← (byte) main::i1#0 + (byte) main::i ← (number) 0 + *((byte*) BGCOL) ← (byte) main::i + (byte) main::i1 ← (number) 1 + *((byte*) BGCOL) ← (byte) main::i1 to:main::@return main::@return: scope:[main] from main return @@ -32,16 +32,14 @@ SYMBOL TABLE SSA (void()) main() (label) main::@return (byte) main::i -(byte) main::i#0 (byte) main::i1 -(byte) main::i1#0 -Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 -Adding number conversion cast (unumber) 1 in (byte) main::i1#0 ← (number) 1 +Adding number conversion cast (unumber) 0 in (byte) main::i ← (number) 0 +Adding number conversion cast (unumber) 1 in (byte) main::i1 ← (number) 1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 -Inlining cast (byte) main::i#0 ← (unumber)(number) 0 -Inlining cast (byte) main::i1#0 ← (unumber)(number) 1 +Inlining cast (byte) main::i ← (unumber)(number) 0 +Inlining cast (byte) main::i1 ← (unumber)(number) 1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53281 Simplifying constant integer cast 0 @@ -51,8 +49,8 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant (const byte*) BGCOL = (byte*) 53281 -Constant (const byte) main::i#0 = 0 -Constant (const byte) main::i1#0 = 1 +Constant (const byte) main::i = 0 +Constant (const byte) main::i1 = 1 Successful SSA optimization Pass2ConstantIdentification Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -81,8 +79,8 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) BGCOL) ← (const byte) main::i#0 - [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 + [4] *((const byte*) BGCOL) ← (const byte) main::i + [5] *((const byte*) BGCOL) ← (const byte) main::i1 to:main::@return main::@return: scope:[main] from main [6] return @@ -91,8 +89,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::i -(byte) main::i1 Initial phi equivalence classes Complete equivalence classes @@ -125,10 +121,10 @@ bend: main: { .const i = 0 .const i1 = 1 - // [4] *((const byte*) BGCOL) ← (const byte) main::i#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (const byte) main::i -- _deref_pbuc1=vbuc2 lda #i sta BGCOL - // [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) BGCOL) ← (const byte) main::i1 -- _deref_pbuc1=vbuc2 lda #i1 sta BGCOL jmp breturn @@ -140,8 +136,8 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) BGCOL) ← (const byte) main::i#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) BGCOL) ← (const byte) main::i [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) BGCOL) ← (const byte) main::i1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -177,10 +173,10 @@ bend: main: { .const i = 0 .const i1 = 1 - // [4] *((const byte*) BGCOL) ← (const byte) main::i#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (const byte) main::i -- _deref_pbuc1=vbuc2 lda #i sta BGCOL - // [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) BGCOL) ← (const byte) main::i1 -- _deref_pbuc1=vbuc2 lda #i1 sta BGCOL jmp breturn @@ -216,10 +212,8 @@ FINAL SYMBOL TABLE (const byte*) BGCOL BGCOL = (byte*) 53281 (void()) main() (label) main::@return -(byte) main::i -(const byte) main::i#0 i = (byte) 0 -(byte) main::i1 -(const byte) main::i1#0 i1 = (byte) 1 +(const byte) main::i i = (byte) 0 +(const byte) main::i1 i1 = (byte) 1 @@ -245,10 +239,10 @@ main: { .const i = 0 .const i1 = 1 // *BGCOL = i - // [4] *((const byte*) BGCOL) ← (const byte) main::i#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (const byte) main::i -- _deref_pbuc1=vbuc2 lda #i sta BGCOL - // [5] *((const byte*) BGCOL) ← (const byte) main::i1#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) BGCOL) ← (const byte) main::i1 -- _deref_pbuc1=vbuc2 lda #i1 sta BGCOL // main::@return diff --git a/src/test/ref/localscope-simple.sym b/src/test/ref/localscope-simple.sym index 351001ab0..fc35b7ad2 100644 --- a/src/test/ref/localscope-simple.sym +++ b/src/test/ref/localscope-simple.sym @@ -4,8 +4,6 @@ (const byte*) BGCOL BGCOL = (byte*) 53281 (void()) main() (label) main::@return -(byte) main::i -(const byte) main::i#0 i = (byte) 0 -(byte) main::i1 -(const byte) main::i1#0 i1 = (byte) 1 +(const byte) main::i i = (byte) 0 +(const byte) main::i1 i1 = (byte) 1 diff --git a/src/test/ref/longjump.cfg b/src/test/ref/longjump.cfg index a942666b9..83ae7e8b8 100644 --- a/src/test/ref/longjump.cfg +++ b/src/test/ref/longjump.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [7] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 [8] (byte) main::i#1 ← ++ (byte) main::i#2 [9] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/longjump.log b/src/test/ref/longjump.log index a7ca4c1ed..22285c4bb 100644 --- a/src/test/ref/longjump.log +++ b/src/test/ref/longjump.log @@ -7,13 +7,13 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$0) goto main::@1 @@ -38,19 +38,18 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 (byte) main::i#2 -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::i#1 ← ++ main::i#2 to ++ @@ -101,7 +100,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [7] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 [8] (byte) main::i#1 ← ++ (byte) main::i#2 [9] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return @@ -112,7 +111,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 14.666666666666666 @@ -421,7 +419,7 @@ main: { nop nop nop - // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [7] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -744,7 +742,7 @@ main: { nop nop nop - // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [7] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -793,8 +791,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 14.666666666666666 @@ -1088,7 +1085,7 @@ main: { nop nop // SCREEN[i] = i - // [7] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [7] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte i : 0..10) diff --git a/src/test/ref/longjump.sym b/src/test/ref/longjump.sym index a574074be..1573c48bf 100644 --- a/src/test/ref/longjump.sym +++ b/src/test/ref/longjump.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 14.666666666666666 diff --git a/src/test/ref/longjump2.cfg b/src/test/ref/longjump2.cfg index e767fcc68..2234c217f 100644 --- a/src/test/ref/longjump2.cfg +++ b/src/test/ref/longjump2.cfg @@ -28,7 +28,7 @@ long2: scope:[long2] from main::@1 long2::@1: scope:[long2] from long2 long2::@1 [10] (byte) long2::i#2 ← phi( long2/(byte) 0 long2::@1/(byte) long2::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [12] *((const byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 + [12] *((const byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 [13] (byte) long2::i#1 ← ++ (byte) long2::i#2 [14] if((byte) long2::i#1!=(byte) $b) goto long2::@1 to:long2::@return @@ -43,7 +43,7 @@ long1: scope:[long1] from main long1::@1: scope:[long1] from long1 long1::@1 [17] (byte) long1::i#2 ← phi( long1/(byte) 0 long1::@1/(byte) long1::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [19] *((const byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 + [19] *((const byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 [20] (byte) long1::i#1 ← ++ (byte) long1::i#2 [21] if((byte) long1::i#1!=(byte) $b) goto long1::@1 to:long1::@return diff --git a/src/test/ref/longjump2.log b/src/test/ref/longjump2.log index 23554cee6..d1bf9a529 100644 --- a/src/test/ref/longjump2.log +++ b/src/test/ref/longjump2.log @@ -24,13 +24,13 @@ main::@return: scope:[main] from main::@2 (void()) long1() long1: scope:[long1] from main - (byte*) long1::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) long1::SCREEN ← ((byte*)) (number) $400 (byte) long1::i#0 ← (byte) 0 to:long1::@1 long1::@1: scope:[long1] from long1 long1::@1 (byte) long1::i#2 ← phi( long1/(byte) long1::i#0 long1::@1/(byte) long1::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 + *((byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 (byte) long1::i#1 ← (byte) long1::i#2 + rangenext(0,$a) (bool~) long1::$0 ← (byte) long1::i#1 != rangelast(0,$a) if((bool~) long1::$0) goto long1::@1 @@ -41,13 +41,13 @@ long1::@return: scope:[long1] from long1::@1 (void()) long2() long2: scope:[long2] from main::@1 - (byte*) long2::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) long2::SCREEN ← ((byte*)) (number) $400 (byte) long2::i#0 ← (byte) 0 to:long2::@1 long2::@1: scope:[long2] from long2 long2::@1 (byte) long2::i#2 ← phi( long2/(byte) long2::i#0 long2::@1/(byte) long2::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 + *((byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 (byte) long2::i#1 ← (byte) long2::i#2 + rangenext(0,$a) (bool~) long2::$0 ← (byte) long2::i#1 != rangelast(0,$a) if((bool~) long2::$0) goto long2::@1 @@ -72,7 +72,6 @@ SYMBOL TABLE SSA (label) long1::@1 (label) long1::@return (byte*) long1::SCREEN -(byte*) long1::SCREEN#0 (byte) long1::i (byte) long1::i#0 (byte) long1::i#1 @@ -82,7 +81,6 @@ SYMBOL TABLE SSA (label) long2::@1 (label) long2::@return (byte*) long2::SCREEN -(byte*) long2::SCREEN#0 (byte) long2::i (byte) long2::i#0 (byte) long2::i#1 @@ -92,8 +90,8 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return -Inlining cast (byte*) long1::SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) long2::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) long1::SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) long2::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant pointer cast (byte*) 1024 @@ -101,9 +99,9 @@ Successful SSA optimization PassNCastSimplification Simple Condition (bool~) long1::$0 [10] if((byte) long1::i#1!=rangelast(0,$a)) goto long1::@1 Simple Condition (bool~) long2::$0 [19] if((byte) long2::i#1!=rangelast(0,$a)) goto long2::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) long1::SCREEN#0 = (byte*) 1024 +Constant (const byte*) long1::SCREEN = (byte*) 1024 Constant (const byte) long1::i#0 = 0 -Constant (const byte*) long2::SCREEN#0 = (byte*) 1024 +Constant (const byte*) long2::SCREEN = (byte*) 1024 Constant (const byte) long2::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [8] long1::i#1 ← ++ long1::i#2 to ++ @@ -187,7 +185,7 @@ long2: scope:[long2] from main::@1 long2::@1: scope:[long2] from long2 long2::@1 [10] (byte) long2::i#2 ← phi( long2/(byte) 0 long2::@1/(byte) long2::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [12] *((const byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 + [12] *((const byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 [13] (byte) long2::i#1 ← ++ (byte) long2::i#2 [14] if((byte) long2::i#1!=(byte) $b) goto long2::@1 to:long2::@return @@ -202,7 +200,7 @@ long1: scope:[long1] from main long1::@1: scope:[long1] from long1 long1::@1 [17] (byte) long1::i#2 ← phi( long1/(byte) 0 long1::@1/(byte) long1::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - [19] *((const byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 + [19] *((const byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 [20] (byte) long1::i#1 ← ++ (byte) long1::i#2 [21] if((byte) long1::i#1!=(byte) $b) goto long1::@1 to:long1::@return @@ -213,12 +211,10 @@ long1::@return: scope:[long1] from long1::@1 VARIABLE REGISTER WEIGHTS (void()) long1() -(byte*) long1::SCREEN (byte) long1::i (byte) long1::i#1 16.5 (byte) long1::i#2 14.666666666666666 (void()) long2() -(byte*) long2::SCREEN (byte) long2::i (byte) long2::i#1 16.5 (byte) long2::i#2 14.666666666666666 @@ -552,7 +548,7 @@ long2: { nop nop nop - // [12] *((const byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [12] *((const byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -841,7 +837,7 @@ long1: { nop nop nop - // [19] *((const byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [19] *((const byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -1190,7 +1186,7 @@ long2: { nop nop nop - // [12] *((const byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [12] *((const byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [13] (byte) long2::i#1 ← ++ (byte) long2::i#2 -- vbuxx=_inc_vbuxx @@ -1475,7 +1471,7 @@ long1: { nop nop nop - // [19] *((const byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [19] *((const byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [20] (byte) long1::i#1 ← ++ (byte) long1::i#2 -- vbuxx=_inc_vbuxx @@ -1539,16 +1535,14 @@ FINAL SYMBOL TABLE (void()) long1() (label) long1::@1 (label) long1::@return -(byte*) long1::SCREEN -(const byte*) long1::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) long1::SCREEN SCREEN = (byte*) 1024 (byte) long1::i (byte) long1::i#1 reg byte x 16.5 (byte) long1::i#2 reg byte x 14.666666666666666 (void()) long2() (label) long2::@1 (label) long2::@return -(byte*) long2::SCREEN -(const byte*) long2::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) long2::SCREEN SCREEN = (byte*) 1024 (byte) long2::i (byte) long2::i#1 reg byte x 16.5 (byte) long2::i#2 reg byte x 14.666666666666666 @@ -1863,7 +1857,7 @@ long2: { nop nop // SCREEN[i] = i - // [12] *((const byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [12] *((const byte*) long2::SCREEN + (byte) long2::i#2) ← (byte) long2::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte i : 0..10) @@ -2148,7 +2142,7 @@ long1: { nop nop // SCREEN[i] = i - // [19] *((const byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [19] *((const byte*) long1::SCREEN + (byte) long1::i#2) ← (byte) long1::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // for(byte i : 0..10) diff --git a/src/test/ref/longjump2.sym b/src/test/ref/longjump2.sym index 72ad07b11..6bad79f01 100644 --- a/src/test/ref/longjump2.sym +++ b/src/test/ref/longjump2.sym @@ -4,16 +4,14 @@ (void()) long1() (label) long1::@1 (label) long1::@return -(byte*) long1::SCREEN -(const byte*) long1::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) long1::SCREEN SCREEN = (byte*) 1024 (byte) long1::i (byte) long1::i#1 reg byte x 16.5 (byte) long1::i#2 reg byte x 14.666666666666666 (void()) long2() (label) long2::@1 (label) long2::@return -(byte*) long2::SCREEN -(const byte*) long2::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) long2::SCREEN SCREEN = (byte*) 1024 (byte) long2::i (byte) long2::i#1 reg byte x 16.5 (byte) long2::i#2 reg byte x 14.666666666666666 diff --git a/src/test/ref/loop-for-sideeffect.cfg b/src/test/ref/loop-for-sideeffect.cfg index c20fe5911..25ac3c905 100644 --- a/src/test/ref/loop-for-sideeffect.cfg +++ b/src/test/ref/loop-for-sideeffect.cfg @@ -18,12 +18,12 @@ main::@1: scope:[main] from main main::@2 [7] if((byte) main::i#3<(byte) 7) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 [9] return to:@return main::@2: scope:[main] from main::@1 - [10] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [10] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [11] (byte~) main::i#6 ← (byte) main::i#2 to:main::@1 diff --git a/src/test/ref/loop-for-sideeffect.log b/src/test/ref/loop-for-sideeffect.log index a4b943124..810f8bfaf 100644 --- a/src/test/ref/loop-for-sideeffect.log +++ b/src/test/ref/loop-for-sideeffect.log @@ -5,7 +5,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -21,11 +21,11 @@ main::@1: scope:[main] from main main::@2 to:main::@3 main::@2: scope:[main] from main::@1 (byte) main::i#4 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#0 + (byte) main::i#4) ← (byte) main::i#4 + *((byte*) SCREEN + (byte) main::i#4) ← (byte) main::i#4 to:main::@1 main::@3: scope:[main] from main::@1 (byte) main::i#5 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#0 + (byte) main::i#5) ← (byte) 'x' + *((byte*) SCREEN + (byte) main::i#5) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 return @@ -43,7 +43,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -61,7 +60,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 7 in (byte) main::i#1 ← (number) 7 Adding number conversion cast (unumber) 7 in (bool~) main::$0 ← (byte) main::i#3 < (number) 7 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#1 ← (unumber)(number) 7 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -75,7 +74,7 @@ Alias (byte) main::i#2 = (byte) main::i#4 (byte) main::i#5 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [6] if((byte) main::i#3<(byte) 7) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Constant (const byte) main::i#1 = 7 Successful SSA optimization Pass2ConstantIdentification @@ -122,19 +121,18 @@ main::@1: scope:[main] from main main::@2 [7] if((byte) main::i#3<(byte) 7) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 [9] return to:@return main::@2: scope:[main] from main::@1 - [10] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [10] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [11] (byte~) main::i#6 ← (byte) main::i#2 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#2 15.333333333333332 @@ -201,7 +199,7 @@ main: { jmp b3 // main::@3 b3: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuz1=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuz1=vbuc2 // The condition-evaluation should increment i - even if when it is not met - x should end up in 0x0408 lda #'x' ldy.z i @@ -213,7 +211,7 @@ main: { rts // main::@2 b2: - // [10] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [10] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -228,7 +226,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#3 main::i#6 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::i#2 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -283,7 +281,7 @@ main: { jmp b3 // main::@3 b3: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 // The condition-evaluation should increment i - even if when it is not met - x should end up in 0x0408 lda #'x' sta SCREEN,x @@ -294,7 +292,7 @@ main: { rts // main::@2 b2: - // [10] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [11] (byte~) main::i#6 ← (byte) main::i#2 -- vbuaa=vbuxx @@ -334,8 +332,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -385,7 +382,7 @@ main: { bcc b2 // main::@3 // (SCREEN)[i] = 'x' - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 // The condition-evaluation should increment i - even if when it is not met - x should end up in 0x0408 lda #'x' sta SCREEN,x @@ -396,7 +393,7 @@ main: { // main::@2 b2: // SCREEN[i] = i - // [10] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [11] (byte~) main::i#6 ← (byte) main::i#2 -- vbuaa=vbuxx diff --git a/src/test/ref/loop-for-sideeffect.sym b/src/test/ref/loop-for-sideeffect.sym index 627ce857f..2a4057c19 100644 --- a/src/test/ref/loop-for-sideeffect.sym +++ b/src/test/ref/loop-for-sideeffect.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/loop-memset-min.log b/src/test/ref/loop-memset-min.log index 3207f8a83..ef5993b2b 100644 --- a/src/test/ref/loop-memset-min.log +++ b/src/test/ref/loop-memset-min.log @@ -8,12 +8,12 @@ Culled Empty Block (label) memset::@3 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@2 (void()) main() main: scope:[main] from @2 - (void*) memset::str#0 ← (void*)(byte*) SCREEN#0 + (void*) memset::str#0 ← (void*)(byte*) SCREEN (byte) memset::c#0 ← (byte) 'c' (word) memset::num#0 ← (number) $3e8 call memset @@ -81,7 +81,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (label) main::@1 (label) main::@return @@ -131,7 +130,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 @@ -167,17 +166,17 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) memset::$1 [10] if((word) memset::num#0<=(byte) 0) goto memset::@1 Simple Condition (bool~) memset::$4 [20] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@5 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) memset::c#0 = 'c' Constant (const word) memset::num#0 = $3e8 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (void*)SCREEN#0 in [1] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)SCREEN in [1] (void*) memset::str#0 ← (void*)(const byte*) SCREEN Successful SSA optimization Pass2ConstantValues if() condition always false - eliminating [10] if((const word) memset::num#0<=(byte) 0) goto memset::@1 Successful SSA optimization Pass2ConstantIfs Eliminating unused variable (void*) memset::return#0 and assignment [2] (void*) memset::return#0 ← (void*) memset::str#0 Successful SSA optimization PassNEliminateUnusedVars -Constant (const void*) memset::str#0 = (void*)SCREEN#0 +Constant (const void*) memset::str#0 = (void*)SCREEN Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte*)memset::str#0 in [3] (byte*~) memset::$2 ← (byte*)(const void*) memset::str#0 Constant value identified (byte*)memset::str#0 in [5] (byte*) memset::dst#0 ← (byte*)(const void*) memset::str#0 @@ -260,7 +259,6 @@ memset::@2: scope:[memset] from memset::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c @@ -492,8 +490,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) @@ -511,7 +508,7 @@ FINAL SYMBOL TABLE (const word) memset::num#0 num = (word) $3e8 (void*) memset::return (void*) memset::str -(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0 +(const void*) memset::str#0 str = (void*)(const byte*) SCREEN zp ZP_WORD:2 [ memset::dst#2 memset::dst#1 ] diff --git a/src/test/ref/loop-memset-min.sym b/src/test/ref/loop-memset-min.sym index c6fda7016..c79b40f2e 100644 --- a/src/test/ref/loop-memset-min.sym +++ b/src/test/ref/loop-memset-min.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) @@ -20,6 +19,6 @@ (const word) memset::num#0 num = (word) $3e8 (void*) memset::return (void*) memset::str -(const void*) memset::str#0 str = (void*)(const byte*) SCREEN#0 +(const void*) memset::str#0 str = (void*)(const byte*) SCREEN zp ZP_WORD:2 [ memset::dst#2 memset::dst#1 ] diff --git a/src/test/ref/loop-problem.cfg b/src/test/ref/loop-problem.cfg index 7b58670e9..f4c828655 100644 --- a/src/test/ref/loop-problem.cfg +++ b/src/test/ref/loop-problem.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (byte) '0' + [4] *((const byte*) SCREEN) ← (byte) '0' [5] call d to:main::@1 main::@1: scope:[main] from main @@ -39,7 +39,7 @@ b::@return: scope:[b] from b::@2 (void()) d() d: scope:[d] from b::@1 main - [15] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) + [15] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) to:d::@return d::@return: scope:[d] from d [16] return diff --git a/src/test/ref/loop-problem.log b/src/test/ref/loop-problem.log index 0417acb2e..8d699672c 100644 --- a/src/test/ref/loop-problem.log +++ b/src/test/ref/loop-problem.log @@ -5,12 +5,12 @@ Culled Empty Block (label) @2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@3 (void()) main() main: scope:[main] from @3 - *((byte*) SCREEN#0) ← (byte) '0' + *((byte*) SCREEN) ← (byte) '0' call d to:main::@1 main::@1: scope:[main] from main @@ -42,7 +42,7 @@ b::@return: scope:[b] from b::@3 (void()) d() d: scope:[d] from b::@1 main - *((byte*) SCREEN#0) ← ++ *((byte*) SCREEN#0) + *((byte*) SCREEN) ← ++ *((byte*) SCREEN) to:d::@return d::@return: scope:[d] from d return @@ -60,7 +60,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) b() (bool~) b::$1 (label) b::@1 @@ -78,7 +77,7 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification @@ -86,7 +85,7 @@ Alias (byte) b::i#2 = (byte) b::i#3 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) b::$1 [11] if((byte) b::i#1!=rangelast(0,3)) goto b::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) b::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [9] b::i#1 ← ++ b::i#2 to ++ @@ -140,7 +139,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN#0) ← (byte) '0' + [4] *((const byte*) SCREEN) ← (byte) '0' [5] call d to:main::@1 main::@1: scope:[main] from main @@ -169,7 +168,7 @@ b::@return: scope:[b] from b::@2 (void()) d() d: scope:[d] from b::@1 main - [15] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) + [15] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) to:d::@return d::@return: scope:[d] from d [16] return @@ -178,7 +177,6 @@ d::@return: scope:[d] from d null depth in calling loop Loop head: b::@1 tails: b::@2 blocks: b::@2 b::@1 in scope d VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) b() (byte) b::i (byte) b::i#1 16.5 @@ -218,7 +216,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN#0) ← (byte) '0' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (byte) '0' -- _deref_pbuc1=vbuc2 lda #'0' sta SCREEN // [5] call d @@ -272,7 +270,7 @@ b: { } // d d: { - // [15] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [15] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN jmp breturn // d::@return @@ -283,7 +281,7 @@ d: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ b::i#2 b::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , REGISTER UPLIFT SCOPES @@ -322,7 +320,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN#0) ← (byte) '0' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (byte) '0' -- _deref_pbuc1=vbuc2 lda #'0' sta SCREEN // [5] call d @@ -373,7 +371,7 @@ b: { } // d d: { - // [15] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [15] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN jmp breturn // d::@return @@ -421,8 +419,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) b() (label) b::@1 (label) b::@2 @@ -459,7 +456,7 @@ Score: 187 // main main: { // *SCREEN = '0' - // [4] *((const byte*) SCREEN#0) ← (byte) '0' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (byte) '0' -- _deref_pbuc1=vbuc2 lda #'0' sta SCREEN // d() @@ -503,7 +500,7 @@ b: { // d d: { // (*SCREEN)++; - // [15] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [15] *((const byte*) SCREEN) ← ++ *((const byte*) SCREEN) -- _deref_pbuc1=_inc__deref_pbuc1 inc SCREEN // d::@return // } diff --git a/src/test/ref/loop-problem.sym b/src/test/ref/loop-problem.sym index 6379a2999..6a0c65fe0 100644 --- a/src/test/ref/loop-problem.sym +++ b/src/test/ref/loop-problem.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) b() (label) b::@1 (label) b::@2 diff --git a/src/test/ref/loop-while-min.cfg b/src/test/ref/loop-while-min.cfg index e54d5f046..fc9e59a45 100644 --- a/src/test/ref/loop-while-min.cfg +++ b/src/test/ref/loop-while-min.cfg @@ -20,6 +20,6 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 diff --git a/src/test/ref/loop-while-min.log b/src/test/ref/loop-while-min.log index adfe03765..0b68d3e29 100644 --- a/src/test/ref/loop-while-min.log +++ b/src/test/ref/loop-while-min.log @@ -6,7 +6,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -20,7 +20,7 @@ main::@1: scope:[main] from main main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#0 + (byte) main::i#3) ← (byte) main::i#3 + *((byte*) SCREEN + (byte) main::i#3) ← (byte) main::i#3 (byte) main::i#1 ← ++ (byte) main::i#3 to:main::@1 main::@return: scope:[main] from main::@1 @@ -39,7 +39,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -54,7 +53,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) $64 in (bool~) main::$0 ← (byte) main::i#2 != (number) $64 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -68,7 +67,7 @@ Alias (byte) main::i#2 = (byte) main::i#3 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [4] if((byte) main::i#2!=(byte) $64) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 @@ -114,13 +113,12 @@ main::@return: scope:[main] from main::@1 [7] return to:@return main::@2: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 + [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 [9] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 22.0 @@ -180,7 +178,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -247,7 +245,7 @@ main: { rts // main::@2 b2: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -285,8 +283,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -334,7 +331,7 @@ main: { // main::@2 b2: // SCREEN[i] = i - // [8] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + // [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // i++; diff --git a/src/test/ref/loop-while-min.sym b/src/test/ref/loop-while-min.sym index 19dc59f31..9c54da9e4 100644 --- a/src/test/ref/loop-while-min.sym +++ b/src/test/ref/loop-while-min.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/loop-while-sideeffect.cfg b/src/test/ref/loop-while-sideeffect.cfg index 77a2ad1eb..d054ba22b 100644 --- a/src/test/ref/loop-while-sideeffect.cfg +++ b/src/test/ref/loop-while-sideeffect.cfg @@ -18,12 +18,12 @@ main::@1: scope:[main] from main main::@2 [7] if((byte) main::i#2!=(byte) 7) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' + [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 [9] return to:@return main::@2: scope:[main] from main::@1 - [10] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::i#1 + [10] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::i#1 [11] (byte~) main::i#5 ← (byte) main::i#1 to:main::@1 diff --git a/src/test/ref/loop-while-sideeffect.log b/src/test/ref/loop-while-sideeffect.log index 864736481..2234d4fd5 100644 --- a/src/test/ref/loop-while-sideeffect.log +++ b/src/test/ref/loop-while-sideeffect.log @@ -5,7 +5,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@1 (void()) main() @@ -20,11 +20,11 @@ main::@1: scope:[main] from main main::@2 to:main::@3 main::@2: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#0 + (byte) main::i#3) ← (byte) main::i#3 + *((byte*) SCREEN + (byte) main::i#3) ← (byte) main::i#3 to:main::@1 main::@3: scope:[main] from main::@1 (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#0 + (byte) main::i#4) ← (byte) 'x' + *((byte*) SCREEN + (byte) main::i#4) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 return @@ -42,7 +42,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -59,7 +58,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 7 in (byte) main::i#0 ← (number) 7 Adding number conversion cast (unumber) 7 in (bool~) main::$0 ← (byte) main::i#2 != (number) 7 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 7 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -73,7 +72,7 @@ Alias (byte) main::i#1 = (byte) main::i#3 (byte) main::i#4 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [5] if((byte) main::i#2!=(byte) 7) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 7 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 @@ -117,19 +116,18 @@ main::@1: scope:[main] from main main::@2 [7] if((byte) main::i#2!=(byte) 7) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' + [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' to:main::@return main::@return: scope:[main] from main::@3 [9] return to:@return main::@2: scope:[main] from main::@1 - [10] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::i#1 + [10] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::i#1 [11] (byte~) main::i#5 ← (byte) main::i#1 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 15.333333333333332 @@ -195,7 +193,7 @@ main: { jmp b3 // main::@3 b3: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuz1=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuz1=vbuc2 // The condition-evaluation should increment i - even if when it is not met lda #'x' ldy.z i @@ -207,7 +205,7 @@ main: { rts // main::@2 b2: - // [10] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuz1=vbuz1 + // [10] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuz1=vbuz1 ldy.z i tya sta SCREEN,y @@ -222,7 +220,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#5 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::i#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -276,7 +274,7 @@ main: { jmp b3 // main::@3 b3: - // [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 // The condition-evaluation should increment i - even if when it is not met lda #'x' sta SCREEN,x @@ -287,7 +285,7 @@ main: { rts // main::@2 b2: - // [10] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [11] (byte~) main::i#5 ← (byte) main::i#1 -- vbuaa=vbuxx @@ -327,8 +325,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -377,7 +374,7 @@ main: { bne b2 // main::@3 // (SCREEN)[i] = 'x' - // [8] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 + // [8] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) 'x' -- pbuc1_derefidx_vbuxx=vbuc2 // The condition-evaluation should increment i - even if when it is not met lda #'x' sta SCREEN,x @@ -388,7 +385,7 @@ main: { // main::@2 b2: // SCREEN[i] = i - // [10] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuxx=vbuxx + // [10] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::i#1 -- pbuc1_derefidx_vbuxx=vbuxx txa sta SCREEN,x // [11] (byte~) main::i#5 ← (byte) main::i#1 -- vbuaa=vbuxx diff --git a/src/test/ref/loop-while-sideeffect.sym b/src/test/ref/loop-while-sideeffect.sym index a335e8d3f..db4d85e99 100644 --- a/src/test/ref/loop-while-sideeffect.sym +++ b/src/test/ref/loop-while-sideeffect.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/loopnest.cfg b/src/test/ref/loopnest.cfg index 9a3c6eb6f..bd00a69fd 100644 --- a/src/test/ref/loopnest.cfg +++ b/src/test/ref/loopnest.cfg @@ -30,7 +30,7 @@ nest: scope:[nest] from main::@1 to:nest::@1 nest::@1: scope:[nest] from nest nest::@1 [11] (byte) nest::j#2 ← phi( nest/(byte) $64 nest::@1/(byte) nest::j#1 ) - [12] *((const byte*) SCREEN#0) ← (byte) nest::j#2 + [12] *((const byte*) SCREEN) ← (byte) nest::j#2 [13] (byte) nest::j#1 ← -- (byte) nest::j#2 [14] if((byte) nest::j#1>(byte) 0) goto nest::@1 to:nest::@return diff --git a/src/test/ref/loopnest.log b/src/test/ref/loopnest.log index e72ccd007..d3f5ab078 100644 --- a/src/test/ref/loopnest.log +++ b/src/test/ref/loopnest.log @@ -5,7 +5,7 @@ Culled Empty Block (label) nest::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@2 (void()) main() @@ -32,7 +32,7 @@ nest: scope:[nest] from main::@1 to:nest::@1 nest::@1: scope:[nest] from nest nest::@1 (byte) nest::j#2 ← phi( nest/(byte) nest::j#0 nest::@1/(byte) nest::j#1 ) - *((byte*) SCREEN#0) ← (byte) nest::j#2 + *((byte*) SCREEN) ← (byte) nest::j#2 (byte) nest::j#1 ← -- (byte) nest::j#2 (bool~) nest::$0 ← (byte) nest::j#1 > (number) 0 if((bool~) nest::$0) goto nest::@1 @@ -53,7 +53,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$1 (label) main::@1 @@ -78,7 +77,7 @@ Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (byte) main::i Adding number conversion cast (unumber) $64 in (byte) nest::j#0 ← (number) $64 Adding number conversion cast (unumber) 0 in (bool~) nest::$0 ← (byte) nest::j#1 > (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) $64 Inlining cast (byte) nest::j#0 ← (unumber)(number) $64 Successful SSA optimization Pass2InlineCast @@ -98,7 +97,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [7] if((byte) main::i#1>(byte) 0) goto main::@1 Simple Condition (bool~) nest::$0 [14] if((byte) nest::j#1>(byte) 0) goto nest::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = $64 Constant (const byte) nest::j#0 = $64 Successful SSA optimization Pass2ConstantIdentification @@ -167,7 +166,7 @@ nest: scope:[nest] from main::@1 to:nest::@1 nest::@1: scope:[nest] from nest nest::@1 [11] (byte) nest::j#2 ← phi( nest/(byte) $64 nest::@1/(byte) nest::j#1 ) - [12] *((const byte*) SCREEN#0) ← (byte) nest::j#2 + [12] *((const byte*) SCREEN) ← (byte) nest::j#2 [13] (byte) nest::j#1 ← -- (byte) nest::j#2 [14] if((byte) nest::j#1>(byte) 0) goto nest::@1 to:nest::@return @@ -177,7 +176,6 @@ nest::@return: scope:[nest] from nest::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -269,7 +267,7 @@ nest: { jmp b1 // nest::@1 b1: - // [12] *((const byte*) SCREEN#0) ← (byte) nest::j#2 -- _deref_pbuc1=vbuz1 + // [12] *((const byte*) SCREEN) ← (byte) nest::j#2 -- _deref_pbuc1=vbuz1 lda.z j sta SCREEN // [13] (byte) nest::j#1 ← -- (byte) nest::j#2 -- vbuz1=_dec_vbuz1 @@ -366,7 +364,7 @@ nest: { jmp b1 // nest::@1 b1: - // [12] *((const byte*) SCREEN#0) ← (byte) nest::j#2 -- _deref_pbuc1=vbuxx + // [12] *((const byte*) SCREEN) ← (byte) nest::j#2 -- _deref_pbuc1=vbuxx stx SCREEN // [13] (byte) nest::j#1 ← -- (byte) nest::j#2 -- vbuxx=_dec_vbuxx dex @@ -420,8 +418,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -492,7 +489,7 @@ nest: { // nest::@1 b1: // *SCREEN = j - // [12] *((const byte*) SCREEN#0) ← (byte) nest::j#2 -- _deref_pbuc1=vbuxx + // [12] *((const byte*) SCREEN) ← (byte) nest::j#2 -- _deref_pbuc1=vbuxx stx SCREEN // while (--j>0) // [13] (byte) nest::j#1 ← -- (byte) nest::j#2 -- vbuxx=_dec_vbuxx diff --git a/src/test/ref/loopnest.sym b/src/test/ref/loopnest.sym index 7502abaa1..71eeeba44 100644 --- a/src/test/ref/loopnest.sym +++ b/src/test/ref/loopnest.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/loopnest2.cfg b/src/test/ref/loopnest2.cfg index b28fa8fad..24642d825 100644 --- a/src/test/ref/loopnest2.cfg +++ b/src/test/ref/loopnest2.cfg @@ -63,7 +63,7 @@ nest2::@1: scope:[nest2] from nest2 nest2::@3 to:nest2::@2 nest2::@2: scope:[nest2] from nest2::@1 nest2::@2 [24] (byte) nest2::j#2 ← phi( nest2::@1/(byte) $64 nest2::@2/(byte) nest2::j#1 ) - [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 + [25] *((const byte*) SCREEN) ← (byte) nest2::j#2 [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [27] if((byte) nest2::j#1>(byte) 0) goto nest2::@2 to:nest2::@3 diff --git a/src/test/ref/loopnest2.log b/src/test/ref/loopnest2.log index e8d628600..2408d52e5 100644 --- a/src/test/ref/loopnest2.log +++ b/src/test/ref/loopnest2.log @@ -7,7 +7,7 @@ Culled Empty Block (label) nest2::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@3 (void()) main() @@ -81,7 +81,7 @@ nest2::@1: scope:[nest2] from nest2 nest2::@3 nest2::@2: scope:[nest2] from nest2::@1 nest2::@2 (byte) nest2::i#3 ← phi( nest2::@1/(byte) nest2::i#4 nest2::@2/(byte) nest2::i#3 ) (byte) nest2::j#2 ← phi( nest2::@1/(byte) nest2::j#0 nest2::@2/(byte) nest2::j#1 ) - *((byte*) SCREEN#0) ← (byte) nest2::j#2 + *((byte*) SCREEN) ← (byte) nest2::j#2 (byte) nest2::j#1 ← -- (byte) nest2::j#2 (bool~) nest2::$0 ← (byte) nest2::j#1 > (number) 0 if((bool~) nest2::$0) goto nest2::@2 @@ -108,7 +108,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$1 (bool~) main::$2 @@ -180,7 +179,7 @@ Adding number conversion cast (unumber) $64 in (byte) nest2::j#0 ← (number) $6 Adding number conversion cast (unumber) 0 in (bool~) nest2::$0 ← (byte) nest2::j#1 > (number) 0 Adding number conversion cast (unumber) 0 in (bool~) nest2::$1 ← (byte) nest2::i#1 > (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) $64 Inlining cast (byte) main::j#0 ← (unumber)(number) $64 Inlining cast (byte) nest1::i#0 ← (unumber)(number) $64 @@ -232,7 +231,7 @@ Simple Condition (bool~) nest1::$2 [27] if((byte) nest1::i#1>(byte) 0) goto nest Simple Condition (bool~) nest2::$0 [36] if((byte) nest2::j#1>(byte) 0) goto nest2::@2 Simple Condition (bool~) nest2::$1 [40] if((byte) nest2::i#1>(byte) 0) goto nest2::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = $64 Constant (const byte) main::j#0 = $64 Constant (const byte) nest1::i#0 = $64 @@ -362,7 +361,7 @@ nest2::@1: scope:[nest2] from nest2 nest2::@3 to:nest2::@2 nest2::@2: scope:[nest2] from nest2::@1 nest2::@2 [24] (byte) nest2::j#2 ← phi( nest2::@1/(byte) $64 nest2::@2/(byte) nest2::j#1 ) - [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 + [25] *((const byte*) SCREEN) ← (byte) nest2::j#2 [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [27] if((byte) nest2::j#1>(byte) 0) goto nest2::@2 to:nest2::@3 @@ -376,7 +375,6 @@ nest2::@return: scope:[nest2] from nest2::@3 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -581,7 +579,7 @@ nest2: { jmp b2 // nest2::@2 b2: - // [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuz1 + // [25] *((const byte*) SCREEN) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuz1 lda.z j sta SCREEN // [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 -- vbuz1=_dec_vbuz1 @@ -785,7 +783,7 @@ nest2: { jmp b2 // nest2::@2 b2: - // [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuyy + // [25] *((const byte*) SCREEN) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuyy sty SCREEN // [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 -- vbuyy=_dec_vbuyy dey @@ -878,8 +876,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -1043,7 +1040,7 @@ nest2: { // nest2::@2 b2: // *SCREEN = j - // [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuyy + // [25] *((const byte*) SCREEN) ← (byte) nest2::j#2 -- _deref_pbuc1=vbuyy sty SCREEN // while (--j>0) // [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 -- vbuyy=_dec_vbuyy diff --git a/src/test/ref/loopnest2.sym b/src/test/ref/loopnest2.sym index 5e59b005b..661b92b82 100644 --- a/src/test/ref/loopnest2.sym +++ b/src/test/ref/loopnest2.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/malloc-0.log b/src/test/ref/malloc-0.log index e4a5f6eb2..1caf92677 100644 --- a/src/test/ref/malloc-0.log +++ b/src/test/ref/malloc-0.log @@ -22,8 +22,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@12 (void*()) malloc((word) malloc::size) @@ -95,7 +95,6 @@ SYMBOL TABLE SSA (byte*) BYTES#2 (byte*) BYTES#3 (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (const byte) RADIX::BINARY = (number) 2 (const byte) RADIX::DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL = (number) $10 @@ -134,7 +133,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $100 in (word) malloc::size#0 ← (number) $100 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (word) malloc::size#0 ← (unumber)(number) $100 Inlining cast (byte*) BYTES#0 ← (byte*)(void*~) $0 @@ -144,7 +143,7 @@ Simplifying constant integer cast $100 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (word) $100 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#7 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#7 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#5 (byte*) heap_head#2 @@ -152,7 +151,7 @@ Alias (void*) malloc::return#2 = (void*) malloc::return#4 Alias (byte*) heap_head#3 = (byte*) heap_head#6 Alias (byte*) BYTES#0 = (byte*) BYTES#3 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) heap_head#4 (byte*) HEAP_TOP#0 +Identical Phi Values (byte*) heap_head#4 (byte*) HEAP_TOP Identical Phi Values (word) malloc::size#1 (word) malloc::size#0 Identical Phi Values (byte*) heap_head#3 (byte*) heap_head#1 Identical Phi Values (byte*) BYTES#2 (byte*) BYTES#0 @@ -160,7 +159,7 @@ Identical Phi Values (byte*) BYTES#1 (byte*) BYTES#2 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$0 [25] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const word) malloc::size#0 = $100 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -174,9 +173,9 @@ Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP#0 - (const word) malloc::size#0 +Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP - (const word) malloc::size#0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) malloc::mem#0 = HEAP_TOP#0-malloc::size#0 +Constant (const byte*) malloc::mem#0 = HEAP_TOP-malloc::size#0 Successful SSA optimization Pass2ConstantIdentification Constant value identified (void*)malloc::mem#0 in [1] (void*) malloc::return#0 ← (void*)(const byte*) malloc::mem#0 Successful SSA optimization Pass2ConstantValues @@ -265,7 +264,6 @@ malloc::@return: scope:[malloc] from malloc VARIABLE REGISTER WEIGHTS (byte*) BYTES -(byte*) HEAP_TOP (byte*) heap_head (void()) main() (byte) main::i @@ -492,8 +490,7 @@ FINAL SYMBOL TABLE (label) @end (byte*) BYTES (const byte*) BYTES#0 BYTES = (byte*)(const void*) malloc::return#0 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -508,7 +505,7 @@ FINAL SYMBOL TABLE (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size diff --git a/src/test/ref/malloc-0.sym b/src/test/ref/malloc-0.sym index 83f102972..65964e8e1 100644 --- a/src/test/ref/malloc-0.sym +++ b/src/test/ref/malloc-0.sym @@ -4,8 +4,7 @@ (label) @end (byte*) BYTES (const byte*) BYTES#0 BYTES = (byte*)(const void*) malloc::return#0 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -20,7 +19,7 @@ (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size diff --git a/src/test/ref/malloc-1.log b/src/test/ref/malloc-1.log index 12768e068..b6044bca0 100644 --- a/src/test/ref/malloc-1.log +++ b/src/test/ref/malloc-1.log @@ -23,8 +23,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@12 (void*()) malloc((word) malloc::size) @@ -93,7 +93,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (const byte) RADIX::BINARY = (number) 2 (const byte) RADIX::DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL = (number) $10 @@ -141,7 +140,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $200 in (word) malloc::size#0 ← (number) $200 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (word) malloc::size#0 ← (unumber)(number) $200 Inlining cast (word*) WORDS#0 ← (word*)(void*~) $0 @@ -151,7 +150,7 @@ Simplifying constant integer cast $200 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (word) $200 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#7 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#7 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#5 (byte*) heap_head#2 @@ -159,14 +158,14 @@ Alias (void*) malloc::return#2 = (void*) malloc::return#4 Alias (byte*) heap_head#3 = (byte*) heap_head#6 Alias (word*) WORDS#0 = (word*) WORDS#2 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) heap_head#4 (byte*) HEAP_TOP#0 +Identical Phi Values (byte*) heap_head#4 (byte*) HEAP_TOP Identical Phi Values (word) malloc::size#1 (word) malloc::size#0 Identical Phi Values (byte*) heap_head#3 (byte*) heap_head#1 Identical Phi Values (word*) WORDS#1 (word*) WORDS#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$0 [27] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const word) malloc::size#0 = $200 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -180,9 +179,9 @@ Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP#0 - (const word) malloc::size#0 +Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP - (const word) malloc::size#0 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) malloc::mem#0 = HEAP_TOP#0-malloc::size#0 +Constant (const byte*) malloc::mem#0 = HEAP_TOP-malloc::size#0 Successful SSA optimization Pass2ConstantIdentification Constant value identified (void*)malloc::mem#0 in [1] (void*) malloc::return#0 ← (void*)(const byte*) malloc::mem#0 Successful SSA optimization Pass2ConstantValues @@ -277,7 +276,6 @@ malloc::@return: scope:[malloc] from malloc VARIABLE REGISTER WEIGHTS -(byte*) HEAP_TOP (word*) WORDS (byte*) heap_head (void()) main() @@ -556,8 +554,7 @@ FINAL SYMBOL TABLE (label) @2 (label) @begin (label) @end -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -578,7 +575,7 @@ FINAL SYMBOL TABLE (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size diff --git a/src/test/ref/malloc-1.sym b/src/test/ref/malloc-1.sym index 23dee1278..80edf6cf0 100644 --- a/src/test/ref/malloc-1.sym +++ b/src/test/ref/malloc-1.sym @@ -2,8 +2,7 @@ (label) @2 (label) @begin (label) @end -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -24,7 +23,7 @@ (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size diff --git a/src/test/ref/memory-heap.cfg b/src/test/ref/memory-heap.cfg index b48a85180..2ff2f7966 100644 --- a/src/test/ref/memory-heap.cfg +++ b/src/test/ref/memory-heap.cfg @@ -37,8 +37,8 @@ main::@5: scope:[main] from main::@2 [18] call free to:main::@6 main::@6: scope:[main] from main::@5 - [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) - [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) + [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) + [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) to:main::@return main::@return: scope:[main] from main::@6 [21] return @@ -54,7 +54,7 @@ free::@return: scope:[free] from free (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from main main::@3 - [24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_TOP#0 main::@3/(byte*) heap_head#1 ) + [24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_TOP main::@3/(byte*) heap_head#1 ) [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 - (byte) $64 [26] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return diff --git a/src/test/ref/memory-heap.log b/src/test/ref/memory-heap.log index 079d9ddac..003f13c02 100644 --- a/src/test/ref/memory-heap.log +++ b/src/test/ref/memory-heap.log @@ -23,8 +23,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@13 (void*()) malloc((word) malloc::size) @@ -107,9 +107,9 @@ main::@6: scope:[main] from main::@5 (byte*) heap_head#14 ← phi( main::@5/(byte*) heap_head#16 ) (byte*) main::buf2#3 ← phi( main::@5/(byte*) main::buf2#2 ) (byte*) main::buf1#3 ← phi( main::@5/(byte*) main::buf1#5 ) - (byte*) main::screen#0 ← ((byte*)) (number) $400 - *((byte*) main::screen#0 + (number) 0) ← *((byte*) main::buf1#3) - *((byte*) main::screen#0 + (number) 1) ← *((byte*) main::buf2#3) + (byte*) main::screen ← ((byte*)) (number) $400 + *((byte*) main::screen + (number) 0) ← *((byte*) main::buf1#3) + *((byte*) main::screen + (number) 1) ← *((byte*) main::buf2#3) to:main::@return main::@return: scope:[main] from main::@6 (byte*) heap_head#11 ← phi( main::@6/(byte*) heap_head#14 ) @@ -133,7 +133,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (const byte) RADIX::BINARY = (number) 2 (const byte) RADIX::DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL = (number) $10 @@ -193,7 +192,6 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 (byte*) main::screen -(byte*) main::screen#0 (void*()) malloc((word) malloc::size) (byte*~) malloc::$0 (label) malloc::@return @@ -216,16 +214,16 @@ Adding number conversion cast (unumber) $64 in (word) malloc::size#0 ← (number Adding number conversion cast (unumber) $64 in (word) malloc::size#1 ← (number) $64 Adding number conversion cast (unumber) $ff in (number~) main::$4 ← (number) $ff - (byte) main::i#2 Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (unumber)(number) $ff - (byte) main::i#2 -Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← *((byte*) main::buf1#3) -Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← *((byte*) main::buf2#3) +Adding number conversion cast (unumber) 0 in *((byte*) main::screen + (number) 0) ← *((byte*) main::buf1#3) +Adding number conversion cast (unumber) 1 in *((byte*) main::screen + (number) 1) ← *((byte*) main::buf2#3) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (word) malloc::size#0 ← (unumber)(number) $64 Inlining cast (byte*) main::buf1#0 ← (byte*)(void*~) main::$0 Inlining cast (word) malloc::size#1 ← (unumber)(number) $64 Inlining cast (byte*) main::buf2#0 ← (byte*)(void*~) main::$1 -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 40960 Simplifying constant integer cast $64 @@ -242,7 +240,7 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to byte in (unumber~) main::$4 ← (byte) $ff - (byte) main::i#2 -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#15 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#15 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#4 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#8 (byte*) heap_head#2 @@ -256,7 +254,7 @@ Alias (byte*) main::buf2#1 = (byte*) main::buf2#4 (byte*) main::buf2#2 (byte*) m Alias (byte*) heap_head#11 = (byte*) heap_head#17 (byte*) heap_head#18 (byte*) heap_head#16 (byte*) heap_head#14 (byte*) heap_head#5 Alias (byte*) heap_head#12 = (byte*) heap_head#6 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) heap_head#13 (byte*) HEAP_TOP#0 +Identical Phi Values (byte*) heap_head#13 (byte*) HEAP_TOP Identical Phi Values (byte*) heap_head#3 (byte*) heap_head#1 Identical Phi Values (byte*) heap_head#10 (byte*) heap_head#1 Identical Phi Values (byte*) main::buf1#1 (byte*) main::buf1#0 @@ -266,15 +264,15 @@ Identical Phi Values (byte*) heap_head#12 (byte*) heap_head#11 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$5 [34] if((byte) main::i#1!=rangelast(0,$63)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const word) malloc::size#0 = $64 Constant (const word) malloc::size#1 = $64 Constant (const byte) main::i#0 = 0 -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [32] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [34] if(main::i#1!=rangelast(0,$63)) goto main::@1 to (number) $64 -Simplifying expression containing zero main::screen#0 in [43] *((const byte*) main::screen#0 + (byte) 0) ← *((byte*) main::buf1#0) +Simplifying expression containing zero main::screen in [43] *((const byte*) main::screen + (byte) 0) ← *((byte*) main::buf1#0) Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused variable (void*) free::ptr#0 and assignment [20] (void*) free::ptr#0 ← (void*)(byte*) main::buf1#0 Eliminating unused variable (void*) free::ptr#1 and assignment [22] (void*) free::ptr#1 ← (void*)(byte*) main::buf2#0 @@ -300,7 +298,7 @@ Constant inlined main::i#0 = (byte) 0 Constant inlined malloc::size#1 = (byte) $64 Constant inlined malloc::size#0 = (byte) $64 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::screen#0+1) +Consolidated array index constant in *(main::screen+1) Successful SSA optimization Pass2ConstantAdditionElimination Identical Phi Values (word) malloc::size#2 (byte) $64 Successful SSA optimization Pass2IdenticalPhiElimination @@ -375,8 +373,8 @@ main::@5: scope:[main] from main::@2 [18] call free to:main::@6 main::@6: scope:[main] from main::@5 - [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) - [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) + [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) + [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) to:main::@return main::@return: scope:[main] from main::@6 [21] return @@ -392,7 +390,7 @@ free::@return: scope:[free] from free (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from main main::@3 - [24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_TOP#0 main::@3/(byte*) heap_head#1 ) + [24] (byte*) heap_head#7 ← phi( main/(const byte*) HEAP_TOP main::@3/(byte*) heap_head#1 ) [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 - (byte) $64 [26] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return @@ -402,7 +400,6 @@ malloc::@return: scope:[malloc] from malloc VARIABLE REGISTER WEIGHTS -(byte*) HEAP_TOP (void()) free((void*) free::ptr) (void*) free::ptr (byte*) heap_head @@ -417,7 +414,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 16.5 -(byte*) main::screen (void*()) malloc((word) malloc::size) (byte*) malloc::mem (byte*) malloc::mem#0 0.8 @@ -483,7 +479,7 @@ main: { // [5] call malloc // [24] phi from main to malloc [phi:main->malloc] malloc_from_main: - // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP#0 [phi:main->malloc#0] -- pbuz1=pbuc1 + // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP [phi:main->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -562,11 +558,11 @@ main: { jmp b6 // main::@6 b6: - // [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 + // [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 ldy #0 lda (buf1),y sta screen - // [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 + // [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 ldy #0 lda (buf2),y sta screen+1 @@ -617,16 +613,16 @@ Statement [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1 Statement [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a Statement [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) 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 [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y -Statement [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y +Statement [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y +Statement [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y Statement [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 - (byte) $64 [ malloc::mem#0 ] ( main:2::malloc:5 [ malloc::mem#0 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 ] ) always clobbers reg byte a Statement [26] (byte*) heap_head#1 ← (byte*) malloc::mem#0 [ malloc::mem#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#1 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#1 ] ) always clobbers reg byte a Statement [6] (void*) main::buf1#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 heap_head#1 ] ( main:2 [ main::buf1#0 heap_head#1 ] ) always clobbers reg byte a Statement [8] (void*) main::buf2#0 ← (void*)(byte*) malloc::mem#0 [ main::buf1#0 main::buf2#0 ] ( main:2 [ main::buf1#0 main::buf2#0 ] ) always clobbers reg byte a Statement [10] *((byte*)(void*) main::buf1#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 ] ) always clobbers reg byte a Statement [11] (byte~) main::$4 ← (byte) $ff - (byte) main::i#2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ( main:2 [ main::buf1#0 main::buf2#0 main::i#2 main::$4 ] ) always clobbers reg byte a -Statement [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y -Statement [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y +Statement [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) [ main::buf2#0 ] ( main:2 [ main::buf2#0 ] ) always clobbers reg byte a reg byte y +Statement [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y Statement [25] (byte*) malloc::mem#0 ← (byte*) heap_head#7 - (byte) $64 [ malloc::mem#0 ] ( main:2::malloc:5 [ malloc::mem#0 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 ] ) always clobbers reg byte a Statement [26] (byte*) heap_head#1 ← (byte*) malloc::mem#0 [ malloc::mem#0 heap_head#1 ] ( main:2::malloc:5 [ malloc::mem#0 heap_head#1 ] main:2::malloc:7 [ main::buf1#0 malloc::mem#0 heap_head#1 ] ) 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 , @@ -688,7 +684,7 @@ main: { // [5] call malloc // [24] phi from main to malloc [phi:main->malloc] malloc_from_main: - // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP#0 [phi:main->malloc#0] -- pbuz1=pbuc1 + // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP [phi:main->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -758,11 +754,11 @@ main: { jmp b6 // main::@6 b6: - // [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 + // [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 ldy #0 lda (buf1),y sta screen - // [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 + // [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 ldy #0 lda (buf2),y sta screen+1 @@ -859,8 +855,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -887,8 +882,7 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte y 16.5 (byte) main::i#2 reg byte y 16.5 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem @@ -931,7 +925,7 @@ main: { // malloc(100) // [5] call malloc // [24] phi from main to malloc [phi:main->malloc] - // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP#0 [phi:main->malloc#0] -- pbuz1=pbuc1 + // [24] phi (byte*) heap_head#7 = (const byte*) HEAP_TOP [phi:main->malloc#0] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -991,12 +985,12 @@ main: { jsr free // main::@6 // screen[0] = *buf1 - // [19] *((const byte*) main::screen#0) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 + // [19] *((const byte*) main::screen) ← *((byte*)(void*) main::buf1#0) -- _deref_pbuc1=_deref_pbuz1 ldy #0 lda (buf1),y sta screen // screen[1] = *buf2 - // [20] *((const byte*) main::screen#0+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 + // [20] *((const byte*) main::screen+(byte) 1) ← *((byte*)(void*) main::buf2#0) -- _deref_pbuc1=_deref_pbuz1 lda (buf2),y sta screen+1 // main::@return diff --git a/src/test/ref/memory-heap.sym b/src/test/ref/memory-heap.sym index ca37ec26c..a53a03f5b 100644 --- a/src/test/ref/memory-heap.sym +++ b/src/test/ref/memory-heap.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -29,8 +28,7 @@ (byte) main::i (byte) main::i#1 reg byte y 16.5 (byte) main::i#2 reg byte y 16.5 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem diff --git a/src/test/ref/min-fmul-16.cfg b/src/test/ref/min-fmul-16.cfg index 34bf1706b..aec58ca77 100644 --- a/src/test/ref/min-fmul-16.cfg +++ b/src/test/ref/min-fmul-16.cfg @@ -17,19 +17,19 @@ main::@4: scope:[main] from main asm { sei } to:main::@1 main::@1: scope:[main] from main::@4 main::@6 - [7] (byte*) print_char_cursor#16 ← phi( main::@4/(byte*) 1024 main::@6/(const byte*) SCREEN#0 ) + [7] (byte*) print_char_cursor#16 ← phi( main::@4/(byte*) 1024 main::@6/(const byte*) SCREEN ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) + [9] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL) [10] call mulf16u [11] (dword) mulf16u::return#0 ← (dword) mulf16u::return#1 to:main::@5 main::@5: scope:[main] from main::@3 [12] (dword) main::r#0 ← (dword) mulf16u::return#0 - [13] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) + [13] *((const byte*) BORDERCOL) ← -- *((const byte*) BORDERCOL) [14] (dword) print_dword::dw#0 ← (dword) main::r#0 [15] call print_dword to:main::@6 @@ -104,8 +104,8 @@ print_char::@return: scope:[print_char] from print_char (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) mulf16u: scope:[mulf16u] from main::@3 - [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 - [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 + [43] *((const word*) mulf16u::memA) ← (const word) main::a + [44] *((const word*) mulf16u::memB) ← (const word) main::b asm { ldamemA stasm1a+1 stasm3a+1 stasm5a+1 stasm7a+1 eor#$ff stasm2a+1 stasm4a+1 stasm6a+1 stasm8a+1 ldamemA+1 stasm1b+1 stasm3b+1 stasm5b+1 stasm7b+1 eor#$ff stasm2b+1 stasm4b+1 stasm6b+1 stasm8b+1 ldxmemB sec sm1a: ldamulf_sqr1_lo,x sm2a: sbcmulf_sqr2_lo,x stamemR+0 sm3a: ldamulf_sqr1_hi,x sm4a: sbcmulf_sqr2_hi,x sta_AA+1 sec sm1b: ldamulf_sqr1_lo,x sm2b: sbcmulf_sqr2_lo,x sta_cc+1 sm3b: ldamulf_sqr1_hi,x sm4b: sbcmulf_sqr2_hi,x sta_CC+1 ldxmemB+1 sec sm5a: ldamulf_sqr1_lo,x sm6a: sbcmulf_sqr2_lo,x sta_bb+1 sm7a: ldamulf_sqr1_hi,x sm8a: sbcmulf_sqr2_hi,x sta_BB+1 sec sm5b: ldamulf_sqr1_lo,x sm6b: sbcmulf_sqr2_lo,x sta_dd+1 sm7b: ldamulf_sqr1_hi,x sm8b: sbcmulf_sqr2_hi,x stamemR+3 clc _AA: lda#0 _bb: adc#0 stamemR+1 _BB: lda#0 _CC: adc#0 stamemR+2 bcc!+ incmemR+3 clc !: _cc: lda#0 adcmemR+1 stamemR+1 _dd: lda#0 adcmemR+2 stamemR+2 bcc!+ incmemR+3 !: } [46] (dword) mulf16u::return#1 ← *((const dword*) mulf16u::memR) to:mulf16u::@return diff --git a/src/test/ref/min-fmul-16.log b/src/test/ref/min-fmul-16.log index 4f7825433..60bb41cff 100644 --- a/src/test/ref/min-fmul-16.log +++ b/src/test/ref/min-fmul-16.log @@ -192,9 +192,9 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte*) print_line_cursor#18 ← phi( @29/(byte*) print_line_cursor#19 ) (byte*) print_screen#18 ← phi( @29/(byte*) print_screen#19 ) (byte*) print_char_cursor#45 ← phi( @29/(byte*) print_char_cursor#46 ) - (byte*) RASTER#0 ← ((byte*)) (number) $d012 - (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) RASTER ← ((byte*)) (number) $d012 + (byte*) BORDERCOL ← ((byte*)) (number) $d020 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@37 (void()) main() @@ -208,8 +208,8 @@ main::@13: scope:[main] from main (byte*) print_line_cursor#13 ← phi( main/(byte*) print_line_cursor#16 ) (byte*) print_screen#13 ← phi( main/(byte*) print_screen#16 ) (byte*) print_char_cursor#40 ← phi( main/(byte*) print_char_cursor#43 ) - (word) main::a#0 ← (number) $4d2 - (word) main::b#0 ← (number) $929 + (word) main::a ← (number) $4d2 + (word) main::b ← (number) $929 asm { sei } to:main::@1 main::@1: scope:[main] from main::@13 main::@16 @@ -222,16 +222,16 @@ main::@4: scope:[main] from main::@1 main::@4 (byte*) print_line_cursor#20 ← phi( main::@1/(byte*) print_line_cursor#11 main::@4/(byte*) print_line_cursor#20 ) (byte*) print_screen#20 ← phi( main::@1/(byte*) print_screen#11 main::@4/(byte*) print_screen#20 ) (byte*) print_char_cursor#44 ← phi( main::@1/(byte*) print_char_cursor#38 main::@4/(byte*) print_char_cursor#44 ) - (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $ff + (bool~) main::$1 ← *((byte*) RASTER) != (number) $ff if((bool~) main::$1) goto main::@4 to:main::@6 main::@6: scope:[main] from main::@4 (byte*) print_line_cursor#17 ← phi( main::@4/(byte*) print_line_cursor#20 ) (byte*) print_screen#17 ← phi( main::@4/(byte*) print_screen#20 ) (byte*) print_char_cursor#41 ← phi( main::@4/(byte*) print_char_cursor#44 ) - *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) - (word) mulf16u::a#0 ← (word) main::a#0 - (word) mulf16u::b#0 ← (word) main::b#0 + *((byte*) BORDERCOL) ← ++ *((byte*) BORDERCOL) + (word) mulf16u::a#0 ← (word) main::a + (word) mulf16u::b#0 ← (word) main::b call mulf16u (dword) mulf16u::return#0 ← (dword) mulf16u::return#2 to:main::@14 @@ -242,7 +242,7 @@ main::@14: scope:[main] from main::@6 (dword) mulf16u::return#3 ← phi( main::@6/(dword) mulf16u::return#0 ) (dword~) main::$3 ← (dword) mulf16u::return#3 (dword) main::r#0 ← (dword~) main::$3 - *((byte*) BORDERCOL#0) ← -- *((byte*) BORDERCOL#0) + *((byte*) BORDERCOL) ← -- *((byte*) BORDERCOL) (dword) print_dword::dw#0 ← (dword) main::r#0 call print_dword to:main::@15 @@ -251,7 +251,7 @@ main::@15: scope:[main] from main::@14 (byte*) print_screen#10 ← phi( main::@14/(byte*) print_screen#14 ) (byte*) print_char_cursor#30 ← phi( main::@14/(byte*) print_char_cursor#6 ) (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#30 - (byte*) print_set_screen::screen#0 ← (byte*) SCREEN#0 + (byte*) print_set_screen::screen#0 ← (byte*) SCREEN call print_set_screen to:main::@16 main::@16: scope:[main] from main::@15 @@ -436,15 +436,12 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) BORDERCOL -(byte*) BORDERCOL#0 (const byte) RADIX::BINARY = (number) 2 (const byte) RADIX::DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL = (number) 8 (byte*) RASTER -(byte*) RASTER#0 (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$1 (dword~) main::$3 @@ -457,9 +454,7 @@ SYMBOL TABLE SSA (label) main::@6 (label) main::@return (word) main::a -(word) main::a#0 (word) main::b -(word) main::b#0 (dword) main::r (dword) main::r#0 (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) @@ -718,9 +713,9 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (number) 4 Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (unumber)(number) $f -Adding number conversion cast (unumber) $4d2 in (word) main::a#0 ← (number) $4d2 -Adding number conversion cast (unumber) $929 in (word) main::b#0 ← (number) $929 -Adding number conversion cast (unumber) $ff in (bool~) main::$1 ← *((byte*) RASTER#0) != (number) $ff +Adding number conversion cast (unumber) $4d2 in (word) main::a ← (number) $4d2 +Adding number conversion cast (unumber) $929 in (word) main::b ← (number) $929 +Adding number conversion cast (unumber) $ff in (bool~) main::$1 ← *((byte*) RASTER) != (number) $ff Adding number conversion cast (unumber) 0 in (word) mulf_init::sqr#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) mulf_init::x_2#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) mulf_init::c#0 ← (number) 0 @@ -740,11 +735,11 @@ Adding number conversion cast (unumber) $100 in (byte*~) mulf_init::$5 ← (byte Adding number conversion cast (unumber) 1 in (byte) mulf_init::dir#1 ← (number) 1 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 -Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 -Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (word) main::a#0 ← (unumber)(number) $4d2 -Inlining cast (word) main::b#0 ← (unumber)(number) $929 +Inlining cast (byte*) RASTER ← (byte*)(number) $d012 +Inlining cast (byte*) BORDERCOL ← (byte*)(number) $d020 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (word) main::a ← (unumber)(number) $4d2 +Inlining cast (word) main::b ← (unumber)(number) $929 Inlining cast (word) mulf_init::sqr#0 ← (unumber)(number) 0 Inlining cast (byte) mulf_init::x_2#0 ← (unumber)(number) 0 Inlining cast (byte) mulf_init::c#0 ← (unumber)(number) 0 @@ -896,7 +891,7 @@ Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#16 Identical Phi Values (byte*) print_screen#5 (byte*) print_screen#11 Identical Phi Values (byte*) print_line_cursor#5 (byte*) print_line_cursor#11 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$1 [76] if(*((byte*) RASTER#0)!=(byte) $ff) goto main::@4 +Simple Condition (bool~) main::$1 [76] if(*((byte*) RASTER)!=(byte) $ff) goto main::@4 Simple Condition (bool~) mulf_init::$8 [117] if((byte*) mulf_init::sqr1_lo#2!=(byte*~) mulf_init::$7) goto mulf_init::@2 Simple Condition (bool~) mulf_init::$11 [123] if((byte~) mulf_init::$9!=(byte) 0) goto mulf_init::@4 Simple Condition (bool~) mulf_init::$16 [144] if((byte*) mulf_init::sqr2_lo#2!=(byte*~) mulf_init::$15) goto mulf_init::@10 @@ -909,11 +904,11 @@ Constant right-side identified [106] (byte[$200]) mulf_sqr2_hi ← { fill( $200, Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) print_char_cursor#0 = (byte*) 1024 Constant (const byte[]) print_hextab = $0 -Constant (const byte*) RASTER#0 = (byte*) 53266 -Constant (const byte*) BORDERCOL#0 = (byte*) 53280 -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const word) main::a#0 = $4d2 -Constant (const word) main::b#0 = $929 +Constant (const byte*) RASTER = (byte*) 53266 +Constant (const byte*) BORDERCOL = (byte*) 53280 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const word) main::a = $4d2 +Constant (const word) main::b = $929 Constant (const byte[$200]) mulf_sqr1_lo = { fill( $200, 0) } Constant (const byte[$200]) mulf_sqr1_hi = { fill( $200, 0) } Constant (const byte[$200]) mulf_sqr2_lo = { fill( $200, 0) } @@ -928,9 +923,9 @@ Constant (const word*) mulf16u::memA = (word*) 248 Constant (const word*) mulf16u::memB = (word*) 250 Constant (const dword*) mulf16u::memR = (dword*) 252 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) mulf16u::a#0 = main::a#0 -Constant (const word) mulf16u::b#0 = main::b#0 -Constant (const byte*) print_set_screen::screen#0 = SCREEN#0 +Constant (const word) mulf16u::a#0 = main::a +Constant (const word) mulf16u::b#0 = main::b +Constant (const byte*) print_set_screen::screen#0 = SCREEN Constant (const byte*) mulf_init::sqr2_hi#0 = mulf_sqr2_hi Constant (const byte*) mulf_init::sqr2_lo#0 = mulf_sqr2_lo Successful SSA optimization Pass2ConstantIdentification @@ -975,10 +970,10 @@ Inlining constant with var siblings (const byte*) print_char_cursor#0 Constant inlined mulf_init::c#0 = (byte) 0 Constant inlined mulf_init::sqr2_lo#0 = (const byte[$200]) mulf_sqr2_lo Constant inlined mulf_init::sqr#0 = (byte) 0 -Constant inlined mulf16u::b#0 = (const word) main::b#0 +Constant inlined mulf16u::b#0 = (const word) main::b Constant inlined mulf_init::sqr2_hi#0 = (const byte[$200]) mulf_sqr2_hi -Constant inlined mulf16u::a#0 = (const word) main::a#0 -Constant inlined print_screen#1 = (const byte*) SCREEN#0 +Constant inlined mulf16u::a#0 = (const word) main::a +Constant inlined print_screen#1 = (const byte*) SCREEN Constant inlined mulf_init::$2 = (const byte[$200]) mulf_sqr2_lo+(word) $1ff Constant inlined $0 = (const byte[]) print_hextab Constant inlined mulf_init::$4 = (const byte[$200]) mulf_sqr2_hi+(word) $1ff @@ -989,7 +984,7 @@ Constant inlined mulf_init::dir#1 = (byte) 1 Constant inlined print_char_cursor#0 = (byte*) 1024 Constant inlined mulf_init::dir#0 = (byte) $ff Constant inlined mulf_init::sqr1_hi#0 = (const byte[$200]) mulf_sqr1_hi+(byte) 1 -Constant inlined print_set_screen::screen#0 = (const byte*) SCREEN#0 +Constant inlined print_set_screen::screen#0 = (const byte*) SCREEN Constant inlined mulf_init::sqr1_lo#0 = (const byte[$200]) mulf_sqr1_lo+(byte) 1 Constant inlined mulf_init::$15 = (const byte[$200]) mulf_sqr2_lo+(word) $1ff Constant inlined mulf_init::x_255#0 = (byte) -1 @@ -1104,19 +1099,19 @@ main::@4: scope:[main] from main asm { sei } to:main::@1 main::@1: scope:[main] from main::@4 main::@6 - [7] (byte*) print_char_cursor#16 ← phi( main::@4/(byte*) 1024 main::@6/(const byte*) SCREEN#0 ) + [7] (byte*) print_char_cursor#16 ← phi( main::@4/(byte*) 1024 main::@6/(const byte*) SCREEN ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 + [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - [9] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) + [9] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL) [10] call mulf16u [11] (dword) mulf16u::return#0 ← (dword) mulf16u::return#1 to:main::@5 main::@5: scope:[main] from main::@3 [12] (dword) main::r#0 ← (dword) mulf16u::return#0 - [13] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) + [13] *((const byte*) BORDERCOL) ← -- *((const byte*) BORDERCOL) [14] (dword) print_dword::dw#0 ← (dword) main::r#0 [15] call print_dword to:main::@6 @@ -1191,8 +1186,8 @@ print_char::@return: scope:[print_char] from print_char (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) mulf16u: scope:[mulf16u] from main::@3 - [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 - [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 + [43] *((const word*) mulf16u::memA) ← (const word) main::a + [44] *((const word*) mulf16u::memB) ← (const word) main::b asm { ldamemA stasm1a+1 stasm3a+1 stasm5a+1 stasm7a+1 eor#$ff stasm2a+1 stasm4a+1 stasm6a+1 stasm8a+1 ldamemA+1 stasm1b+1 stasm3b+1 stasm5b+1 stasm7b+1 eor#$ff stasm2b+1 stasm4b+1 stasm6b+1 stasm8b+1 ldxmemB sec sm1a: ldamulf_sqr1_lo,x sm2a: sbcmulf_sqr2_lo,x stamemR+0 sm3a: ldamulf_sqr1_hi,x sm4a: sbcmulf_sqr2_hi,x sta_AA+1 sec sm1b: ldamulf_sqr1_lo,x sm2b: sbcmulf_sqr2_lo,x sta_cc+1 sm3b: ldamulf_sqr1_hi,x sm4b: sbcmulf_sqr2_hi,x sta_CC+1 ldxmemB+1 sec sm5a: ldamulf_sqr1_lo,x sm6a: sbcmulf_sqr2_lo,x sta_bb+1 sm7a: ldamulf_sqr1_hi,x sm8a: sbcmulf_sqr2_hi,x sta_BB+1 sec sm5b: ldamulf_sqr1_lo,x sm6b: sbcmulf_sqr2_lo,x sta_dd+1 sm7b: ldamulf_sqr1_hi,x sm8b: sbcmulf_sqr2_hi,x stamemR+3 clc _AA: lda#0 _bb: adc#0 stamemR+1 _BB: lda#0 _CC: adc#0 stamemR+2 bcc!+ incmemR+3 clc !: _cc: lda#0 adcmemR+1 stamemR+1 _dd: lda#0 adcmemR+2 stamemR+2 bcc!+ incmemR+3 !: } [46] (dword) mulf16u::return#1 ← *((const dword*) mulf16u::memR) to:mulf16u::@return @@ -1263,12 +1258,7 @@ mulf_init::@3: scope:[mulf_init] from mulf_init::@2 mulf_init::@4 VARIABLE REGISTER WEIGHTS -(byte*) BORDERCOL -(byte*) RASTER -(byte*) SCREEN (void()) main() -(word) main::a -(word) main::b (dword) main::r (dword) main::r#0 11.0 (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) @@ -1466,14 +1456,14 @@ main: { jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BORDERCOL // [10] call mulf16u jsr mulf16u @@ -1498,7 +1488,7 @@ main: { sta.z r+2 lda.z mulf16u.return+3 sta.z r+3 - // [13] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [13] *((const byte*) BORDERCOL) ← -- *((const byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BORDERCOL // [14] (dword) print_dword::dw#0 ← (dword) main::r#0 -- vduz1=vduz2 lda.z r @@ -1522,7 +1512,7 @@ main: { jsr print_set_screen // [7] phi from main::@6 to main::@1 [phi:main::@6->main::@1] b1_from_b6: - // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN#0 [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 + // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1682,12 +1672,12 @@ mulf16u: { .label memR = $fc .label return = $16 .label return_1 = $24 - // [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 -- _deref_pwuc1=vwuc2 + // [43] *((const word*) mulf16u::memA) ← (const word) main::a -- _deref_pwuc1=vwuc2 lda #main.a sta memA+1 - // [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 -- _deref_pwuc1=vwuc2 + // [44] *((const word*) mulf16u::memB) ← (const word) main::b -- _deref_pwuc1=vwuc2 lda #main.b @@ -2034,7 +2024,7 @@ mulf_init: { mulf_sqr2_hi: .fill $200, 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ print_char_cursor#16 ] ( main:2 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ print_char_cursor#16 ] ( main:2 [ print_char_cursor#16 ] ) always clobbers reg byte a Statement [11] (dword) mulf16u::return#0 ← (dword) mulf16u::return#1 [ print_char_cursor#16 mulf16u::return#0 ] ( main:2 [ print_char_cursor#16 mulf16u::return#0 ] ) always clobbers reg byte a Statement [12] (dword) main::r#0 ← (dword) mulf16u::return#0 [ print_char_cursor#16 main::r#0 ] ( main:2 [ print_char_cursor#16 main::r#0 ] ) always clobbers reg byte a Statement [14] (dword) print_dword::dw#0 ← (dword) main::r#0 [ print_char_cursor#16 print_dword::dw#0 ] ( main:2 [ print_char_cursor#16 print_dword::dw#0 ] ) always clobbers reg byte a @@ -2047,8 +2037,8 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ pr Statement [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#10 print_byte::$2 ] ( main:2::print_dword:15::print_word:21::print_byte:27 [ print_dword::dw#0 print_word::w#2 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:23::print_byte:27 [ print_word::w#2 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:21::print_byte:29 [ print_dword::dw#0 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:23::print_byte:29 [ print_char_cursor#10 print_byte::$2 ] ) always clobbers reg byte a Statement [40] *((byte*) print_char_cursor#27) ← (byte) print_char::ch#2 [ print_char_cursor#27 ] ( main:2::print_dword:15::print_word:21::print_byte:27::print_char:34 [ print_dword::dw#0 print_word::w#2 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:27::print_char:34 [ print_word::w#2 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:29::print_char:34 [ print_dword::dw#0 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:29::print_char:34 [ print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:27::print_char:37 [ print_dword::dw#0 print_word::w#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:27::print_char:37 [ print_word::w#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:29::print_char:37 [ print_dword::dw#0 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:29::print_char:37 [ print_char_cursor#27 ] ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Statement [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a -Statement [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [43] *((const word*) mulf16u::memA) ← (const word) main::a [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [44] *((const word*) mulf16u::memB) ← (const word) main::b [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a Statement asm { ldamemA stasm1a+1 stasm3a+1 stasm5a+1 stasm7a+1 eor#$ff stasm2a+1 stasm4a+1 stasm6a+1 stasm8a+1 ldamemA+1 stasm1b+1 stasm3b+1 stasm5b+1 stasm7b+1 eor#$ff stasm2b+1 stasm4b+1 stasm6b+1 stasm8b+1 ldxmemB sec sm1a: ldamulf_sqr1_lo,x sm2a: sbcmulf_sqr2_lo,x stamemR+0 sm3a: ldamulf_sqr1_hi,x sm4a: sbcmulf_sqr2_hi,x sta_AA+1 sec sm1b: ldamulf_sqr1_lo,x sm2b: sbcmulf_sqr2_lo,x sta_cc+1 sm3b: ldamulf_sqr1_hi,x sm4b: sbcmulf_sqr2_hi,x sta_CC+1 ldxmemB+1 sec sm5a: ldamulf_sqr1_lo,x sm6a: sbcmulf_sqr2_lo,x sta_bb+1 sm7a: ldamulf_sqr1_hi,x sm8a: sbcmulf_sqr2_hi,x sta_BB+1 sec sm5b: ldamulf_sqr1_lo,x sm6b: sbcmulf_sqr2_lo,x sta_dd+1 sm7b: ldamulf_sqr1_hi,x sm8b: sbcmulf_sqr2_hi,x stamemR+3 clc _AA: lda#0 _bb: adc#0 stamemR+1 _BB: lda#0 _CC: adc#0 stamemR+2 bcc!+ incmemR+3 clc !: _cc: lda#0 adcmemR+1 stamemR+1 _dd: lda#0 adcmemR+2 stamemR+2 bcc!+ incmemR+3 !: } always clobbers reg byte a reg byte x Statement [46] (dword) mulf16u::return#1 ← *((const dword*) mulf16u::memR) [ mulf16u::return#1 ] ( main:2::mulf16u:10 [ print_char_cursor#16 mulf16u::return#1 ] ) always clobbers reg byte a Statement [50] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::mulf_init:5 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a @@ -2072,7 +2062,7 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:13 [ m Statement [72] (byte~) mulf_init::$13 ← > (word) mulf_init::sqr#3 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 mulf_init::$13 ] ( main:2::mulf_init:5 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 mulf_init::$13 ] ) always clobbers reg byte a Statement [73] *((byte*) mulf_init::sqr1_hi#2) ← (byte~) mulf_init::$13 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] ( main:2::mulf_init:5 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] ) always clobbers reg byte y Statement [75] (word) mulf_init::sqr#1 ← (word) mulf_init::sqr#3 + (byte) mulf_init::x_2#2 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ( main:2::mulf_init:5 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ) always clobbers reg byte a -Statement [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ print_char_cursor#16 ] ( main:2 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ print_char_cursor#16 ] ( main:2 [ print_char_cursor#16 ] ) always clobbers reg byte a Statement [11] (dword) mulf16u::return#0 ← (dword) mulf16u::return#1 [ print_char_cursor#16 mulf16u::return#0 ] ( main:2 [ print_char_cursor#16 mulf16u::return#0 ] ) always clobbers reg byte a Statement [12] (dword) main::r#0 ← (dword) mulf16u::return#0 [ print_char_cursor#16 main::r#0 ] ( main:2 [ print_char_cursor#16 main::r#0 ] ) always clobbers reg byte a Statement [14] (dword) print_dword::dw#0 ← (dword) main::r#0 [ print_char_cursor#16 print_dword::dw#0 ] ( main:2 [ print_char_cursor#16 print_dword::dw#0 ] ) always clobbers reg byte a @@ -2083,8 +2073,8 @@ Statement [28] (byte) print_byte::b#1 ← < (word) print_word::w#2 [ print_char_ Statement [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 [ print_byte::b#2 print_char_cursor#36 print_byte::$0 ] ( main:2::print_dword:15::print_word:21::print_byte:27 [ print_dword::dw#0 print_word::w#2 print_byte::b#2 print_char_cursor#36 print_byte::$0 ] main:2::print_dword:15::print_word:23::print_byte:27 [ print_word::w#2 print_byte::b#2 print_char_cursor#36 print_byte::$0 ] main:2::print_dword:15::print_word:21::print_byte:29 [ print_dword::dw#0 print_byte::b#2 print_char_cursor#36 print_byte::$0 ] main:2::print_dword:15::print_word:23::print_byte:29 [ print_byte::b#2 print_char_cursor#36 print_byte::$0 ] ) always clobbers reg byte a Statement [35] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f [ print_char_cursor#10 print_byte::$2 ] ( main:2::print_dword:15::print_word:21::print_byte:27 [ print_dword::dw#0 print_word::w#2 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:23::print_byte:27 [ print_word::w#2 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:21::print_byte:29 [ print_dword::dw#0 print_char_cursor#10 print_byte::$2 ] main:2::print_dword:15::print_word:23::print_byte:29 [ print_char_cursor#10 print_byte::$2 ] ) always clobbers reg byte a Statement [40] *((byte*) print_char_cursor#27) ← (byte) print_char::ch#2 [ print_char_cursor#27 ] ( main:2::print_dword:15::print_word:21::print_byte:27::print_char:34 [ print_dword::dw#0 print_word::w#2 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:27::print_char:34 [ print_word::w#2 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:29::print_char:34 [ print_dword::dw#0 print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:29::print_char:34 [ print_byte::b#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:27::print_char:37 [ print_dword::dw#0 print_word::w#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:27::print_char:37 [ print_word::w#2 print_char_cursor#27 ] main:2::print_dword:15::print_word:21::print_byte:29::print_char:37 [ print_dword::dw#0 print_char_cursor#27 ] main:2::print_dword:15::print_word:23::print_byte:29::print_char:37 [ print_char_cursor#27 ] ) always clobbers reg byte y -Statement [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a -Statement [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [43] *((const word*) mulf16u::memA) ← (const word) main::a [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a +Statement [44] *((const word*) mulf16u::memB) ← (const word) main::b [ ] ( main:2::mulf16u:10 [ print_char_cursor#16 ] ) always clobbers reg byte a Statement asm { ldamemA stasm1a+1 stasm3a+1 stasm5a+1 stasm7a+1 eor#$ff stasm2a+1 stasm4a+1 stasm6a+1 stasm8a+1 ldamemA+1 stasm1b+1 stasm3b+1 stasm5b+1 stasm7b+1 eor#$ff stasm2b+1 stasm4b+1 stasm6b+1 stasm8b+1 ldxmemB sec sm1a: ldamulf_sqr1_lo,x sm2a: sbcmulf_sqr2_lo,x stamemR+0 sm3a: ldamulf_sqr1_hi,x sm4a: sbcmulf_sqr2_hi,x sta_AA+1 sec sm1b: ldamulf_sqr1_lo,x sm2b: sbcmulf_sqr2_lo,x sta_cc+1 sm3b: ldamulf_sqr1_hi,x sm4b: sbcmulf_sqr2_hi,x sta_CC+1 ldxmemB+1 sec sm5a: ldamulf_sqr1_lo,x sm6a: sbcmulf_sqr2_lo,x sta_bb+1 sm7a: ldamulf_sqr1_hi,x sm8a: sbcmulf_sqr2_hi,x sta_BB+1 sec sm5b: ldamulf_sqr1_lo,x sm6b: sbcmulf_sqr2_lo,x sta_dd+1 sm7b: ldamulf_sqr1_hi,x sm8b: sbcmulf_sqr2_hi,x stamemR+3 clc _AA: lda#0 _bb: adc#0 stamemR+1 _BB: lda#0 _CC: adc#0 stamemR+2 bcc!+ incmemR+3 clc !: _cc: lda#0 adcmemR+1 stamemR+1 _dd: lda#0 adcmemR+2 stamemR+2 bcc!+ incmemR+3 !: } always clobbers reg byte a reg byte x Statement [46] (dword) mulf16u::return#1 ← *((const dword*) mulf16u::memR) [ mulf16u::return#1 ] ( main:2::mulf16u:10 [ print_char_cursor#16 mulf16u::return#1 ] ) always clobbers reg byte a Statement [50] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::mulf_init:5 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a @@ -2220,14 +2210,14 @@ main: { jmp b2 // main::@2 b2: - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 jmp b3 // main::@3 b3: - // [9] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BORDERCOL // [10] call mulf16u jsr mulf16u @@ -2236,7 +2226,7 @@ main: { // main::@5 b5: // [12] (dword) main::r#0 ← (dword) mulf16u::return#0 - // [13] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [13] *((const byte*) BORDERCOL) ← -- *((const byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BORDERCOL // [14] (dword) print_dword::dw#0 ← (dword) main::r#0 // [15] call print_dword @@ -2252,7 +2242,7 @@ main: { jsr print_set_screen // [7] phi from main::@6 to main::@1 [phi:main::@6->main::@1] b1_from_b6: - // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN#0 [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 + // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2401,12 +2391,12 @@ mulf16u: { .label memB = $fa .label memR = $fc .label return = $e - // [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 -- _deref_pwuc1=vwuc2 + // [43] *((const word*) mulf16u::memA) ← (const word) main::a -- _deref_pwuc1=vwuc2 lda #main.a sta memA+1 - // [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 -- _deref_pwuc1=vwuc2 + // [44] *((const word*) mulf16u::memB) ← (const word) main::b -- _deref_pwuc1=vwuc2 lda #main.b @@ -2829,16 +2819,13 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BORDERCOL -(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 +(const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -2846,10 +2833,8 @@ FINAL SYMBOL TABLE (label) main::@4 (label) main::@5 (label) main::@6 -(word) main::a -(const word) main::a#0 a = (word) $4d2 -(word) main::b -(const word) main::b#0 b = (word) $929 +(const word) main::a a = (word) $4d2 +(const word) main::b b = (word) $929 (dword) main::r (dword) main::r#0 r zp ZP_DWORD:14 11.0 (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) @@ -3012,13 +2997,13 @@ main: { // main::@2 b2: // while(*RASTER!=$ff) - // [8] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 // main::@3 // (*BORDERCOL)++; - // [9] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [9] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BORDERCOL // mulf16u(a, b) // [10] call mulf16u @@ -3028,7 +3013,7 @@ main: { // r = mulf16u(a, b) // [12] (dword) main::r#0 ← (dword) mulf16u::return#0 // (*BORDERCOL)--; - // [13] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) -- _deref_pbuc1=_dec__deref_pbuc1 + // [13] *((const byte*) BORDERCOL) ← -- *((const byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1 dec BORDERCOL // print_dword(r) // [14] (dword) print_dword::dw#0 ← (dword) main::r#0 @@ -3041,7 +3026,7 @@ main: { // [18] phi from main::@6 to print_set_screen [phi:main::@6->print_set_screen] jsr print_set_screen // [7] phi from main::@6 to main::@1 [phi:main::@6->main::@1] - // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN#0 [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 + // [7] phi (byte*) print_char_cursor#16 = (const byte*) SCREEN [phi:main::@6->main::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -3184,13 +3169,13 @@ mulf16u: { .label memR = $fc .label return = $e // *memA = a - // [43] *((const word*) mulf16u::memA) ← (const word) main::a#0 -- _deref_pwuc1=vwuc2 + // [43] *((const word*) mulf16u::memA) ← (const word) main::a -- _deref_pwuc1=vwuc2 lda #main.a sta memA+1 // *memB = b - // [44] *((const word*) mulf16u::memB) ← (const word) main::b#0 -- _deref_pwuc1=vwuc2 + // [44] *((const word*) mulf16u::memB) ← (const word) main::b -- _deref_pwuc1=vwuc2 lda #main.b diff --git a/src/test/ref/min-fmul-16.sym b/src/test/ref/min-fmul-16.sym index b7e6da54a..e7699fb95 100644 --- a/src/test/ref/min-fmul-16.sym +++ b/src/test/ref/min-fmul-16.sym @@ -1,16 +1,13 @@ (label) @1 (label) @begin (label) @end -(byte*) BORDERCOL -(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 +(const byte*) BORDERCOL BORDERCOL = (byte*) 53280 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 (const byte) RADIX::OCTAL OCTAL = (number) 8 -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -18,10 +15,8 @@ (label) main::@4 (label) main::@5 (label) main::@6 -(word) main::a -(const word) main::a#0 a = (word) $4d2 -(word) main::b -(const word) main::b#0 b = (word) $929 +(const word) main::a a = (word) $4d2 +(const word) main::b b = (word) $929 (dword) main::r (dword) main::r#0 r zp ZP_DWORD:14 11.0 (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) diff --git a/src/test/ref/mixed-array-0.cfg b/src/test/ref/mixed-array-0.cfg index d709f9319..9aa4d2229 100644 --- a/src/test/ref/mixed-array-0.cfg +++ b/src/test/ref/mixed-array-0.cfg @@ -10,9 +10,9 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) - [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) + [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) + [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) + [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) to:main::@return main::@return: scope:[main] from main [7] return diff --git a/src/test/ref/mixed-array-0.log b/src/test/ref/mixed-array-0.log index db6c97d66..0eee18d70 100644 --- a/src/test/ref/mixed-array-0.log +++ b/src/test/ref/mixed-array-0.log @@ -7,10 +7,10 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte[]) main::msg ← { (byte) 1, (number) 2, (number) 3 } - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 - *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[]) main::msg + (number) 0) - *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[]) main::msg + (number) 1) - *((byte*) main::SCREEN#0 + (number) 2) ← *((byte[]) main::msg + (number) 2) + (byte*) main::SCREEN ← ((byte*)) (number) $400 + *((byte*) main::SCREEN + (number) 0) ← *((byte[]) main::msg + (number) 0) + *((byte*) main::SCREEN + (number) 1) ← *((byte[]) main::msg + (number) 1) + *((byte*) main::SCREEN + (number) 2) ← *((byte[]) main::msg + (number) 2) to:main::@return main::@return: scope:[main] from main return @@ -30,19 +30,18 @@ SYMBOL TABLE SSA (void()) main() (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte[]) main::msg -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[]) main::msg + (number) 0) -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[]) main::msg + (unumber)(number) 0) -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[]) main::msg + (number) 1) -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[]) main::msg + (unumber)(number) 1) -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 2) ← *((byte[]) main::msg + (number) 2) -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 2) ← *((byte[]) main::msg + (unumber)(number) 2) +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← *((byte[]) main::msg + (number) 0) +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← *((byte[]) main::msg + (unumber)(number) 0) +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← *((byte[]) main::msg + (number) 1) +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← *((byte[]) main::msg + (unumber)(number) 1) +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← *((byte[]) main::msg + (number) 2) +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← *((byte[]) main::msg + (unumber)(number) 2) Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) main::msg ← (byte[]){ (byte) 1, (byte)(number) 2, (byte)(number) 3 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 2 Simplifying constant integer cast 3 @@ -64,15 +63,15 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Identified constant from value list (byte[]) { (byte) 1, (byte) 2, (byte) 3 } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte[]) main::msg = { 1, 2, 3 } -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::msg in [2] *((const byte*) main::SCREEN#0 + (byte) 0) ← *((const byte[]) main::msg + (byte) 0) -Simplifying expression containing zero main::SCREEN#0 in [2] *((const byte*) main::SCREEN#0 + (byte) 0) ← *((const byte[]) main::msg) +Simplifying expression containing zero main::msg in [2] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte[]) main::msg + (byte) 0) +Simplifying expression containing zero main::SCREEN in [2] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte[]) main::msg) Successful SSA optimization PassNSimplifyExpressionWithZero Consolidated array index constant in *(main::msg+1) -Consolidated array index constant in *(main::SCREEN#0+1) +Consolidated array index constant in *(main::SCREEN+1) Consolidated array index constant in *(main::msg+2) -Consolidated array index constant in *(main::SCREEN#0+2) +Consolidated array index constant in *(main::SCREEN+2) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -101,9 +100,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) - [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) + [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) + [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) + [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) to:main::@return main::@return: scope:[main] from main [7] return @@ -112,7 +111,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN Initial phi equivalence classes Complete equivalence classes @@ -143,13 +141,13 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 lda msg sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda msg+1 sta SCREEN+1 - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda msg+2 sta SCREEN+2 jmp breturn @@ -162,9 +160,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -198,13 +196,13 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 lda msg sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda msg+1 sta SCREEN+1 - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda msg+2 sta SCREEN+2 jmp breturn @@ -240,8 +238,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (const byte[]) main::msg msg = { (byte) 1, (byte) 2, (byte) 3 } @@ -266,15 +263,15 @@ Score: 30 main: { .label SCREEN = $400 // SCREEN[0] = msg[0] - // [4] *((const byte*) main::SCREEN#0) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 + // [4] *((const byte*) main::SCREEN) ← *((const byte[]) main::msg) -- _deref_pbuc1=_deref_pbuc2 lda msg sta SCREEN // SCREEN[1] = msg[1] - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← *((const byte[]) main::msg+(byte) 1) -- _deref_pbuc1=_deref_pbuc2 lda msg+1 sta SCREEN+1 // SCREEN[2] = msg[2] - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← *((const byte[]) main::msg+(byte) 2) -- _deref_pbuc1=_deref_pbuc2 lda msg+2 sta SCREEN+2 // main::@return diff --git a/src/test/ref/mixed-array-0.sym b/src/test/ref/mixed-array-0.sym index 5f468c777..f46dac254 100644 --- a/src/test/ref/mixed-array-0.sym +++ b/src/test/ref/mixed-array-0.sym @@ -3,7 +3,6 @@ (label) @end (void()) main() (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (const byte[]) main::msg msg = { (byte) 1, (byte) 2, (byte) 3 } diff --git a/src/test/ref/mixed-array-1.cfg b/src/test/ref/mixed-array-1.cfg index d4d95d17e..2bb4a6ca1 100644 --- a/src/test/ref/mixed-array-1.cfg +++ b/src/test/ref/mixed-array-1.cfg @@ -10,9 +10,9 @@ (void()) main() main: scope:[main] from @1 - [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) - [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) - [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) + [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) + [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) + [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) to:main::@return main::@return: scope:[main] from main [7] return diff --git a/src/test/ref/mixed-array-1.log b/src/test/ref/mixed-array-1.log index 2d484af3c..6c4e6cf33 100644 --- a/src/test/ref/mixed-array-1.log +++ b/src/test/ref/mixed-array-1.log @@ -7,10 +7,10 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (signed byte[]) main::msg ← { (number) -1, (number) 0, (number) 1 } - (signed byte*) main::SCREEN#0 ← ((signed byte*)) (number) $400 - *((signed byte*) main::SCREEN#0 + (number) 0) ← *((signed byte[]) main::msg + (number) 0) - *((signed byte*) main::SCREEN#0 + (number) 1) ← *((signed byte[]) main::msg + (number) 1) - *((signed byte*) main::SCREEN#0 + (number) 2) ← *((signed byte[]) main::msg + (number) 2) + (signed byte*) main::SCREEN ← ((signed byte*)) (number) $400 + *((signed byte*) main::SCREEN + (number) 0) ← *((signed byte[]) main::msg + (number) 0) + *((signed byte*) main::SCREEN + (number) 1) ← *((signed byte[]) main::msg + (number) 1) + *((signed byte*) main::SCREEN + (number) 2) ← *((signed byte[]) main::msg + (number) 2) to:main::@return main::@return: scope:[main] from main return @@ -30,19 +30,18 @@ SYMBOL TABLE SSA (void()) main() (label) main::@return (signed byte*) main::SCREEN -(signed byte*) main::SCREEN#0 (signed byte[]) main::msg -Adding number conversion cast (unumber) 0 in *((signed byte*) main::SCREEN#0 + (number) 0) ← *((signed byte[]) main::msg + (number) 0) -Adding number conversion cast (unumber) 0 in *((signed byte*) main::SCREEN#0 + (number) 0) ← *((signed byte[]) main::msg + (unumber)(number) 0) -Adding number conversion cast (unumber) 1 in *((signed byte*) main::SCREEN#0 + (number) 1) ← *((signed byte[]) main::msg + (number) 1) -Adding number conversion cast (unumber) 1 in *((signed byte*) main::SCREEN#0 + (number) 1) ← *((signed byte[]) main::msg + (unumber)(number) 1) -Adding number conversion cast (unumber) 2 in *((signed byte*) main::SCREEN#0 + (number) 2) ← *((signed byte[]) main::msg + (number) 2) -Adding number conversion cast (unumber) 2 in *((signed byte*) main::SCREEN#0 + (number) 2) ← *((signed byte[]) main::msg + (unumber)(number) 2) +Adding number conversion cast (unumber) 0 in *((signed byte*) main::SCREEN + (number) 0) ← *((signed byte[]) main::msg + (number) 0) +Adding number conversion cast (unumber) 0 in *((signed byte*) main::SCREEN + (number) 0) ← *((signed byte[]) main::msg + (unumber)(number) 0) +Adding number conversion cast (unumber) 1 in *((signed byte*) main::SCREEN + (number) 1) ← *((signed byte[]) main::msg + (number) 1) +Adding number conversion cast (unumber) 1 in *((signed byte*) main::SCREEN + (number) 1) ← *((signed byte[]) main::msg + (unumber)(number) 1) +Adding number conversion cast (unumber) 2 in *((signed byte*) main::SCREEN + (number) 2) ← *((signed byte[]) main::msg + (number) 2) +Adding number conversion cast (unumber) 2 in *((signed byte*) main::SCREEN + (number) 2) ← *((signed byte[]) main::msg + (unumber)(number) 2) Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (signed byte[]) main::msg ← (signed byte[]){ (signed byte)(number) -1, (signed byte)(number) 0, (signed byte)(number) 1 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (signed byte*) main::SCREEN#0 ← (signed byte*)(number) $400 +Inlining cast (signed byte*) main::SCREEN ← (signed byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast -1 Simplifying constant integer cast 0 @@ -65,15 +64,15 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Identified constant from value list (signed byte[]) { (signed byte) -1, (signed byte) 0, (signed byte) 1 } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const signed byte[]) main::msg = { -1, 0, 1 } -Constant (const signed byte*) main::SCREEN#0 = (signed byte*) 1024 +Constant (const signed byte*) main::SCREEN = (signed byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::msg in [2] *((const signed byte*) main::SCREEN#0 + (byte) 0) ← *((const signed byte[]) main::msg + (byte) 0) -Simplifying expression containing zero main::SCREEN#0 in [2] *((const signed byte*) main::SCREEN#0 + (byte) 0) ← *((const signed byte[]) main::msg) +Simplifying expression containing zero main::msg in [2] *((const signed byte*) main::SCREEN + (byte) 0) ← *((const signed byte[]) main::msg + (byte) 0) +Simplifying expression containing zero main::SCREEN in [2] *((const signed byte*) main::SCREEN + (byte) 0) ← *((const signed byte[]) main::msg) Successful SSA optimization PassNSimplifyExpressionWithZero Consolidated array index constant in *(main::msg+1) -Consolidated array index constant in *(main::SCREEN#0+1) +Consolidated array index constant in *(main::SCREEN+1) Consolidated array index constant in *(main::msg+2) -Consolidated array index constant in *(main::SCREEN#0+2) +Consolidated array index constant in *(main::SCREEN+2) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -102,9 +101,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) - [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) - [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) + [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) + [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) + [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) to:main::@return main::@return: scope:[main] from main [7] return @@ -113,7 +112,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(signed byte*) main::SCREEN Initial phi equivalence classes Complete equivalence classes @@ -144,13 +142,13 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 + // [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 lda msg sta SCREEN - // [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 + // [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 lda msg+1 sta SCREEN+1 - // [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 + // [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 lda msg+2 sta SCREEN+2 jmp breturn @@ -163,9 +161,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -199,13 +197,13 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 + // [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 lda msg sta SCREEN - // [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 + // [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 lda msg+1 sta SCREEN+1 - // [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 + // [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 lda msg+2 sta SCREEN+2 jmp breturn @@ -241,8 +239,7 @@ FINAL SYMBOL TABLE (label) @end (void()) main() (label) main::@return -(signed byte*) main::SCREEN -(const signed byte*) main::SCREEN#0 SCREEN = (signed byte*) 1024 +(const signed byte*) main::SCREEN SCREEN = (signed byte*) 1024 (const signed byte[]) main::msg msg = { (signed byte) -1, (signed byte) 0, (signed byte) 1 } @@ -267,15 +264,15 @@ Score: 30 main: { .label SCREEN = $400 // SCREEN[0] = msg[0] - // [4] *((const signed byte*) main::SCREEN#0) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 + // [4] *((const signed byte*) main::SCREEN) ← *((const signed byte[]) main::msg) -- _deref_pbsc1=_deref_pbsc2 lda msg sta SCREEN // SCREEN[1] = msg[1] - // [5] *((const signed byte*) main::SCREEN#0+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 + // [5] *((const signed byte*) main::SCREEN+(byte) 1) ← *((const signed byte[]) main::msg+(byte) 1) -- _deref_pbsc1=_deref_pbsc2 lda msg+1 sta SCREEN+1 // SCREEN[2] = msg[2] - // [6] *((const signed byte*) main::SCREEN#0+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 + // [6] *((const signed byte*) main::SCREEN+(byte) 2) ← *((const signed byte[]) main::msg+(byte) 2) -- _deref_pbsc1=_deref_pbsc2 lda msg+2 sta SCREEN+2 // main::@return diff --git a/src/test/ref/mixed-array-1.sym b/src/test/ref/mixed-array-1.sym index 1e046c8a9..3c2d19577 100644 --- a/src/test/ref/mixed-array-1.sym +++ b/src/test/ref/mixed-array-1.sym @@ -3,7 +3,6 @@ (label) @end (void()) main() (label) main::@return -(signed byte*) main::SCREEN -(const signed byte*) main::SCREEN#0 SCREEN = (signed byte*) 1024 +(const signed byte*) main::SCREEN SCREEN = (signed byte*) 1024 (const signed byte[]) main::msg msg = { (signed byte) -1, (signed byte) 0, (signed byte) 1 } diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg index 7a912a473..ce72dd778 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg @@ -10,7 +10,7 @@ [4] (byte) plex_free_next#31 ← (byte) 0 to:@3 @3: scope:[] from @2 - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -137,7 +137,7 @@ init: scope:[init] from main init::@1: scope:[init] from init init::@1 [59] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 ) [59] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 [62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2 [63] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log index 3a162ffce..62763d158 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log @@ -292,9 +292,9 @@ plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexSho (byte) plex_sprite_idx#45 ← phi( @9/(byte) plex_sprite_idx#49 ) (byte) plex_show_idx#48 ← phi( @9/(byte) plex_show_idx#50 ) (byte*) PLEX_SCREEN_PTR#28 ← phi( @9/(byte*) PLEX_SCREEN_PTR#29 ) - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) SPRITE#0 ← ((byte*)) (number) $2000 - kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) SPRITE ← ((byte*)) (number) $2000 + kickasm(location (byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -363,7 +363,7 @@ init: scope:[init] from main (byte~) init::$0 ← (byte) VIC_DEN | (byte) VIC_RSEL (number~) init::$1 ← (byte~) init::$0 | (number) 3 *((byte*) D011) ← (number~) init::$1 - (byte*) plexInit::screen#0 ← (byte*) SCREEN#0 + (byte*) plexInit::screen#0 ← (byte*) SCREEN call plexInit to:init::@5 init::@5: scope:[init] from init @@ -377,7 +377,7 @@ init::@1: scope:[init] from init::@1 init::@5 (byte*) PLEX_SCREEN_PTR#30 ← phi( init::@1/(byte*) PLEX_SCREEN_PTR#30 init::@5/(byte*) PLEX_SCREEN_PTR#5 ) (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init::@5/(word) init::xp#0 ) (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init::@5/(byte) init::sx#0 ) - (byte*~) init::$5 ← (byte*) SPRITE#0 / (number) $40 + (byte*~) init::$5 ← (byte*) SPRITE / (number) $40 (byte~) init::$6 ← ((byte)) (byte*~) init::$5 *((byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte~) init::$6 (byte~) init::$9 ← (byte) init::sx#2 * (const byte) SIZEOF_WORD @@ -720,10 +720,8 @@ SYMBOL TABLE SSA (byte*) RASTER (byte) RED (byte*) SCREEN -(byte*) SCREEN#0 (const byte) SIZEOF_WORD = (byte) 2 (byte*) SPRITE -(byte*) SPRITE#0 (byte*) SPRITES_COLS (byte*) SPRITES_ENABLE (byte*) SPRITES_XMSB @@ -1208,7 +1206,7 @@ Adding number conversion cast (unumber) init::$1 in (number~) init::$1 ← (byte Adding number conversion cast (unumber) $20 in (word) init::xp#0 ← (number) $20 Adding number conversion cast (unumber) 1 in (number~) init::$4 ← (byte) PLEX_COUNT - (number) 1 Adding number conversion cast (unumber) init::$4 in (number~) init::$4 ← (byte) PLEX_COUNT - (unumber)(number) 1 -Adding number conversion cast (unumber) $40 in (byte*~) init::$5 ← (byte*) SPRITE#0 / (number) $40 +Adding number conversion cast (unumber) $40 in (byte*~) init::$5 ← (byte*) SPRITE / (number) $40 Adding number conversion cast (unumber) 9 in (word) init::xp#1 ← (word) init::xp#2 + (number) 9 Adding number conversion cast (unumber) $ff in *((byte*) SPRITES_ENABLE) ← (number) $ff Adding number conversion cast (unumber) 2 in (number~) plex_irq::$4 ← *((byte*) RASTER) + (number) 2 @@ -1254,8 +1252,8 @@ Inlining cast *((byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2 Inlining cast (byte) plex_free_next#0 ← (unumber)(number) 0 Inlining cast (byte) plex_sprite_msb#4 ← (unumber)(number) 1 Inlining cast (byte) plex_free_next#4 ← (unumber)(number) 0 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) SPRITE#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) SPRITE ← (byte*)(number) $2000 Inlining cast (word) init::xp#0 ← (unumber)(number) $20 Inlining cast (byte~) init::$6 ← (byte)(byte*~) init::$5 Inlining cast *((byte*) SPRITES_ENABLE) ← (unumber)(number) $ff @@ -1621,8 +1619,8 @@ Constant (const byte) plexInit::i#0 = 0 Constant (const byte) plexSort::m#0 = 0 Constant (const byte) plexSort::plexFreePrepare1_s#0 = 0 Constant (const byte[8]) PLEX_FREE_YPOS = { fill( 8, 0) } -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) SPRITE#0 = (byte*) 8192 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) SPRITE = (byte*) 8192 Constant (const byte[$100]) YSIN = kickasm {{ .var min = 50 .var max = 250-21 .var ampl = max-min; @@ -1637,7 +1635,7 @@ Constant (const byte) plex_irq::rasterY#0 = 0 Constant (const byte) loop::sin_idx#0 = 0 Constant (const byte) loop::sy#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) plexInit::screen#0 = SCREEN#0 +Constant (const byte*) plexInit::screen#0 = SCREEN Successful SSA optimization Pass2ConstantIdentification Constant value identified { fill( PLEX_COUNT, 0) } in [21] (word[PLEX_COUNT]) PLEX_XPOS ← { fill( PLEX_COUNT, 0) } Constant value identified { fill( PLEX_COUNT, 0) } in [22] (byte[PLEX_COUNT]) PLEX_YPOS ← { fill( PLEX_COUNT, 0) } @@ -1655,7 +1653,7 @@ Eliminating unused constant (const byte) plex_irq::rasterY#0 Successful SSA optimization PassNEliminateUnusedVars Eliminating unused constant (const byte*) plexInit::screen#0 Successful SSA optimization PassNEliminateUnusedVars -Eliminating unused constant (const byte*) SCREEN#0 +Eliminating unused constant (const byte*) SCREEN Successful SSA optimization PassNEliminateUnusedVars Removing unused block loop::@return Successful SSA optimization Pass2EliminateUnusedBlocks @@ -1686,7 +1684,7 @@ Constant right-side identified [7] (byte~) plexInit::$1 ← (const byte) PLEX_CO Constant right-side identified [13] (byte~) plexSort::$1 ← (const byte) PLEX_COUNT - (byte) 2 Constant right-side identified [73] (byte~) init::$0 ← (const byte) VIC_DEN | (const byte) VIC_RSEL Constant right-side identified [77] (byte~) init::$4 ← (const byte) PLEX_COUNT - (byte) 1 -Constant right-side identified [79] (byte*~) init::$5 ← (const byte*) SPRITE#0 / (byte) $40 +Constant right-side identified [79] (byte*~) init::$5 ← (const byte*) SPRITE / (byte) $40 Constant right-side identified [118] (byte~) loop::$1 ← (const byte) PLEX_COUNT - (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word[PLEX_COUNT]) PLEX_XPOS = { fill( PLEX_COUNT, 0) } @@ -1697,7 +1695,7 @@ Constant (const byte) plexInit::$1 = PLEX_COUNT-1 Constant (const byte) plexSort::$1 = PLEX_COUNT-2 Constant (const byte) init::$0 = VIC_DEN|VIC_RSEL Constant (const byte) init::$4 = PLEX_COUNT-1 -Constant (const byte*) init::$5 = SPRITE#0/$40 +Constant (const byte*) init::$5 = SPRITE/$40 Constant (const byte) loop::$1 = PLEX_COUNT-1 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte)init::$5 in [80] (byte~) init::$6 ← (byte)(const byte*) init::$5 @@ -1765,8 +1763,8 @@ Constant inlined init::$3 = &interrupt(KERNEL_MIN)(void()) plex_irq() Constant inlined init::$1 = (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 Constant inlined loop::sin_idx#0 = (byte) 0 Constant inlined init::$0 = (const byte) VIC_DEN|(const byte) VIC_RSEL -Constant inlined init::$6 = (byte)(const byte*) SPRITE#0/(byte) $40 -Constant inlined init::$5 = (const byte*) SPRITE#0/(byte) $40 +Constant inlined init::$6 = (byte)(const byte*) SPRITE/(byte) $40 +Constant inlined init::$5 = (const byte*) SPRITE/(byte) $40 Constant inlined init::$4 = (const byte) PLEX_COUNT-(byte) 1 Constant inlined loop::$1 = (const byte) PLEX_COUNT-(byte) 1 Constant inlined loop::sy#0 = (byte) 0 @@ -1908,7 +1906,7 @@ FINAL CONTROL FLOW GRAPH [4] (byte) plex_free_next#31 ← (byte) 0 to:@3 @3: scope:[] from @2 - kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) + kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) @@ -2035,7 +2033,7 @@ init: scope:[init] from main init::@1: scope:[init] from init init::@1 [59] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 ) [59] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 + [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 [62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2 [63] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 @@ -2165,8 +2163,6 @@ plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5 VARIABLE REGISTER WEIGHTS (byte*) PLEX_SCREEN_PTR -(byte*) SCREEN -(byte*) SPRITE (bool) framedone (bool) framedone#10 40.0 (bool) framedone#12 57.0 @@ -2433,7 +2429,7 @@ b2: jmp b3 // @3 b3: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} jmp b4 // @4 b4: @@ -2753,7 +2749,7 @@ init: { jmp b1 // init::@1 b1: - // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #SPRITE/$40 ldy.z sx sta PLEX_PTR,y @@ -3150,7 +3146,7 @@ Statement [52] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepa Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] Statement [55] (byte) plex_free_next#0 ← (byte) 0 [ plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ( main:8::loop:13::plexSort:27 [ loop::sin_idx#1 plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ) always clobbers reg byte a Statement [57] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a -Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a +Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ init::sx#2 init::sx#1 ] Statement [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$9 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 init::$9 ] ) always clobbers reg byte a Statement [62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a @@ -3215,7 +3211,7 @@ Statement [49] (byte) plex_sprite_msb#1 ← (byte) 1 [ plex_show_idx#1 plex_spri Statement [52] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plexSort::plexFreePrepare1_s#2 ] ( main:8::loop:13::plexSort:27 [ loop::sin_idx#1 plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plexSort::plexFreePrepare1_s#2 ] ) always clobbers reg byte a Statement [55] (byte) plex_free_next#0 ← (byte) 0 [ plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ( main:8::loop:13::plexSort:27 [ loop::sin_idx#1 plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ) always clobbers reg byte a Statement [57] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a -Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a +Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$9 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 init::$9 ] ) always clobbers reg byte a Statement [62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [63] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#1 ] ) always clobbers reg byte a @@ -3273,7 +3269,7 @@ Statement [49] (byte) plex_sprite_msb#1 ← (byte) 1 [ plex_show_idx#1 plex_spri Statement [52] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plexSort::plexFreePrepare1_s#2 ] ( main:8::loop:13::plexSort:27 [ loop::sin_idx#1 plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plexSort::plexFreePrepare1_s#2 ] ) always clobbers reg byte a Statement [55] (byte) plex_free_next#0 ← (byte) 0 [ plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ( main:8::loop:13::plexSort:27 [ loop::sin_idx#1 plex_show_idx#1 plex_sprite_idx#1 plex_sprite_msb#1 plex_free_next#0 ] ) always clobbers reg byte a Statement [57] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3 [ ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a -Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a +Statement [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$9 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 init::$9 ] ) always clobbers reg byte a Statement [62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#2 ] ) always clobbers reg byte a Statement [63] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:8::init:11 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 init::sx#2 init::xp#1 ] ) always clobbers reg byte a @@ -3482,7 +3478,7 @@ b2: jmp b3 // @3 b3: - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} jmp b4 // @4 b4: @@ -3777,7 +3773,7 @@ init: { jmp b1 // init::@1 b1: - // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta PLEX_PTR,x // [61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 @@ -4270,9 +4266,7 @@ FINAL SYMBOL TABLE (const byte[PLEX_COUNT]) PLEX_YPOS PLEX_YPOS = { fill( PLEX_COUNT, 0) } (const byte*) RASTER RASTER = (byte*) 53266 (const byte) RED RED = (byte) 2 -(byte*) SCREEN -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 8192 +(const byte*) SPRITE SPRITE = (byte*) 8192 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 @@ -4532,7 +4526,7 @@ bbegin: sta.z plex_free_next // @3 // kickasm - // kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} + // kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }} // @4 // framedone = true // [6] (bool) framedone#17 ← true -- vboz1=vboc1 @@ -4801,7 +4795,7 @@ init: { // init::@1 b1: // PLEX_PTR[sx] = (byte)(SPRITE/$40) - // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE#0/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #SPRITE/$40 sta PLEX_PTR,x // PLEX_XPOS[sx] = xp diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym index 53cb8f94b..edff65b29 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym @@ -24,9 +24,7 @@ (const byte[PLEX_COUNT]) PLEX_YPOS PLEX_YPOS = { fill( PLEX_COUNT, 0) } (const byte*) RASTER RASTER = (byte*) 53266 (const byte) RED RED = (byte) 2 -(byte*) SCREEN -(byte*) SPRITE -(const byte*) SPRITE#0 SPRITE = (byte*) 8192 +(const byte*) SPRITE SPRITE = (byte*) 8192 (const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287 (const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269 (const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264 diff --git a/src/test/ref/norom-charset.cfg b/src/test/ref/norom-charset.cfg index c559594a9..23b60ca5c 100644 --- a/src/test/ref/norom-charset.cfg +++ b/src/test/ref/norom-charset.cfg @@ -13,12 +13,12 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@4 - [5] (byte*) main::charset#2 ← phi( main/(const byte*) CHARSET#0+(byte) 8 main::@4/(byte*) main::charset#1 ) + [5] (byte*) main::charset#2 ← phi( main/(const byte*) CHARSET+(byte) 8 main::@4/(byte*) main::charset#1 ) [5] (byte) main::c#2 ← phi( main/(byte) 0 main::@4/(byte) main::c#1 ) [6] if((byte) main::c#2!=(byte) 4) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 + [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 to:main::@return main::@return: scope:[main] from main::@3 [8] return diff --git a/src/test/ref/norom-charset.log b/src/test/ref/norom-charset.log index e8c84beb3..2622b56a7 100644 --- a/src/test/ref/norom-charset.log +++ b/src/test/ref/norom-charset.log @@ -10,15 +10,15 @@ Culled Empty Block (label) gen_char3::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) VIC_MEMORY#0 ← ((byte*)) (number) $d018 - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) CHARSET#0 ← ((byte*)) (number) $3000 + (byte*) VIC_MEMORY ← ((byte*)) (number) $d018 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) CHARSET ← ((byte*)) (number) $3000 (word[]) charset_spec_row ← { (number) $f7da, (number) $f7de, (number) $f24e, (number) $d6de } to:@2 (void()) main() main: scope:[main] from @2 - (byte*~) main::$0 ← (byte*) CHARSET#0 + (number) 8 + (byte*~) main::$0 ← (byte*) CHARSET + (number) 8 (byte*) main::charset#0 ← (byte*~) main::$0 (byte) main::c#0 ← (number) 0 to:main::@1 @@ -44,13 +44,13 @@ main::@7: scope:[main] from main::@2 (byte) main::c#1 ← ++ (byte) main::c#4 to:main::@1 main::@3: scope:[main] from main::@1 - (word~) main::$1 ← ((word)) (byte*) SCREEN#0 + (word~) main::$1 ← ((word)) (byte*) SCREEN (number~) main::$2 ← (word~) main::$1 / (number) $40 - (word~) main::$3 ← ((word)) (byte*) CHARSET#0 + (word~) main::$3 ← ((word)) (byte*) CHARSET (number~) main::$4 ← (word~) main::$3 / (number) $400 (number~) main::$5 ← (number~) main::$2 | (number~) main::$4 (byte~) main::$6 ← ((byte)) (number~) main::$5 - *((byte*) VIC_MEMORY#0) ← (byte~) main::$6 + *((byte*) VIC_MEMORY) ← (byte~) main::$6 to:main::@return main::@return: scope:[main] from main::@3 return @@ -130,12 +130,9 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) CHARSET -(byte*) CHARSET#0 (byte*) SCREEN -(byte*) SCREEN#0 (const byte) SIZEOF_WORD = (byte) 2 (byte*) VIC_MEMORY -(byte*) VIC_MEMORY#0 (word[]) charset_spec_row (void()) gen_char3((byte*) gen_char3::dst , (word) gen_char3::spec) (byte~) gen_char3::$0 @@ -221,7 +218,7 @@ SYMBOL TABLE SSA (byte*) main::charset#3 (byte*) main::charset#4 -Adding number conversion cast (unumber) 8 in (byte*~) main::$0 ← (byte*) CHARSET#0 + (number) 8 +Adding number conversion cast (unumber) 8 in (byte*~) main::$0 ← (byte*) CHARSET + (number) 8 Adding number conversion cast (unumber) 0 in (byte) main::c#0 ← (number) 0 Adding number conversion cast (unumber) 4 in (bool~) main::$7 ← (byte) main::c#2 != (number) 4 Adding number conversion cast (unumber) 8 in (byte*~) main::$9 ← (byte*) main::charset#3 + (number) 8 @@ -243,12 +240,12 @@ Adding number conversion cast (unumber) gen_char3::$4 in (number~) gen_char3::$4 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (word[]) charset_spec_row ← (word[]){ (word)(number) $f7da, (word)(number) $f7de, (word)(number) $f24e, (word)(number) $d6de } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) VIC_MEMORY#0 ← (byte*)(number) $d018 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) CHARSET#0 ← (byte*)(number) $3000 +Inlining cast (byte*) VIC_MEMORY ← (byte*)(number) $d018 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) CHARSET ← (byte*)(number) $3000 Inlining cast (byte) main::c#0 ← (unumber)(number) 0 -Inlining cast (word~) main::$1 ← (word)(byte*) SCREEN#0 -Inlining cast (word~) main::$3 ← (word)(byte*) CHARSET#0 +Inlining cast (word~) main::$1 ← (word)(byte*) SCREEN +Inlining cast (word~) main::$3 ← (word)(byte*) CHARSET Inlining cast (byte~) main::$6 ← (byte)(unumber~) main::$5 Inlining cast (byte) gen_char3::b#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -328,17 +325,17 @@ Simple Condition (bool~) gen_char3::$8 [53] if((byte) gen_char3::r#1!=rangelast( Successful SSA optimization Pass2ConditionalJumpSimplification Identified constant from value list (word[]) { (word) $f7da, (word) $f7de, (word) $f24e, (word) $d6de } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) VIC_MEMORY#0 = (byte*) 53272 -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) CHARSET#0 = (byte*) 12288 +Constant (const byte*) VIC_MEMORY = (byte*) 53272 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) CHARSET = (byte*) 12288 Constant (const word[]) charset_spec_row = { $f7da, $f7de, $f24e, $d6de } Constant (const byte) main::c#0 = 0 Constant (const byte) gen_char3::r#0 = 0 Constant (const byte) gen_char3::b#0 = 0 Constant (const byte) gen_char3::c#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (word)SCREEN#0 in [19] (word~) main::$1 ← (word)(const byte*) SCREEN#0 -Constant value identified (word)CHARSET#0 in [21] (word~) main::$3 ← (word)(const byte*) CHARSET#0 +Constant value identified (word)SCREEN in [19] (word~) main::$1 ← (word)(const byte*) SCREEN +Constant value identified (word)CHARSET in [21] (word~) main::$3 ← (word)(const byte*) CHARSET Successful SSA optimization Pass2ConstantValues Resolved ranged next value [43] gen_char3::c#1 ← ++ gen_char3::c#2 to ++ Resolved ranged comparison value [45] if(gen_char3::c#1!=rangelast(0,2)) goto gen_char3::@2 to (number) 3 @@ -353,11 +350,11 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 3 Finalized unsigned number type (byte) 5 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*) main::charset#0 ← (const byte*) CHARSET#0 + (byte) 8 +Constant right-side identified [0] (byte*) main::charset#0 ← (const byte*) CHARSET + (byte) 8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::charset#0 = CHARSET#0+8 -Constant (const word) main::$1 = (word)SCREEN#0 -Constant (const word) main::$3 = (word)CHARSET#0 +Constant (const byte*) main::charset#0 = CHARSET+8 +Constant (const word) main::$1 = (word)SCREEN +Constant (const word) main::$3 = (word)CHARSET Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [8] (word~) main::$2 ← (const word) main::$1 / (byte) $40 Constant right-side identified [9] (word~) main::$4 ← (const word) main::$3 / (word) $400 @@ -386,13 +383,13 @@ Constant inlined gen_char3::r#0 = (byte) 0 Constant inlined gen_char3::b#0 = (byte) 0 Constant inlined main::c#0 = (byte) 0 Constant inlined gen_char3::c#0 = (byte) 0 -Constant inlined main::$1 = (word)(const byte*) SCREEN#0 -Constant inlined main::$2 = (word)(const byte*) SCREEN#0/(byte) $40 -Constant inlined main::charset#0 = (const byte*) CHARSET#0+(byte) 8 -Constant inlined main::$5 = (word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 -Constant inlined main::$6 = (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 -Constant inlined main::$3 = (word)(const byte*) CHARSET#0 -Constant inlined main::$4 = (word)(const byte*) CHARSET#0/(word) $400 +Constant inlined main::$1 = (word)(const byte*) SCREEN +Constant inlined main::$2 = (word)(const byte*) SCREEN/(byte) $40 +Constant inlined main::charset#0 = (const byte*) CHARSET+(byte) 8 +Constant inlined main::$5 = (word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 +Constant inlined main::$6 = (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 +Constant inlined main::$3 = (word)(const byte*) CHARSET +Constant inlined main::$4 = (word)(const byte*) CHARSET/(word) $400 Successful SSA optimization Pass2ConstantInlining Eliminating unused constant (const byte) SIZEOF_WORD Successful SSA optimization PassNEliminateUnusedVars @@ -449,12 +446,12 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@4 - [5] (byte*) main::charset#2 ← phi( main/(const byte*) CHARSET#0+(byte) 8 main::@4/(byte*) main::charset#1 ) + [5] (byte*) main::charset#2 ← phi( main/(const byte*) CHARSET+(byte) 8 main::@4/(byte*) main::charset#1 ) [5] (byte) main::c#2 ← phi( main/(byte) 0 main::@4/(byte) main::c#1 ) [6] if((byte) main::c#2!=(byte) 4) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 + [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 to:main::@return main::@return: scope:[main] from main::@3 [8] return @@ -507,9 +504,6 @@ gen_char3::@return: scope:[gen_char3] from gen_char3::@5 VARIABLE REGISTER WEIGHTS -(byte*) CHARSET -(byte*) SCREEN -(byte*) VIC_MEMORY (void()) gen_char3((byte*) gen_char3::dst , (word) gen_char3::spec) (byte~) gen_char3::$0 2002.0 (byte~) gen_char3::$1 2002.0 @@ -608,7 +602,7 @@ main: { .label c = 2 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET#0+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET+8 @@ -626,7 +620,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|CHARSET/$400 sta VIC_MEMORY jmp breturn @@ -779,7 +773,7 @@ gen_char3: { charset_spec_row: .word $f7da, $f7de, $f24e, $d6de REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [9] (byte~) main::$10 ← (byte) main::c#2 << (byte) 1 [ main::c#2 main::charset#2 main::$10 ] ( main:2 [ main::c#2 main::charset#2 main::$10 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::c#2 main::c#1 ] Statement [10] (byte*) gen_char3::dst#0 ← (byte*) main::charset#2 [ main::c#2 main::charset#2 main::$10 gen_char3::dst#0 ] ( main:2 [ main::c#2 main::charset#2 main::$10 gen_char3::dst#0 ] ) always clobbers reg byte a @@ -792,7 +786,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ ge Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ gen_char3::c#2 gen_char3::c#1 ] Statement [21] (byte) gen_char3::b#2 ← (byte) gen_char3::b#4 | (byte) 1 [ gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#2 gen_char3::c#2 gen_char3::b#2 ] ( main:2::gen_char3:12 [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#2 gen_char3::c#2 gen_char3::b#2 ] ) always clobbers reg byte a Statement [27] *((byte*) gen_char3::dst#0 + (byte) gen_char3::r#6) ← (byte) gen_char3::b#1 [ gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#1 ] ( main:2::gen_char3:12 [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#1 ] ) always clobbers reg byte a -Statement [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [9] (byte~) main::$10 ← (byte) main::c#2 << (byte) 1 [ main::c#2 main::charset#2 main::$10 ] ( main:2 [ main::c#2 main::charset#2 main::$10 ] ) always clobbers reg byte a Statement [10] (byte*) gen_char3::dst#0 ← (byte*) main::charset#2 [ main::c#2 main::charset#2 main::$10 gen_char3::dst#0 ] ( main:2 [ main::c#2 main::charset#2 main::$10 gen_char3::dst#0 ] ) always clobbers reg byte a Statement [11] (word) gen_char3::spec#0 ← *((const word[]) charset_spec_row + (byte~) main::$10) [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::spec#0 ] ( main:2 [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::spec#0 ] ) always clobbers reg byte a @@ -859,7 +853,7 @@ main: { .label c = 2 // [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET#0+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET+8 @@ -877,7 +871,7 @@ main: { jmp b3 // main::@3 b3: - // [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|CHARSET/$400 sta VIC_MEMORY jmp breturn @@ -1067,12 +1061,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) CHARSET -(const byte*) CHARSET#0 CHARSET = (byte*) 12288 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) VIC_MEMORY -(const byte*) VIC_MEMORY#0 VIC_MEMORY = (byte*) 53272 +(const byte*) CHARSET CHARSET = (byte*) 12288 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) VIC_MEMORY VIC_MEMORY = (byte*) 53272 (const word[]) charset_spec_row charset_spec_row = { (word) $f7da, (word) $f7de, (word) $f24e, (word) $d6de } (void()) gen_char3((byte*) gen_char3::dst , (word) gen_char3::spec) (byte~) gen_char3::$0 reg byte a 2002.0 @@ -1151,7 +1142,7 @@ main: { .label charset = 3 .label c = 2 // [5] phi from main to main::@1 [phi:main->main::@1] - // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET#0+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [5] phi (byte*) main::charset#2 = (const byte*) CHARSET+(byte) 8 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #CHARSET+8 @@ -1168,7 +1159,7 @@ main: { bne b2 // main::@3 // *VIC_MEMORY = (byte)(((word)SCREEN/$40)|((word)CHARSET/$400)) - // [7] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) CHARSET#0/(word) $400 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) SCREEN/(byte) $40|(word)(const byte*) CHARSET/(word) $400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|CHARSET/$400 sta VIC_MEMORY // main::@return diff --git a/src/test/ref/norom-charset.sym b/src/test/ref/norom-charset.sym index 3a5b0cec1..4b0b198ff 100644 --- a/src/test/ref/norom-charset.sym +++ b/src/test/ref/norom-charset.sym @@ -1,12 +1,9 @@ (label) @1 (label) @begin (label) @end -(byte*) CHARSET -(const byte*) CHARSET#0 CHARSET = (byte*) 12288 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) VIC_MEMORY -(const byte*) VIC_MEMORY#0 VIC_MEMORY = (byte*) 53272 +(const byte*) CHARSET CHARSET = (byte*) 12288 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) VIC_MEMORY VIC_MEMORY = (byte*) 53272 (const word[]) charset_spec_row charset_spec_row = { (word) $f7da, (word) $f7de, (word) $f24e, (word) $d6de } (void()) gen_char3((byte*) gen_char3::dst , (word) gen_char3::spec) (byte~) gen_char3::$0 reg byte a 2002.0 diff --git a/src/test/ref/number-inference-sum.log b/src/test/ref/number-inference-sum.log index 06f9f89fa..54add9cc5 100644 --- a/src/test/ref/number-inference-sum.log +++ b/src/test/ref/number-inference-sum.log @@ -11,8 +11,8 @@ main: scope:[main] from @1 (word*) main::screen ← ((word*)) (number) $400 (byte*) main::bgcol ← ((byte*)) (number) $d020 (byte) main::RED ← (number) 2 - (byte) main::b1#0 ← (number) $fa - (number~) main::$0 ← (byte) main::b1#0 + (number) $fa + (byte) main::b1 ← (number) $fa + (number~) main::$0 ← (byte) main::b1 + (number) $fa (byte) main::b2#0 ← (number~) main::$0 (number~) main::$1 ← (byte) main::b2#0 + (number) 1 (word) main::w#0 ← (number~) main::$1 @@ -51,7 +51,6 @@ SYMBOL TABLE SSA (label) main::@return (byte) main::RED (byte) main::b1 -(byte) main::b1#0 (byte) main::b2 (byte) main::b2#0 (byte*) main::bgcol @@ -60,9 +59,9 @@ SYMBOL TABLE SSA (word) main::w#0 Adding number conversion cast (unumber) 2 in (byte) main::RED ← (number) 2 -Adding number conversion cast (unumber) $fa in (byte) main::b1#0 ← (number) $fa -Adding number conversion cast (unumber) $fa in (number~) main::$0 ← (byte) main::b1#0 + (number) $fa -Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b1#0 + (unumber)(number) $fa +Adding number conversion cast (unumber) $fa in (byte) main::b1 ← (number) $fa +Adding number conversion cast (unumber) $fa in (number~) main::$0 ← (byte) main::b1 + (number) $fa +Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::b1 + (unumber)(number) $fa Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (byte) main::b2#0 + (number) 1 Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::b2#0 + (unumber)(number) 1 Adding number conversion cast (unumber) 0 in (number~) main::$4 ← (number) 0 * (const byte) SIZEOF_WORD @@ -72,7 +71,7 @@ Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (word*) main::screen ← (word*)(number) $400 Inlining cast (byte*) main::bgcol ← (byte*)(number) $d020 Inlining cast (byte) main::RED ← (unumber)(number) 2 -Inlining cast (byte) main::b1#0 ← (unumber)(number) $fa +Inlining cast (byte) main::b1 ← (unumber)(number) $fa Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (word*) 1024 Simplifying constant pointer cast (byte*) 53280 @@ -90,7 +89,7 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) $ff Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b1#0 + (byte) $fa +Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::b1 + (byte) $fa Inferred type updated to byte in (unumber~) main::$1 ← (byte) main::b2#0 + (byte) 1 Inferred type updated to byte in (unumber~) main::$4 ← (byte) 0 * (const byte) SIZEOF_WORD Inversing boolean not [11] (bool~) main::$3 ← (word) main::w#0 <= (byte) $ff from [10] (bool~) main::$2 ← (word) main::w#0 > (byte) $ff @@ -105,7 +104,7 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word*) main::screen = (word*) 1024 Constant (const byte*) main::bgcol = (byte*) 53280 Constant (const byte) main::RED = 2 -Constant (const byte) main::b1#0 = $fa +Constant (const byte) main::b1 = $fa Constant (const byte) main::$4 = 0*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in @@ -115,9 +114,9 @@ Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::$4 Eliminating unused constant (const byte) SIZEOF_WORD Successful SSA optimization PassNEliminateUnusedVars -Constant right-side identified [0] (byte) main::b2#0 ← (const byte) main::b1#0 + (byte) $fa +Constant right-side identified [0] (byte) main::b2#0 ← (const byte) main::b1 + (byte) $fa Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::b2#0 = main::b1#0+$fa +Constant (const byte) main::b2#0 = main::b1+$fa Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (word) main::w#0 ← (const byte) main::b2#0 + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -165,7 +164,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b1 (byte) main::b2 (word) main::w @@ -312,10 +310,9 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@return (const byte) main::RED RED = (byte) 2 -(byte) main::b1 -(const byte) main::b1#0 b1 = (byte) $fa +(const byte) main::b1 b1 = (byte) $fa (byte) main::b2 -(const byte) main::b2#0 b2 = (const byte) main::b1#0+(byte) $fa +(const byte) main::b2#0 b2 = (const byte) main::b1+(byte) $fa (const byte*) main::bgcol bgcol = (byte*) 53280 (const word*) main::screen screen = (word*) 1024 (word) main::w diff --git a/src/test/ref/number-inference-sum.sym b/src/test/ref/number-inference-sum.sym index 2bb090bde..6f15c82a9 100644 --- a/src/test/ref/number-inference-sum.sym +++ b/src/test/ref/number-inference-sum.sym @@ -5,10 +5,9 @@ (label) main::@1 (label) main::@return (const byte) main::RED RED = (byte) 2 -(byte) main::b1 -(const byte) main::b1#0 b1 = (byte) $fa +(const byte) main::b1 b1 = (byte) $fa (byte) main::b2 -(const byte) main::b2#0 b2 = (const byte) main::b1#0+(byte) $fa +(const byte) main::b2#0 b2 = (const byte) main::b1+(byte) $fa (const byte*) main::bgcol bgcol = (byte*) 53280 (const word*) main::screen screen = (word*) 1024 (word) main::w diff --git a/src/test/ref/operator-lohi-problem.log b/src/test/ref/operator-lohi-problem.log index 356d21c6e..98bbe66aa 100644 --- a/src/test/ref/operator-lohi-problem.log +++ b/src/test/ref/operator-lohi-problem.log @@ -7,10 +7,10 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (dword) main::dw#0 ← (number) $2000 - (word~) main::$0 ← < (dword) main::dw#0 + (dword) main::dw ← (number) $2000 + (word~) main::$0 ← < (dword) main::dw (word) main::w1#0 ← (word~) main::$0 - (number~) main::$1 ← (dword) main::dw#0 + (number) 1 + (number~) main::$1 ← (dword) main::dw + (number) 1 (number~) main::$2 ← < (number~) main::$1 (word) main::w2#0 ← (number~) main::$2 (byte~) main::$3 ← < (word) main::w1#0 @@ -48,15 +48,14 @@ SYMBOL TABLE SSA (byte~) main::$6 (label) main::@return (dword) main::dw -(dword) main::dw#0 (word) main::w1 (word) main::w1#0 (word) main::w2 (word) main::w2#0 -Adding number conversion cast (unumber) $2000 in (dword) main::dw#0 ← (number) $2000 -Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (dword) main::dw#0 + (number) 1 -Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (dword) main::dw#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) $2000 in (dword) main::dw ← (number) $2000 +Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (dword) main::dw + (number) 1 +Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (dword) main::dw + (unumber)(number) 1 Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← < (unumber~) main::$1 Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte~) main::$3 Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (number) 1) ← (byte~) main::$4 @@ -64,7 +63,7 @@ Adding number conversion cast (unumber) 3 in *((byte*) SCREEN + (number) 3) ← Adding number conversion cast (unumber) 4 in *((byte*) SCREEN + (number) 4) ← (byte~) main::$6 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) SCREEN ← (byte*)(number) $400 -Inlining cast (dword) main::dw#0 ← (unumber)(number) $2000 +Inlining cast (dword) main::dw ← (unumber)(number) $2000 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $2000 @@ -81,23 +80,23 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 3 Finalized unsigned number type (byte) 4 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to dword in (unumber~) main::$1 ← (dword) main::dw#0 + (byte) 1 +Inferred type updated to dword in (unumber~) main::$1 ← (dword) main::dw + (byte) 1 Inferred type updated to word in (unumber~) main::$2 ← < (dword~) main::$1 Alias (word) main::w1#0 = (word~) main::$0 Alias (word) main::w2#0 = (word~) main::$2 Successful SSA optimization Pass2AliasElimination Constant (const byte*) SCREEN = (byte*) 1024 -Constant (const dword) main::dw#0 = $2000 +Constant (const dword) main::dw = $2000 Successful SSA optimization Pass2ConstantIdentification Simplifying expression containing zero SCREEN in [8] *((const byte*) SCREEN + (byte) 0) ← (byte~) main::$3 Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (word) main::w1#0 ← < (const dword) main::dw#0 -Constant right-side identified [1] (dword~) main::$1 ← (const dword) main::dw#0 + (byte) 1 +Constant right-side identified [0] (word) main::w1#0 ← < (const dword) main::dw +Constant right-side identified [1] (dword~) main::$1 ← (const dword) main::dw + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word) main::w1#0 = (const word) main::w2#0 Constant inlined main::$3 = (byte) 0 Constant inlined main::$4 = (byte) 0 -Constant inlined main::$1 = (const dword) main::dw#0+(byte) 1 +Constant inlined main::$1 = (const dword) main::dw+(byte) 1 Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(SCREEN+1) Consolidated array index constant in *(SCREEN+3) @@ -167,7 +166,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(dword) main::dw (word) main::w1 (word) main::w2 @@ -317,11 +315,10 @@ FINAL SYMBOL TABLE (const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return -(dword) main::dw -(const dword) main::dw#0 dw = (word) $2000 +(const dword) main::dw dw = (word) $2000 (word) main::w1 (word) main::w2 -(const word) main::w2#0 w2 = <(const dword) main::dw#0+(byte) 1 +(const word) main::w2#0 w2 = <(const dword) main::dw+(byte) 1 diff --git a/src/test/ref/operator-lohi-problem.sym b/src/test/ref/operator-lohi-problem.sym index 13e04e56e..d76f41315 100644 --- a/src/test/ref/operator-lohi-problem.sym +++ b/src/test/ref/operator-lohi-problem.sym @@ -4,9 +4,8 @@ (const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@return -(dword) main::dw -(const dword) main::dw#0 dw = (word) $2000 +(const dword) main::dw dw = (word) $2000 (word) main::w1 (word) main::w2 -(const word) main::w2#0 w2 = <(const dword) main::dw#0+(byte) 1 +(const word) main::w2#0 w2 = <(const dword) main::dw+(byte) 1 diff --git a/src/test/ref/overlap-allocation-2.cfg b/src/test/ref/overlap-allocation-2.cfg index ac4054e94..a2e11eaf9 100644 --- a/src/test/ref/overlap-allocation-2.cfg +++ b/src/test/ref/overlap-allocation-2.cfg @@ -51,7 +51,7 @@ line::@return: scope:[line] from line::@1 (void()) plot((byte) plot::x) plot: scope:[plot] from line line::@1 [22] (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 ) - [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' + [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot [24] return diff --git a/src/test/ref/overlap-allocation-2.log b/src/test/ref/overlap-allocation-2.log index 7dd448bde..7490dc7db 100644 --- a/src/test/ref/overlap-allocation-2.log +++ b/src/test/ref/overlap-allocation-2.log @@ -5,7 +5,7 @@ Culled Empty Block (label) @2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@3 (void()) main() @@ -62,7 +62,7 @@ line::@return: scope:[line] from line::@2 (void()) plot((byte) plot::x) plot: scope:[plot] from line line::@1 (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 ) - *((byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' + *((byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot return @@ -80,7 +80,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) line((byte) line::l) (number~) line::$1 (label) line::@1 @@ -120,7 +119,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) $14 in (number~) line::$1 ← (byte) line::l#3 + (number) $14 Adding number conversion cast (unumber) line::$1 in (number~) line::$1 ← (byte) line::l#3 + (unumber)(number) $14 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $14 @@ -136,7 +135,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [8] if((byte) main::i#1!=rangelast(0,8)) goto main::@1 Simple Condition (bool~) main::$3 [16] if((byte) main::j#1!=rangelast($a,$12)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#0 = $a Successful SSA optimization Pass2ConstantIdentification @@ -248,7 +247,7 @@ line::@return: scope:[line] from line::@1 (void()) plot((byte) plot::x) plot: scope:[plot] from line line::@1 [22] (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 ) - [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' + [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot [24] return @@ -256,7 +255,6 @@ plot::@return: scope:[plot] from plot VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) line((byte) line::l) (byte) line::l (byte) line::l#0 22.0 @@ -418,7 +416,7 @@ line: { // plot(byte zeropage(5) x) plot: { .label x = 5 - // [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 + // [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'*' ldy.z x sta SCREEN,y @@ -431,12 +429,12 @@ plot: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) always clobbers reg byte a +Statement [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#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 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::j#2 main::j#1 ] Statement [19] (byte) plot::x#1 ← (byte) line::l#2 + (byte) $14 [ plot::x#1 ] ( main:2::line:7 [ main::i#2 plot::x#1 ] main:2::line:12 [ main::j#2 plot::x#1 ] ) always clobbers reg byte a -Statement [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) always clobbers reg byte a +Statement [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#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 , Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ line::l#2 line::l#0 line::l#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -573,7 +571,7 @@ line: { // plot // plot(byte register(X) x) plot: { - // [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta SCREEN,x jmp breturn @@ -632,8 +630,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) line((byte) line::l) (label) line::@1 (label) line::@return @@ -762,7 +759,7 @@ line: { // plot(byte register(X) x) plot: { // SCREEN[x] = '*' - // [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [23] *((const byte*) SCREEN + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta SCREEN,x // plot::@return diff --git a/src/test/ref/overlap-allocation-2.sym b/src/test/ref/overlap-allocation-2.sym index deda30fb3..c4d2e6786 100644 --- a/src/test/ref/overlap-allocation-2.sym +++ b/src/test/ref/overlap-allocation-2.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) line((byte) line::l) (label) line::@1 (label) line::@return diff --git a/src/test/ref/overlap-allocation.cfg b/src/test/ref/overlap-allocation.cfg index 5468ab1ba..9d4f982ab 100644 --- a/src/test/ref/overlap-allocation.cfg +++ b/src/test/ref/overlap-allocation.cfg @@ -46,7 +46,7 @@ main::@return: scope:[main] from main::@6 (void()) plot((byte) plot::x) plot: scope:[plot] from main::@1 main::@2 main::@3 [21] (byte) plot::x#3 ← phi( main::@1/(byte) plot::x#0 main::@2/(byte) plot::x#1 main::@3/(byte) plot::x#2 ) - [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' + [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot [23] return diff --git a/src/test/ref/overlap-allocation.log b/src/test/ref/overlap-allocation.log index 032b9aeb8..5d17812af 100644 --- a/src/test/ref/overlap-allocation.log +++ b/src/test/ref/overlap-allocation.log @@ -4,7 +4,7 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 to:@2 (void()) main() @@ -57,7 +57,7 @@ main::@return: scope:[main] from main::@9 (void()) plot((byte) plot::x) plot: scope:[plot] from main::@1 main::@3 main::@5 (byte) plot::x#3 ← phi( main::@1/(byte) plot::x#0 main::@3/(byte) plot::x#1 main::@5/(byte) plot::x#2 ) - *((byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' + *((byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot return @@ -75,7 +75,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (bool~) main::$1 (bool~) main::$3 @@ -112,7 +111,7 @@ SYMBOL TABLE SSA (byte) plot::x#2 (byte) plot::x#3 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification @@ -124,7 +123,7 @@ Simple Condition (bool~) main::$1 [8] if((byte) main::i#1!=rangelast(0,$a)) goto Simple Condition (bool~) main::$3 [16] if((byte) main::j#1!=rangelast(0,$a)) goto main::@3 Simple Condition (bool~) main::$5 [24] if((byte) main::k#1!=rangelast(0,$a)) goto main::@5 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#0 = 0 Constant (const byte) main::k#0 = 0 @@ -242,7 +241,7 @@ main::@return: scope:[main] from main::@6 (void()) plot((byte) plot::x) plot: scope:[plot] from main::@1 main::@2 main::@3 [21] (byte) plot::x#3 ← phi( main::@1/(byte) plot::x#0 main::@2/(byte) plot::x#1 main::@3/(byte) plot::x#2 ) - [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' + [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot [23] return @@ -250,7 +249,6 @@ plot::@return: scope:[plot] from plot VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::i (byte) main::i#1 16.5 @@ -412,7 +410,7 @@ main: { // plot(byte zeropage(5) x) plot: { .label x = 5 - // [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 + // [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'*' ldy.z x sta SCREEN,y @@ -425,11 +423,11 @@ plot: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' [ ] ( main:2::plot:7 [ main::i#2 ] main:2::plot:12 [ main::j#2 ] main:2::plot:17 [ main::k#2 ] ) always clobbers reg byte a +Statement [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' [ ] ( main:2::plot:7 [ main::i#2 ] main:2::plot:12 [ main::j#2 ] main:2::plot:17 [ main::k#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 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::j#2 main::j#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::k#2 main::k#1 ] -Statement [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' [ ] ( main:2::plot:7 [ main::i#2 ] main:2::plot:12 [ main::j#2 ] main:2::plot:17 [ main::k#2 ] ) always clobbers reg byte a +Statement [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' [ ] ( main:2::plot:7 [ main::i#2 ] main:2::plot:12 [ main::j#2 ] main:2::plot:17 [ main::k#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 , Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::k#2 main::k#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -556,7 +554,7 @@ main: { // plot // plot(byte register(X) x) plot: { - // [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta SCREEN,x jmp breturn @@ -617,8 +615,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 @@ -740,7 +737,7 @@ main: { // plot(byte register(X) x) plot: { // SCREEN[x] = '*' - // [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 + // [22] *((const byte*) SCREEN + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2 lda #'*' sta SCREEN,x // plot::@return diff --git a/src/test/ref/overlap-allocation.sym b/src/test/ref/overlap-allocation.sym index c2ac5149d..fcd1aab69 100644 --- a/src/test/ref/overlap-allocation.sym +++ b/src/test/ref/overlap-allocation.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/plasma-center.cfg b/src/test/ref/plasma-center.cfg index e42ccc5ba..c3c4b6236 100644 --- a/src/test/ref/plasma-center.cfg +++ b/src/test/ref/plasma-center.cfg @@ -545,7 +545,7 @@ init_squares::@return: scope:[init_squares] from init_squares::@1 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @3 init_squares [255] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [255] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [255] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [256] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3 [257] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return diff --git a/src/test/ref/plasma-center.log b/src/test/ref/plasma-center.log index 0b64e7666..644ad5263 100644 --- a/src/test/ref/plasma-center.log +++ b/src/test/ref/plasma-center.log @@ -172,8 +172,8 @@ memset::@return: scope:[memset] from memset::@1 return to:@return @8: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@16 (void*()) malloc((word) malloc::size) @@ -1528,7 +1528,6 @@ SYMBOL TABLE SSA (byte) CORDIC_ITERATIONS_16 (byte*) D018 (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (byte) NUM_SQUARES (byte) NUM_SQUARES#0 (byte) NUM_SQUARES#1 @@ -2886,7 +2885,7 @@ Inlining cast (byte*) COLS ← (byte*)(number) $d800 Inlining cast (byte) BLACK ← (unumber)(number) 0 Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (signed word~) bsearch16u::$8 ← (signed word)(word) bsearch16u::key#1 Inlining cast (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0) @@ -3190,7 +3189,7 @@ Alias (byte) memset::c#2 = (byte) memset::c#3 Alias (byte*) memset::dst#2 = (byte*) memset::dst#3 Alias (byte*) memset::end#1 = (byte*) memset::end#2 Alias (void*) memset::str#5 = (void*) memset::str#6 -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#46 (byte*) heap_head#41 (byte*) heap_head#36 (byte*) heap_head#31 (byte*) heap_head#23 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#46 (byte*) heap_head#41 (byte*) heap_head#36 (byte*) heap_head#31 (byte*) heap_head#23 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#5 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#13 (byte*) heap_head#2 @@ -3594,7 +3593,7 @@ Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte*) D018 = (byte*) 53272 Constant (const byte*) COLS = (byte*) 55296 Constant (const byte) BLACK = 0 -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const byte) bsearch16u::$17 = 1*SIZEOF_WORD Constant (const byte) bsearch16u::$18 = 1*SIZEOF_WORD Constant (const byte) NUM_SQUARES#0 = $ff @@ -4692,7 +4691,7 @@ init_squares::@return: scope:[init_squares] from init_squares::@1 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @3 init_squares [255] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [255] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [255] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [256] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3 [257] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return @@ -4702,7 +4701,6 @@ malloc::@return: scope:[malloc] from malloc VARIABLE REGISTER WEIGHTS -(byte*) HEAP_TOP (byte) NUM_SQUARES (void*) SCREEN_ANGLE 0.05405405405405406 (void*) SCREEN_DIST 0.05128205128205128 @@ -5361,7 +5359,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -7884,7 +7882,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -9821,8 +9819,7 @@ FINAL SYMBOL TABLE }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte*) D018 D018 = (byte*) 53272 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 @@ -10338,7 +10335,7 @@ bbegin: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [255] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP diff --git a/src/test/ref/plasma-center.sym b/src/test/ref/plasma-center.sym index 610fa0583..c3d31db18 100644 --- a/src/test/ref/plasma-center.sym +++ b/src/test/ref/plasma-center.sym @@ -12,8 +12,7 @@ }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte*) D018 D018 = (byte*) 53272 -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 diff --git a/src/test/ref/pointer-cast-4.log b/src/test/ref/pointer-cast-4.log index aa7ad04d9..84f9e312f 100644 --- a/src/test/ref/pointer-cast-4.log +++ b/src/test/ref/pointer-cast-4.log @@ -8,12 +8,12 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::bscreen#0 ← ((byte*)) (number) $400 + (byte*) main::bscreen ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - (word*~) main::$0 ← ((word*)) (byte*) main::bscreen#0 + (word*~) main::$0 ← ((word*)) (byte*) main::bscreen (word*) main::wscreen#0 ← (word*~) main::$0 (word~) main::$1 ← ((word)) (byte) main::i#2 (byte~) main::$3 ← (byte) main::i#2 * (const byte) SIZEOF_WORD @@ -46,7 +46,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::bscreen -(byte*) main::bscreen#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -54,8 +53,8 @@ SYMBOL TABLE SSA (word*) main::wscreen (word*) main::wscreen#0 -Inlining cast (byte*) main::bscreen#0 ← (byte*)(number) $400 -Inlining cast (word*~) main::$0 ← (word*)(byte*) main::bscreen#0 +Inlining cast (byte*) main::bscreen ← (byte*)(number) $400 +Inlining cast (word*~) main::$0 ← (word*)(byte*) main::bscreen Inlining cast (word~) main::$1 ← (word)(byte) main::i#2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -64,10 +63,10 @@ Alias (word*) main::wscreen#0 = (word*~) main::$0 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [10] if((byte) main::i#1!=rangelast(0,2)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::bscreen#0 = (byte*) 1024 +Constant (const byte*) main::bscreen = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (word*)main::bscreen#0 in [3] (word*) main::wscreen#0 ← (word*)(const byte*) main::bscreen#0 +Constant value identified (word*)main::bscreen in [3] (word*) main::wscreen#0 ← (word*)(const byte*) main::bscreen Successful SSA optimization Pass2ConstantValues Resolved ranged next value [8] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [10] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3 @@ -77,7 +76,7 @@ Simplifying constant integer cast 3 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 3 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant (const word*) main::wscreen#0 = (word*)main::bscreen#0 +Constant (const word*) main::wscreen#0 = (word*)main::bscreen Successful SSA optimization Pass2ConstantIdentification Rewriting multiplication to use shift [2] (byte~) main::$3 ← (byte) main::i#2 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2MultiplyToShiftRewriting @@ -137,7 +136,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (word~) main::$1 11.0 (byte~) main::$3 22.0 -(byte*) main::bscreen (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 8.25 @@ -349,13 +347,12 @@ FINAL SYMBOL TABLE (byte~) main::$3 reg byte a 22.0 (label) main::@1 (label) main::@return -(byte*) main::bscreen -(const byte*) main::bscreen#0 bscreen = (byte*) 1024 +(const byte*) main::bscreen bscreen = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 8.25 (word*) main::wscreen -(const word*) main::wscreen#0 wscreen = (word*)(const byte*) main::bscreen#0 +(const word*) main::wscreen#0 wscreen = (word*)(const byte*) main::bscreen reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:2 [ main::$1 ] diff --git a/src/test/ref/pointer-cast-4.sym b/src/test/ref/pointer-cast-4.sym index 1a3d44bb1..16b6b6495 100644 --- a/src/test/ref/pointer-cast-4.sym +++ b/src/test/ref/pointer-cast-4.sym @@ -6,13 +6,12 @@ (byte~) main::$3 reg byte a 22.0 (label) main::@1 (label) main::@return -(byte*) main::bscreen -(const byte*) main::bscreen#0 bscreen = (byte*) 1024 +(const byte*) main::bscreen bscreen = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 8.25 (word*) main::wscreen -(const word*) main::wscreen#0 wscreen = (word*)(const byte*) main::bscreen#0 +(const word*) main::wscreen#0 wscreen = (word*)(const byte*) main::bscreen reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:2 [ main::$1 ] diff --git a/src/test/ref/pointer-cast.cfg b/src/test/ref/pointer-cast.cfg index f985cf261..95f708077 100644 --- a/src/test/ref/pointer-cast.cfg +++ b/src/test/ref/pointer-cast.cfg @@ -10,22 +10,22 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 - [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 - [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 - [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 - [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 - [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 - [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 - [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 - [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 + [4] *((const byte*) ub_screen) ← (const byte) ub + [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb + [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub + [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb + [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [12] *((byte*)(const word*) uw_screen) ← (const byte) ub + [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb + [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub + [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb + [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw to:main::@return main::@return: scope:[main] from main [20] return diff --git a/src/test/ref/pointer-cast.log b/src/test/ref/pointer-cast.log index 732e52770..f2ffe676f 100644 --- a/src/test/ref/pointer-cast.log +++ b/src/test/ref/pointer-cast.log @@ -17,70 +17,70 @@ Identified constant variable (signed word) sw CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) ub_screen#0 ← ((byte*)) (number) $400 - (signed byte*) sb_screen#0 ← ((signed byte*)) (number) $428 - (word*) uw_screen#0 ← ((word*)) (number) $450 - (signed word*) sw_screen#0 ← ((signed word*)) (number) $478 - (byte) ub#0 ← (number) $29 - (signed byte) sb#0 ← (number) -$29 - (word) uw#0 ← (number) $3000 - (signed word) sw#0 ← (number) -$3000 + (byte*) ub_screen ← ((byte*)) (number) $400 + (signed byte*) sb_screen ← ((signed byte*)) (number) $428 + (word*) uw_screen ← ((word*)) (number) $450 + (signed word*) sw_screen ← ((signed word*)) (number) $478 + (byte) ub ← (number) $29 + (signed byte) sb ← (number) -$29 + (word) uw ← (number) $3000 + (signed word) sw ← (number) -$3000 to:@1 (void()) main() main: scope:[main] from @1 - (byte*~) main::$0 ← ((byte*)) (byte*) ub_screen#0 - *((byte*~) main::$0) ← (byte) ub#0 - (signed byte*~) main::$1 ← ((signed byte*)) (byte*) ub_screen#0 + (byte*~) main::$0 ← ((byte*)) (byte*) ub_screen + *((byte*~) main::$0) ← (byte) ub + (signed byte*~) main::$1 ← ((signed byte*)) (byte*) ub_screen (signed byte*~) main::$2 ← (signed byte*~) main::$1 + (number) 1 - *((signed byte*~) main::$2) ← (signed byte) sb#0 - (word*~) main::$3 ← ((word*)) (byte*) ub_screen#0 + *((signed byte*~) main::$2) ← (signed byte) sb + (word*~) main::$3 ← ((word*)) (byte*) ub_screen (number~) main::$28 ← (number) 1 * (const byte) SIZEOF_WORD (word*~) main::$4 ← (word*~) main::$3 + (number~) main::$28 - *((word*~) main::$4) ← (word) uw#0 - (signed word*~) main::$5 ← ((signed word*)) (byte*) ub_screen#0 + *((word*~) main::$4) ← (word) uw + (signed word*~) main::$5 ← ((signed word*)) (byte*) ub_screen (number~) main::$29 ← (number) 2 * (const byte) SIZEOF_SIGNED_WORD (signed word*~) main::$6 ← (signed word*~) main::$5 + (number~) main::$29 - *((signed word*~) main::$6) ← (signed word) sw#0 - (byte*~) main::$7 ← ((byte*)) (signed byte*) sb_screen#0 - *((byte*~) main::$7) ← (byte) ub#0 - (signed byte*~) main::$8 ← ((signed byte*)) (signed byte*) sb_screen#0 + *((signed word*~) main::$6) ← (signed word) sw + (byte*~) main::$7 ← ((byte*)) (signed byte*) sb_screen + *((byte*~) main::$7) ← (byte) ub + (signed byte*~) main::$8 ← ((signed byte*)) (signed byte*) sb_screen (signed byte*~) main::$9 ← (signed byte*~) main::$8 + (number) 1 - *((signed byte*~) main::$9) ← (signed byte) sb#0 - (word*~) main::$10 ← ((word*)) (signed byte*) sb_screen#0 + *((signed byte*~) main::$9) ← (signed byte) sb + (word*~) main::$10 ← ((word*)) (signed byte*) sb_screen (number~) main::$30 ← (number) 1 * (const byte) SIZEOF_WORD (word*~) main::$11 ← (word*~) main::$10 + (number~) main::$30 - *((word*~) main::$11) ← (word) uw#0 - (signed word*~) main::$12 ← ((signed word*)) (signed byte*) sb_screen#0 + *((word*~) main::$11) ← (word) uw + (signed word*~) main::$12 ← ((signed word*)) (signed byte*) sb_screen (number~) main::$31 ← (number) 2 * (const byte) SIZEOF_SIGNED_WORD (signed word*~) main::$13 ← (signed word*~) main::$12 + (number~) main::$31 - *((signed word*~) main::$13) ← (signed word) sw#0 - (byte*~) main::$14 ← ((byte*)) (word*) uw_screen#0 - *((byte*~) main::$14) ← (byte) ub#0 - (signed byte*~) main::$15 ← ((signed byte*)) (word*) uw_screen#0 + *((signed word*~) main::$13) ← (signed word) sw + (byte*~) main::$14 ← ((byte*)) (word*) uw_screen + *((byte*~) main::$14) ← (byte) ub + (signed byte*~) main::$15 ← ((signed byte*)) (word*) uw_screen (signed byte*~) main::$16 ← (signed byte*~) main::$15 + (number) 1 - *((signed byte*~) main::$16) ← (signed byte) sb#0 - (word*~) main::$17 ← ((word*)) (word*) uw_screen#0 + *((signed byte*~) main::$16) ← (signed byte) sb + (word*~) main::$17 ← ((word*)) (word*) uw_screen (number~) main::$32 ← (number) 1 * (const byte) SIZEOF_WORD (word*~) main::$18 ← (word*~) main::$17 + (number~) main::$32 - *((word*~) main::$18) ← (word) uw#0 - (signed word*~) main::$19 ← ((signed word*)) (word*) uw_screen#0 + *((word*~) main::$18) ← (word) uw + (signed word*~) main::$19 ← ((signed word*)) (word*) uw_screen (number~) main::$33 ← (number) 2 * (const byte) SIZEOF_SIGNED_WORD (signed word*~) main::$20 ← (signed word*~) main::$19 + (number~) main::$33 - *((signed word*~) main::$20) ← (signed word) sw#0 - (byte*~) main::$21 ← ((byte*)) (signed word*) sw_screen#0 - *((byte*~) main::$21) ← (byte) ub#0 - (signed byte*~) main::$22 ← ((signed byte*)) (signed word*) sw_screen#0 + *((signed word*~) main::$20) ← (signed word) sw + (byte*~) main::$21 ← ((byte*)) (signed word*) sw_screen + *((byte*~) main::$21) ← (byte) ub + (signed byte*~) main::$22 ← ((signed byte*)) (signed word*) sw_screen (signed byte*~) main::$23 ← (signed byte*~) main::$22 + (number) 1 - *((signed byte*~) main::$23) ← (signed byte) sb#0 - (word*~) main::$24 ← ((word*)) (signed word*) sw_screen#0 + *((signed byte*~) main::$23) ← (signed byte) sb + (word*~) main::$24 ← ((word*)) (signed word*) sw_screen (number~) main::$34 ← (number) 1 * (const byte) SIZEOF_WORD (word*~) main::$25 ← (word*~) main::$24 + (number~) main::$34 - *((word*~) main::$25) ← (word) uw#0 - (signed word*~) main::$26 ← ((signed word*)) (signed word*) sw_screen#0 + *((word*~) main::$25) ← (word) uw + (signed word*~) main::$26 ← ((signed word*)) (signed word*) sw_screen (number~) main::$35 ← (number) 2 * (const byte) SIZEOF_SIGNED_WORD (signed word*~) main::$27 ← (signed word*~) main::$26 + (number~) main::$35 - *((signed word*~) main::$27) ← (signed word) sw#0 + *((signed word*~) main::$27) ← (signed word) sw to:main::@return main::@return: scope:[main] from main return @@ -138,26 +138,18 @@ SYMBOL TABLE SSA (signed byte*~) main::$9 (label) main::@return (signed byte) sb -(signed byte) sb#0 (signed byte*) sb_screen -(signed byte*) sb_screen#0 (signed word) sw -(signed word) sw#0 (signed word*) sw_screen -(signed word*) sw_screen#0 (byte) ub -(byte) ub#0 (byte*) ub_screen -(byte*) ub_screen#0 (word) uw -(word) uw#0 (word*) uw_screen -(word*) uw_screen#0 -Adding number conversion cast (unumber) $29 in (byte) ub#0 ← (number) $29 -Adding number conversion cast (snumber) -$29 in (signed byte) sb#0 ← (number) -$29 -Adding number conversion cast (unumber) $3000 in (word) uw#0 ← (number) $3000 -Adding number conversion cast (snumber) -$3000 in (signed word) sw#0 ← (number) -$3000 +Adding number conversion cast (unumber) $29 in (byte) ub ← (number) $29 +Adding number conversion cast (snumber) -$29 in (signed byte) sb ← (number) -$29 +Adding number conversion cast (unumber) $3000 in (word) uw ← (number) $3000 +Adding number conversion cast (snumber) -$3000 in (signed word) sw ← (number) -$3000 Adding number conversion cast (unumber) 1 in (signed byte*~) main::$2 ← (signed byte*~) main::$1 + (number) 1 Adding number conversion cast (unumber) 1 in (number~) main::$28 ← (number) 1 * (const byte) SIZEOF_WORD Adding number conversion cast (unumber) main::$28 in (number~) main::$28 ← (unumber)(number) 1 * (const byte) SIZEOF_WORD @@ -179,30 +171,30 @@ Adding number conversion cast (unumber) main::$34 in (number~) main::$34 ← (un Adding number conversion cast (unumber) 2 in (number~) main::$35 ← (number) 2 * (const byte) SIZEOF_SIGNED_WORD Adding number conversion cast (unumber) main::$35 in (number~) main::$35 ← (unumber)(number) 2 * (const byte) SIZEOF_SIGNED_WORD Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) ub_screen#0 ← (byte*)(number) $400 -Inlining cast (signed byte*) sb_screen#0 ← (signed byte*)(number) $428 -Inlining cast (word*) uw_screen#0 ← (word*)(number) $450 -Inlining cast (signed word*) sw_screen#0 ← (signed word*)(number) $478 -Inlining cast (byte) ub#0 ← (unumber)(number) $29 -Inlining cast (signed byte) sb#0 ← (snumber)(number) -$29 -Inlining cast (word) uw#0 ← (unumber)(number) $3000 -Inlining cast (signed word) sw#0 ← (snumber)(number) -$3000 -Inlining cast (byte*~) main::$0 ← (byte*)(byte*) ub_screen#0 -Inlining cast (signed byte*~) main::$1 ← (signed byte*)(byte*) ub_screen#0 -Inlining cast (word*~) main::$3 ← (word*)(byte*) ub_screen#0 -Inlining cast (signed word*~) main::$5 ← (signed word*)(byte*) ub_screen#0 -Inlining cast (byte*~) main::$7 ← (byte*)(signed byte*) sb_screen#0 -Inlining cast (signed byte*~) main::$8 ← (signed byte*)(signed byte*) sb_screen#0 -Inlining cast (word*~) main::$10 ← (word*)(signed byte*) sb_screen#0 -Inlining cast (signed word*~) main::$12 ← (signed word*)(signed byte*) sb_screen#0 -Inlining cast (byte*~) main::$14 ← (byte*)(word*) uw_screen#0 -Inlining cast (signed byte*~) main::$15 ← (signed byte*)(word*) uw_screen#0 -Inlining cast (word*~) main::$17 ← (word*)(word*) uw_screen#0 -Inlining cast (signed word*~) main::$19 ← (signed word*)(word*) uw_screen#0 -Inlining cast (byte*~) main::$21 ← (byte*)(signed word*) sw_screen#0 -Inlining cast (signed byte*~) main::$22 ← (signed byte*)(signed word*) sw_screen#0 -Inlining cast (word*~) main::$24 ← (word*)(signed word*) sw_screen#0 -Inlining cast (signed word*~) main::$26 ← (signed word*)(signed word*) sw_screen#0 +Inlining cast (byte*) ub_screen ← (byte*)(number) $400 +Inlining cast (signed byte*) sb_screen ← (signed byte*)(number) $428 +Inlining cast (word*) uw_screen ← (word*)(number) $450 +Inlining cast (signed word*) sw_screen ← (signed word*)(number) $478 +Inlining cast (byte) ub ← (unumber)(number) $29 +Inlining cast (signed byte) sb ← (snumber)(number) -$29 +Inlining cast (word) uw ← (unumber)(number) $3000 +Inlining cast (signed word) sw ← (snumber)(number) -$3000 +Inlining cast (byte*~) main::$0 ← (byte*)(byte*) ub_screen +Inlining cast (signed byte*~) main::$1 ← (signed byte*)(byte*) ub_screen +Inlining cast (word*~) main::$3 ← (word*)(byte*) ub_screen +Inlining cast (signed word*~) main::$5 ← (signed word*)(byte*) ub_screen +Inlining cast (byte*~) main::$7 ← (byte*)(signed byte*) sb_screen +Inlining cast (signed byte*~) main::$8 ← (signed byte*)(signed byte*) sb_screen +Inlining cast (word*~) main::$10 ← (word*)(signed byte*) sb_screen +Inlining cast (signed word*~) main::$12 ← (signed word*)(signed byte*) sb_screen +Inlining cast (byte*~) main::$14 ← (byte*)(word*) uw_screen +Inlining cast (signed byte*~) main::$15 ← (signed byte*)(word*) uw_screen +Inlining cast (word*~) main::$17 ← (word*)(word*) uw_screen +Inlining cast (signed word*~) main::$19 ← (signed word*)(word*) uw_screen +Inlining cast (byte*~) main::$21 ← (byte*)(signed word*) sw_screen +Inlining cast (signed byte*~) main::$22 ← (signed byte*)(signed word*) sw_screen +Inlining cast (word*~) main::$24 ← (word*)(signed word*) sw_screen +Inlining cast (signed word*~) main::$26 ← (signed word*)(signed word*) sw_screen Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant pointer cast (signed byte*) 1064 @@ -212,21 +204,21 @@ Simplifying constant integer cast $29 Simplifying constant integer cast -$29 Simplifying constant integer cast $3000 Simplifying constant integer cast -$3000 -Simplifying constant integer cast (byte*) ub_screen#0 +Simplifying constant integer cast (byte*) ub_screen Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast 2 -Simplifying constant integer cast (signed byte*) sb_screen#0 +Simplifying constant integer cast (signed byte*) sb_screen Simplifying constant integer cast 1 Simplifying constant integer cast 1 Simplifying constant integer cast 2 Simplifying constant integer cast 1 -Simplifying constant integer cast (word*) uw_screen#0 +Simplifying constant integer cast (word*) uw_screen Simplifying constant integer cast 1 Simplifying constant integer cast 2 Simplifying constant integer cast 1 Simplifying constant integer cast 1 -Simplifying constant integer cast (signed word*) sw_screen#0 +Simplifying constant integer cast (signed word*) sw_screen Simplifying constant integer cast 2 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $29 @@ -263,14 +255,14 @@ Constant right-side identified [44] (byte~) main::$33 ← (byte) 2 * (const byte Constant right-side identified [53] (byte~) main::$34 ← (byte) 1 * (const byte) SIZEOF_WORD Constant right-side identified [57] (byte~) main::$35 ← (byte) 2 * (const byte) SIZEOF_SIGNED_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) ub_screen#0 = (byte*) 1024 -Constant (const signed byte*) sb_screen#0 = (signed byte*) 1064 -Constant (const word*) uw_screen#0 = (word*) 1104 -Constant (const signed word*) sw_screen#0 = (signed word*) 1144 -Constant (const byte) ub#0 = $29 -Constant (const signed byte) sb#0 = -$29 -Constant (const word) uw#0 = $3000 -Constant (const signed word) sw#0 = -$3000 +Constant (const byte*) ub_screen = (byte*) 1024 +Constant (const signed byte*) sb_screen = (signed byte*) 1064 +Constant (const word*) uw_screen = (word*) 1104 +Constant (const signed word*) sw_screen = (signed word*) 1144 +Constant (const byte) ub = $29 +Constant (const signed byte) sb = -$29 +Constant (const word) uw = $3000 +Constant (const signed word) sw = -$3000 Constant (const byte) main::$28 = 1*SIZEOF_WORD Constant (const byte) main::$29 = 2*SIZEOF_SIGNED_WORD Constant (const byte) main::$30 = 1*SIZEOF_WORD @@ -280,36 +272,36 @@ Constant (const byte) main::$33 = 2*SIZEOF_SIGNED_WORD Constant (const byte) main::$34 = 1*SIZEOF_WORD Constant (const byte) main::$35 = 2*SIZEOF_SIGNED_WORD Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::$0 = ub_screen#0 -Constant (const signed byte*) main::$8 = sb_screen#0 -Constant (const word*) main::$17 = uw_screen#0 -Constant (const signed word*) main::$26 = sw_screen#0 +Constant (const byte*) main::$0 = ub_screen +Constant (const signed byte*) main::$8 = sb_screen +Constant (const word*) main::$17 = uw_screen +Constant (const signed word*) main::$26 = sw_screen Successful SSA optimization Pass2ConstantIdentification -Constant value identified (signed byte*)ub_screen#0 in [10] (signed byte*~) main::$1 ← (signed byte*)(const byte*) ub_screen#0 -Constant value identified (word*)ub_screen#0 in [13] (word*~) main::$3 ← (word*)(const byte*) ub_screen#0 -Constant value identified (signed word*)ub_screen#0 in [17] (signed word*~) main::$5 ← (signed word*)(const byte*) ub_screen#0 -Constant value identified (byte*)sb_screen#0 in [21] (byte*~) main::$7 ← (byte*)(const signed byte*) sb_screen#0 -Constant value identified (word*)sb_screen#0 in [26] (word*~) main::$10 ← (word*)(const signed byte*) sb_screen#0 -Constant value identified (signed word*)sb_screen#0 in [30] (signed word*~) main::$12 ← (signed word*)(const signed byte*) sb_screen#0 -Constant value identified (byte*)uw_screen#0 in [34] (byte*~) main::$14 ← (byte*)(const word*) uw_screen#0 -Constant value identified (signed byte*)uw_screen#0 in [36] (signed byte*~) main::$15 ← (signed byte*)(const word*) uw_screen#0 -Constant value identified (signed word*)uw_screen#0 in [43] (signed word*~) main::$19 ← (signed word*)(const word*) uw_screen#0 -Constant value identified (byte*)sw_screen#0 in [47] (byte*~) main::$21 ← (byte*)(const signed word*) sw_screen#0 -Constant value identified (signed byte*)sw_screen#0 in [49] (signed byte*~) main::$22 ← (signed byte*)(const signed word*) sw_screen#0 -Constant value identified (word*)sw_screen#0 in [52] (word*~) main::$24 ← (word*)(const signed word*) sw_screen#0 +Constant value identified (signed byte*)ub_screen in [10] (signed byte*~) main::$1 ← (signed byte*)(const byte*) ub_screen +Constant value identified (word*)ub_screen in [13] (word*~) main::$3 ← (word*)(const byte*) ub_screen +Constant value identified (signed word*)ub_screen in [17] (signed word*~) main::$5 ← (signed word*)(const byte*) ub_screen +Constant value identified (byte*)sb_screen in [21] (byte*~) main::$7 ← (byte*)(const signed byte*) sb_screen +Constant value identified (word*)sb_screen in [26] (word*~) main::$10 ← (word*)(const signed byte*) sb_screen +Constant value identified (signed word*)sb_screen in [30] (signed word*~) main::$12 ← (signed word*)(const signed byte*) sb_screen +Constant value identified (byte*)uw_screen in [34] (byte*~) main::$14 ← (byte*)(const word*) uw_screen +Constant value identified (signed byte*)uw_screen in [36] (signed byte*~) main::$15 ← (signed byte*)(const word*) uw_screen +Constant value identified (signed word*)uw_screen in [43] (signed word*~) main::$19 ← (signed word*)(const word*) uw_screen +Constant value identified (byte*)sw_screen in [47] (byte*~) main::$21 ← (byte*)(const signed word*) sw_screen +Constant value identified (signed byte*)sw_screen in [49] (signed byte*~) main::$22 ← (signed byte*)(const signed word*) sw_screen +Constant value identified (word*)sw_screen in [52] (word*~) main::$24 ← (word*)(const signed word*) sw_screen Successful SSA optimization Pass2ConstantValues -Converting *(pointer+n) to pointer[n] [12] *((signed byte*~) main::$2) ← (const signed byte) sb#0 -- *(main::$1 + 1) -Converting *(pointer+n) to pointer[n] [16] *((word*~) main::$4) ← (const word) uw#0 -- *(main::$3 + main::$28) -Converting *(pointer+n) to pointer[n] [20] *((signed word*~) main::$6) ← (const signed word) sw#0 -- *(main::$5 + main::$29) -Converting *(pointer+n) to pointer[n] [25] *((signed byte*~) main::$9) ← (const signed byte) sb#0 -- *(main::$8 + 1) -Converting *(pointer+n) to pointer[n] [29] *((word*~) main::$11) ← (const word) uw#0 -- *(main::$10 + main::$30) -Converting *(pointer+n) to pointer[n] [33] *((signed word*~) main::$13) ← (const signed word) sw#0 -- *(main::$12 + main::$31) -Converting *(pointer+n) to pointer[n] [38] *((signed byte*~) main::$16) ← (const signed byte) sb#0 -- *(main::$15 + 1) -Converting *(pointer+n) to pointer[n] [42] *((word*~) main::$18) ← (const word) uw#0 -- *(main::$17 + main::$32) -Converting *(pointer+n) to pointer[n] [46] *((signed word*~) main::$20) ← (const signed word) sw#0 -- *(main::$19 + main::$33) -Converting *(pointer+n) to pointer[n] [51] *((signed byte*~) main::$23) ← (const signed byte) sb#0 -- *(main::$22 + 1) -Converting *(pointer+n) to pointer[n] [55] *((word*~) main::$25) ← (const word) uw#0 -- *(main::$24 + main::$34) -Converting *(pointer+n) to pointer[n] [59] *((signed word*~) main::$27) ← (const signed word) sw#0 -- *(main::$26 + main::$35) +Converting *(pointer+n) to pointer[n] [12] *((signed byte*~) main::$2) ← (const signed byte) sb -- *(main::$1 + 1) +Converting *(pointer+n) to pointer[n] [16] *((word*~) main::$4) ← (const word) uw -- *(main::$3 + main::$28) +Converting *(pointer+n) to pointer[n] [20] *((signed word*~) main::$6) ← (const signed word) sw -- *(main::$5 + main::$29) +Converting *(pointer+n) to pointer[n] [25] *((signed byte*~) main::$9) ← (const signed byte) sb -- *(main::$8 + 1) +Converting *(pointer+n) to pointer[n] [29] *((word*~) main::$11) ← (const word) uw -- *(main::$10 + main::$30) +Converting *(pointer+n) to pointer[n] [33] *((signed word*~) main::$13) ← (const signed word) sw -- *(main::$12 + main::$31) +Converting *(pointer+n) to pointer[n] [38] *((signed byte*~) main::$16) ← (const signed byte) sb -- *(main::$15 + 1) +Converting *(pointer+n) to pointer[n] [42] *((word*~) main::$18) ← (const word) uw -- *(main::$17 + main::$32) +Converting *(pointer+n) to pointer[n] [46] *((signed word*~) main::$20) ← (const signed word) sw -- *(main::$19 + main::$33) +Converting *(pointer+n) to pointer[n] [51] *((signed byte*~) main::$23) ← (const signed byte) sb -- *(main::$22 + 1) +Converting *(pointer+n) to pointer[n] [55] *((word*~) main::$25) ← (const word) uw -- *(main::$24 + main::$34) +Converting *(pointer+n) to pointer[n] [59] *((signed word*~) main::$27) ← (const signed word) sw -- *(main::$26 + main::$35) Successful SSA optimization Pass2InlineDerefIdx Eliminating unused variable (signed byte*~) main::$2 and assignment [2] (signed byte*~) main::$2 ← (signed byte*~) main::$1 + (byte) 1 Eliminating unused variable (word*~) main::$4 and assignment [5] (word*~) main::$4 ← (word*~) main::$3 + (const byte) main::$28 @@ -324,56 +316,56 @@ Eliminating unused variable (signed byte*~) main::$23 and assignment [33] (signe Eliminating unused variable (word*~) main::$25 and assignment [36] (word*~) main::$25 ← (word*~) main::$24 + (const byte) main::$34 Eliminating unused variable (signed word*~) main::$27 and assignment [38] (signed word*~) main::$27 ← (const signed word*) main::$26 + (const byte) main::$35 Successful SSA optimization PassNEliminateUnusedVars -Constant (const signed byte*) main::$1 = (signed byte*)ub_screen#0 -Constant (const word*) main::$3 = (word*)ub_screen#0 -Constant (const signed word*) main::$5 = (signed word*)ub_screen#0 -Constant (const byte*) main::$7 = (byte*)sb_screen#0 -Constant (const word*) main::$10 = (word*)sb_screen#0 -Constant (const signed word*) main::$12 = (signed word*)sb_screen#0 -Constant (const byte*) main::$14 = (byte*)uw_screen#0 -Constant (const signed byte*) main::$15 = (signed byte*)uw_screen#0 -Constant (const signed word*) main::$19 = (signed word*)uw_screen#0 -Constant (const byte*) main::$21 = (byte*)sw_screen#0 -Constant (const signed byte*) main::$22 = (signed byte*)sw_screen#0 -Constant (const word*) main::$24 = (word*)sw_screen#0 +Constant (const signed byte*) main::$1 = (signed byte*)ub_screen +Constant (const word*) main::$3 = (word*)ub_screen +Constant (const signed word*) main::$5 = (signed word*)ub_screen +Constant (const byte*) main::$7 = (byte*)sb_screen +Constant (const word*) main::$10 = (word*)sb_screen +Constant (const signed word*) main::$12 = (signed word*)sb_screen +Constant (const byte*) main::$14 = (byte*)uw_screen +Constant (const signed byte*) main::$15 = (signed byte*)uw_screen +Constant (const signed word*) main::$19 = (signed word*)uw_screen +Constant (const byte*) main::$21 = (byte*)sw_screen +Constant (const signed byte*) main::$22 = (signed byte*)sw_screen +Constant (const word*) main::$24 = (word*)sw_screen Successful SSA optimization Pass2ConstantIdentification Constant inlined main::$34 = (byte) 1*(const byte) SIZEOF_WORD -Constant inlined main::$12 = (signed word*)(const signed byte*) sb_screen#0 +Constant inlined main::$12 = (signed word*)(const signed byte*) sb_screen Constant inlined main::$35 = (byte) 2*(const byte) SIZEOF_SIGNED_WORD -Constant inlined main::$24 = (word*)(const signed word*) sw_screen#0 -Constant inlined main::$14 = (byte*)(const word*) uw_screen#0 -Constant inlined main::$26 = (const signed word*) sw_screen#0 -Constant inlined main::$15 = (signed byte*)(const word*) uw_screen#0 +Constant inlined main::$24 = (word*)(const signed word*) sw_screen +Constant inlined main::$14 = (byte*)(const word*) uw_screen +Constant inlined main::$26 = (const signed word*) sw_screen +Constant inlined main::$15 = (signed byte*)(const word*) uw_screen Constant inlined main::$30 = (byte) 1*(const byte) SIZEOF_WORD Constant inlined main::$31 = (byte) 2*(const byte) SIZEOF_SIGNED_WORD Constant inlined main::$32 = (byte) 1*(const byte) SIZEOF_WORD -Constant inlined main::$10 = (word*)(const signed byte*) sb_screen#0 -Constant inlined main::$21 = (byte*)(const signed word*) sw_screen#0 +Constant inlined main::$10 = (word*)(const signed byte*) sb_screen +Constant inlined main::$21 = (byte*)(const signed word*) sw_screen Constant inlined main::$33 = (byte) 2*(const byte) SIZEOF_SIGNED_WORD -Constant inlined main::$22 = (signed byte*)(const signed word*) sw_screen#0 -Constant inlined main::$1 = (signed byte*)(const byte*) ub_screen#0 -Constant inlined main::$17 = (const word*) uw_screen#0 +Constant inlined main::$22 = (signed byte*)(const signed word*) sw_screen +Constant inlined main::$1 = (signed byte*)(const byte*) ub_screen +Constant inlined main::$17 = (const word*) uw_screen Constant inlined main::$28 = (byte) 1*(const byte) SIZEOF_WORD Constant inlined main::$29 = (byte) 2*(const byte) SIZEOF_SIGNED_WORD -Constant inlined main::$0 = (const byte*) ub_screen#0 -Constant inlined main::$19 = (signed word*)(const word*) uw_screen#0 -Constant inlined main::$5 = (signed word*)(const byte*) ub_screen#0 -Constant inlined main::$3 = (word*)(const byte*) ub_screen#0 -Constant inlined main::$7 = (byte*)(const signed byte*) sb_screen#0 -Constant inlined main::$8 = (const signed byte*) sb_screen#0 +Constant inlined main::$0 = (const byte*) ub_screen +Constant inlined main::$19 = (signed word*)(const word*) uw_screen +Constant inlined main::$5 = (signed word*)(const byte*) ub_screen +Constant inlined main::$3 = (word*)(const byte*) ub_screen +Constant inlined main::$7 = (byte*)(const signed byte*) sb_screen +Constant inlined main::$8 = (const signed byte*) sb_screen Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *((signed byte*)ub_screen#0+1) -Consolidated array index constant in *((word*)ub_screen#0+1*SIZEOF_WORD) -Consolidated array index constant in *((signed word*)ub_screen#0+2*SIZEOF_SIGNED_WORD) -Consolidated array index constant in *(sb_screen#0+1) -Consolidated array index constant in *((word*)sb_screen#0+1*SIZEOF_WORD) -Consolidated array index constant in *((signed word*)sb_screen#0+2*SIZEOF_SIGNED_WORD) -Consolidated array index constant in *((signed byte*)uw_screen#0+1) -Consolidated array index constant in *(uw_screen#0+1*SIZEOF_WORD) -Consolidated array index constant in *((signed word*)uw_screen#0+2*SIZEOF_SIGNED_WORD) -Consolidated array index constant in *((signed byte*)sw_screen#0+1) -Consolidated array index constant in *((word*)sw_screen#0+1*SIZEOF_WORD) -Consolidated array index constant in *(sw_screen#0+2*SIZEOF_SIGNED_WORD) +Consolidated array index constant in *((signed byte*)ub_screen+1) +Consolidated array index constant in *((word*)ub_screen+1*SIZEOF_WORD) +Consolidated array index constant in *((signed word*)ub_screen+2*SIZEOF_SIGNED_WORD) +Consolidated array index constant in *(sb_screen+1) +Consolidated array index constant in *((word*)sb_screen+1*SIZEOF_WORD) +Consolidated array index constant in *((signed word*)sb_screen+2*SIZEOF_SIGNED_WORD) +Consolidated array index constant in *((signed byte*)uw_screen+1) +Consolidated array index constant in *(uw_screen+1*SIZEOF_WORD) +Consolidated array index constant in *((signed word*)uw_screen+2*SIZEOF_SIGNED_WORD) +Consolidated array index constant in *((signed byte*)sw_screen+1) +Consolidated array index constant in *((word*)sw_screen+1*SIZEOF_WORD) +Consolidated array index constant in *(sw_screen+2*SIZEOF_SIGNED_WORD) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -402,22 +394,22 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 - [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 - [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 - [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 - [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 - [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 - [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 - [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 - [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 - [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 - [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 + [4] *((const byte*) ub_screen) ← (const byte) ub + [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb + [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub + [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb + [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [12] *((byte*)(const word*) uw_screen) ← (const byte) ub + [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb + [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw + [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub + [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb + [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw + [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw to:main::@return main::@return: scope:[main] from main [20] return @@ -426,14 +418,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(signed byte) sb -(signed byte*) sb_screen -(signed word) sw -(signed word*) sw_screen -(byte) ub -(byte*) ub_screen -(word) uw -(word*) uw_screen Initial phi equivalence classes Complete equivalence classes @@ -473,66 +457,66 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) ub_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta ub_screen - // [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta ub_screen+1 - // [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta ub_screen+1*SIZEOF_WORD+1 - // [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta ub_screen+2*SIZEOF_SIGNED_WORD+1 - // [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sb_screen - // [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sb_screen+1 - // [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sb_screen+1*SIZEOF_WORD+1 - // [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta sb_screen+2*SIZEOF_SIGNED_WORD+1 - // [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [12] *((byte*)(const word*) uw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta uw_screen - // [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta uw_screen+1 - // [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta uw_screen+1*SIZEOF_WORD+1 - // [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta uw_screen+2*SIZEOF_SIGNED_WORD+1 - // [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sw_screen - // [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sw_screen+1 - // [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sw_screen+1*SIZEOF_WORD+1 - // [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw @@ -546,22 +530,22 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) ub_screen) ← (const byte) ub [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((byte*)(const word*) uw_screen) ← (const byte) ub [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -604,66 +588,66 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) ub_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta ub_screen - // [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta ub_screen+1 - // [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta ub_screen+1*SIZEOF_WORD+1 - // [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta ub_screen+2*SIZEOF_SIGNED_WORD+1 - // [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sb_screen - // [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sb_screen+1 - // [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sb_screen+1*SIZEOF_WORD+1 - // [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta sb_screen+2*SIZEOF_SIGNED_WORD+1 - // [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [12] *((byte*)(const word*) uw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta uw_screen - // [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta uw_screen+1 - // [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta uw_screen+1*SIZEOF_WORD+1 - // [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta uw_screen+2*SIZEOF_SIGNED_WORD+1 - // [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sw_screen - // [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sw_screen+1 - // [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sw_screen+1*SIZEOF_WORD+1 - // [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw @@ -702,22 +686,14 @@ FINAL SYMBOL TABLE (const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2 (void()) main() (label) main::@return -(signed byte) sb -(const signed byte) sb#0 sb = (signed byte) -$29 -(signed byte*) sb_screen -(const signed byte*) sb_screen#0 sb_screen = (signed byte*) 1064 -(signed word) sw -(const signed word) sw#0 sw = (signed word) -$3000 -(signed word*) sw_screen -(const signed word*) sw_screen#0 sw_screen = (signed word*) 1144 -(byte) ub -(const byte) ub#0 ub = (byte) $29 -(byte*) ub_screen -(const byte*) ub_screen#0 ub_screen = (byte*) 1024 -(word) uw -(const word) uw#0 uw = (word) $3000 -(word*) uw_screen -(const word*) uw_screen#0 uw_screen = (word*) 1104 +(const signed byte) sb sb = (signed byte) -$29 +(const signed byte*) sb_screen sb_screen = (signed byte*) 1064 +(const signed word) sw sw = (signed word) -$3000 +(const signed word*) sw_screen sw_screen = (signed word*) 1144 +(const byte) ub ub = (byte) $29 +(const byte*) ub_screen ub_screen = (byte*) 1024 +(const word) uw uw = (word) $3000 +(const word*) uw_screen uw_screen = (word*) 1104 @@ -750,81 +726,81 @@ Score: 150 // main main: { // *((byte*)ub_screen) = ub - // [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) ub_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta ub_screen // *((signed byte*)ub_screen+1) = sb - // [5] *((signed byte*)(const byte*) ub_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [5] *((signed byte*)(const byte*) ub_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta ub_screen+1 // *((word*)ub_screen+1)= uw - // [6] *((word*)(const byte*) ub_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [6] *((word*)(const byte*) ub_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta ub_screen+1*SIZEOF_WORD+1 // *((signed word*)ub_screen+2) = sw - // [7] *((signed word*)(const byte*) ub_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [7] *((signed word*)(const byte*) ub_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta ub_screen+2*SIZEOF_SIGNED_WORD+1 // *((byte*)sb_screen) = ub - // [8] *((byte*)(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [8] *((byte*)(const signed byte*) sb_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sb_screen // *((signed byte*)sb_screen+1) = sb - // [9] *((const signed byte*) sb_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [9] *((const signed byte*) sb_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sb_screen+1 // *((word*)sb_screen+1)= uw - // [10] *((word*)(const signed byte*) sb_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [10] *((word*)(const signed byte*) sb_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sb_screen+1*SIZEOF_WORD+1 // *((signed word*)sb_screen+2) = sw - // [11] *((signed word*)(const signed byte*) sb_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [11] *((signed word*)(const signed byte*) sb_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta sb_screen+2*SIZEOF_SIGNED_WORD+1 // *((byte*)uw_screen) = ub - // [12] *((byte*)(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [12] *((byte*)(const word*) uw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta uw_screen // *((signed byte*)uw_screen+1) = sb - // [13] *((signed byte*)(const word*) uw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [13] *((signed byte*)(const word*) uw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta uw_screen+1 // *((word*)uw_screen+1)= uw - // [14] *((const word*) uw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [14] *((const word*) uw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta uw_screen+1*SIZEOF_WORD+1 // *((signed word*)uw_screen+2) = sw - // [15] *((signed word*)(const word*) uw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [15] *((signed word*)(const word*) uw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw sta uw_screen+2*SIZEOF_SIGNED_WORD+1 // *((byte*)sw_screen) = ub - // [16] *((byte*)(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2 + // [16] *((byte*)(const signed word*) sw_screen) ← (const byte) ub -- _deref_pbuc1=vbuc2 lda #ub sta sw_screen // *((signed byte*)sw_screen+1) = sb - // [17] *((signed byte*)(const signed word*) sw_screen#0+(byte) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2 + // [17] *((signed byte*)(const signed word*) sw_screen+(byte) 1) ← (const signed byte) sb -- _deref_pbsc1=vbsc2 lda #sb sta sw_screen+1 // *((word*)sw_screen+1)= uw - // [18] *((word*)(const signed word*) sw_screen#0+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2 + // [18] *((word*)(const signed word*) sw_screen+(byte) 1*(const byte) SIZEOF_WORD) ← (const word) uw -- _deref_pwuc1=vwuc2 lda #uw sta sw_screen+1*SIZEOF_WORD+1 // *((signed word*)sw_screen+2) = sw - // [19] *((const signed word*) sw_screen#0+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2 + // [19] *((const signed word*) sw_screen+(byte) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw -- _deref_pwsc1=vwsc2 lda #sw diff --git a/src/test/ref/pointer-cast.sym b/src/test/ref/pointer-cast.sym index aa96f782c..4508fc6dd 100644 --- a/src/test/ref/pointer-cast.sym +++ b/src/test/ref/pointer-cast.sym @@ -5,20 +5,12 @@ (const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2 (void()) main() (label) main::@return -(signed byte) sb -(const signed byte) sb#0 sb = (signed byte) -$29 -(signed byte*) sb_screen -(const signed byte*) sb_screen#0 sb_screen = (signed byte*) 1064 -(signed word) sw -(const signed word) sw#0 sw = (signed word) -$3000 -(signed word*) sw_screen -(const signed word*) sw_screen#0 sw_screen = (signed word*) 1144 -(byte) ub -(const byte) ub#0 ub = (byte) $29 -(byte*) ub_screen -(const byte*) ub_screen#0 ub_screen = (byte*) 1024 -(word) uw -(const word) uw#0 uw = (word) $3000 -(word*) uw_screen -(const word*) uw_screen#0 uw_screen = (word*) 1104 +(const signed byte) sb sb = (signed byte) -$29 +(const signed byte*) sb_screen sb_screen = (signed byte*) 1064 +(const signed word) sw sw = (signed word) -$3000 +(const signed word*) sw_screen sw_screen = (signed word*) 1144 +(const byte) ub ub = (byte) $29 +(const byte*) ub_screen ub_screen = (byte*) 1024 +(const word) uw uw = (word) $3000 +(const word*) uw_screen uw_screen = (word*) 1104 diff --git a/src/test/ref/pointer-plus-signed-word.cfg b/src/test/ref/pointer-plus-signed-word.cfg index 77d9f57f5..5c1756506 100644 --- a/src/test/ref/pointer-plus-signed-word.cfg +++ b/src/test/ref/pointer-plus-signed-word.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (signed word) main::i#2 ← phi( main/(signed word) -$a main::@1/(signed word) main::i#1 ) - [6] (byte*) main::sc#0 ← (const byte*) SCREEN#0 + (signed word) main::i#2 + [6] (byte*) main::sc#0 ← (const byte*) SCREEN + (signed word) main::i#2 [7] (byte~) main::$1 ← (byte)(signed word) main::i#2 [8] *((byte*) main::sc#0) ← (byte~) main::$1 [9] (signed word) main::i#1 ← ++ (signed word) main::i#2 diff --git a/src/test/ref/pointer-plus-signed-word.log b/src/test/ref/pointer-plus-signed-word.log index 94883bbb7..4cb95f1f9 100644 --- a/src/test/ref/pointer-plus-signed-word.log +++ b/src/test/ref/pointer-plus-signed-word.log @@ -3,7 +3,7 @@ Culled Empty Block (label) main::@2 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400+(number) $28*(number) $a + (byte*) SCREEN ← ((byte*)) (number) $400+(number) $28*(number) $a to:@1 (void()) main() @@ -12,7 +12,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 (signed word) main::i#2 ← phi( main/(signed word) main::i#0 main::@1/(signed word) main::i#1 ) - (byte*~) main::$0 ← (byte*) SCREEN#0 + (signed word) main::i#2 + (byte*~) main::$0 ← (byte*) SCREEN + (signed word) main::i#2 (byte*) main::sc#0 ← (byte*~) main::$0 (byte~) main::$1 ← ((byte)) (signed word) main::i#2 *((byte*) main::sc#0) ← (byte~) main::$1 @@ -36,7 +36,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (void()) main() (byte*~) main::$0 (byte~) main::$1 @@ -50,16 +49,16 @@ SYMBOL TABLE SSA (byte*) main::sc (byte*) main::sc#0 -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400+(number) $28*(number) $a +Inlining cast (byte*) SCREEN ← (byte*)(number) $400+(number) $28*(number) $a Inlining cast (byte~) main::$1 ← (byte)(signed word) main::i#2 Successful SSA optimization Pass2InlineCast Alias (byte*) main::sc#0 = (byte*~) main::$0 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [9] if((signed word) main::i#1!=rangelast(-$a,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant right-side identified [0] (byte*) SCREEN#0 ← (byte*)(number) $400+(number) $28*(number) $a +Constant right-side identified [0] (byte*) SCREEN ← (byte*)(number) $400+(number) $28*(number) $a Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) SCREEN#0 = (byte*)$400+$28*$a +Constant (const byte*) SCREEN = (byte*)$400+$28*$a Constant (const signed word) main::i#0 = -$a Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [7] main::i#1 ← ++ main::i#2 to ++ @@ -109,7 +108,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (signed word) main::i#2 ← phi( main/(signed word) -$a main::@1/(signed word) main::i#1 ) - [6] (byte*) main::sc#0 ← (const byte*) SCREEN#0 + (signed word) main::i#2 + [6] (byte*) main::sc#0 ← (const byte*) SCREEN + (signed word) main::i#2 [7] (byte~) main::$1 ← (byte)(signed word) main::i#2 [8] *((byte*) main::sc#0) ← (byte~) main::$1 [9] (signed word) main::i#1 ← ++ (signed word) main::i#2 @@ -121,7 +120,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte~) main::$1 22.0 (signed word) main::i @@ -188,7 +186,7 @@ main: { jmp b1 // main::@1 b1: - // [6] (byte*) main::sc#0 ← (const byte*) SCREEN#0 + (signed word) main::i#2 -- pbuz1=pbuc1_plus_vwsz2 + // [6] (byte*) main::sc#0 ← (const byte*) SCREEN + (signed word) main::i#2 -- pbuz1=pbuc1_plus_vwsz2 lda #setscreen] setscreen_from_main: - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1#0 [phi:main->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1 [phi:main->setscreen#0] -- pbuz1=pbuc1 lda #screen1 @@ -258,7 +254,7 @@ main: { // [7] call setscreen // [10] phi from main::@1 to setscreen [phi:main::@1->setscreen] setscreen_from_b1: - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2#0 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 lda #screen2 @@ -348,7 +344,7 @@ main: { // [5] call setscreen // [10] phi from main to setscreen [phi:main->setscreen] setscreen_from_main: - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1#0 [phi:main->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1 [phi:main->setscreen#0] -- pbuz1=pbuc1 lda #screen1 @@ -364,7 +360,7 @@ main: { // [7] call setscreen // [10] phi from main::@1 to setscreen [phi:main::@1->setscreen] setscreen_from_b1: - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2#0 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 lda #screen2 @@ -434,10 +430,8 @@ FINAL SYMBOL TABLE (label) main::@return (byte*) screen (byte*) screen#0 screen zp ZP_WORD:4 0.6666666666666666 -(byte*) screen1 -(const byte*) screen1#0 screen1 = (byte*) 1024 -(byte*) screen2 -(const byte*) screen2#0 screen2 = (byte*)(number) $400+(number) $28 +(const byte*) screen1 screen1 = (byte*) 1024 +(const byte*) screen2 screen2 = (byte*)(number) $400+(number) $28 (void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val) (label) setscreen::@return (byte**) setscreen::screen @@ -482,7 +476,7 @@ main: { // setscreen(&screen, screen1) // [5] call setscreen // [10] phi from main to setscreen [phi:main->setscreen] - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1#0 [phi:main->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen1 [phi:main->setscreen#0] -- pbuz1=pbuc1 lda #screen1 @@ -497,7 +491,7 @@ main: { // setscreen(&screen, screen2) // [7] call setscreen // [10] phi from main::@1 to setscreen [phi:main::@1->setscreen] - // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2#0 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 + // [10] phi (byte*) setscreen::val#2 = (const byte*) screen2 [phi:main::@1->setscreen#0] -- pbuz1=pbuc1 lda #screen2 diff --git a/src/test/ref/pointer-pointer-3.sym b/src/test/ref/pointer-pointer-3.sym index 66809fc12..9a75b9f0c 100644 --- a/src/test/ref/pointer-pointer-3.sym +++ b/src/test/ref/pointer-pointer-3.sym @@ -7,10 +7,8 @@ (label) main::@return (byte*) screen (byte*) screen#0 screen zp ZP_WORD:4 0.6666666666666666 -(byte*) screen1 -(const byte*) screen1#0 screen1 = (byte*) 1024 -(byte*) screen2 -(const byte*) screen2#0 screen2 = (byte*)(number) $400+(number) $28 +(const byte*) screen1 screen1 = (byte*) 1024 +(const byte*) screen2 screen2 = (byte*)(number) $400+(number) $28 (void()) setscreen((byte**) setscreen::screen , (byte*) setscreen::val) (label) setscreen::@return (byte**) setscreen::screen diff --git a/src/test/ref/print-problem.cfg b/src/test/ref/print-problem.cfg index 1ce44cecd..1cd699152 100644 --- a/src/test/ref/print-problem.cfg +++ b/src/test/ref/print-problem.cfg @@ -22,8 +22,8 @@ main::@2: scope:[main] from main::@1 [9] call ln to:main::@3 main::@3: scope:[main] from main::@2 - [10] *((const byte*) SCREEN#0) ← (byte) line#13 - [11] *((const byte*) SCREEN#0+(byte) $28) ← (byte) line#13 + [10] *((const byte*) SCREEN) ← (byte) line#13 + [11] *((const byte*) SCREEN+(byte) $28) ← (byte) line#13 to:main::@return main::@return: scope:[main] from main::@3 [12] return diff --git a/src/test/ref/print-problem.log b/src/test/ref/print-problem.log index f17ffbe5b..3c28a3ef9 100644 --- a/src/test/ref/print-problem.log +++ b/src/test/ref/print-problem.log @@ -3,7 +3,7 @@ Culled Empty Block (label) @1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte) line#0 ← (number) $40 (byte) ch#0 ← (byte) line#0 to:@2 @@ -35,8 +35,8 @@ main::@3: scope:[main] from main::@2 (byte) line#10 ← phi( main::@2/(byte) line#6 ) (byte) line#3 ← (byte) line#10 (byte) ch#5 ← (byte) ch#12 - *((byte*) SCREEN#0) ← (byte) ch#5 - (byte*~) main::$3 ← (byte*) SCREEN#0 + (number) $28 + *((byte*) SCREEN) ← (byte) ch#5 + (byte*~) main::$3 ← (byte*) SCREEN + (number) $28 *((byte*~) main::$3) ← (byte) line#3 to:main::@return main::@return: scope:[main] from main::@3 @@ -80,7 +80,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte) ch (byte) ch#0 (byte) ch#1 @@ -129,11 +128,11 @@ SYMBOL TABLE SSA (label) main::@return Adding number conversion cast (unumber) $40 in (byte) line#0 ← (number) $40 -Adding number conversion cast (unumber) $28 in (byte*~) main::$3 ← (byte*) SCREEN#0 + (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) main::$3 ← (byte*) SCREEN + (number) $28 Adding number conversion cast (unumber) 2 in (number~) ln::$0 ← (byte) line#12 + (number) 2 Adding number conversion cast (unumber) ln::$0 in (number~) ln::$0 ← (byte) line#12 + (unumber)(number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) line#0 ← (unumber)(number) $40 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -168,19 +167,19 @@ Identical Phi Values (byte) ch#12 (byte) line#13 Identical Phi Values (byte) line#14 (byte) line#10 Identical Phi Values (byte) ch#15 (byte) ch#12 Successful SSA optimization Pass2IdenticalPhiElimination -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) line#0 = $40 Successful SSA optimization Pass2ConstantIdentification -Converting *(pointer+n) to pointer[n] [20] *((byte*~) main::$3) ← (byte) line#13 -- *(SCREEN#0 + $28) +Converting *(pointer+n) to pointer[n] [20] *((byte*~) main::$3) ← (byte) line#13 -- *(SCREEN + $28) Successful SSA optimization Pass2InlineDerefIdx Eliminating unused variable (byte) ch#2 and assignment [1] (byte) ch#2 ← ++ (byte) line#13 Eliminating unused variable (byte) ch#4 and assignment [3] (byte) ch#4 ← ++ (byte) line#13 -Eliminating unused variable (byte*~) main::$3 and assignment [6] (byte*~) main::$3 ← (const byte*) SCREEN#0 + (byte) $28 +Eliminating unused variable (byte*~) main::$3 and assignment [6] (byte*~) main::$3 ← (const byte*) SCREEN + (byte) $28 Successful SSA optimization PassNEliminateUnusedVars Inlining constant with var siblings (const byte) line#0 Constant inlined line#0 = (byte) $40 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(SCREEN#0+$28) +Consolidated array index constant in *(SCREEN+$28) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @2 @@ -229,8 +228,8 @@ main::@2: scope:[main] from main::@1 [9] call ln to:main::@3 main::@3: scope:[main] from main::@2 - [10] *((const byte*) SCREEN#0) ← (byte) line#13 - [11] *((const byte*) SCREEN#0+(byte) $28) ← (byte) line#13 + [10] *((const byte*) SCREEN) ← (byte) line#13 + [11] *((const byte*) SCREEN+(byte) $28) ← (byte) line#13 to:main::@return main::@return: scope:[main] from main::@3 [12] return @@ -247,7 +246,6 @@ ln::@return: scope:[ln] from ln VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (byte) ch (byte) line (byte) line#12 6.0 @@ -319,10 +317,10 @@ main: { jmp b3 // main::@3 b3: - // [10] *((const byte*) SCREEN#0) ← (byte) line#13 -- _deref_pbuc1=vbuz1 + // [10] *((const byte*) SCREEN) ← (byte) line#13 -- _deref_pbuc1=vbuz1 lda.z line sta SCREEN - // [11] *((const byte*) SCREEN#0+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuz1 + // [11] *((const byte*) SCREEN+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuz1 lda.z line sta SCREEN+$28 jmp breturn @@ -413,9 +411,9 @@ main: { jmp b3 // main::@3 b3: - // [10] *((const byte*) SCREEN#0) ← (byte) line#13 -- _deref_pbuc1=vbuaa + // [10] *((const byte*) SCREEN) ← (byte) line#13 -- _deref_pbuc1=vbuaa sta SCREEN - // [11] *((const byte*) SCREEN#0+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuaa + // [11] *((const byte*) SCREEN+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuaa sta SCREEN+$28 jmp breturn // main::@return @@ -472,8 +470,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte) ch (byte) line (byte) line#12 reg byte a 6.0 @@ -530,10 +527,10 @@ main: { jsr ln // main::@3 // *SCREEN = ch - // [10] *((const byte*) SCREEN#0) ← (byte) line#13 -- _deref_pbuc1=vbuaa + // [10] *((const byte*) SCREEN) ← (byte) line#13 -- _deref_pbuc1=vbuaa sta SCREEN // *(SCREEN+40) = line - // [11] *((const byte*) SCREEN#0+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuaa + // [11] *((const byte*) SCREEN+(byte) $28) ← (byte) line#13 -- _deref_pbuc1=vbuaa sta SCREEN+$28 // main::@return // } diff --git a/src/test/ref/print-problem.sym b/src/test/ref/print-problem.sym index bdad19d46..4ed0f16bd 100644 --- a/src/test/ref/print-problem.sym +++ b/src/test/ref/print-problem.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte) ch (byte) line (byte) line#12 reg byte a 6.0 diff --git a/src/test/ref/problem-negative-word-const.cfg b/src/test/ref/problem-negative-word-const.cfg index 9011f8f83..a92c99385 100644 --- a/src/test/ref/problem-negative-word-const.cfg +++ b/src/test/ref/problem-negative-word-const.cfg @@ -23,7 +23,7 @@ main::@3: scope:[main] from main::@1 main::@2: scope:[main] from main::@1 main::@3 [9] (word) main::w#2 ← phi( main::@3/(word~) main::w#3 main::@1/(byte) -1 ) [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 - [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 + [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 [12] (byte) main::i#1 ← ++ (byte) main::i#2 [13] if((byte) main::i#1!=(byte) 8) goto main::@1 to:main::@return diff --git a/src/test/ref/problem-negative-word-const.log b/src/test/ref/problem-negative-word-const.log index 9200fac01..219d7ef0d 100644 --- a/src/test/ref/problem-negative-word-const.log +++ b/src/test/ref/problem-negative-word-const.log @@ -5,7 +5,7 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (word*) screen#0 ← ((word*)) (number) $400 + (word*) screen ← ((word*)) (number) $400 to:@1 (void()) main() @@ -24,7 +24,7 @@ main::@2: scope:[main] from main::@1 main::@3 (word) main::w#2 ← phi( main::@1/(word) main::w#0 main::@3/(word) main::w#1 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 main::@3/(byte) main::i#4 ) (byte~) main::$3 ← (byte) main::i#3 * (const byte) SIZEOF_WORD - *((word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 + *((word*) screen + (byte~) main::$3) ← (word) main::w#2 (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,7) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,7) if((bool~) main::$2) goto main::@1 @@ -70,14 +70,13 @@ SYMBOL TABLE SSA (word) main::w#1 (word) main::w#2 (word*) screen -(word*) screen#0 Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 & (number) 1 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 & (unumber)(number) 1 Adding number conversion cast (unumber) 0 in (bool~) main::$4 ← (number) 0 != (unumber~) main::$0 Adding number conversion cast (unumber) -1 in (word) main::w#1 ← (number) -1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) screen#0 ← (word*)(number) $400 +Inlining cast (word*) screen ← (word*)(number) $400 Inlining cast (word) main::w#1 ← (unumber)(number) -1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (word*) 1024 @@ -100,7 +99,7 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$1 [7] if((byte) 0==(byte~) main::$0) goto main::@2 Simple Condition (bool~) main::$2 [13] if((byte) main::i#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const word*) screen#0 = (word*) 1024 +Constant (const word*) screen = (word*) 1024 Constant (const byte) main::i#0 = 0 Constant (const word) main::w#1 = -1 Successful SSA optimization Pass2ConstantIdentification @@ -171,7 +170,7 @@ main::@3: scope:[main] from main::@1 main::@2: scope:[main] from main::@1 main::@3 [9] (word) main::w#2 ← phi( main::@3/(word~) main::w#3 main::@1/(byte) -1 ) [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 - [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 + [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 [12] (byte) main::i#1 ← ++ (byte) main::i#2 [13] if((byte) main::i#1!=(byte) 8) goto main::@1 to:main::@return @@ -190,7 +189,6 @@ VARIABLE REGISTER WEIGHTS (word) main::w (word) main::w#2 11.0 (word~) main::w#3 22.0 -(word*) screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -284,7 +282,7 @@ main: { lda.z i asl sta.z _3 - // [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuz1=vwuz2 + // [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuz1=vwuz2 ldy.z _3 lda.z w sta screen,y @@ -308,11 +306,11 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (word~) main::w#3 ← (byte) main::i#2 [ main::i#2 main::w#3 ] ( main:2 [ main::i#2 main::w#3 ] ) 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 [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::w#2 main::$3 ] ( main:2 [ main::i#2 main::w#2 main::$3 ] ) always clobbers reg byte a -Statement [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a Statement [8] (word~) main::w#3 ← (byte) main::i#2 [ main::i#2 main::w#3 ] ( main:2 [ main::i#2 main::w#3 ] ) always clobbers reg byte a Statement [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::w#2 main::$3 ] ( main:2 [ main::i#2 main::w#2 main::$3 ] ) always clobbers reg byte a -Statement [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 [ main::i#2 ] ( main:2 [ main::i#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 , Potential registers zp ZP_WORD:3 [ main::w#2 main::w#3 ] : zp ZP_WORD:3 , Potential registers zp ZP_BYTE:5 [ main::$0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , @@ -395,7 +393,7 @@ main: { // [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuaa=vwuz1 + // [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z w sta screen,y @@ -459,8 +457,7 @@ FINAL SYMBOL TABLE (word) main::w (word) main::w#2 w zp ZP_WORD:2 11.0 (word~) main::w#3 w zp ZP_WORD:2 22.0 -(word*) screen -(const word*) screen#0 screen = (word*) 1024 +(const word*) screen screen = (word*) 1024 reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:2 [ main::w#2 main::w#3 ] @@ -526,7 +523,7 @@ main: { // [10] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [11] *((const word*) screen#0 + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuaa=vwuz1 + // [11] *((const word*) screen + (byte~) main::$3) ← (word) main::w#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z w sta screen,y diff --git a/src/test/ref/problem-negative-word-const.sym b/src/test/ref/problem-negative-word-const.sym index e0da15416..0205df1f0 100644 --- a/src/test/ref/problem-negative-word-const.sym +++ b/src/test/ref/problem-negative-word-const.sym @@ -14,8 +14,7 @@ (word) main::w (word) main::w#2 w zp ZP_WORD:2 11.0 (word~) main::w#3 w zp ZP_WORD:2 22.0 -(word*) screen -(const word*) screen#0 screen = (word*) 1024 +(const word*) screen screen = (word*) 1024 reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:2 [ main::w#2 main::w#3 ] diff --git a/src/test/ref/ptr-complex.cfg b/src/test/ref/ptr-complex.cfg index a6f0e1aaf..0a0f93ad3 100644 --- a/src/test/ref/ptr-complex.cfg +++ b/src/test/ref/ptr-complex.cfg @@ -14,24 +14,24 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) + [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) - [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) + [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) + [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [11] (byte) main::j#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::j#1 ) - [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) + [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) [13] (byte) main::j#1 ← ++ (byte) main::j#2 [14] if((byte) main::j#1!=(byte) $b) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 [15] *((byte*) 53280) ← ++ *((byte*) 53280) [16] *((byte*)(number) $d000+(number) $21) ← -- *((byte*)(number) $d000+(number) $21) - [17] *((const byte*) main::BGCOL#0) ← ++ *((const byte*) main::BGCOL#0) + [17] *((const byte*) main::BGCOL) ← ++ *((const byte*) main::BGCOL) to:main::@return main::@return: scope:[main] from main::@4 [18] return diff --git a/src/test/ref/ptr-complex.log b/src/test/ref/ptr-complex.log index b33eacbfb..e2565aff5 100644 --- a/src/test/ref/ptr-complex.log +++ b/src/test/ref/ptr-complex.log @@ -7,33 +7,33 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - (byte*~) main::$14 ← (byte*) main::screen#0 + (number) $28 + (byte*~) main::$14 ← (byte*) main::screen + (number) $28 (byte*~) main::$15 ← (byte*~) main::$14 + (byte) main::i#2 - *((byte*) main::screen#0 + (byte) main::i#2) ← *((byte*~) main::$15) + *((byte*) main::screen + (byte) main::i#2) ← *((byte*~) main::$15) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$16 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$16) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - (byte*~) main::$1 ← (byte*) main::screen#0 + (number) $51 + (byte*~) main::$1 ← (byte*) main::screen + (number) $51 (byte*) main::sc2#0 ← (byte*~) main::$1 - (byte*~) main::$2 ← (byte*) main::screen#0 + (number) $79 + (byte*~) main::$2 ← (byte*) main::screen + (number) $79 *((byte*) main::sc2#0) ← *((byte*~) main::$2) - (byte*~) main::$3 ← (byte*) main::screen#0 + (number) $52 - (byte*~) main::$4 ← (byte*) main::screen#0 + (number) $7a + (byte*~) main::$3 ← (byte*) main::screen + (number) $52 + (byte*~) main::$4 ← (byte*) main::screen + (number) $7a *((byte*~) main::$3) ← *((byte*~) main::$4) (byte) main::j#0 ← (byte) 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 (byte) main::j#2 ← phi( main::@2/(byte) main::j#0 main::@3/(byte) main::j#1 ) - (byte*~) main::$17 ← (byte*) main::screen#0 + (number) $a0 + (byte*~) main::$17 ← (byte*) main::screen + (number) $a0 (byte*~) main::$18 ← (byte*~) main::$17 + (byte) main::j#2 - (byte*~) main::$19 ← (byte*) main::screen#0 + (number) $c8 + (byte*~) main::$19 ← (byte*) main::screen + (number) $c8 (byte*~) main::$20 ← (byte*~) main::$19 + (byte) main::j#2 *((byte*~) main::$18) ← *((byte*~) main::$20) (byte) main::j#1 ← (byte) main::j#2 + rangenext(0,$a) @@ -45,8 +45,8 @@ main::@4: scope:[main] from main::@3 *((byte*~) main::$5) ← ++ *((byte*~) main::$5) (byte*~) main::$9 ← ((byte*)) (number) $d000+(number) $21 *((byte*~) main::$9) ← -- *((byte*~) main::$9) - (byte*) main::BGCOL#0 ← ((byte*)) (number) $d020 - *((byte*) main::BGCOL#0) ← ++ *((byte*) main::BGCOL#0) + (byte*) main::BGCOL ← ((byte*)) (number) $d020 + *((byte*) main::BGCOL) ← ++ *((byte*) main::BGCOL) to:main::@return main::@return: scope:[main] from main::@4 return @@ -84,7 +84,6 @@ SYMBOL TABLE SSA (label) main::@4 (label) main::@return (byte*) main::BGCOL -(byte*) main::BGCOL#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -96,20 +95,19 @@ SYMBOL TABLE SSA (byte*) main::sc2 (byte*) main::sc2#0 (byte*) main::screen -(byte*) main::screen#0 -Adding number conversion cast (unumber) $28 in (byte*~) main::$14 ← (byte*) main::screen#0 + (number) $28 -Adding number conversion cast (unumber) $51 in (byte*~) main::$1 ← (byte*) main::screen#0 + (number) $51 -Adding number conversion cast (unumber) $79 in (byte*~) main::$2 ← (byte*) main::screen#0 + (number) $79 -Adding number conversion cast (unumber) $52 in (byte*~) main::$3 ← (byte*) main::screen#0 + (number) $52 -Adding number conversion cast (unumber) $7a in (byte*~) main::$4 ← (byte*) main::screen#0 + (number) $7a -Adding number conversion cast (unumber) $a0 in (byte*~) main::$17 ← (byte*) main::screen#0 + (number) $a0 -Adding number conversion cast (unumber) $c8 in (byte*~) main::$19 ← (byte*) main::screen#0 + (number) $c8 +Adding number conversion cast (unumber) $28 in (byte*~) main::$14 ← (byte*) main::screen + (number) $28 +Adding number conversion cast (unumber) $51 in (byte*~) main::$1 ← (byte*) main::screen + (number) $51 +Adding number conversion cast (unumber) $79 in (byte*~) main::$2 ← (byte*) main::screen + (number) $79 +Adding number conversion cast (unumber) $52 in (byte*~) main::$3 ← (byte*) main::screen + (number) $52 +Adding number conversion cast (unumber) $7a in (byte*~) main::$4 ← (byte*) main::screen + (number) $7a +Adding number conversion cast (unumber) $a0 in (byte*~) main::$17 ← (byte*) main::screen + (number) $a0 +Adding number conversion cast (unumber) $c8 in (byte*~) main::$19 ← (byte*) main::screen + (number) $c8 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (byte*~) main::$5 ← (byte*)(number) $d020 Inlining cast (byte*~) main::$9 ← (byte*)(number) $d000+(number) $21 -Inlining cast (byte*) main::BGCOL#0 ← (byte*)(number) $d020 +Inlining cast (byte*) main::BGCOL ← (byte*)(number) $d020 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $28 @@ -137,30 +135,30 @@ Simple Condition (bool~) main::$21 [25] if((byte) main::j#1!=rangelast(0,$a)) go Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [28] (byte*~) main::$9 ← (byte*)(number) $d000+(number) $21 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::i#0 = 0 Constant (const byte) main::j#0 = 0 Constant (const byte*) main::$5 = (byte*) 53280 Constant (const byte*) main::$9 = (byte*)$d000+$21 -Constant (const byte*) main::BGCOL#0 = (byte*) 53280 +Constant (const byte*) main::BGCOL = (byte*) 53280 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [6] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [8] if(main::i#1!=rangelast(0,$a)) goto main::@1 to (number) $b Resolved ranged next value [23] main::j#1 ← ++ main::j#2 to ++ Resolved ranged comparison value [25] if(main::j#1!=rangelast(0,$a)) goto main::@3 to (number) $b -Converting *(pointer+n) to pointer[n] [5] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((byte*~) main::$15) -- *(main::$14 + main::i#2) -Converting *(pointer+n) to pointer[n] [12] *((byte*) main::sc2#0) ← *((byte*~) main::$2) -- *(main::screen#0 + $79) -Converting *(pointer+n) to pointer[n] [12] *((byte*) main::sc2#0) ← *((const byte*) main::screen#0 + (byte) $79) -- *(main::screen#0 + $51) -Converting *(pointer+n) to pointer[n] [15] *((byte*~) main::$3) ← *((byte*~) main::$4) -- *(main::screen#0 + $7a) -Converting *(pointer+n) to pointer[n] [15] *((byte*~) main::$3) ← *((const byte*) main::screen#0 + (byte) $7a) -- *(main::screen#0 + $52) +Converting *(pointer+n) to pointer[n] [5] *((const byte*) main::screen + (byte) main::i#2) ← *((byte*~) main::$15) -- *(main::$14 + main::i#2) +Converting *(pointer+n) to pointer[n] [12] *((byte*) main::sc2#0) ← *((byte*~) main::$2) -- *(main::screen + $79) +Converting *(pointer+n) to pointer[n] [12] *((byte*) main::sc2#0) ← *((const byte*) main::screen + (byte) $79) -- *(main::screen + $51) +Converting *(pointer+n) to pointer[n] [15] *((byte*~) main::$3) ← *((byte*~) main::$4) -- *(main::screen + $7a) +Converting *(pointer+n) to pointer[n] [15] *((byte*~) main::$3) ← *((const byte*) main::screen + (byte) $7a) -- *(main::screen + $52) Converting *(pointer+n) to pointer[n] [22] *((byte*~) main::$18) ← *((byte*~) main::$20) -- *(main::$19 + main::j#2) Converting *(pointer+n) to pointer[n] [22] *((byte*~) main::$18) ← *((byte*~) main::$19 + (byte) main::j#2) -- *(main::$17 + main::j#2) Successful SSA optimization Pass2InlineDerefIdx Eliminating unused variable (byte*~) main::$15 and assignment [2] (byte*~) main::$15 ← (byte*~) main::$14 + (byte) main::i#2 -Eliminating unused variable (byte*) main::sc2#0 and assignment [6] (byte*) main::sc2#0 ← (const byte*) main::screen#0 + (byte) $51 -Eliminating unused variable (byte*~) main::$2 and assignment [7] (byte*~) main::$2 ← (const byte*) main::screen#0 + (byte) $79 -Eliminating unused variable (byte*~) main::$3 and assignment [9] (byte*~) main::$3 ← (const byte*) main::screen#0 + (byte) $52 -Eliminating unused variable (byte*~) main::$4 and assignment [10] (byte*~) main::$4 ← (const byte*) main::screen#0 + (byte) $7a +Eliminating unused variable (byte*) main::sc2#0 and assignment [6] (byte*) main::sc2#0 ← (const byte*) main::screen + (byte) $51 +Eliminating unused variable (byte*~) main::$2 and assignment [7] (byte*~) main::$2 ← (const byte*) main::screen + (byte) $79 +Eliminating unused variable (byte*~) main::$3 and assignment [9] (byte*~) main::$3 ← (const byte*) main::screen + (byte) $52 +Eliminating unused variable (byte*~) main::$4 and assignment [10] (byte*~) main::$4 ← (const byte*) main::screen + (byte) $7a Eliminating unused variable (byte*~) main::$18 and assignment [14] (byte*~) main::$18 ← (byte*~) main::$17 + (byte) main::j#2 Eliminating unused variable (byte*~) main::$20 and assignment [16] (byte*~) main::$20 ← (byte*~) main::$19 + (byte) main::j#2 Successful SSA optimization PassNEliminateUnusedVars @@ -173,28 +171,28 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $b Finalized unsigned number type (byte) $b Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [1] (byte*~) main::$14 ← (const byte*) main::screen#0 + (byte) $28 -Constant right-side identified [8] (byte*~) main::$17 ← (const byte*) main::screen#0 + (byte) $a0 -Constant right-side identified [9] (byte*~) main::$19 ← (const byte*) main::screen#0 + (byte) $c8 +Constant right-side identified [1] (byte*~) main::$14 ← (const byte*) main::screen + (byte) $28 +Constant right-side identified [8] (byte*~) main::$17 ← (const byte*) main::screen + (byte) $a0 +Constant right-side identified [9] (byte*~) main::$19 ← (const byte*) main::screen + (byte) $c8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::$14 = main::screen#0+$28 -Constant (const byte*) main::$17 = main::screen#0+$a0 -Constant (const byte*) main::$19 = main::screen#0+$c8 +Constant (const byte*) main::$14 = main::screen+$28 +Constant (const byte*) main::$17 = main::screen+$a0 +Constant (const byte*) main::$19 = main::screen+$c8 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::j#0 -Constant inlined main::$17 = (const byte*) main::screen#0+(byte) $a0 -Constant inlined main::$19 = (const byte*) main::screen#0+(byte) $c8 +Constant inlined main::$17 = (const byte*) main::screen+(byte) $a0 +Constant inlined main::$19 = (const byte*) main::screen+(byte) $c8 Constant inlined main::$5 = (byte*) 53280 Constant inlined main::i#0 = (byte) 0 -Constant inlined main::$14 = (const byte*) main::screen#0+(byte) $28 +Constant inlined main::$14 = (const byte*) main::screen+(byte) $28 Constant inlined main::j#0 = (byte) 0 Constant inlined main::$9 = (byte*)(number) $d000+(number) $21 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::screen#0+$79) -Consolidated array index constant in *(main::screen#0+$51) -Consolidated array index constant in *(main::screen#0+$7a) -Consolidated array index constant in *(main::screen#0+$52) +Consolidated array index constant in *(main::screen+$79) +Consolidated array index constant in *(main::screen+$51) +Consolidated array index constant in *(main::screen+$7a) +Consolidated array index constant in *(main::screen+$52) Successful SSA optimization Pass2ConstantAdditionElimination Added new block during phi lifting main::@5(between main::@1 and main::@1) Added new block during phi lifting main::@6(between main::@3 and main::@3) @@ -235,24 +233,24 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) + [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 [8] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) - [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) + [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) + [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [11] (byte) main::j#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::j#1 ) - [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) + [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) [13] (byte) main::j#1 ← ++ (byte) main::j#2 [14] if((byte) main::j#1!=(byte) $b) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 [15] *((byte*) 53280) ← ++ *((byte*) 53280) [16] *((byte*)(number) $d000+(number) $21) ← -- *((byte*)(number) $d000+(number) $21) - [17] *((const byte*) main::BGCOL#0) ← ++ *((const byte*) main::BGCOL#0) + [17] *((const byte*) main::BGCOL) ← ++ *((const byte*) main::BGCOL) to:main::@return main::@return: scope:[main] from main::@4 [18] return @@ -261,7 +259,6 @@ main::@return: scope:[main] from main::@4 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::BGCOL (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 22.0 @@ -269,7 +266,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::j#1 16.5 (byte) main::j#2 22.0 (byte*) main::sc2 -(byte*) main::screen Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -326,7 +322,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda screen+$28,y sta screen,y @@ -339,10 +335,10 @@ main: { jmp b2 // main::@2 b2: - // [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 + // [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 lda screen+$79 sta screen+$51 - // [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 + // [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 // LValue pointer expression (constant - directly) lda screen+$7a sta screen+$52 @@ -359,7 +355,7 @@ main: { jmp b3 // main::@3 b3: - // [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z j lda screen+$c8,y sta screen+$a0,y @@ -376,7 +372,7 @@ main: { inc $d020 // [16] *((byte*)(number) $d000+(number) $21) ← -- *((byte*)(number) $d000+(number) $21) -- _deref_pbuc1=_dec__deref_pbuc1 dec $d000+$21 - // [17] *((const byte*) main::BGCOL#0) ← ++ *((const byte*) main::BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) main::BGCOL) ← ++ *((const byte*) main::BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL jmp breturn // main::@return @@ -387,16 +383,16 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (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 [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) [ main::j#2 ] ( main:2 [ main::j#2 ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) [ main::j#2 ] ( main:2 [ main::j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::j#2 main::j#1 ] -Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) [ main::j#2 ] ( main:2 [ main::j#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) [ main::j#2 ] ( main:2 [ main::j#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 , Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -449,7 +445,7 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda screen+$28,x sta screen,x // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -460,10 +456,10 @@ main: { jmp b2 // main::@2 b2: - // [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 + // [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 lda screen+$79 sta screen+$51 - // [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 + // [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 // LValue pointer expression (constant - directly) lda screen+$7a sta screen+$52 @@ -479,7 +475,7 @@ main: { jmp b3 // main::@3 b3: - // [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda screen+$c8,x sta screen+$a0,x // [13] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuxx=_inc_vbuxx @@ -494,7 +490,7 @@ main: { inc $d020 // [16] *((byte*)(number) $d000+(number) $21) ← -- *((byte*)(number) $d000+(number) $21) -- _deref_pbuc1=_dec__deref_pbuc1 dec $d000+$21 - // [17] *((const byte*) main::BGCOL#0) ← ++ *((const byte*) main::BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) main::BGCOL) ← ++ *((const byte*) main::BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL jmp breturn // main::@return @@ -548,8 +544,7 @@ FINAL SYMBOL TABLE (label) main::@3 (label) main::@4 (label) main::@return -(byte*) main::BGCOL -(const byte*) main::BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) main::BGCOL BGCOL = (byte*) 53280 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 @@ -557,8 +552,7 @@ FINAL SYMBOL TABLE (byte) main::j#1 reg byte x 16.5 (byte) main::j#2 reg byte x 22.0 (byte*) main::sc2 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::j#2 main::j#1 ] @@ -596,7 +590,7 @@ main: { // main::@1 b1: // screen[i] = *(screen+40+i) - // [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::screen + (byte) main::i#2) ← *((const byte*) main::screen+(byte) $28 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda screen+$28,x sta screen,x // for(byte i : 0..10) @@ -607,11 +601,11 @@ main: { bne b1 // main::@2 // *sc2 = *(screen+121) - // [9] *((const byte*) main::screen#0+(byte) $51) ← *((const byte*) main::screen#0+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 + // [9] *((const byte*) main::screen+(byte) $51) ← *((const byte*) main::screen+(byte) $79) -- _deref_pbuc1=_deref_pbuc2 lda screen+$79 sta screen+$51 // *(screen+82) = *(screen+122) - // [10] *((const byte*) main::screen#0+(byte) $52) ← *((const byte*) main::screen#0+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 + // [10] *((const byte*) main::screen+(byte) $52) ← *((const byte*) main::screen+(byte) $7a) -- _deref_pbuc1=_deref_pbuc2 // LValue pointer expression (constant - directly) lda screen+$7a sta screen+$52 @@ -624,7 +618,7 @@ main: { // main::@3 b3: // *(screen+160+j) = *(screen+200+j) - // [12] *((const byte*) main::screen#0+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen#0+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [12] *((const byte*) main::screen+(byte) $a0 + (byte) main::j#2) ← *((const byte*) main::screen+(byte) $c8 + (byte) main::j#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda screen+$c8,x sta screen+$a0,x // for(byte j : 0..10) @@ -641,7 +635,7 @@ main: { // [16] *((byte*)(number) $d000+(number) $21) ← -- *((byte*)(number) $d000+(number) $21) -- _deref_pbuc1=_dec__deref_pbuc1 dec $d000+$21 // ++*BGCOL; - // [17] *((const byte*) main::BGCOL#0) ← ++ *((const byte*) main::BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 + // [17] *((const byte*) main::BGCOL) ← ++ *((const byte*) main::BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL // main::@return // } diff --git a/src/test/ref/ptr-complex.sym b/src/test/ref/ptr-complex.sym index ebfdb2371..2b3e88bcf 100644 --- a/src/test/ref/ptr-complex.sym +++ b/src/test/ref/ptr-complex.sym @@ -7,8 +7,7 @@ (label) main::@3 (label) main::@4 (label) main::@return -(byte*) main::BGCOL -(const byte*) main::BGCOL#0 BGCOL = (byte*) 53280 +(const byte*) main::BGCOL BGCOL = (byte*) 53280 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 22.0 @@ -16,8 +15,7 @@ (byte) main::j#1 reg byte x 16.5 (byte) main::j#2 reg byte x 22.0 (byte*) main::sc2 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::j#2 main::j#1 ] diff --git a/src/test/ref/ptrtest.cfg b/src/test/ref/ptrtest.cfg index 0c5e9dfff..2dfd22482 100644 --- a/src/test/ref/ptrtest.cfg +++ b/src/test/ref/ptrtest.cfg @@ -42,7 +42,7 @@ lvaluevar::@return: scope:[lvaluevar] from lvaluevar::@1 [16] return to:@return lvaluevar::@2: scope:[lvaluevar] from lvaluevar::@1 - [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 + [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 to:lvaluevar::@1 @@ -58,7 +58,7 @@ rvaluevar::@1: scope:[rvaluevar] from rvaluevar rvaluevar::@2 [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2 to:rvaluevar::@3 rvaluevar::@3: scope:[rvaluevar] from rvaluevar::@1 - [23] *((const byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 + [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 to:rvaluevar::@return rvaluevar::@return: scope:[rvaluevar] from rvaluevar::@3 [24] return @@ -79,7 +79,7 @@ rvalue::@1: scope:[rvalue] from rvalue rvalue::@2 [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2 to:rvalue::@3 rvalue::@3: scope:[rvalue] from rvalue::@1 - [31] *((const byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 + [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 to:rvalue::@return rvalue::@return: scope:[rvalue] from rvalue::@3 [32] return diff --git a/src/test/ref/ptrtest.log b/src/test/ref/ptrtest.log index 2b32861ab..921b8cbd5 100644 --- a/src/test/ref/ptrtest.log +++ b/src/test/ref/ptrtest.log @@ -84,8 +84,8 @@ rvalue::@2: scope:[rvalue] from rvalue::@1 to:rvalue::@1 rvalue::@3: scope:[rvalue] from rvalue::@1 (byte) rvalue::b#3 ← phi( rvalue::@1/(byte) rvalue::b#4 ) - (byte*) rvalue::screen2#0 ← ((byte*)) (number) $400 - *((byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 + (byte*) rvalue::screen2 ← ((byte*)) (number) $400 + *((byte*) rvalue::screen2) ← (byte) rvalue::b#3 to:rvalue::@return rvalue::@return: scope:[rvalue] from rvalue::@3 return @@ -94,7 +94,7 @@ rvalue::@return: scope:[rvalue] from rvalue::@3 (void()) lvaluevar() lvaluevar: scope:[lvaluevar] from main::@3 (byte*) lvaluevar::screen#0 ← ((byte*)) (number) $400 - (byte) lvaluevar::b#0 ← (number) 4 + (byte) lvaluevar::b ← (number) 4 (byte) lvaluevar::i#0 ← (number) 2 to:lvaluevar::@1 lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2 @@ -106,7 +106,7 @@ lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2 lvaluevar::@2: scope:[lvaluevar] from lvaluevar::@1 (byte) lvaluevar::i#3 ← phi( lvaluevar::@1/(byte) lvaluevar::i#2 ) (byte*) lvaluevar::screen#2 ← phi( lvaluevar::@1/(byte*) lvaluevar::screen#3 ) - *((byte*) lvaluevar::screen#2) ← (byte) lvaluevar::b#0 + *((byte*) lvaluevar::screen#2) ← (byte) lvaluevar::b (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#3 to:lvaluevar::@1 @@ -136,8 +136,8 @@ rvaluevar::@2: scope:[rvaluevar] from rvaluevar::@1 to:rvaluevar::@1 rvaluevar::@3: scope:[rvaluevar] from rvaluevar::@1 (byte) rvaluevar::b#2 ← phi( rvaluevar::@1/(byte) rvaluevar::b#3 ) - (byte*) rvaluevar::screen2#0 ← ((byte*)) (number) $400 - *((byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 + (byte*) rvaluevar::screen2 ← ((byte*)) (number) $400 + *((byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 to:rvaluevar::@return rvaluevar::@return: scope:[rvaluevar] from rvaluevar::@3 return @@ -171,7 +171,6 @@ SYMBOL TABLE SSA (label) lvaluevar::@2 (label) lvaluevar::@return (byte) lvaluevar::b -(byte) lvaluevar::b#0 (byte) lvaluevar::i (byte) lvaluevar::i#0 (byte) lvaluevar::i#1 @@ -207,7 +206,6 @@ SYMBOL TABLE SSA (byte) rvalue::i#2 (byte) rvalue::i#3 (byte*) rvalue::screen2 -(byte*) rvalue::screen2#0 (void()) rvaluevar() (bool~) rvaluevar::$0 (label) rvaluevar::@1 @@ -230,7 +228,6 @@ SYMBOL TABLE SSA (byte*) rvaluevar::screen#2 (byte*) rvaluevar::screen#3 (byte*) rvaluevar::screen2 -(byte*) rvaluevar::screen2#0 Adding number conversion cast (unumber) 1 in *((byte[$400]) lvalue::SCREEN) ← (number) 1 Adding number conversion cast (unumber) 2 in *((byte[$400]) lvalue::SCREEN + (number) 1) ← (number) 2 @@ -241,7 +238,7 @@ Adding number conversion cast (unumber) 3 in *((byte[$400]) lvalue::SCREEN + (by Adding number conversion cast (unumber) 1 in (byte) rvalue::b#1 ← *((byte[$400]) rvalue::SCREEN + (number) 1) Adding number conversion cast (unumber) 2 in (byte) rvalue::i#0 ← (number) 2 Adding number conversion cast (unumber) $a in (bool~) rvalue::$0 ← (byte) rvalue::i#2 < (number) $a -Adding number conversion cast (unumber) 4 in (byte) lvaluevar::b#0 ← (number) 4 +Adding number conversion cast (unumber) 4 in (byte) lvaluevar::b ← (number) 4 Adding number conversion cast (unumber) 2 in (byte) lvaluevar::i#0 ← (number) 2 Adding number conversion cast (unumber) $a in (bool~) lvaluevar::$0 ← (byte) lvaluevar::i#2 < (number) $a Adding number conversion cast (unumber) 2 in (byte) rvaluevar::i#0 ← (number) 2 @@ -254,13 +251,13 @@ Inlining cast (byte) lvalue::i#0 ← (unumber)(number) 2 Inlining cast *((byte[$400]) lvalue::SCREEN + (byte) lvalue::i#3) ← (unumber)(number) 3 Inlining cast (byte[$400]) rvalue::SCREEN ← (byte[$400])(number) $400 Inlining cast (byte) rvalue::i#0 ← (unumber)(number) 2 -Inlining cast (byte*) rvalue::screen2#0 ← (byte*)(number) $400 +Inlining cast (byte*) rvalue::screen2 ← (byte*)(number) $400 Inlining cast (byte*) lvaluevar::screen#0 ← (byte*)(number) $400 -Inlining cast (byte) lvaluevar::b#0 ← (unumber)(number) 4 +Inlining cast (byte) lvaluevar::b ← (unumber)(number) 4 Inlining cast (byte) lvaluevar::i#0 ← (unumber)(number) 2 Inlining cast (byte*) rvaluevar::screen#0 ← (byte*)(number) $400 Inlining cast (byte) rvaluevar::i#0 ← (unumber)(number) 2 -Inlining cast (byte*) rvaluevar::screen2#0 ← (byte*)(number) $400 +Inlining cast (byte*) rvaluevar::screen2 ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -316,14 +313,14 @@ Constant (const byte[$400]) lvalue::SCREEN = (byte*) 1024 Constant (const byte) lvalue::i#0 = 2 Constant (const byte[$400]) rvalue::SCREEN = (byte*) 1024 Constant (const byte) rvalue::i#0 = 2 -Constant (const byte*) rvalue::screen2#0 = (byte*) 1024 +Constant (const byte*) rvalue::screen2 = (byte*) 1024 Constant (const byte*) lvaluevar::screen#0 = (byte*) 1024 -Constant (const byte) lvaluevar::b#0 = 4 +Constant (const byte) lvaluevar::b = 4 Constant (const byte) lvaluevar::i#0 = 2 Constant (const byte*) rvaluevar::screen#0 = (byte*) 1024 Constant (const byte) rvaluevar::b#0 = 0 Constant (const byte) rvaluevar::i#0 = 2 -Constant (const byte*) rvaluevar::screen2#0 = (byte*) 1024 +Constant (const byte*) rvaluevar::screen2 = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Eliminating unused variable (byte) rvalue::b#0 and assignment [12] (byte) rvalue::b#0 ← *((const byte[$400]) rvalue::SCREEN) Successful SSA optimization PassNEliminateUnusedVars @@ -429,7 +426,7 @@ lvaluevar::@return: scope:[lvaluevar] from lvaluevar::@1 [16] return to:@return lvaluevar::@2: scope:[lvaluevar] from lvaluevar::@1 - [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 + [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 to:lvaluevar::@1 @@ -445,7 +442,7 @@ rvaluevar::@1: scope:[rvaluevar] from rvaluevar rvaluevar::@2 [22] if((byte) rvaluevar::i#2<(byte) $a) goto rvaluevar::@2 to:rvaluevar::@3 rvaluevar::@3: scope:[rvaluevar] from rvaluevar::@1 - [23] *((const byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 + [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 to:rvaluevar::@return rvaluevar::@return: scope:[rvaluevar] from rvaluevar::@3 [24] return @@ -466,7 +463,7 @@ rvalue::@1: scope:[rvalue] from rvalue rvalue::@2 [30] if((byte) rvalue::i#2<(byte) $a) goto rvalue::@2 to:rvalue::@3 rvalue::@3: scope:[rvalue] from rvalue::@1 - [31] *((const byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 + [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 to:rvalue::@return rvalue::@return: scope:[rvalue] from rvalue::@3 [32] return @@ -500,7 +497,6 @@ VARIABLE REGISTER WEIGHTS (byte) lvalue::i#1 22.0 (byte) lvalue::i#2 14.666666666666666 (void()) lvaluevar() -(byte) lvaluevar::b (byte) lvaluevar::i (byte) lvaluevar::i#1 22.0 (byte) lvaluevar::i#2 8.25 @@ -516,7 +512,6 @@ VARIABLE REGISTER WEIGHTS (byte) rvalue::i (byte) rvalue::i#1 22.0 (byte) rvalue::i#2 14.666666666666666 -(byte*) rvalue::screen2 (void()) rvaluevar() (byte) rvaluevar::b (byte) rvaluevar::b#1 7.333333333333333 @@ -527,7 +522,6 @@ VARIABLE REGISTER WEIGHTS (byte*) rvaluevar::screen (byte*) rvaluevar::screen#1 11.0 (byte*) rvaluevar::screen#2 11.0 -(byte*) rvaluevar::screen2 Initial phi equivalence classes [ lvaluevar::i#2 lvaluevar::i#1 ] @@ -646,7 +640,7 @@ lvaluevar: { rts // lvaluevar::@2 b2: - // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 -- _deref_pbuz1=vbuc1 + // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 lda #b ldy #0 sta (screen),y @@ -692,7 +686,7 @@ rvaluevar: { jmp b3 // rvaluevar::@3 b3: - // [23] *((const byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuz1 + // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuz1 lda.z b sta screen2 jmp breturn @@ -747,7 +741,7 @@ rvalue: { jmp b3 // rvalue::@3 b3: - // [31] *((const byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuz1 + // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuz1 lda.z b sta screen2 jmp breturn @@ -815,7 +809,7 @@ lvalue: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y +Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] Statement [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ) always clobbers reg byte a reg byte y @@ -825,7 +819,7 @@ Statement [35] *((const byte[$400]) lvalue::SCREEN) ← (byte) 1 [ ] ( main:2::l Statement [36] *((const byte[$400]) lvalue::SCREEN+(byte) 1) ← (byte) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a Statement [40] *((const byte[$400]) lvalue::SCREEN + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ lvalue::i#2 lvalue::i#1 ] -Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y +Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y Statement [25] (byte) rvaluevar::b#1 ← *((byte*) rvaluevar::screen#2) [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 rvaluevar::b#1 ] ) always clobbers reg byte a reg byte y Statement [35] *((const byte[$400]) lvalue::SCREEN) ← (byte) 1 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a Statement [36] *((const byte[$400]) lvalue::SCREEN+(byte) 1) ← (byte) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a @@ -942,7 +936,7 @@ lvaluevar: { rts // lvaluevar::@2 b2: - // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 -- _deref_pbuz1=vbuc1 + // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 lda #b ldy #0 sta (screen),y @@ -983,7 +977,7 @@ rvaluevar: { jmp b3 // rvaluevar::@3 b3: - // [23] *((const byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy + // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy sty screen2 jmp breturn // rvaluevar::@return @@ -1032,7 +1026,7 @@ rvalue: { jmp b3 // rvalue::@3 b3: - // [31] *((const byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa + // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa sta screen2 jmp breturn // rvalue::@return @@ -1163,8 +1157,7 @@ FINAL SYMBOL TABLE (label) lvaluevar::@1 (label) lvaluevar::@2 (label) lvaluevar::@return -(byte) lvaluevar::b -(const byte) lvaluevar::b#0 b = (byte) 4 +(const byte) lvaluevar::b b = (byte) 4 (byte) lvaluevar::i (byte) lvaluevar::i#1 reg byte x 22.0 (byte) lvaluevar::i#2 reg byte x 8.25 @@ -1189,8 +1182,7 @@ FINAL SYMBOL TABLE (byte) rvalue::i (byte) rvalue::i#1 reg byte x 22.0 (byte) rvalue::i#2 reg byte x 14.666666666666666 -(byte*) rvalue::screen2 -(const byte*) rvalue::screen2#0 screen2 = (byte*) 1024 +(const byte*) rvalue::screen2 screen2 = (byte*) 1024 (void()) rvaluevar() (label) rvaluevar::@1 (label) rvaluevar::@2 @@ -1205,8 +1197,7 @@ FINAL SYMBOL TABLE (byte*) rvaluevar::screen (byte*) rvaluevar::screen#1 screen zp ZP_WORD:2 11.0 (byte*) rvaluevar::screen#2 screen zp ZP_WORD:2 11.0 -(byte*) rvaluevar::screen2 -(const byte*) rvaluevar::screen2#0 screen2 = (byte*) 1024 +(const byte*) rvaluevar::screen2 screen2 = (byte*) 1024 reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] @@ -1287,7 +1278,7 @@ lvaluevar: { // lvaluevar::@2 b2: // *screen = b - // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 -- _deref_pbuz1=vbuc1 + // [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b -- _deref_pbuz1=vbuc1 lda #b ldy #0 sta (screen),y @@ -1327,7 +1318,7 @@ rvaluevar: { bcc b2 // rvaluevar::@3 // *screen2 = b - // [23] *((const byte*) rvaluevar::screen2#0) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy + // [23] *((const byte*) rvaluevar::screen2) ← (byte) rvaluevar::b#2 -- _deref_pbuc1=vbuyy sty screen2 // rvaluevar::@return // } @@ -1376,7 +1367,7 @@ rvalue: { bcc b2 // rvalue::@3 // *screen2 = b - // [31] *((const byte*) rvalue::screen2#0) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa + // [31] *((const byte*) rvalue::screen2) ← (byte) rvalue::b#3 -- _deref_pbuc1=vbuaa sta screen2 // rvalue::@return // } diff --git a/src/test/ref/ptrtest.sym b/src/test/ref/ptrtest.sym index 4c37727cd..efb96335a 100644 --- a/src/test/ref/ptrtest.sym +++ b/src/test/ref/ptrtest.sym @@ -13,8 +13,7 @@ (label) lvaluevar::@1 (label) lvaluevar::@2 (label) lvaluevar::@return -(byte) lvaluevar::b -(const byte) lvaluevar::b#0 b = (byte) 4 +(const byte) lvaluevar::b b = (byte) 4 (byte) lvaluevar::i (byte) lvaluevar::i#1 reg byte x 22.0 (byte) lvaluevar::i#2 reg byte x 8.25 @@ -39,8 +38,7 @@ (byte) rvalue::i (byte) rvalue::i#1 reg byte x 22.0 (byte) rvalue::i#2 reg byte x 14.666666666666666 -(byte*) rvalue::screen2 -(const byte*) rvalue::screen2#0 screen2 = (byte*) 1024 +(const byte*) rvalue::screen2 screen2 = (byte*) 1024 (void()) rvaluevar() (label) rvaluevar::@1 (label) rvaluevar::@2 @@ -55,8 +53,7 @@ (byte*) rvaluevar::screen (byte*) rvaluevar::screen#1 screen zp ZP_WORD:2 11.0 (byte*) rvaluevar::screen#2 screen zp ZP_WORD:2 11.0 -(byte*) rvaluevar::screen2 -(const byte*) rvaluevar::screen2#0 screen2 = (byte*) 1024 +(const byte*) rvaluevar::screen2 screen2 = (byte*) 1024 reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] diff --git a/src/test/ref/roll-variable.cfg b/src/test/ref/roll-variable.cfg index a16a8deef..5db2b1db7 100644 --- a/src/test/ref/roll-variable.cfg +++ b/src/test/ref/roll-variable.cfg @@ -15,7 +15,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 ) [6] (byte~) main::$0 ← (byte) $55 << (byte) main::b#2 - [7] *((const byte*) main::screen#0 + (byte) main::b#2) ← (byte~) main::$0 + [7] *((const byte*) main::screen + (byte) main::b#2) ← (byte~) main::$0 [8] (byte) main::b#1 ← ++ (byte) main::b#2 [9] if((byte) main::b#1!=(byte) 8) goto main::@1 to:main::@return diff --git a/src/test/ref/roll-variable.log b/src/test/ref/roll-variable.log index e413d34bd..b5308c1e4 100644 --- a/src/test/ref/roll-variable.log +++ b/src/test/ref/roll-variable.log @@ -7,13 +7,13 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (byte) main::b#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) (number~) main::$0 ← (number) $55 << (byte) main::b#2 - *((byte*) main::screen#0 + (byte) main::b#2) ← (number~) main::$0 + *((byte*) main::screen + (byte) main::b#2) ← (number~) main::$0 (byte) main::b#1 ← (byte) main::b#2 + rangenext(0,7) (bool~) main::$1 ← (byte) main::b#1 != rangelast(0,7) if((bool~) main::$1) goto main::@1 @@ -43,12 +43,11 @@ SYMBOL TABLE SSA (byte) main::b#1 (byte) main::b#2 (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) $55 in (number~) main::$0 ← (number) $55 << (byte) main::b#2 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) $55 << (byte) main::b#2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast $55 @@ -58,7 +57,7 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to byte in (unumber~) main::$0 ← (byte) $55 << (byte) main::b#2 Simple Condition (bool~) main::$1 [7] if((byte) main::b#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const byte) main::b#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::b#1 ← ++ main::b#2 to ++ @@ -109,7 +108,7 @@ main: scope:[main] from @1 main::@1: scope:[main] from main main::@1 [5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 ) [6] (byte~) main::$0 ← (byte) $55 << (byte) main::b#2 - [7] *((const byte*) main::screen#0 + (byte) main::b#2) ← (byte~) main::$0 + [7] *((const byte*) main::screen + (byte) main::b#2) ← (byte~) main::$0 [8] (byte) main::b#1 ← ++ (byte) main::b#2 [9] if((byte) main::b#1!=(byte) 8) goto main::@1 to:main::@return @@ -124,7 +123,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::b (byte) main::b#1 16.5 (byte) main::b#2 14.666666666666666 -(byte*) main::screen Initial phi equivalence classes [ main::b#2 main::b#1 ] @@ -188,7 +186,7 @@ main: { bne !- !e: sta.z _0 - // [7] *((const byte*) main::screen#0 + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [7] *((const byte*) main::screen + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _0 ldy.z b sta screen,y @@ -272,7 +270,7 @@ main: { dey bne !- !e: - // [7] *((const byte*) main::screen#0 + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuaa + // [7] *((const byte*) main::screen + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z b sta screen,y // [8] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1 @@ -325,8 +323,7 @@ FINAL SYMBOL TABLE (byte) main::b (byte) main::b#1 b zp ZP_BYTE:2 16.5 (byte) main::b#2 b zp ZP_BYTE:2 14.666666666666666 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 zp ZP_BYTE:2 [ main::b#2 main::b#1 ] reg byte a [ main::$0 ] @@ -373,7 +370,7 @@ main: { bne !- !e: // screen[b] = $55 << b - // [7] *((const byte*) main::screen#0 + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuaa + // [7] *((const byte*) main::screen + (byte) main::b#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z b sta screen,y // for( byte b: 0..7) diff --git a/src/test/ref/roll-variable.sym b/src/test/ref/roll-variable.sym index 16a90700a..3f470fb73 100644 --- a/src/test/ref/roll-variable.sym +++ b/src/test/ref/roll-variable.sym @@ -8,8 +8,7 @@ (byte) main::b (byte) main::b#1 b zp ZP_BYTE:2 16.5 (byte) main::b#2 b zp ZP_BYTE:2 14.666666666666666 -(byte*) main::screen -(const byte*) main::screen#0 screen = (byte*) 1024 +(const byte*) main::screen screen = (byte*) 1024 zp ZP_BYTE:2 [ main::b#2 main::b#1 ] reg byte a [ main::$0 ] diff --git a/src/test/ref/runtime-unused-procedure.cfg b/src/test/ref/runtime-unused-procedure.cfg index efe2c52e0..708c71c6c 100644 --- a/src/test/ref/runtime-unused-procedure.cfg +++ b/src/test/ref/runtime-unused-procedure.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) screen#0) ← (byte) 'a' + [4] *((const byte*) screen) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main [5] return diff --git a/src/test/ref/runtime-unused-procedure.log b/src/test/ref/runtime-unused-procedure.log index 17fa9d433..ca1f8deb9 100644 --- a/src/test/ref/runtime-unused-procedure.log +++ b/src/test/ref/runtime-unused-procedure.log @@ -6,14 +6,14 @@ Culled Empty Block (label) proc::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) call#0 ← (number) 0 - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte) call ← (number) 0 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() main: scope:[main] from @2 - *((byte*) screen#0 + (number) 0) ← (byte) 'a' - (bool~) main::$0 ← (byte) call#0 != (number) 0 + *((byte*) screen + (number) 0) ← (byte) 'a' + (bool~) main::$0 ← (byte) call != (number) 0 (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@return to:main::@2 @@ -28,13 +28,13 @@ main::@return: scope:[main] from main main::@3 (void()) proc() proc: scope:[proc] from main::@2 - *((byte*) screen#0 + (number) 1) ← (byte) 'a' - (bool~) proc::$0 ← *((byte*) screen#0 + (number) 1) != (number) 0 + *((byte*) screen + (number) 1) ← (byte) 'a' + (bool~) proc::$0 ← *((byte*) screen + (number) 1) != (number) 0 (bool~) proc::$1 ← ! (bool~) proc::$0 if((bool~) proc::$1) goto proc::@return to:proc::@2 proc::@2: scope:[proc] from proc - *((byte*) screen#0 + (number) 2) ← (byte) 'a' + *((byte*) screen + (number) 2) ← (byte) 'a' to:proc::@return proc::@return: scope:[proc] from proc proc::@2 return @@ -52,7 +52,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte) call -(byte) call#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -65,18 +64,17 @@ SYMBOL TABLE SSA (label) proc::@2 (label) proc::@return (byte*) screen -(byte*) screen#0 -Adding number conversion cast (unumber) 0 in (byte) call#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in *((byte*) screen#0 + (number) 0) ← (byte) 'a' -Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← (byte) call#0 != (number) 0 -Adding number conversion cast (unumber) 1 in *((byte*) screen#0 + (number) 1) ← (byte) 'a' -Adding number conversion cast (unumber) 0 in (bool~) proc::$0 ← *((byte*) screen#0 + (number) 1) != (number) 0 -Adding number conversion cast (unumber) 1 in (bool~) proc::$0 ← *((byte*) screen#0 + (number) 1) != (unumber)(number) 0 -Adding number conversion cast (unumber) 2 in *((byte*) screen#0 + (number) 2) ← (byte) 'a' +Adding number conversion cast (unumber) 0 in (byte) call ← (number) 0 +Adding number conversion cast (unumber) 0 in *((byte*) screen + (number) 0) ← (byte) 'a' +Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← (byte) call != (number) 0 +Adding number conversion cast (unumber) 1 in *((byte*) screen + (number) 1) ← (byte) 'a' +Adding number conversion cast (unumber) 0 in (bool~) proc::$0 ← *((byte*) screen + (number) 1) != (number) 0 +Adding number conversion cast (unumber) 1 in (bool~) proc::$0 ← *((byte*) screen + (number) 1) != (unumber)(number) 0 +Adding number conversion cast (unumber) 2 in *((byte*) screen + (number) 2) ← (byte) 'a' Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) call#0 ← (unumber)(number) 0 -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte) call ← (unumber)(number) 0 +Inlining cast (byte*) screen ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant pointer cast (byte*) 1024 @@ -95,20 +93,20 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inversing boolean not [4] (bool~) main::$1 ← (byte) call#0 == (byte) 0 from [3] (bool~) main::$0 ← (byte) call#0 != (byte) 0 -Inversing boolean not [10] (bool~) proc::$1 ← *((byte*) screen#0 + (byte) 1) == (byte) 0 from [9] (bool~) proc::$0 ← *((byte*) screen#0 + (byte) 1) != (byte) 0 +Inversing boolean not [4] (bool~) main::$1 ← (byte) call == (byte) 0 from [3] (bool~) main::$0 ← (byte) call != (byte) 0 +Inversing boolean not [10] (bool~) proc::$1 ← *((byte*) screen + (byte) 1) == (byte) 0 from [9] (bool~) proc::$0 ← *((byte*) screen + (byte) 1) != (byte) 0 Successful SSA optimization Pass2UnaryNotSimplification -Simple Condition (bool~) main::$1 [5] if((byte) call#0==(byte) 0) goto main::@return -Simple Condition (bool~) proc::$1 [11] if(*((byte*) screen#0 + (byte) 1)==(byte) 0) goto proc::@return +Simple Condition (bool~) main::$1 [5] if((byte) call==(byte) 0) goto main::@return +Simple Condition (bool~) proc::$1 [11] if(*((byte*) screen + (byte) 1)==(byte) 0) goto proc::@return Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) call#0 = 0 -Constant (const byte*) screen#0 = (byte*) 1024 +Constant (const byte) call = 0 +Constant (const byte*) screen = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [5] if((const byte) call#0==(byte) 0) goto main::@return +if() condition always true - replacing block destination [5] if((const byte) call==(byte) 0) goto main::@return Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero screen#0 in [2] *((const byte*) screen#0 + (byte) 0) ← (byte) 'a' +Simplifying expression containing zero screen in [2] *((const byte*) screen + (byte) 0) ← (byte) 'a' Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused constant (const byte) call#0 +Eliminating unused constant (const byte) call Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@2 Removing unused block main::@3 @@ -145,7 +143,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) screen#0) ← (byte) 'a' + [4] *((const byte*) screen) ← (byte) 'a' to:main::@return main::@return: scope:[main] from main [5] return @@ -153,9 +151,7 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte) call (void()) main() -(byte*) screen Initial phi equivalence classes Complete equivalence classes @@ -186,7 +182,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen jmp breturn @@ -198,7 +194,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) screen) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -232,7 +228,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen jmp breturn @@ -265,11 +261,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte) call (void()) main() (label) main::@return -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 @@ -293,7 +287,7 @@ Score: 12 // main main: { // screen[0] = 'a' - // [4] *((const byte*) screen#0) ← (byte) 'a' -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) screen) ← (byte) 'a' -- _deref_pbuc1=vbuc2 lda #'a' sta screen // main::@return diff --git a/src/test/ref/runtime-unused-procedure.sym b/src/test/ref/runtime-unused-procedure.sym index 48a0c0e43..dbe9e219c 100644 --- a/src/test/ref/runtime-unused-procedure.sym +++ b/src/test/ref/runtime-unused-procedure.sym @@ -1,9 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte) call (void()) main() (label) main::@return -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 diff --git a/src/test/ref/screen-center-angle.cfg b/src/test/ref/screen-center-angle.cfg index db270bcfc..6044e55a8 100644 --- a/src/test/ref/screen-center-angle.cfg +++ b/src/test/ref/screen-center-angle.cfg @@ -60,7 +60,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN#0 print_dword_at::@1/(const byte*) main::BASE_SCREEN#0+(byte) 4 ) + [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN print_dword_at::@1/(const byte*) main::BASE_SCREEN+(byte) 4 ) [26] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 diff --git a/src/test/ref/screen-center-angle.log b/src/test/ref/screen-center-angle.log index 7445a501c..c9cc0edf4 100644 --- a/src/test/ref/screen-center-angle.log +++ b/src/test/ref/screen-center-angle.log @@ -556,15 +556,15 @@ main::@6: scope:[main] from main::@5 (dword~) main::$4 ← (dword) clock::return#4 (dword~) main::$5 ← (dword~) main::$4 - (dword) CLOCKS_PER_INIT (dword) main::cyclecount#0 ← (dword~) main::$5 - (byte*) main::BASE_SCREEN#0 ← ((byte*)) (number) $400 - (byte*) main::BASE_CHARSET#0 ← ((byte*)) (number) $1000 + (byte*) main::BASE_SCREEN ← ((byte*)) (number) $400 + (byte*) main::BASE_CHARSET ← ((byte*)) (number) $1000 (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0 - (byte*) print_dword_at::at#0 ← (byte*) main::BASE_SCREEN#0 + (byte*) print_dword_at::at#0 ← (byte*) main::BASE_SCREEN call print_dword_at to:main::@7 main::@7: scope:[main] from main::@6 - (byte*) main::toD0182_screen#0 ← (byte*) main::BASE_SCREEN#0 - (byte*) main::toD0182_gfx#0 ← (byte*) main::BASE_CHARSET#0 + (byte*) main::toD0182_screen#0 ← (byte*) main::BASE_SCREEN + (byte*) main::toD0182_gfx#0 ← (byte*) main::BASE_CHARSET to:main::toD0182 main::toD0182: scope:[main] from main::@7 (byte*) main::toD0182_gfx#1 ← phi( main::@7/(byte*) main::toD0182_gfx#0 ) @@ -1068,9 +1068,7 @@ SYMBOL TABLE SSA (label) main::@7 (label) main::@return (byte*) main::BASE_CHARSET -(byte*) main::BASE_CHARSET#0 (byte*) main::BASE_SCREEN -(byte*) main::BASE_SCREEN#0 (dword) main::cyclecount (dword) main::cyclecount#0 (label) main::toD0181 @@ -1289,8 +1287,8 @@ Inlining cast (byte*) CHARSET ← (byte*)(number) $2000 Inlining cast (byte*) SCREEN ← (byte*)(number) $2800 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 -Inlining cast (byte*) main::BASE_SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) main::BASE_CHARSET#0 ← (byte*)(number) $1000 +Inlining cast (byte*) main::BASE_SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) main::BASE_CHARSET ← (byte*)(number) $1000 Inlining cast (word~) main::toD0182_$0 ← (word)(byte*) main::toD0182_screen#1 Inlining cast (word~) main::toD0182_$4 ← (word)(byte*) main::toD0182_gfx#1 Inlining cast (byte) init_angle_screen::x#0 ← (unumber)(number) 0 @@ -1599,8 +1597,8 @@ Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 Alias (dword) clock::return#2 = (dword) clock::return#4 Alias (dword) main::cyclecount#0 = (dword~) main::$5 -Alias (byte*) main::BASE_SCREEN#0 = (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1 -Alias (byte*) main::BASE_CHARSET#0 = (byte*) main::toD0182_gfx#0 (byte*) main::toD0182_gfx#1 +Alias (byte*) main::BASE_SCREEN = (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1 +Alias (byte*) main::BASE_CHARSET = (byte*) main::toD0182_gfx#0 (byte*) main::toD0182_gfx#1 Alias (byte) main::toD0182_return#0 = (byte~) main::toD0182_$8 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$7 Alias (byte*) init_angle_screen::screen_topline#0 = (byte*~) init_angle_screen::$0 Alias (byte*) init_angle_screen::screen_bottomline#0 = (byte*~) init_angle_screen::$1 @@ -1702,8 +1700,8 @@ Constant (const dword) CLOCKS_PER_INIT = $12 Constant (const byte[]) print_hextab = $1 Constant (const byte*) CHARSET = (byte*) 8192 Constant (const byte*) SCREEN = (byte*) 10240 -Constant (const byte*) main::BASE_SCREEN#0 = (byte*) 1024 -Constant (const byte*) main::BASE_CHARSET#0 = (byte*) 4096 +Constant (const byte*) main::BASE_SCREEN = (byte*) 1024 +Constant (const byte*) main::BASE_CHARSET = (byte*) 4096 Constant (const byte) init_angle_screen::y#0 = 0 Constant (const byte) init_angle_screen::x#0 = 0 Constant (const byte) init_angle_screen::xb#0 = $27 @@ -1714,14 +1712,14 @@ Constant (const byte*) init_font_hex::charset#1 = CHARSET Constant (const byte*) main::toD0181_screen#0 = SCREEN Constant (const byte*) main::toD0181_gfx#0 = CHARSET Constant (const byte*) init_angle_screen::screen#0 = SCREEN -Constant (const byte*) print_dword_at::at#0 = main::BASE_SCREEN#0 +Constant (const byte*) print_dword_at::at#0 = main::BASE_SCREEN Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_word_at::at#0 = print_dword_at::at#0 Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [196] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [200] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (word)main::BASE_SCREEN#0 in [228] (word~) main::toD0182_$0 ← (word)(const byte*) main::BASE_SCREEN#0 -Constant value identified (word)main::BASE_CHARSET#0 in [232] (word~) main::toD0182_$4 ← (word)(const byte*) main::BASE_CHARSET#0 +Constant value identified (word)main::BASE_SCREEN in [228] (word~) main::toD0182_$0 ← (word)(const byte*) main::BASE_SCREEN +Constant value identified (word)main::BASE_CHARSET in [232] (word~) main::toD0182_$4 ← (word)(const byte*) main::BASE_CHARSET Successful SSA optimization Pass2ConstantValues Resolved ranged next value [26] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++ Resolved ranged comparison value [28] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5 @@ -1780,8 +1778,8 @@ Constant (const byte) clock_start::$6 = CIA_TIMER_CONTROL_START Constant (const byte*) print_word_at::at#1 = print_dword_at::at#0+4 Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 -Constant (const word) main::toD0182_$0 = (word)main::BASE_SCREEN#0 -Constant (const word) main::toD0182_$4 = (word)main::BASE_CHARSET#0 +Constant (const word) main::toD0182_$0 = (word)main::BASE_SCREEN +Constant (const word) main::toD0182_$4 = (word)main::BASE_CHARSET Constant (const byte*) init_angle_screen::screen_topline#0 = init_angle_screen::screen#0+(word)$28*$c Constant (const byte*) init_angle_screen::screen_bottomline#0 = init_angle_screen::screen#0+(word)$28*$c Successful SSA optimization Pass2ConstantIdentification @@ -1865,24 +1863,24 @@ Inlining constant with var siblings (const byte*) init_angle_screen::screen_bott Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET Constant inlined init_font_hex::proto_hi#0 = (const byte[]) FONT_HEX_PROTO -Constant inlined main::toD0182_$4 = (word)(const byte*) main::BASE_CHARSET#0 +Constant inlined main::toD0182_$4 = (word)(const byte*) main::BASE_CHARSET Constant inlined init_angle_screen::y#0 = (byte) 0 -Constant inlined main::toD0182_$5 = >(word)(const byte*) main::BASE_CHARSET#0 +Constant inlined main::toD0182_$5 = >(word)(const byte*) main::BASE_CHARSET Constant inlined init_angle_screen::x#0 = (byte) 0 -Constant inlined main::toD0182_$6 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4 -Constant inlined main::toD0182_$7 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +Constant inlined main::toD0182_$6 = >(word)(const byte*) main::BASE_CHARSET/(byte) 4 +Constant inlined main::toD0182_$7 = >(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f Constant inlined clock_start::$5 = (const byte) CIA_TIMER_CONTROL_START|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -Constant inlined main::toD0182_$0 = (word)(const byte*) main::BASE_SCREEN#0 +Constant inlined main::toD0182_$0 = (word)(const byte*) main::BASE_SCREEN Constant inlined atan2_16::angle#0 = (byte) 0 Constant inlined clock_start::$6 = (const byte) CIA_TIMER_CONTROL_START Constant inlined $1 = (const byte[]) print_hextab -Constant inlined main::toD0182_$1 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff +Constant inlined main::toD0182_$1 = (word)(const byte*) main::BASE_SCREEN&(word) $3fff Constant inlined init_angle_screen::screen_bottomline#0 = (const byte*) SCREEN+(word)(number) $28*(number) $c Constant inlined clock_start::$3 = (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -Constant inlined main::toD0182_$2 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0182_$3 = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$2 = (word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$3 = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4 Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET -Constant inlined print_dword_at::at#0 = (const byte*) main::BASE_SCREEN#0 +Constant inlined print_dword_at::at#0 = (const byte*) main::BASE_SCREEN Constant inlined init_angle_screen::screen#0 = (const byte*) SCREEN Constant inlined init_font_hex::c1#0 = (byte) 0 Constant inlined atan2_16::$16 = (const byte) CORDIC_ITERATIONS_16-(byte) 1 @@ -1903,8 +1901,8 @@ Constant inlined init_angle_screen::screen_topline#0 = (const byte*) SCREEN+(wor Constant inlined init_font_hex::idx#0 = (byte) 0 Constant inlined init_font_hex::proto_lo#0 = (const byte[]) FONT_HEX_PROTO Constant inlined init_font_hex::c#0 = (byte) 0 -Constant inlined print_word_at::at#1 = (const byte*) main::BASE_SCREEN#0+(byte) 4 -Constant inlined print_word_at::at#0 = (const byte*) main::BASE_SCREEN#0 +Constant inlined print_word_at::at#1 = (const byte*) main::BASE_SCREEN+(byte) 4 +Constant inlined print_word_at::at#0 = (const byte*) main::BASE_SCREEN Successful SSA optimization Pass2ConstantInlining Simplifying constant integer increment ++0 Successful SSA optimization Pass2ConstantSimplification @@ -2124,7 +2122,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN#0 print_dword_at::@1/(const byte*) main::BASE_SCREEN#0+(byte) 4 ) + [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN print_dword_at::@1/(const byte*) main::BASE_SCREEN+(byte) 4 ) [26] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 @@ -2503,8 +2501,6 @@ VARIABLE REGISTER WEIGHTS (byte*) init_font_hex::proto_lo#4 92.53846153846155 (void()) main() (dword~) main::$4 4.0 -(byte*) main::BASE_CHARSET -(byte*) main::BASE_SCREEN (dword) main::cyclecount (dword) main::cyclecount#0 4.0 (byte*) main::toD0181_gfx @@ -2870,7 +2866,7 @@ print_dword_at: { // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -2888,7 +2884,7 @@ print_dword_at: { // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 @@ -4248,7 +4244,7 @@ print_dword_at: { // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -4266,7 +4262,7 @@ print_dword_at: { // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 @@ -5440,10 +5436,8 @@ FINAL SYMBOL TABLE (label) main::@4 (label) main::@5 (label) main::@return -(byte*) main::BASE_CHARSET -(const byte*) main::BASE_CHARSET#0 BASE_CHARSET = (byte*) 4096 -(byte*) main::BASE_SCREEN -(const byte*) main::BASE_SCREEN#0 BASE_SCREEN = (byte*) 1024 +(const byte*) main::BASE_CHARSET BASE_CHARSET = (byte*) 4096 +(const byte*) main::BASE_SCREEN BASE_SCREEN = (byte*) 1024 (dword) main::cyclecount (dword) main::cyclecount#0 cyclecount zp ZP_DWORD:18 4.0 (label) main::toD0181 @@ -5454,7 +5448,7 @@ FINAL SYMBOL TABLE (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 reg byte a 4.0 @@ -5647,7 +5641,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -5663,7 +5657,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 diff --git a/src/test/ref/screen-center-angle.sym b/src/test/ref/screen-center-angle.sym index c70c9428e..0d6ca5f89 100644 --- a/src/test/ref/screen-center-angle.sym +++ b/src/test/ref/screen-center-angle.sym @@ -183,10 +183,8 @@ (label) main::@4 (label) main::@5 (label) main::@return -(byte*) main::BASE_CHARSET -(const byte*) main::BASE_CHARSET#0 BASE_CHARSET = (byte*) 4096 -(byte*) main::BASE_SCREEN -(const byte*) main::BASE_SCREEN#0 BASE_SCREEN = (byte*) 1024 +(const byte*) main::BASE_CHARSET BASE_CHARSET = (byte*) 4096 +(const byte*) main::BASE_SCREEN BASE_SCREEN = (byte*) 1024 (dword) main::cyclecount (dword) main::cyclecount#0 cyclecount zp ZP_DWORD:18 4.0 (label) main::toD0181 @@ -197,7 +195,7 @@ (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 reg byte a 4.0 diff --git a/src/test/ref/screen-center-distance.cfg b/src/test/ref/screen-center-distance.cfg index fd0a24d9b..76a07de4e 100644 --- a/src/test/ref/screen-center-distance.cfg +++ b/src/test/ref/screen-center-distance.cfg @@ -60,7 +60,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN#0 print_dword_at::@1/(const byte*) main::BASE_SCREEN#0+(byte) 4 ) + [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN print_dword_at::@1/(const byte*) main::BASE_SCREEN+(byte) 4 ) [26] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 diff --git a/src/test/ref/screen-center-distance.log b/src/test/ref/screen-center-distance.log index 31f9a7805..b16479d31 100644 --- a/src/test/ref/screen-center-distance.log +++ b/src/test/ref/screen-center-distance.log @@ -89,8 +89,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@12 (void*()) malloc((word) malloc::size) @@ -575,18 +575,18 @@ main::@6: scope:[main] from main::@5 (dword~) main::$4 ← (dword) clock::return#4 (dword~) main::$5 ← (dword~) main::$4 - (dword) CLOCKS_PER_INIT (dword) main::cyclecount#0 ← (dword~) main::$5 - (byte*) main::BASE_SCREEN#0 ← ((byte*)) (number) $400 - (byte*) main::BASE_CHARSET#0 ← ((byte*)) (number) $1000 + (byte*) main::BASE_SCREEN ← ((byte*)) (number) $400 + (byte*) main::BASE_CHARSET ← ((byte*)) (number) $1000 (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0 - (byte*) print_dword_at::at#0 ← (byte*) main::BASE_SCREEN#0 + (byte*) print_dword_at::at#0 ← (byte*) main::BASE_SCREEN call print_dword_at to:main::@7 main::@7: scope:[main] from main::@6 (word*) SQUARES#43 ← phi( main::@6/(word*) SQUARES#46 ) (byte*) heap_head#37 ← phi( main::@6/(byte*) heap_head#42 ) (byte) NUM_SQUARES#32 ← phi( main::@6/(byte) NUM_SQUARES#37 ) - (byte*) main::toD0182_screen#0 ← (byte*) main::BASE_SCREEN#0 - (byte*) main::toD0182_gfx#0 ← (byte*) main::BASE_CHARSET#0 + (byte*) main::toD0182_screen#0 ← (byte*) main::BASE_SCREEN + (byte*) main::toD0182_gfx#0 ← (byte*) main::BASE_CHARSET to:main::toD0182 main::toD0182: scope:[main] from main::@7 (word*) SQUARES#36 ← phi( main::@7/(word*) SQUARES#43 ) @@ -884,7 +884,6 @@ SYMBOL TABLE SSA (byte*) D018 (byte[]) FONT_HEX_PROTO (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (byte) NUM_SQUARES (byte) NUM_SQUARES#0 (byte) NUM_SQUARES#1 @@ -1366,9 +1365,7 @@ SYMBOL TABLE SSA (label) main::@7 (label) main::@return (byte*) main::BASE_CHARSET -(byte*) main::BASE_CHARSET#0 (byte*) main::BASE_SCREEN -(byte*) main::BASE_SCREEN#0 (dword) main::cyclecount (dword) main::cyclecount#0 (label) main::toD0181 @@ -1631,7 +1628,7 @@ Adding number conversion cast (unumber) init_dist_screen::$17 in (byte*) heap_he Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) FONT_HEX_PROTO ← (byte[]){ (byte)(number) 2, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 2, (byte)(number) 2, (byte)(number) 2, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 4, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 1, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 1, (byte)(number) 6, (byte)(number) 3, (byte)(number) 4, (byte)(number) 6, (byte)(number) 5, (byte)(number) 2, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 2, (byte)(number) 5, (byte)(number) 3, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 7, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 2, (byte)(number) 5, (byte)(number) 4, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 7, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 4 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (signed word~) bsearch16u::$8 ← (signed word)(word) bsearch16u::key#1 Inlining cast (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0) @@ -1658,8 +1655,8 @@ Inlining cast (byte*) CHARSET ← (byte*)(number) $2000 Inlining cast (byte*) SCREEN ← (byte*)(number) $2800 Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 -Inlining cast (byte*) main::BASE_SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) main::BASE_CHARSET#0 ← (byte*)(number) $1000 +Inlining cast (byte*) main::BASE_SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) main::BASE_CHARSET ← (byte*)(number) $1000 Inlining cast (word~) main::toD0182_$0 ← (word)(byte*) main::toD0182_screen#1 Inlining cast (word~) main::toD0182_$4 ← (word)(byte*) main::toD0182_gfx#1 Inlining cast (byte) NUM_SQUARES#3 ← (unumber)(number) $30 @@ -1903,7 +1900,7 @@ Inferred type updated to byte for (unumber~) init_dist_screen::$17 Inversing boolean not [25] (bool~) bsearch16u::$12 ← (signed word) bsearch16u::result#0 != (signed byte) 0 from [24] (bool~) bsearch16u::$11 ← (signed word) bsearch16u::result#0 == (signed byte) 0 Inversing boolean not [32] (bool~) bsearch16u::$14 ← (signed word) bsearch16u::result#1 <= (signed byte) 0 from [31] (bool~) bsearch16u::$13 ← (signed word) bsearch16u::result#1 > (signed byte) 0 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#46 (byte*) heap_head#40 (byte*) heap_head#35 (byte*) heap_head#30 (byte*) heap_head#29 (byte*) heap_head#25 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#46 (byte*) heap_head#40 (byte*) heap_head#35 (byte*) heap_head#30 (byte*) heap_head#29 (byte*) heap_head#25 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#3 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#11 (byte*) heap_head#2 @@ -1961,8 +1958,8 @@ Alias (byte*) heap_head#14 = (byte*) heap_head#5 (byte*) heap_head#42 (byte*) he Alias (word*) SQUARES#12 = (word*) SQUARES#3 (word*) SQUARES#46 (word*) SQUARES#43 (word*) SQUARES#36 (word*) SQUARES#27 (word*) SQUARES#22 (word*) SQUARES#13 (word*) SQUARES#4 Alias (dword) clock::return#2 = (dword) clock::return#4 Alias (dword) main::cyclecount#0 = (dword~) main::$5 -Alias (byte*) main::BASE_SCREEN#0 = (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1 -Alias (byte*) main::BASE_CHARSET#0 = (byte*) main::toD0182_gfx#0 (byte*) main::toD0182_gfx#1 +Alias (byte*) main::BASE_SCREEN = (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1 +Alias (byte*) main::BASE_CHARSET = (byte*) main::toD0182_gfx#0 (byte*) main::toD0182_gfx#1 Alias (byte) main::toD0182_return#0 = (byte~) main::toD0182_$8 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$7 Alias (byte*) init_dist_screen::screen#1 = (byte*) init_dist_screen::screen#2 (byte*) init_dist_screen::screen_topline#0 Alias (byte) NUM_SQUARES#3 = (byte) NUM_SQUARES#42 @@ -2058,7 +2055,7 @@ Identical Phi Values (byte) init_font_hex::c#2 (byte) init_font_hex::c#5 Identical Phi Values (dword) print_dword_at::dw#1 (dword) print_dword_at::dw#0 Identical Phi Values (byte*) print_dword_at::at#1 (byte*) print_dword_at::at#0 Identical Phi Values (byte) NUM_SQUARES#14 (byte) NUM_SQUARES#0 -Identical Phi Values (byte*) heap_head#21 (byte*) HEAP_TOP#0 +Identical Phi Values (byte*) heap_head#21 (byte*) HEAP_TOP Identical Phi Values (word*) SQUARES#21 (word*) SQUARES#0 Identical Phi Values (byte) NUM_SQUARES#1 (byte) NUM_SQUARES#11 Identical Phi Values (byte*) heap_head#14 (byte*) heap_head#17 @@ -2107,7 +2104,7 @@ Constant right-side identified [49] (byte~) bsearch16u::$18 ← (byte) 1 * (cons Successful SSA optimization Pass2ConstantRValueConsolidation Identified constant from value list (byte[]) { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const byte) bsearch16u::$17 = 1*SIZEOF_WORD Constant (const byte) bsearch16u::$18 = 1*SIZEOF_WORD Constant (const byte) NUM_SQUARES#0 = $ff @@ -2132,8 +2129,8 @@ Constant (const dword) CLOCKS_PER_INIT = $12 Constant (const byte[]) print_hextab = $1 Constant (const byte*) CHARSET = (byte*) 8192 Constant (const byte*) SCREEN = (byte*) 10240 -Constant (const byte*) main::BASE_SCREEN#0 = (byte*) 1024 -Constant (const byte*) main::BASE_CHARSET#0 = (byte*) 4096 +Constant (const byte*) main::BASE_SCREEN = (byte*) 1024 +Constant (const byte*) main::BASE_CHARSET = (byte*) 4096 Constant (const byte) NUM_SQUARES#3 = $30 Constant (const byte) init_dist_screen::y#0 = 0 Constant (const byte) init_dist_screen::x#0 = 0 @@ -2146,14 +2143,14 @@ Constant (const byte*) init_font_hex::charset#1 = CHARSET Constant (const byte*) main::toD0181_screen#0 = SCREEN Constant (const byte*) main::toD0181_gfx#0 = CHARSET Constant (const byte*) init_dist_screen::screen#0 = SCREEN -Constant (const byte*) print_dword_at::at#0 = main::BASE_SCREEN#0 +Constant (const byte*) print_dword_at::at#0 = main::BASE_SCREEN Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_word_at::at#0 = print_dword_at::at#0 Successful SSA optimization Pass2ConstantIdentification Constant value identified (word)main::toD0181_screen#0 in [225] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [229] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (word)main::BASE_SCREEN#0 in [263] (word~) main::toD0182_$0 ← (word)(const byte*) main::BASE_SCREEN#0 -Constant value identified (word)main::BASE_CHARSET#0 in [267] (word~) main::toD0182_$4 ← (word)(const byte*) main::BASE_CHARSET#0 +Constant value identified (word)main::BASE_SCREEN in [263] (word~) main::toD0182_$0 ← (word)(const byte*) main::BASE_SCREEN +Constant value identified (word)main::BASE_CHARSET in [267] (word~) main::toD0182_$4 ← (word)(const byte*) main::BASE_CHARSET Successful SSA optimization Pass2ConstantValues Resolved ranged next value [133] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++ Resolved ranged comparison value [135] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5 @@ -2214,8 +2211,8 @@ Constant (const byte) clock_start::$6 = CIA_TIMER_CONTROL_START Constant (const byte*) print_word_at::at#1 = print_dword_at::at#0+4 Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 -Constant (const word) main::toD0182_$0 = (word)main::BASE_SCREEN#0 -Constant (const word) main::toD0182_$4 = (word)main::BASE_CHARSET#0 +Constant (const word) main::toD0182_$0 = (word)main::BASE_SCREEN +Constant (const word) main::toD0182_$4 = (word)main::BASE_CHARSET Constant (const byte*) init_dist_screen::screen_bottomline#0 = init_dist_screen::screen#0+(word)$28*$18 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [35] init_squares::i#1 ← ++ init_squares::i#2 to ++ @@ -2230,14 +2227,14 @@ Simplifying constant integer cast 1 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP#0 - (const word) malloc::size#0 +Constant right-side identified [0] (byte*) malloc::mem#0 ← (const byte*) HEAP_TOP - (const word) malloc::size#0 Constant right-side identified [77] (byte~) clock_start::$5 ← (const byte) clock_start::$6 | (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A Constant right-side identified [108] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff Constant right-side identified [111] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4 Constant right-side identified [124] (word~) main::toD0182_$1 ← (const word) main::toD0182_$0 & (word) $3fff Constant right-side identified [127] (byte~) main::toD0182_$5 ← > (const word) main::toD0182_$4 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) malloc::mem#0 = HEAP_TOP#0-malloc::size#0 +Constant (const byte*) malloc::mem#0 = HEAP_TOP-malloc::size#0 Constant (const byte) clock_start::$3 = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A Constant (const byte) clock_start::$5 = clock_start::$6|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A Constant (const word) main::toD0181_$1 = main::toD0181_$0&$3fff @@ -2316,20 +2313,20 @@ Inlining constant with var siblings (const byte) init_dist_screen::xb#0 Inlining constant with var siblings (const byte*) init_dist_screen::screen_bottomline#0 Constant inlined init_squares::squares#0 = (const word*) SQUARES#1 Constant inlined init_font_hex::proto_hi#0 = (const byte[]) FONT_HEX_PROTO -Constant inlined main::toD0182_$4 = (word)(const byte*) main::BASE_CHARSET#0 -Constant inlined main::toD0182_$5 = >(word)(const byte*) main::BASE_CHARSET#0 -Constant inlined main::toD0182_$6 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4 -Constant inlined main::toD0182_$7 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +Constant inlined main::toD0182_$4 = (word)(const byte*) main::BASE_CHARSET +Constant inlined main::toD0182_$5 = >(word)(const byte*) main::BASE_CHARSET +Constant inlined main::toD0182_$6 = >(word)(const byte*) main::BASE_CHARSET/(byte) 4 +Constant inlined main::toD0182_$7 = >(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f Constant inlined clock_start::$5 = (const byte) CIA_TIMER_CONTROL_START|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -Constant inlined main::toD0182_$0 = (word)(const byte*) main::BASE_SCREEN#0 +Constant inlined main::toD0182_$0 = (word)(const byte*) main::BASE_SCREEN Constant inlined clock_start::$6 = (const byte) CIA_TIMER_CONTROL_START Constant inlined $1 = (const byte[]) print_hextab -Constant inlined main::toD0182_$1 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff +Constant inlined main::toD0182_$1 = (word)(const byte*) main::BASE_SCREEN&(word) $3fff Constant inlined clock_start::$3 = (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -Constant inlined main::toD0182_$2 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4 -Constant inlined main::toD0182_$3 = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$2 = (word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$3 = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4 Constant inlined init_dist_screen::x#0 = (byte) 0 -Constant inlined print_dword_at::at#0 = (const byte*) main::BASE_SCREEN#0 +Constant inlined print_dword_at::at#0 = (const byte*) main::BASE_SCREEN Constant inlined malloc::return#2 = (const void*) malloc::return#0 Constant inlined main::toD0181_$7 = >(word)(const byte*) CHARSET/(byte) 4&(byte) $f Constant inlined bsearch16u::num#2 = (const byte) NUM_SQUARES#3 @@ -2360,8 +2357,8 @@ Constant inlined bsearch16u::$18 = (byte) 1*(const byte) SIZEOF_WORD Constant inlined clock_start::$1 = (const byte) CIA_TIMER_CONTROL_CONTINUOUS Constant inlined init_font_hex::c#0 = (byte) 0 Constant inlined init_squares::$1 = (const void*) malloc::return#0 -Constant inlined print_word_at::at#1 = (const byte*) main::BASE_SCREEN#0+(byte) 4 -Constant inlined print_word_at::at#0 = (const byte*) main::BASE_SCREEN#0 +Constant inlined print_word_at::at#1 = (const byte*) main::BASE_SCREEN+(byte) 4 +Constant inlined print_word_at::at#0 = (const byte*) main::BASE_SCREEN Constant inlined init_squares::$2 = (const byte) NUM_SQUARES#3-(byte) 1 Successful SSA optimization Pass2ConstantInlining Simplifying constant integer increment ++0 @@ -2573,7 +2570,7 @@ print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1 (void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at) print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1 - [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN#0 print_dword_at::@1/(const byte*) main::BASE_SCREEN#0+(byte) 4 ) + [26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN print_dword_at::@1/(const byte*) main::BASE_SCREEN+(byte) 4 ) [26] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 ) [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 @@ -2857,7 +2854,6 @@ init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5 VARIABLE REGISTER WEIGHTS -(byte*) HEAP_TOP (byte) NUM_SQUARES (word*) SQUARES (word*()) bsearch16u((word) bsearch16u::key , (word*) bsearch16u::items , (byte) bsearch16u::num) @@ -2968,8 +2964,6 @@ VARIABLE REGISTER WEIGHTS (word*) init_squares::squares#2 16.5 (void()) main() (dword~) main::$4 4.0 -(byte*) main::BASE_CHARSET -(byte*) main::BASE_SCREEN (dword) main::cyclecount (dword) main::cyclecount#0 4.0 (byte*) main::toD0181_gfx @@ -3386,7 +3380,7 @@ print_dword_at: { // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -3404,7 +3398,7 @@ print_dword_at: { // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 @@ -4877,7 +4871,7 @@ print_dword_at: { // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] print_word_at_from_print_dword_at: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -4895,7 +4889,7 @@ print_dword_at: { // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] print_word_at_from_b1: - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 @@ -5922,8 +5916,7 @@ FINAL SYMBOL TABLE (const dword) CLOCKS_PER_INIT CLOCKS_PER_INIT = (byte) $12 (const byte*) D018 D018 = (byte*) 53272 (const byte[]) FONT_HEX_PROTO FONT_HEX_PROTO = { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 } -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 @@ -6082,10 +6075,8 @@ FINAL SYMBOL TABLE (label) main::@4 (label) main::@5 (label) main::@return -(byte*) main::BASE_CHARSET -(const byte*) main::BASE_CHARSET#0 BASE_CHARSET = (byte*) 4096 -(byte*) main::BASE_SCREEN -(const byte*) main::BASE_SCREEN#0 BASE_SCREEN = (byte*) 1024 +(const byte*) main::BASE_CHARSET BASE_CHARSET = (byte*) 4096 +(const byte*) main::BASE_SCREEN BASE_SCREEN = (byte*) 1024 (dword) main::cyclecount (dword) main::cyclecount#0 cyclecount zp ZP_DWORD:13 4.0 (label) main::toD0181 @@ -6096,12 +6087,12 @@ FINAL SYMBOL TABLE (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size @@ -6326,7 +6317,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [22] call print_word_at // [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at] - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN @@ -6342,7 +6333,7 @@ print_dword_at: { sta.z print_word_at.w+1 // [24] call print_word_at // [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at] - // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 + // [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1 lda #main.BASE_SCREEN+4 diff --git a/src/test/ref/screen-center-distance.sym b/src/test/ref/screen-center-distance.sym index a58ea0867..8d57d68e4 100644 --- a/src/test/ref/screen-center-distance.sym +++ b/src/test/ref/screen-center-distance.sym @@ -11,8 +11,7 @@ (const dword) CLOCKS_PER_INIT CLOCKS_PER_INIT = (byte) $12 (const byte*) D018 D018 = (byte*) 53272 (const byte[]) FONT_HEX_PROTO FONT_HEX_PROTO = { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 } -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 @@ -171,10 +170,8 @@ (label) main::@4 (label) main::@5 (label) main::@return -(byte*) main::BASE_CHARSET -(const byte*) main::BASE_CHARSET#0 BASE_CHARSET = (byte*) 4096 -(byte*) main::BASE_SCREEN -(const byte*) main::BASE_SCREEN#0 BASE_SCREEN = (byte*) 1024 +(const byte*) main::BASE_CHARSET BASE_CHARSET = (byte*) 4096 +(const byte*) main::BASE_SCREEN BASE_SCREEN = (byte*) 1024 (dword) main::cyclecount (dword) main::cyclecount#0 cyclecount zp ZP_DWORD:13 4.0 (label) main::toD0181 @@ -185,12 +182,12 @@ (label) main::toD0182 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET/(byte) 4&(byte) $f (byte*) main::toD0182_screen (void*()) malloc((word) malloc::size) (label) malloc::@return (byte*) malloc::mem -(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP#0-(const word) malloc::size#0 +(const byte*) malloc::mem#0 mem = (const byte*) HEAP_TOP-(const word) malloc::size#0 (void*) malloc::return (const void*) malloc::return#0 return = (void*)(const byte*) malloc::mem#0 (word) malloc::size diff --git a/src/test/ref/screen-show-spiral-buckets.cfg b/src/test/ref/screen-show-spiral-buckets.cfg index 5cedceeb5..ad39b92ee 100644 --- a/src/test/ref/screen-show-spiral-buckets.cfg +++ b/src/test/ref/screen-show-spiral-buckets.cfg @@ -181,7 +181,7 @@ init_buckets::@return: scope:[init_buckets] from init_buckets::@7 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @2 @4 @6 @7 init_buckets::@4 init_squares [93] (word) malloc::size#7 ← phi( @1/(word) $3e8 @2/(const byte) NUM_BUCKETS*(const byte) SIZEOF_BYTE @4/(word) $3e8 @6/(const byte) NUM_BUCKETS*(const byte) SIZEOF_POINTER @7/(const byte) NUM_BUCKETS*(const byte) SIZEOF_BYTE init_buckets::@4/(word) malloc::size#6 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [93] (byte*) heap_head#18 ← phi( @1/(const byte*) HEAP_TOP#0 @2/(byte*) heap_head#1 @4/(byte*) heap_head#1 @6/(byte*) heap_head#1 @7/(byte*) heap_head#1 init_buckets::@4/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [93] (byte*) heap_head#18 ← phi( @1/(const byte*) HEAP_TOP @2/(byte*) heap_head#1 @4/(byte*) heap_head#1 @6/(byte*) heap_head#1 @7/(byte*) heap_head#1 init_buckets::@4/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [94] (byte*) malloc::mem#0 ← (byte*) heap_head#18 - (word) malloc::size#7 [95] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return diff --git a/src/test/ref/screen-show-spiral-buckets.log b/src/test/ref/screen-show-spiral-buckets.log index 517578e4a..0e7541469 100644 --- a/src/test/ref/screen-show-spiral-buckets.log +++ b/src/test/ref/screen-show-spiral-buckets.log @@ -100,8 +100,8 @@ CONTROL FLOW GRAPH SSA (byte*) COLS ← ((byte*)) (number) $d800 to:@8 @8: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@16 (void*()) malloc((word) malloc::size) @@ -1246,7 +1246,6 @@ SYMBOL TABLE SSA (byte) CORDIC_ITERATIONS_16 (byte) FILL_CHAR (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (byte) NUM_BUCKETS (byte) NUM_SQUARES (byte) NUM_SQUARES#0 @@ -2322,7 +2321,7 @@ Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) RASTER ← (byte*)(number) $d012 Inlining cast (byte*) BORDERCOL ← (byte*)(number) $d020 Inlining cast (byte*) COLS ← (byte*)(number) $d800 -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (signed word~) bsearch16u::$8 ← (signed word)(word) bsearch16u::key#1 Inlining cast (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0) @@ -2549,7 +2548,7 @@ Inversing boolean not [257] (bool~) main::$10 ← *((byte*) main::fill#0) == (by Inversing boolean not [261] (bool~) main::$15 ← (word) main::min_offset#2 == (word) $ffff from [260] (bool~) main::$14 ← (word) main::min_offset#2 != (word) $ffff Inversing boolean not [269] (bool~) main::$13 ← *((byte*) main::angle#0) > (byte) main::min_angle#2 from [268] (bool~) main::$12 ← *((byte*) main::angle#0) <= (byte) main::min_angle#2 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#54 (byte*) heap_head#47 (byte*) heap_head#35 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#54 (byte*) heap_head#47 (byte*) heap_head#35 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#9 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#19 (byte*) heap_head#2 @@ -2901,7 +2900,7 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) RASTER = (byte*) 53266 Constant (const byte*) BORDERCOL = (byte*) 53280 Constant (const byte*) COLS = (byte*) 55296 -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const byte) bsearch16u::$17 = 1*SIZEOF_WORD Constant (const byte) bsearch16u::$18 = 1*SIZEOF_WORD Constant (const byte) NUM_SQUARES#0 = $ff @@ -3563,7 +3562,7 @@ init_buckets::@return: scope:[init_buckets] from init_buckets::@7 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @2 @4 @6 @7 init_buckets::@4 init_squares [93] (word) malloc::size#7 ← phi( @1/(word) $3e8 @2/(const byte) NUM_BUCKETS*(const byte) SIZEOF_BYTE @4/(word) $3e8 @6/(const byte) NUM_BUCKETS*(const byte) SIZEOF_POINTER @7/(const byte) NUM_BUCKETS*(const byte) SIZEOF_BYTE init_buckets::@4/(word) malloc::size#6 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [93] (byte*) heap_head#18 ← phi( @1/(const byte*) HEAP_TOP#0 @2/(byte*) heap_head#1 @4/(byte*) heap_head#1 @6/(byte*) heap_head#1 @7/(byte*) heap_head#1 init_buckets::@4/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [93] (byte*) heap_head#18 ← phi( @1/(const byte*) HEAP_TOP @2/(byte*) heap_head#1 @4/(byte*) heap_head#1 @6/(byte*) heap_head#1 @7/(byte*) heap_head#1 init_buckets::@4/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [94] (byte*) malloc::mem#0 ← (byte*) heap_head#18 - (word) malloc::size#7 [95] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return @@ -3900,7 +3899,6 @@ VARIABLE REGISTER WEIGHTS (void*) BUCKETS 0.02531645569620253 (void*) BUCKET_IDX 0.0425531914893617 (void*) BUCKET_SIZES 0.024691358024691357 -(byte*) HEAP_TOP (byte) NUM_SQUARES (void*) SCREEN_ANGLE 0.045454545454545456 (void*) SCREEN_DIST 0.125 @@ -4555,7 +4553,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -7132,7 +7130,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -9091,8 +9089,7 @@ FINAL SYMBOL TABLE }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte) FILL_CHAR FILL_CHAR = (byte) '*' -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) NUM_BUCKETS NUM_BUCKETS = (byte) $30 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 @@ -9571,7 +9568,7 @@ bbegin: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [93] phi (byte*) heap_head#18 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP diff --git a/src/test/ref/screen-show-spiral-buckets.sym b/src/test/ref/screen-show-spiral-buckets.sym index 4f7b27bfa..13f136b09 100644 --- a/src/test/ref/screen-show-spiral-buckets.sym +++ b/src/test/ref/screen-show-spiral-buckets.sym @@ -18,8 +18,7 @@ }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte) FILL_CHAR FILL_CHAR = (byte) '*' -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (const byte) NUM_BUCKETS NUM_BUCKETS = (byte) $30 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 diff --git a/src/test/ref/screen-show-spiral.cfg b/src/test/ref/screen-show-spiral.cfg index c0cdaed7a..7d766677d 100644 --- a/src/test/ref/screen-show-spiral.cfg +++ b/src/test/ref/screen-show-spiral.cfg @@ -400,7 +400,7 @@ init_squares::@return: scope:[init_squares] from init_squares::@1 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @3 init_squares [190] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [191] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3 [192] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return diff --git a/src/test/ref/screen-show-spiral.log b/src/test/ref/screen-show-spiral.log index 423fba6d6..807610fb0 100644 --- a/src/test/ref/screen-show-spiral.log +++ b/src/test/ref/screen-show-spiral.log @@ -74,8 +74,8 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@4 @4: scope:[] from @begin - (byte*) HEAP_TOP#0 ← ((byte*)) (number) $a000 - (byte*) heap_head#0 ← (byte*) HEAP_TOP#0 + (byte*) HEAP_TOP ← ((byte*)) (number) $a000 + (byte*) heap_head#0 ← (byte*) HEAP_TOP to:@12 (void*()) malloc((word) malloc::size) @@ -968,7 +968,6 @@ SYMBOL TABLE SSA (byte) CORDIC_ITERATIONS_16 (byte) FILL_CHAR (byte*) HEAP_TOP -(byte*) HEAP_TOP#0 (byte) NUM_SQUARES (byte) NUM_SQUARES#0 (byte) NUM_SQUARES#1 @@ -1842,7 +1841,7 @@ Adding number conversion cast (unumber) init_dist_screen::$17 in (byte*) heap_he (word*) SQUARES#18 ← phi( init_dist_screen::@8/(word*) SQUARES#33 init_dist_screen::@9/(word*) SQUARES#34 ) (number~) init_dist_screen::$17 ← phi( init_dist_screen::@8/(unumber~) init_dist_screen::$16 init_dist_screen::@9/(unumber~) init_dist_screen::$14 ) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) HEAP_TOP#0 ← (byte*)(number) $a000 +Inlining cast (byte*) HEAP_TOP ← (byte*)(number) $a000 Inlining cast (void*) malloc::return#0 ← (void*)(byte*) malloc::mem#0 Inlining cast (signed word~) bsearch16u::$8 ← (signed word)(word) bsearch16u::key#1 Inlining cast (signed word~) bsearch16u::$9 ← (signed word)*((word*) bsearch16u::pivot#0) @@ -2030,7 +2029,7 @@ Inversing boolean not [227] (bool~) main::$3 ← *((byte*) main::fill#2) == (byt Inversing boolean not [240] (bool~) main::$5 ← (word) main::dist_angle#0 >= (word) main::min_dist_angle#2 from [239] (bool~) main::$4 ← (word) main::dist_angle#0 < (word) main::min_dist_angle#2 Inversing boolean not [247] (bool~) main::$9 ← (word) main::min_dist_angle#3 != (word) $ffff from [246] (bool~) main::$8 ← (word) main::min_dist_angle#3 == (word) $ffff Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) HEAP_TOP#0 = (byte*) heap_head#0 (byte*) heap_head#37 (byte*) heap_head#32 (byte*) heap_head#23 +Alias (byte*) HEAP_TOP = (byte*) heap_head#0 (byte*) heap_head#37 (byte*) heap_head#32 (byte*) heap_head#23 Alias (byte*) malloc::mem#0 = (byte*~) malloc::$0 Alias (void*) malloc::return#0 = (void*) malloc::return#5 (void*) malloc::return#1 Alias (byte*) heap_head#1 = (byte*) heap_head#13 (byte*) heap_head#2 @@ -2319,7 +2318,7 @@ Successful SSA optimization Pass2ConditionalJumpSequenceImprovement Constant right-side identified [42] (byte~) bsearch16u::$17 ← (byte) 1 * (const byte) SIZEOF_WORD Constant right-side identified [49] (byte~) bsearch16u::$18 ← (byte) 1 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) HEAP_TOP#0 = (byte*) 40960 +Constant (const byte*) HEAP_TOP = (byte*) 40960 Constant (const byte) bsearch16u::$17 = 1*SIZEOF_WORD Constant (const byte) bsearch16u::$18 = 1*SIZEOF_WORD Constant (const byte) NUM_SQUARES#0 = $ff @@ -3063,7 +3062,7 @@ init_squares::@return: scope:[init_squares] from init_squares::@1 (void*()) malloc((word) malloc::size) malloc: scope:[malloc] from @1 @3 init_squares [190] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD ) - [190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) + [190] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_TOP @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 ) [191] (byte*) malloc::mem#0 ← (byte*) heap_head#12 - (word) malloc::size#3 [192] (byte*) heap_head#1 ← (byte*) malloc::mem#0 to:malloc::@return @@ -3073,7 +3072,6 @@ malloc::@return: scope:[malloc] from malloc VARIABLE REGISTER WEIGHTS -(byte*) HEAP_TOP (byte) NUM_SQUARES (void*) SCREEN_ANGLE 0.08695652173913043 (void*) SCREEN_DIST 0.08 @@ -3581,7 +3579,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -5538,7 +5536,7 @@ malloc_from_b1: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP @@ -7006,8 +7004,7 @@ FINAL SYMBOL TABLE }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte) FILL_CHAR FILL_CHAR = (byte) '@' -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 @@ -7394,7 +7391,7 @@ bbegin: sta.z malloc.size lda #>$3e8 sta.z malloc.size+1 - // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP#0 [phi:@1->malloc#1] -- pbuz1=pbuc1 + // [190] phi (byte*) heap_head#12 = (const byte*) HEAP_TOP [phi:@1->malloc#1] -- pbuz1=pbuc1 lda #HEAP_TOP diff --git a/src/test/ref/screen-show-spiral.sym b/src/test/ref/screen-show-spiral.sym index 8c6e4fe23..841558ca9 100644 --- a/src/test/ref/screen-show-spiral.sym +++ b/src/test/ref/screen-show-spiral.sym @@ -9,8 +9,7 @@ }} (const byte) CORDIC_ITERATIONS_16 CORDIC_ITERATIONS_16 = (byte) $f (const byte) FILL_CHAR FILL_CHAR = (byte) '@' -(byte*) HEAP_TOP -(const byte*) HEAP_TOP#0 HEAP_TOP = (byte*) 40960 +(const byte*) HEAP_TOP HEAP_TOP = (byte*) 40960 (byte) NUM_SQUARES (const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30 (const byte) RADIX::BINARY BINARY = (number) 2 diff --git a/src/test/ref/scroll-clobber.cfg b/src/test/ref/scroll-clobber.cfg index 697aa60bd..0abeb0497 100644 --- a/src/test/ref/scroll-clobber.cfg +++ b/src/test/ref/scroll-clobber.cfg @@ -25,6 +25,6 @@ main::@2: scope:[main] from main::@1 main::@3 [9] (byte*) main::nxt#4 ← phi( main::@1/(byte*) main::nxt#3 main::@3/(const byte[]) TEXT ) [9] (byte) main::c#2 ← phi( main::@1/(byte) main::c#0 main::@3/(byte) main::c#1 ) [10] (byte) main::i#1 ← ++ (byte) main::i#2 - [11] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 + [11] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 [12] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 to:main::@1 diff --git a/src/test/ref/scroll-clobber.log b/src/test/ref/scroll-clobber.log index 9c725e3de..45bbc8246 100644 --- a/src/test/ref/scroll-clobber.log +++ b/src/test/ref/scroll-clobber.log @@ -4,7 +4,7 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) SCREEN ← ((byte*)) (number) $400 (byte[]) TEXT ← (const string) $0 to:@1 @@ -26,7 +26,7 @@ main::@2: scope:[main] from main::@1 main::@3 (byte) main::c#2 ← phi( main::@1/(byte) main::c#0 main::@3/(byte) main::c#1 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 main::@3/(byte) main::i#4 ) (byte) main::i#1 ← ++ (byte) main::i#2 - *((byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 + *((byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 if(true) goto main::@1 to:main::@return @@ -52,7 +52,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte[]) TEXT (void()) main() (bool~) main::$0 @@ -81,7 +80,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← (byte) main::c#0 == (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -99,7 +98,7 @@ Alias (byte) main::i#2 = (byte) main::i#3 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [8] if((byte) main::c#0!=(byte) 0) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte[]) TEXT = $0 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -169,13 +168,12 @@ main::@2: scope:[main] from main::@1 main::@3 [9] (byte*) main::nxt#4 ← phi( main::@1/(byte*) main::nxt#3 main::@3/(const byte[]) TEXT ) [9] (byte) main::c#2 ← phi( main::@1/(byte) main::c#0 main::@3/(byte) main::c#1 ) [10] (byte) main::i#1 ← ++ (byte) main::i#2 - [11] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 + [11] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 [12] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) main() (byte) main::c (byte) main::c#0 16.5 @@ -276,7 +274,7 @@ main: { b2: // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 inc.z i - // [11] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuz1=vbuz2 + // [11] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z c ldy.z i sta SCREEN,y @@ -381,7 +379,7 @@ main: { b2: // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx inx - // [11] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuyy + // [11] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuyy tya sta SCREEN,x // [12] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 -- pbuz1=_inc_pbuz1 @@ -431,8 +429,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TEXT TEXT = (string) "01234567" (void()) main() (label) main::@1 @@ -514,7 +511,7 @@ main: { // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx inx // SCREEN[++i] = c - // [11] *((const byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuyy + // [11] *((const byte*) SCREEN + (byte) main::i#1) ← (byte) main::c#2 -- pbuc1_derefidx_vbuxx=vbuyy tya sta SCREEN,x // nxt++; diff --git a/src/test/ref/scroll-clobber.sym b/src/test/ref/scroll-clobber.sym index 50979a301..b558bcd28 100644 --- a/src/test/ref/scroll-clobber.sym +++ b/src/test/ref/scroll-clobber.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) TEXT TEXT = (string) "01234567" (void()) main() (label) main::@1 diff --git a/src/test/ref/scrollbig-clobber.cfg b/src/test/ref/scrollbig-clobber.cfg index 2667d3b34..2c0240fe6 100644 --- a/src/test/ref/scrollbig-clobber.cfg +++ b/src/test/ref/scrollbig-clobber.cfg @@ -14,13 +14,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) - [5] (byte*) nxt#13 ← phi( main/(const byte*) TEXT#0 main::@2/(byte*) nxt#11 ) + [5] (byte*) nxt#13 ← phi( main/(const byte*) TEXT main::@2/(byte*) nxt#11 ) [6] call next_char [7] (byte) next_char::return#0 ← (byte) next_char::return#1 to:main::@2 main::@2: scope:[main] from main::@1 [8] (byte~) main::$0 ← (byte) next_char::return#0 - [9] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 + [9] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 [10] (byte) main::i#1 ← ++ (byte) main::i#2 [11] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@return @@ -34,11 +34,11 @@ next_char: scope:[next_char] from main::@1 [14] if((byte) next_char::c#0!=(byte) 0) goto next_char::@1 to:next_char::@2 next_char::@2: scope:[next_char] from next_char - [15] (byte) next_char::c#1 ← *((const byte*) TEXT#0) + [15] (byte) next_char::c#1 ← *((const byte*) TEXT) to:next_char::@1 next_char::@1: scope:[next_char] from next_char next_char::@2 [16] (byte) next_char::return#1 ← phi( next_char/(byte) next_char::c#0 next_char::@2/(byte) next_char::c#1 ) - [16] (byte*) nxt#10 ← phi( next_char/(byte*) nxt#13 next_char::@2/(const byte*) TEXT#0 ) + [16] (byte*) nxt#10 ← phi( next_char/(byte*) nxt#13 next_char::@2/(const byte*) TEXT ) [17] (byte*) nxt#11 ← ++ (byte*) nxt#10 to:next_char::@return next_char::@return: scope:[next_char] from next_char::@1 diff --git a/src/test/ref/scrollbig-clobber.log b/src/test/ref/scrollbig-clobber.log index 29b183ecc..f520f2801 100644 --- a/src/test/ref/scrollbig-clobber.log +++ b/src/test/ref/scrollbig-clobber.log @@ -5,13 +5,13 @@ Culled Empty Block (label) next_char::@3 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) TEXT#0 ← (const string) $0 + (byte*) TEXT ← (const string) $0 to:@1 (void()) main() main: scope:[main] from @2 (byte*) nxt#15 ← phi( @2/(byte*) nxt#14 ) - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@3 @@ -26,7 +26,7 @@ main::@3: scope:[main] from main::@1 (byte) next_char::return#3 ← phi( main::@1/(byte) next_char::return#0 ) (byte~) main::$0 ← (byte) next_char::return#3 (byte*) nxt#0 ← (byte*) nxt#7 - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 + *((byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$1) goto main::@1 @@ -37,7 +37,7 @@ main::@return: scope:[main] from main::@3 return to:@return @1: scope:[] from @begin - (byte*) nxt#2 ← (byte*) TEXT#0 + (byte*) nxt#2 ← (byte*) TEXT to:@2 (byte()) next_char() @@ -55,7 +55,7 @@ next_char::@1: scope:[next_char] from next_char next_char::@2 (byte) next_char::return#1 ← (byte) next_char::c#2 to:next_char::@return next_char::@2: scope:[next_char] from next_char - (byte*) nxt#4 ← (byte*) TEXT#0 + (byte*) nxt#4 ← (byte*) TEXT (byte) next_char::c#1 ← *((byte*) nxt#4) to:next_char::@1 next_char::@return: scope:[next_char] from next_char::@1 @@ -83,7 +83,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) TEXT -(byte*) TEXT#0 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -91,7 +90,6 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -133,7 +131,7 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (bool~) next_char::$0 ← (byte) next_char::c#0 == (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -145,12 +143,12 @@ Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) next_char::return#0 = (byte) next_char::return#3 Alias (byte) main::i#2 = (byte) main::i#3 Alias (byte*) nxt#0 = (byte*) nxt#7 (byte*) nxt#8 (byte*) nxt#1 -Alias (byte*) TEXT#0 = (byte*) nxt#2 (byte*) nxt#14 +Alias (byte*) TEXT = (byte*) nxt#2 (byte*) nxt#14 Alias (byte) next_char::return#1 = (byte) next_char::c#2 (byte) next_char::return#4 (byte) next_char::return#2 Alias (byte*) nxt#11 = (byte*) nxt#3 (byte*) nxt#5 Alias (byte*) nxt#12 = (byte*) nxt#6 Successful SSA optimization Pass2AliasElimination -Identical Phi Values (byte*) nxt#15 (byte*) TEXT#0 +Identical Phi Values (byte*) nxt#15 (byte*) TEXT Identical Phi Values (byte*) nxt#0 (byte*) nxt#11 Identical Phi Values (byte*) nxt#9 (byte*) nxt#13 Identical Phi Values (byte*) nxt#12 (byte*) nxt#0 @@ -158,11 +156,11 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$1 [13] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 Simple Condition (bool~) next_char::$1 [22] if((byte) next_char::c#0!=(byte) 0) goto next_char::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) TEXT#0 = $0 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) TEXT = $0 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) nxt#4 = TEXT#0 +Constant (const byte*) nxt#4 = TEXT Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [11] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [13] if(main::i#1!=rangelast(0,$ff)) goto main::@1 to (number) 0 @@ -174,9 +172,9 @@ Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte*) nxt#4 -Constant inlined $0 = (const byte*) TEXT#0 +Constant inlined $0 = (const byte*) TEXT Constant inlined main::i#0 = (byte) 0 -Constant inlined nxt#4 = (const byte*) TEXT#0 +Constant inlined nxt#4 = (const byte*) TEXT Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@4(between main::@3 and main::@1) Added new block during phi lifting next_char::@4(between next_char and next_char::@1) @@ -225,13 +223,13 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) - [5] (byte*) nxt#13 ← phi( main/(const byte*) TEXT#0 main::@2/(byte*) nxt#11 ) + [5] (byte*) nxt#13 ← phi( main/(const byte*) TEXT main::@2/(byte*) nxt#11 ) [6] call next_char [7] (byte) next_char::return#0 ← (byte) next_char::return#1 to:main::@2 main::@2: scope:[main] from main::@1 [8] (byte~) main::$0 ← (byte) next_char::return#0 - [9] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 + [9] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 [10] (byte) main::i#1 ← ++ (byte) main::i#2 [11] if((byte) main::i#1!=(byte) 0) goto main::@1 to:main::@return @@ -245,11 +243,11 @@ next_char: scope:[next_char] from main::@1 [14] if((byte) next_char::c#0!=(byte) 0) goto next_char::@1 to:next_char::@2 next_char::@2: scope:[next_char] from next_char - [15] (byte) next_char::c#1 ← *((const byte*) TEXT#0) + [15] (byte) next_char::c#1 ← *((const byte*) TEXT) to:next_char::@1 next_char::@1: scope:[next_char] from next_char next_char::@2 [16] (byte) next_char::return#1 ← phi( next_char/(byte) next_char::c#0 next_char::@2/(byte) next_char::c#1 ) - [16] (byte*) nxt#10 ← phi( next_char/(byte*) nxt#13 next_char::@2/(const byte*) TEXT#0 ) + [16] (byte*) nxt#10 ← phi( next_char/(byte*) nxt#13 next_char::@2/(const byte*) TEXT ) [17] (byte*) nxt#11 ← ++ (byte*) nxt#10 to:next_char::@return next_char::@return: scope:[next_char] from next_char::@1 @@ -258,10 +256,8 @@ next_char::@return: scope:[next_char] from next_char::@1 VARIABLE REGISTER WEIGHTS -(byte*) TEXT (void()) main() (byte~) main::$0 22.0 -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 6.6000000000000005 @@ -331,7 +327,7 @@ main: { // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z i - // [5] phi (byte*) nxt#13 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [5] phi (byte*) nxt#13 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -355,7 +351,7 @@ main: { // [8] (byte~) main::$0 ← (byte) next_char::return#0 -- vbuz1=vbuz2 lda.z next_char.return sta.z _0 - // [9] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [9] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _0 ldy.z i sta SCREEN,y @@ -388,13 +384,13 @@ next_char: { jmp b2 // next_char::@2 b2: - // [15] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuz1=_deref_pbuc1 + // [15] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuz1=_deref_pbuc1 lda TEXT sta.z c // [16] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] b1_from_b2: // [16] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [16] phi (byte*) nxt#10 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) nxt#10 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -475,7 +471,7 @@ main: { b1_from_main: // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (byte*) nxt#13 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [5] phi (byte*) nxt#13 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -496,7 +492,7 @@ main: { // main::@2 b2: // [8] (byte~) main::$0 ← (byte) next_char::return#0 - // [9] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa + // [9] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx inx @@ -522,12 +518,12 @@ next_char: { jmp b2 // next_char::@2 b2: - // [15] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuyy=_deref_pbuc1 + // [15] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuyy=_deref_pbuc1 ldy TEXT // [16] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] b1_from_b2: // [16] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [16] phi (byte*) nxt#10 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) nxt#10 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -595,15 +591,13 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "cml " +(const byte*) TEXT TEXT = (string) "cml " (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.6000000000000005 @@ -653,7 +647,7 @@ main: { // [5] phi from main to main::@1 [phi:main->main::@1] // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (byte*) nxt#13 = (const byte*) TEXT#0 [phi:main->main::@1#1] -- pbuz1=pbuc1 + // [5] phi (byte*) nxt#13 = (const byte*) TEXT [phi:main->main::@1#1] -- pbuz1=pbuc1 lda #TEXT @@ -671,7 +665,7 @@ main: { // main::@2 // [8] (byte~) main::$0 ← (byte) next_char::return#0 // SCREEN[i] = next_char() - // [9] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa + // [9] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // for( byte i: 0..255) // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -698,11 +692,11 @@ next_char: { bne b1 // next_char::@2 // c = *nxt - // [15] (byte) next_char::c#1 ← *((const byte*) TEXT#0) -- vbuyy=_deref_pbuc1 + // [15] (byte) next_char::c#1 ← *((const byte*) TEXT) -- vbuyy=_deref_pbuc1 ldy TEXT // [16] phi from next_char::@2 to next_char::@1 [phi:next_char::@2->next_char::@1] // [16] phi (byte) next_char::return#1 = (byte) next_char::c#1 [phi:next_char::@2->next_char::@1#0] -- register_copy - // [16] phi (byte*) nxt#10 = (const byte*) TEXT#0 [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 + // [16] phi (byte*) nxt#10 = (const byte*) TEXT [phi:next_char::@2->next_char::@1#1] -- pbuz1=pbuc1 lda #TEXT diff --git a/src/test/ref/scrollbig-clobber.sym b/src/test/ref/scrollbig-clobber.sym index 0c8b48f34..a84d2a4ed 100644 --- a/src/test/ref/scrollbig-clobber.sym +++ b/src/test/ref/scrollbig-clobber.sym @@ -1,15 +1,13 @@ (label) @1 (label) @begin (label) @end -(byte*) TEXT -(const byte*) TEXT#0 TEXT = (string) "cml " +(const byte*) TEXT TEXT = (string) "cml " (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 (label) main::@2 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 6.6000000000000005 diff --git a/src/test/ref/sieve-min.cfg b/src/test/ref/sieve-min.cfg index 51f86cc76..e173a47cc 100644 --- a/src/test/ref/sieve-min.cfg +++ b/src/test/ref/sieve-min.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 [5] call memset to:main::@1 main::@1: scope:[main] from main main::@3 - [6] (byte*) main::sieve_i#2 ← phi( main/(const byte*) sieve#0+(byte) 2 main::@3/(byte*) main::sieve_i#1 ) + [6] (byte*) main::sieve_i#2 ← phi( main/(const byte*) sieve+(byte) 2 main::@3/(byte*) main::sieve_i#1 ) [6] (word) main::i#12 ← phi( main/(byte) 2 main::@3/(word) main::i#2 ) [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 to:main::@7 @@ -27,7 +27,7 @@ main::@11: scope:[main] from main::@11 main::@7 [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) to:main::@11 main::@8: scope:[main] from main::@7 - [11] (byte*~) main::$19 ← (const byte*) sieve#0 + (word) main::i#10 + [11] (byte*~) main::$19 ← (const byte*) sieve + (word) main::i#10 [12] if((byte) 0!=*((byte*~) main::$19)) goto main::@9 to:main::@10 main::@10: scope:[main] from main::@8 @@ -47,7 +47,7 @@ main::@2: scope:[main] from main::@1 to:main::@6 main::@6: scope:[main] from main::@2 [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 - [21] (byte*) main::s#0 ← (const byte*) sieve#0 + (word) main::j#0 + [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 to:main::@4 main::@4: scope:[main] from main::@5 main::@6 [22] (byte*) main::s#2 ← phi( main::@6/(byte*) main::s#0 main::@5/(byte*) main::s#1 ) diff --git a/src/test/ref/sieve-min.log b/src/test/ref/sieve-min.log index d19b44051..f580a3e2d 100644 --- a/src/test/ref/sieve-min.log +++ b/src/test/ref/sieve-min.log @@ -208,13 +208,13 @@ print_char::@return: scope:[print_char] from print_char (byte*) SCREEN ← ((byte*)) (number) $400 (word) COUNT ← (number) $4000 (byte) SQRT_COUNT ← (number) $80 - (byte*) sieve#0 ← ((byte*)) (number) $1000 + (byte*) sieve ← ((byte*)) (number) $1000 to:@51 (void()) main() main: scope:[main] from @51 (byte*) print_char_cursor#40 ← phi( @51/(byte*) print_char_cursor#29 ) - (void*) memset::str#0 ← (void*)(byte*) sieve#0 + (void*) memset::str#0 ← (void*)(byte*) sieve (byte) memset::c#0 ← (number) 0 (word) memset::num#0 ← (word) COUNT call memset @@ -223,7 +223,7 @@ main: scope:[main] from @51 main::@29: scope:[main] from main (byte*) print_char_cursor#38 ← phi( main/(byte*) print_char_cursor#40 ) (word) main::i#0 ← (number) 2 - (byte*~) main::$1 ← & *((byte*) sieve#0 + (word) main::i#0) + (byte*~) main::$1 ← & *((byte*) sieve + (word) main::i#0) (byte*) main::sieve_i#0 ← (byte*~) main::$1 to:main::@1 main::@1: scope:[main] from main::@29 main::@4 @@ -259,7 +259,7 @@ main::@13: scope:[main] from main::@2 (word) main::i#6 ← phi( main::@2/(word) main::i#12 ) (number~) main::$5 ← (word) main::i#6 * (number) 2 (word) main::j#0 ← (number~) main::$5 - (byte*~) main::$6 ← & *((byte*) sieve#0 + (word) main::j#0) + (byte*~) main::$6 ← & *((byte*) sieve + (word) main::j#0) (byte*) main::s#0 ← (byte*~) main::$6 to:main::@5 main::@5: scope:[main] from main::@13 main::@6 @@ -290,7 +290,7 @@ main::@15: scope:[main] from main::@18 main::@3 main::@16: scope:[main] from main::@15 (byte*) print_char_cursor#30 ← phi( main::@15/(byte*) print_char_cursor#31 ) (word) main::i#9 ← phi( main::@15/(word) main::i#8 ) - (bool~) main::$18 ← (number) 0 != *((byte*) sieve#0 + (word) main::i#9) + (bool~) main::$18 ← (number) 0 != *((byte*) sieve + (word) main::i#9) (bool~) main::$9 ← ! (bool~) main::$18 (bool~) main::$10 ← ! (bool~) main::$9 if((bool~) main::$10) goto main::@18 @@ -547,7 +547,6 @@ SYMBOL TABLE SSA (word) print_word::w#1 (word) print_word::w#2 (byte*) sieve -(byte*) sieve#0 Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (number) 4 @@ -563,7 +562,7 @@ Adding number conversion cast (unumber) 2 in (number~) main::$5 ← (word) main: Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (word) main::i#6 * (unumber)(number) 2 Adding number conversion cast (unumber) 1 in *((byte*) main::s#2) ← (number) 1 Adding number conversion cast (unumber) $4c7 in (bool~) main::$8 ← (word) main::i#8 < (number) $4c7 -Adding number conversion cast (unumber) 0 in (bool~) main::$18 ← (number) 0 != *((byte*) sieve#0 + (word) main::i#9) +Adding number conversion cast (unumber) 0 in (bool~) main::$18 ← (number) 0 != *((byte*) sieve + (word) main::i#9) Adding number conversion cast (unumber) $3e7 in (byte*~) main::$16 ← (byte*) SCREEN + (number) $3e7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 @@ -572,7 +571,7 @@ Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (word) COUNT ← (unumber)(number) $4000 Inlining cast (byte) SQRT_COUNT ← (unumber)(number) $80 -Inlining cast (byte*) sieve#0 ← (byte*)(number) $1000 +Inlining cast (byte*) sieve ← (byte*)(number) $1000 Inlining cast (byte) memset::c#0 ← (unumber)(number) 0 Inlining cast (word) main::i#0 ← (unumber)(number) 2 Inlining cast (word) main::i#1 ← (unumber)(number) 2 @@ -616,8 +615,8 @@ Inferred type updated to word in (unumber~) main::$5 ← (word) main::i#6 * (byt Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0 Inversing boolean not [79] (bool~) main::$3 ← (byte) 0 == *((byte*) main::sieve_i#2) from [78] (bool~) main::$17 ← (byte) 0 != *((byte*) main::sieve_i#2) Inversing boolean not [80] (bool~) main::$4 ← (byte) 0 != *((byte*) main::sieve_i#2) from [79] (bool~) main::$3 ← (byte) 0 == *((byte*) main::sieve_i#2) -Inversing boolean not [104] (bool~) main::$9 ← (byte) 0 == *((byte*) sieve#0 + (word) main::i#9) from [103] (bool~) main::$18 ← (byte) 0 != *((byte*) sieve#0 + (word) main::i#9) -Inversing boolean not [105] (bool~) main::$10 ← (byte) 0 != *((byte*) sieve#0 + (word) main::i#9) from [104] (bool~) main::$9 ← (byte) 0 == *((byte*) sieve#0 + (word) main::i#9) +Inversing boolean not [104] (bool~) main::$9 ← (byte) 0 == *((byte*) sieve + (word) main::i#9) from [103] (bool~) main::$18 ← (byte) 0 != *((byte*) sieve + (word) main::i#9) +Inversing boolean not [105] (bool~) main::$10 ← (byte) 0 != *((byte*) sieve + (word) main::i#9) from [104] (bool~) main::$9 ← (byte) 0 == *((byte*) sieve + (word) main::i#9) Successful SSA optimization Pass2UnaryNotSimplification Alias (void*) memset::return#0 = (void*) memset::str#1 (void*) memset::return#3 (void*) memset::return#1 Alias (void*) memset::str#2 = (void*) memset::str#3 @@ -693,17 +692,17 @@ Simple Condition (bool~) main::$2 [76] if((word) main::i#12<(byte) SQRT_COUNT) g Simple Condition (bool~) main::$4 [81] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@4 Simple Condition (bool~) main::$7 [94] if((word) main::j#2<(word) COUNT) goto main::@6 Simple Condition (bool~) main::$8 [101] if((word) main::i#10<(word) $4c7) goto main::@16 -Simple Condition (bool~) main::$10 [106] if((byte) 0!=*((byte*) sieve#0 + (word) main::i#10)) goto main::@18 +Simple Condition (bool~) main::$10 [106] if((byte) 0!=*((byte*) sieve + (word) main::i#10)) goto main::@18 Successful SSA optimization Pass2ConditionalJumpSimplification -Rewriting array member address-of to pointer addition [72] (byte*) main::sieve_i#0 ← (byte*) sieve#0 + (word) main::i#0 -Rewriting array member address-of to pointer addition [90] (byte*) main::s#0 ← (byte*) sieve#0 + (word) main::j#0 +Rewriting array member address-of to pointer addition [72] (byte*) main::sieve_i#0 ← (byte*) sieve + (word) main::i#0 +Rewriting array member address-of to pointer addition [90] (byte*) main::s#0 ← (byte*) sieve + (word) main::j#0 Successful SSA optimization PassNArrayElementAddressOfRewriting Constant (const byte*) print_char_cursor#0 = (byte*) 1024 Constant (const byte[]) print_hextab = $1 Constant (const byte*) SCREEN = (byte*) 1024 Constant (const word) COUNT = $4000 Constant (const byte) SQRT_COUNT = $80 -Constant (const byte*) sieve#0 = (byte*) 4096 +Constant (const byte*) sieve = (byte*) 4096 Constant (const byte) memset::c#0 = 0 Constant (const word) main::i#0 = 2 Constant (const word) main::i#1 = 2 @@ -711,22 +710,22 @@ Constant (const byte) print_char::ch#2 = ' ' Successful SSA optimization Pass2ConstantIdentification Constant (const word) memset::num#0 = COUNT Successful SSA optimization Pass2ConstantIdentification -Constant value identified (void*)sieve#0 in [65] (void*) memset::str#0 ← (void*)(const byte*) sieve#0 +Constant value identified (void*)sieve in [65] (void*) memset::str#0 ← (void*)(const byte*) sieve Successful SSA optimization Pass2ConstantValues if() condition always false - eliminating [3] if((const word) memset::num#0<=(byte) 0) goto memset::@1 if() condition always true - replacing block destination [119] if(true) goto main::@24 Successful SSA optimization Pass2ConstantIfs -De-inlining pointer[w] to *(pointer+w) [106] if((byte) 0!=*((const byte*) sieve#0 + (word) main::i#10)) goto main::@18 +De-inlining pointer[w] to *(pointer+w) [106] if((byte) 0!=*((const byte*) sieve + (word) main::i#10)) goto main::@18 Successful SSA optimization Pass2DeInlineWordDerefIdx Eliminating unused variable (void*) memset::return#2 and assignment [27] (void*) memset::return#2 ← (void*) memset::str#0 Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks -Constant right-side identified [27] (byte*) main::sieve_i#0 ← (const byte*) sieve#0 + (const word) main::i#0 +Constant right-side identified [27] (byte*) main::sieve_i#0 ← (const byte*) sieve + (const word) main::i#0 Constant right-side identified [49] (byte*~) main::$16 ← (const byte*) SCREEN + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const void*) memset::str#0 = (void*)sieve#0 -Constant (const byte*) main::sieve_i#0 = sieve#0+main::i#0 +Constant (const void*) memset::str#0 = (void*)sieve +Constant (const byte*) main::sieve_i#0 = sieve+main::i#0 Constant (const byte*) main::$16 = SCREEN+$3e7 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte*)memset::str#0 in [0] (byte*~) memset::$2 ← (byte*)(const void*) memset::str#0 @@ -756,7 +755,7 @@ Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 Constant inlined memset::num#0 = (const word) COUNT Constant inlined main::i#1 = (byte) 2 Constant inlined $1 = (const byte[]) print_hextab -Constant inlined main::sieve_i#0 = (const byte*) sieve#0+(byte) 2 +Constant inlined main::sieve_i#0 = (const byte*) sieve+(byte) 2 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@32(between main::@16 and main::@18) Adding NOP phi() at start of @begin @@ -853,7 +852,7 @@ main: scope:[main] from @1 [5] call memset to:main::@1 main::@1: scope:[main] from main main::@3 - [6] (byte*) main::sieve_i#2 ← phi( main/(const byte*) sieve#0+(byte) 2 main::@3/(byte*) main::sieve_i#1 ) + [6] (byte*) main::sieve_i#2 ← phi( main/(const byte*) sieve+(byte) 2 main::@3/(byte*) main::sieve_i#1 ) [6] (word) main::i#12 ← phi( main/(byte) 2 main::@3/(word) main::i#2 ) [7] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 to:main::@7 @@ -866,7 +865,7 @@ main::@11: scope:[main] from main::@11 main::@7 [10] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) to:main::@11 main::@8: scope:[main] from main::@7 - [11] (byte*~) main::$19 ← (const byte*) sieve#0 + (word) main::i#10 + [11] (byte*~) main::$19 ← (const byte*) sieve + (word) main::i#10 [12] if((byte) 0!=*((byte*~) main::$19)) goto main::@9 to:main::@10 main::@10: scope:[main] from main::@8 @@ -886,7 +885,7 @@ main::@2: scope:[main] from main::@1 to:main::@6 main::@6: scope:[main] from main::@2 [20] (word) main::j#0 ← (word) main::i#12 << (byte) 1 - [21] (byte*) main::s#0 ← (const byte*) sieve#0 + (word) main::j#0 + [21] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 to:main::@4 main::@4: scope:[main] from main::@5 main::@6 [22] (byte*) main::s#2 ← phi( main::@6/(byte*) main::s#0 main::@5/(byte*) main::s#1 ) @@ -1012,7 +1011,6 @@ VARIABLE REGISTER WEIGHTS (void()) print_word((word) print_word::w) (word) print_word::w (word) print_word::w#0 5.0 -(byte*) sieve Initial phi equivalence classes [ main::i#12 main::i#2 ] @@ -1102,7 +1100,7 @@ main: { jsr memset // [6] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -1156,7 +1154,7 @@ main: { jmp b11 // main::@8 b8: - // [11] (byte*~) main::$19 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [11] (byte*~) main::$19 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc #main::@1] b1_from_main: - // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -1620,7 +1618,7 @@ main: { jmp b11 // main::@8 b8: - // [11] (byte*~) main::$19 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [11] (byte*~) main::$19 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc #memset] jsr memset // [6] phi from main to main::@1 [phi:main->main::@1] - // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 + // [6] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -2141,7 +2138,7 @@ main: { // main::@8 b8: // if (!sieve[i]) - // [11] (byte*~) main::$19 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [11] (byte*~) main::$19 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc #= (word) divr16u::divisor#2 Inversing boolean not [432] (bool~) main::$23 ← (byte) 0 == *((byte*) main::sieve_i#2) from [431] (bool~) main::$37 ← (byte) 0 != *((byte*) main::sieve_i#2) Inversing boolean not [433] (bool~) main::$24 ← (byte) 0 != *((byte*) main::sieve_i#2) from [432] (bool~) main::$23 ← (byte) 0 == *((byte*) main::sieve_i#2) -Inversing boolean not [494] (bool~) main::$29 ← (byte) 0 == *((byte*) sieve#0 + (word) main::i#9) from [493] (bool~) main::$38 ← (byte) 0 != *((byte*) sieve#0 + (word) main::i#9) -Inversing boolean not [495] (bool~) main::$30 ← (byte) 0 != *((byte*) sieve#0 + (word) main::i#9) from [494] (bool~) main::$29 ← (byte) 0 == *((byte*) sieve#0 + (word) main::i#9) +Inversing boolean not [494] (bool~) main::$29 ← (byte) 0 == *((byte*) sieve + (word) main::i#9) from [493] (bool~) main::$38 ← (byte) 0 != *((byte*) sieve + (word) main::i#9) +Inversing boolean not [495] (bool~) main::$30 ← (byte) 0 != *((byte*) sieve + (word) main::i#9) from [494] (bool~) main::$29 ← (byte) 0 == *((byte*) sieve + (word) main::i#9) Successful SSA optimization Pass2UnaryNotSimplification Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1 Alias (void*) memset::str#3 = (void*) memset::str#4 @@ -2801,7 +2800,7 @@ Simple Condition (bool~) main::$22 [429] if((word) main::i#12<(byte) SQRT_COUNT) Simple Condition (bool~) main::$24 [434] if((byte) 0!=*((byte*) main::sieve_i#2)) goto main::@4 Simple Condition (bool~) main::$27 [484] if((word) main::j#2<(word) COUNT) goto main::@6 Simple Condition (bool~) main::$28 [491] if((word) main::i#10<(word) $514) goto main::@16 -Simple Condition (bool~) main::$30 [496] if((byte) 0!=*((byte*) sieve#0 + (word) main::i#10)) goto main::@18 +Simple Condition (bool~) main::$30 [496] if((byte) 0!=*((byte*) sieve + (word) main::i#10)) goto main::@18 Successful SSA optimization Pass2ConditionalJumpSimplification Rewriting ! if()-condition to reversed if() [172] (bool~) utoa::$9 ← ! (bool~) utoa::$8 Rewriting || if()-condition to two if()s [171] (bool~) utoa::$8 ← (byte) utoa::started#2 || (bool~) utoa::$7 @@ -2810,8 +2809,8 @@ Rewriting || if()-condition to two if()s [257] (bool~) ultoa::$8 ← (byte) ulto Successful SSA optimization Pass2ConditionalAndOrRewriting Warning! Adding boolean cast to non-boolean condition (byte) utoa::started#2 Warning! Adding boolean cast to non-boolean condition (byte) ultoa::started#2 -Rewriting array member address-of to pointer addition [425] (byte*) main::sieve_i#0 ← (byte*) sieve#0 + (word) main::i#0 -Rewriting array member address-of to pointer addition [480] (byte*) main::s#0 ← (byte*) sieve#0 + (word) main::j#0 +Rewriting array member address-of to pointer addition [425] (byte*) main::sieve_i#0 ← (byte*) sieve + (word) main::i#0 +Rewriting array member address-of to pointer addition [480] (byte*) main::s#0 ← (byte*) sieve + (word) main::j#0 Successful SSA optimization PassNArrayElementAddressOfRewriting Constant right-side identified [320] (byte[6]) decimal_digits ← { fill( 6, 0) } Constant right-side identified [335] (byte[$b]) decimal_digits_long ← { fill( $b, 0) } @@ -2880,7 +2879,7 @@ Constant (const word) memset::num#0 = $3e8 Constant (const byte*) SCREEN = (byte*) 1024 Constant (const word) COUNT = $4000 Constant (const byte) SQRT_COUNT = $80 -Constant (const byte*) sieve#0 = (byte*) 4096 +Constant (const byte*) sieve = (byte*) 4096 Constant (const byte*) main::toD0181_gfx#0 = (byte*) 6144 Constant (const byte*) print_str::str#3 = main::str Constant (const byte*) print_str::str#4 = main::str1 @@ -2911,7 +2910,7 @@ Successful SSA optimization Pass2ConstantIdentification Constant value identified (void*)print_line_cursor#0 in [356] (void*) memset::str#0 ← (void*)(const byte*) print_line_cursor#0 Constant value identified (word)main::toD0181_screen#0 in [377] (word~) main::toD0181_$0 ← (word)(const byte*) main::toD0181_screen#0 Constant value identified (word)main::toD0181_gfx#0 in [381] (word~) main::toD0181_$4 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (void*)sieve#0 in [416] (void*) memset::str#1 ← (void*)(const byte*) sieve#0 +Constant value identified (void*)sieve in [416] (void*) memset::str#1 ← (void*)(const byte*) sieve Successful SSA optimization Pass2ConstantValues if() condition always true - replacing block destination [129] if((const byte) utoa::radix#0==(const byte) DECIMAL) goto utoa::@1 if() condition always false - eliminating [135] if((const byte) utoa::radix#0==(const byte) HEXADECIMAL) goto utoa::@2 @@ -2925,7 +2924,7 @@ if() condition always true - replacing block destination [514] if(true) goto mai Successful SSA optimization Pass2ConstantIfs Resolved ranged next value [77] divr16u::i#1 ← ++ divr16u::i#2 to ++ Resolved ranged comparison value [79] if(divr16u::i#1!=rangelast(0,$f)) goto divr16u::@1 to (number) $10 -De-inlining pointer[w] to *(pointer+w) [496] if((byte) 0!=*((const byte*) sieve#0 + (word) main::i#10)) goto main::@18 +De-inlining pointer[w] to *(pointer+w) [496] if((byte) 0!=*((const byte*) sieve + (word) main::i#10)) goto main::@18 Successful SSA optimization Pass2DeInlineWordDerefIdx Simplifying expression containing zero CIA_TIMER_CONTROL_CONTINUOUS in [39] (byte~) clock_start::$0 ← (const byte) CIA_TIMER_CONTROL_STOP | (const byte) CIA_TIMER_CONTROL_CONTINUOUS Simplifying expression containing zero clock_start::$0 in [40] (byte~) clock_start::$1 ← (byte~) clock_start::$0 | (const byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES @@ -3011,7 +3010,7 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [10] (dword) CLOCKS_PER_SEC ← (const word) CLOCKS_PER_FRAME * (const byte) FRAMES_PER_SEC Constant right-side identified [61] (byte~) utoa::$5 ← (const byte) utoa::max_digits#1 - (byte) 1 Constant right-side identified [90] (byte~) ultoa::$5 ← (const byte) ultoa::max_digits#1 - (byte) 1 -Constant right-side identified [162] (byte*) main::sieve_i#0 ← (const byte*) sieve#0 + (const word) main::i#0 +Constant right-side identified [162] (byte*) main::sieve_i#0 ← (const byte*) sieve + (const word) main::i#0 Constant right-side identified [203] (byte*~) main::$36 ← (const byte*) SCREEN + (word) $3e7 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const dword) CLOCKS_PER_SEC = CLOCKS_PER_FRAME*FRAMES_PER_SEC @@ -3022,8 +3021,8 @@ Constant (const byte) ultoa::$5 = ultoa::max_digits#1-1 Constant (const void*) memset::str#0 = (void*)print_line_cursor#0 Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 -Constant (const void*) memset::str#1 = (void*)sieve#0 -Constant (const byte*) main::sieve_i#0 = sieve#0+main::i#0 +Constant (const void*) memset::str#1 = (void*)sieve +Constant (const byte*) main::sieve_i#0 = sieve+main::i#0 Constant (const byte*) main::$36 = SCREEN+$3e7 Successful SSA optimization Pass2ConstantIdentification Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [17] (byte~) clock_start::$3 ← (const byte) clock_start::$1 | (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A @@ -3166,14 +3165,14 @@ Constant inlined main::i#1 = (byte) 2 Constant inlined divr16u::divisor#1 = (const word) div32u16u::divisor#0 Constant inlined divr16u::divisor#0 = (const word) div32u16u::divisor#0 Constant inlined print_word_decimal::w#0 = (const word) COUNT -Constant inlined memset::str#1 = (void*)(const byte*) sieve#0 +Constant inlined memset::str#1 = (void*)(const byte*) sieve Constant inlined memset::str#0 = (void*)(byte*) 1024 Constant inlined utoa::started#1 = (byte) 1 Constant inlined utoa::started#0 = (byte) 0 Constant inlined clock_start::$1 = (const byte) CIA_TIMER_CONTROL_CONTINUOUS Constant inlined ultoa_append::digit#0 = (byte) 0 Constant inlined ultoa::digit_values#1 = (const dword[]) RADIX_DECIMAL_VALUES_LONG -Constant inlined main::sieve_i#0 = (const byte*) sieve#0+(byte) 2 +Constant inlined main::sieve_i#0 = (const byte*) sieve+(byte) 2 Successful SSA optimization Pass2ConstantInlining Identical Phi Values (word) divr16u::divisor#6 (const word) div32u16u::divisor#0 Successful SSA optimization Pass2IdenticalPhiElimination @@ -3454,7 +3453,7 @@ main::@21: scope:[main] from main::@20 [21] call clock_start to:main::@1 main::@1: scope:[main] from main::@21 main::@4 - [22] (byte*) main::sieve_i#2 ← phi( main::@21/(const byte*) sieve#0+(byte) 2 main::@4/(byte*) main::sieve_i#1 ) + [22] (byte*) main::sieve_i#2 ← phi( main::@21/(const byte*) sieve+(byte) 2 main::@4/(byte*) main::sieve_i#1 ) [22] (word) main::i#12 ← phi( main::@21/(byte) 2 main::@4/(word) main::i#2 ) [23] if((word) main::i#12<(const byte) SQRT_COUNT) goto main::@2 to:main::@3 @@ -3505,7 +3504,7 @@ main::@13: scope:[main] from main::@10 main::@13 [48] *((const byte*) SCREEN+(word) $3e7) ← ++ *((const byte*) SCREEN+(word) $3e7) to:main::@13 main::@9: scope:[main] from main::@8 - [49] (byte*~) main::$39 ← (const byte*) sieve#0 + (word) main::i#10 + [49] (byte*~) main::$39 ← (const byte*) sieve + (word) main::i#10 [50] if((byte) 0!=*((byte*~) main::$39)) goto main::@11 to:main::@12 main::@12: scope:[main] from main::@9 @@ -3526,7 +3525,7 @@ main::@2: scope:[main] from main::@1 to:main::@7 main::@7: scope:[main] from main::@2 [59] (word) main::j#0 ← (word) main::i#12 << (byte) 1 - [60] (byte*) main::s#0 ← (const byte*) sieve#0 + (word) main::j#0 + [60] (byte*) main::s#0 ← (const byte*) sieve + (word) main::j#0 to:main::@5 main::@5: scope:[main] from main::@6 main::@7 [61] (byte*) main::s#2 ← phi( main::@7/(byte*) main::s#0 main::@6/(byte*) main::s#1 ) @@ -3829,7 +3828,7 @@ clock_start::@return: scope:[clock_start] from clock_start (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) memset: scope:[memset] from main::@20 print_cls [187] (byte) memset::c#4 ← phi( main::@20/(byte) 0 print_cls/(byte) ' ' ) - [187] (void*) memset::str#3 ← phi( main::@20/(void*)(const byte*) sieve#0 print_cls/(void*)(byte*) 1024 ) + [187] (void*) memset::str#3 ← phi( main::@20/(void*)(const byte*) sieve print_cls/(void*)(byte*) 1024 ) [187] (word) memset::num#2 ← phi( main::@20/(const word) COUNT print_cls/(word) $3e8 ) [188] if((word) memset::num#2<=(byte) 0) goto memset::@return to:memset::@1 @@ -3984,7 +3983,6 @@ VARIABLE REGISTER WEIGHTS (word) print_word_decimal::w#3 15.0 (word) rem16u (word) rem16u#1 0.6666666666666666 -(byte*) sieve (void()) ultoa((dword) ultoa::value , (byte*) ultoa::buffer , (byte) ultoa::radix) (byte~) ultoa::$11 22.0 (byte~) ultoa::$4 4.0 @@ -4427,7 +4425,7 @@ main: { // [187] phi (byte) memset::c#4 = (byte) 0 [phi:main::@20->memset#0] -- vbuz1=vbuc1 lda #0 sta.z memset.c - // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve#0 [phi:main::@20->memset#1] -- pvoz1=pvoc1 + // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve [phi:main::@20->memset#1] -- pvoz1=pvoc1 lda #sieve @@ -4447,7 +4445,7 @@ main: { jsr clock_start // [22] phi from main::@21 to main::@1 [phi:main::@21->main::@1] b1_from_b21: - // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 + // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -4662,7 +4660,7 @@ main: { jmp b13 // main::@9 b9: - // [49] (byte*~) main::$39 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [49] (byte*~) main::$39 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc #memset#0] -- vbuxx=vbuc1 ldx #0 - // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve#0 [phi:main::@20->memset#1] -- pvoz1=pvoc1 + // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve [phi:main::@20->memset#1] -- pvoz1=pvoc1 lda #sieve @@ -6383,7 +6381,7 @@ main: { jsr clock_start // [22] phi from main::@21 to main::@1 [phi:main::@21->main::@1] b1_from_b21: - // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 + // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -6546,7 +6544,7 @@ main: { jmp b13 // main::@9 b9: - // [49] (byte*~) main::$39 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [49] (byte*~) main::$39 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc #memset] // [187] phi (byte) memset::c#4 = (byte) 0 [phi:main::@20->memset#0] -- vbuxx=vbuc1 ldx #0 - // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve#0 [phi:main::@20->memset#1] -- pvoz1=pvoc1 + // [187] phi (void*) memset::str#3 = (void*)(const byte*) sieve [phi:main::@20->memset#1] -- pvoz1=pvoc1 lda #sieve @@ -8325,7 +8322,7 @@ main: { // [21] call clock_start jsr clock_start // [22] phi from main::@21 to main::@1 [phi:main::@21->main::@1] - // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve#0+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 + // [22] phi (byte*) main::sieve_i#2 = (const byte*) sieve+(byte) 2 [phi:main::@21->main::@1#0] -- pbuz1=pbuc1 lda #sieve+2 @@ -8478,7 +8475,7 @@ main: { // main::@9 b9: // if (!sieve[i]) - // [49] (byte*~) main::$39 ← (const byte*) sieve#0 + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 + // [49] (byte*~) main::$39 ← (const byte*) sieve + (word) main::i#10 -- pbuz1=pbuc1_plus_vwuz2 lda.z i_10 clc adc # (number) -$78 -Adding number conversion cast (unumber) $a in *((byte*) SCREEN#0 + (byte) debug::i#1) ← (number) $a +Adding number conversion cast (unumber) $a in *((byte*) SCREEN + (byte) debug::i#1) ← (number) $a Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte~) debug::$0 ← (byte)(signed byte) debug::dy#1 -Inlining cast *((byte*) SCREEN#0 + (byte) debug::i#1) ← (unumber)(number) $a +Inlining cast *((byte*) SCREEN + (byte) debug::i#1) ← (unumber)(number) $a Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast -$78 @@ -107,7 +106,7 @@ Simple Condition (bool~) main::$1 [7] if((signed byte) main::dy#1!=rangelast(-$8 Simple Condition (bool~) debug::$2 [15] if((signed byte) debug::dy#0<=(signed byte) -$78) goto debug::@return Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const signed byte) main::dy#0 = -$80 -Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [5] main::dy#1 ← ++ main::dy#2 to ++ Resolved ranged comparison value [7] if(main::dy#1!=rangelast(-$80,$7f)) goto main::@1 to (number) -$80 @@ -180,7 +179,7 @@ debug: scope:[debug] from main::@1 [11] if((signed byte) debug::dy#0<=(signed byte) -$78) goto debug::@return to:debug::@1 debug::@1: scope:[debug] from debug - [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a + [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a to:debug::@return debug::@return: scope:[debug] from debug debug::@1 [13] return @@ -188,7 +187,6 @@ debug::@return: scope:[debug] from debug debug::@1 VARIABLE REGISTER WEIGHTS -(byte*) SCREEN (void()) debug((signed byte) debug::dy) (signed byte) debug::dy (signed byte) debug::dy#0 6.5 @@ -284,7 +282,7 @@ debug: { jmp b1 // debug::@1 b1: - // [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuz1=vbuc2 + // [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuz1=vbuc2 lda #$a ldy.z dy sta SCREEN,y @@ -300,9 +298,9 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] if((signed byte) debug::dy#0<=(signed byte) -$78) goto debug::@return [ debug::dy#0 ] ( main:2::debug:7 [ main::dy#2 debug::dy#0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::dy#2 main::dy#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ debug::dy#0 ] -Statement [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a [ ] ( main:2::debug:7 [ main::dy#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a [ ] ( main:2::debug:7 [ main::dy#2 ] ) always clobbers reg byte a Statement [11] if((signed byte) debug::dy#0<=(signed byte) -$78) goto debug::@return [ debug::dy#0 ] ( main:2::debug:7 [ main::dy#2 debug::dy#0 ] ) always clobbers reg byte a -Statement [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a [ ] ( main:2::debug:7 [ main::dy#2 ] ) always clobbers reg byte a +Statement [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a [ ] ( main:2::debug:7 [ main::dy#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::dy#2 main::dy#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ debug::dy#0 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -386,7 +384,7 @@ debug: { jmp b1 // debug::@1 b1: - // [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuxx=vbuc2 + // [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuxx=vbuc2 lda #$a sta SCREEN,x jmp breturn @@ -431,8 +429,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) debug((signed byte) debug::dy) (label) debug::@1 (label) debug::@return @@ -510,7 +507,7 @@ debug: { bmi breturn // debug::@1 // SCREEN[i] = 10 - // [12] *((const byte*) SCREEN#0 + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuxx=vbuc2 + // [12] *((const byte*) SCREEN + (byte)(signed byte) debug::dy#0) ← (byte) $a -- pbuc1_derefidx_vbuxx=vbuc2 lda #$a sta SCREEN,x // debug::@return diff --git a/src/test/ref/signed-char-comparison.sym b/src/test/ref/signed-char-comparison.sym index 9371cadca..9ae878e3b 100644 --- a/src/test/ref/signed-char-comparison.sym +++ b/src/test/ref/signed-char-comparison.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) SCREEN SCREEN = (byte*) 1024 (void()) debug((signed byte) debug::dy) (label) debug::@1 (label) debug::@return diff --git a/src/test/ref/signed-word-minus-byte-2.cfg b/src/test/ref/signed-word-minus-byte-2.cfg index c1c902087..50acd5dbb 100644 --- a/src/test/ref/signed-word-minus-byte-2.cfg +++ b/src/test/ref/signed-word-minus-byte-2.cfg @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@1 [5] (signed word) main::w1#2 ← phi( main/(signed word) $4d2 main::@1/(signed word) main::w1#1 ) [6] (signed word) main::w1#1 ← (signed word) main::w1#2 - (signed byte) $29 [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 - [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 + [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/signed-word-minus-byte-2.log b/src/test/ref/signed-word-minus-byte-2.log index fbc6bd43f..15f169f74 100644 --- a/src/test/ref/signed-word-minus-byte-2.log +++ b/src/test/ref/signed-word-minus-byte-2.log @@ -9,7 +9,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (signed word) main::w1#0 ← (number) $4d2 - (signed word*) main::screen#0 ← ((signed word*)) (number) $400 + (signed word*) main::screen ← ((signed word*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -18,7 +18,7 @@ main::@1: scope:[main] from main main::@1 (number~) main::$0 ← (signed word) main::w1#2 - (number) $29 (signed word) main::w1#1 ← (number~) main::$0 (byte~) main::$2 ← (byte) main::i#2 * (const byte) SIZEOF_SIGNED_WORD - *((signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 + *((signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$1) goto main::@1 @@ -50,7 +50,6 @@ SYMBOL TABLE SSA (byte) main::i#1 (byte) main::i#2 (signed word*) main::screen -(signed word*) main::screen#0 (signed word) main::w1 (signed word) main::w1#0 (signed word) main::w1#1 @@ -61,7 +60,7 @@ Adding number conversion cast (snumber) $29 in (number~) main::$0 ← (signed wo Adding number conversion cast (snumber) main::$0 in (number~) main::$0 ← (signed word) main::w1#2 - (snumber)(number) $29 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (signed word) main::w1#0 ← (snumber)(number) $4d2 -Inlining cast (signed word*) main::screen#0 ← (signed word*)(number) $400 +Inlining cast (signed word*) main::screen ← (signed word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $4d2 Simplifying constant pointer cast (signed word*) 1024 @@ -76,7 +75,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$1 [10] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const signed word) main::w1#0 = $4d2 -Constant (const signed word*) main::screen#0 = (signed word*) 1024 +Constant (const signed word*) main::screen = (signed word*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [8] main::i#1 ← ++ main::i#2 to ++ @@ -136,7 +135,7 @@ main::@1: scope:[main] from main main::@1 [5] (signed word) main::w1#2 ← phi( main/(signed word) $4d2 main::@1/(signed word) main::w1#1 ) [6] (signed word) main::w1#1 ← (signed word) main::w1#2 - (signed byte) $29 [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 - [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 + [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return @@ -151,7 +150,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 8.25 -(signed word*) main::screen (signed word) main::w1 (signed word) main::w1#1 6.6000000000000005 (signed word) main::w1#2 22.0 @@ -229,7 +227,7 @@ main: { lda.z i asl sta.z _2 - // [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuz1=vwsz2 + // [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuz1=vwsz2 ldy.z _2 lda.z w1 sta screen,y @@ -253,10 +251,10 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (signed word) main::w1#1 ← (signed word) main::w1#2 - (signed byte) $29 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::i#2 main::i#1 ] Statement [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::w1#1 main::$2 ] ( main:2 [ main::i#2 main::w1#1 main::$2 ] ) always clobbers reg byte a -Statement [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a +Statement [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a Statement [6] (signed word) main::w1#1 ← (signed word) main::w1#2 - (signed byte) $29 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::w1#1 main::$2 ] ( main:2 [ main::i#2 main::w1#1 main::$2 ] ) always clobbers reg byte a -Statement [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a +Statement [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::w1#2 main::w1#1 ] : zp ZP_WORD:2 , Potential registers zp ZP_BYTE:4 [ main::i#2 main::i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:5 [ main::$2 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , @@ -324,7 +322,7 @@ main: { // [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuaa=vwsz1 + // [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z w1 sta screen,y @@ -379,8 +377,7 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 8.25 -(signed word*) main::screen -(const signed word*) main::screen#0 screen = (signed word*) 1024 +(const signed word*) main::screen screen = (signed word*) 1024 (signed word) main::w1 (signed word) main::w1#1 w1 zp ZP_WORD:2 6.6000000000000005 (signed word) main::w1#2 w1 zp ZP_WORD:2 22.0 @@ -437,7 +434,7 @@ main: { // [7] (byte~) main::$2 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [8] *((const signed word*) main::screen#0 + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuaa=vwsz1 + // [8] *((const signed word*) main::screen + (byte~) main::$2) ← (signed word) main::w1#1 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z w1 sta screen,y diff --git a/src/test/ref/signed-word-minus-byte-2.sym b/src/test/ref/signed-word-minus-byte-2.sym index 8032d114d..a03c05342 100644 --- a/src/test/ref/signed-word-minus-byte-2.sym +++ b/src/test/ref/signed-word-minus-byte-2.sym @@ -8,8 +8,7 @@ (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 8.25 -(signed word*) main::screen -(const signed word*) main::screen#0 screen = (signed word*) 1024 +(const signed word*) main::screen screen = (signed word*) 1024 (signed word) main::w1 (signed word) main::w1#1 w1 zp ZP_WORD:2 6.6000000000000005 (signed word) main::w1#2 w1 zp ZP_WORD:2 22.0 diff --git a/src/test/ref/sinusgen16.cfg b/src/test/ref/sinusgen16.cfg index 98c2f0f2a..b3b61dee5 100644 --- a/src/test/ref/sinusgen16.cfg +++ b/src/test/ref/sinusgen16.cfg @@ -20,7 +20,7 @@ main::@5: scope:[main] from main main::@1: scope:[main] from main::@5 main::@7 [8] (byte*) print_char_cursor#21 ← phi( main::@5/(const byte*) print_line_cursor#0 main::@7/(byte*) print_char_cursor#2 ) [8] (signed word*) main::st1#2 ← phi( main::@5/(const signed word[$78]) main::sintab1 main::@7/(signed word*) main::st1#1 ) - [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 + [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 [10] return @@ -167,7 +167,7 @@ sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@3 sin16s_gen::@4 [68] (signed word*) sin16s_gen::sintab#2 ← phi( sin16s_gen::@3/(const signed word[$78]) main::sintab1 sin16s_gen::@4/(signed word*) sin16s_gen::sintab#0 ) [68] (dword) sin16s_gen::x#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(dword) sin16s_gen::x#1 ) [68] (word) sin16s_gen::i#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(word) sin16s_gen::i#1 ) - [69] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 + [69] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 to:sin16s_gen::@return sin16s_gen::@return: scope:[sin16s_gen] from sin16s_gen::@1 [70] return @@ -343,11 +343,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [155] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [156] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1 [157] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 + [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [159] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 + [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [161] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) diff --git a/src/test/ref/sinusgen16.log b/src/test/ref/sinusgen16.log index c51468afe..90dc3ef69 100644 --- a/src/test/ref/sinusgen16.log +++ b/src/test/ref/sinusgen16.log @@ -712,10 +712,10 @@ main: scope:[main] from @57 (byte*) print_line_cursor#13 ← phi( @57/(byte*) print_line_cursor#12 ) (byte*) print_screen#4 ← phi( @57/(byte*) print_screen#5 ) (word) rem16u#23 ← phi( @57/(word) rem16u#25 ) - (word) main::wavelength#0 ← (number) $78 + (word) main::wavelength ← (number) $78 (signed word[$78]) main::sintab1 ← { fill( $78, 0) } (signed word*) sin16s_gen::sintab#1 ← (signed word[$78]) main::sintab1 - (word) sin16s_gen::wavelength#0 ← (word) main::wavelength#0 + (word) sin16s_gen::wavelength#0 ← (word) main::wavelength call sin16s_gen to:main::@9 main::@9: scope:[main] from main @@ -739,7 +739,7 @@ main::@1: scope:[main] from main::@10 main::@12 (byte*) print_line_cursor#11 ← phi( main::@10/(byte*) print_line_cursor#3 main::@12/(byte*) print_line_cursor#14 ) (word) rem16u#24 ← phi( main::@10/(word) rem16u#27 main::@12/(word) rem16u#28 ) (signed word*) main::st1#2 ← phi( main::@10/(signed word*) main::st1#0 main::@12/(signed word*) main::st1#1 ) - (word~) main::$9 ← (word) main::wavelength#0 * (const byte) SIZEOF_SIGNED_WORD + (word~) main::$9 ← (word) main::wavelength * (const byte) SIZEOF_SIGNED_WORD (signed word*~) main::$2 ← (signed word[$78]) main::sintab1 + (word~) main::$9 (bool~) main::$3 ← (signed word*) main::st1#2 < (signed word*~) main::$2 if((bool~) main::$3) goto main::@2 @@ -983,7 +983,6 @@ SYMBOL TABLE SSA (signed word) main::sw#2 (signed word) main::sw#3 (word) main::wavelength -(word) main::wavelength#0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (bool~) memset::$0 (bool~) memset::$1 @@ -1484,7 +1483,7 @@ Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) p Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (number) $f Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#3 & (unumber)(number) $f Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 -Adding number conversion cast (unumber) $78 in (word) main::wavelength#0 ← (number) $78 +Adding number conversion cast (unumber) $78 in (word) main::wavelength ← (number) $78 Adding number conversion cast (snumber) 0 in (bool~) main::$4 ← (signed word) main::sw#0 >= (number) 0 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (word) rem16u#0 ← (unumber)(number) 0 @@ -1511,7 +1510,7 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#4 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (word) main::wavelength#0 ← (unumber)(number) $78 +Inlining cast (word) main::wavelength ← (unumber)(number) $78 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant integer cast 0 @@ -1842,14 +1841,14 @@ Constant (const byte) print_char::ch#1 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const word) main::wavelength#0 = $78 +Constant (const word) main::wavelength = $78 Constant (const signed word[$78]) main::sintab1 = { fill( $78, 0) } Constant (const byte*) print_str::str#1 = main::str Constant (const byte*) print_str::str#2 = main::str1 Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 Constant (const signed word*) sin16s_gen::sintab#1 = main::sintab1 -Constant (const word) sin16s_gen::wavelength#0 = main::wavelength#0 +Constant (const word) sin16s_gen::wavelength#0 = main::wavelength Successful SSA optimization Pass2ConstantIdentification Constant (const word) div32u16u::divisor#0 = sin16s_gen::wavelength#0 Successful SSA optimization Pass2ConstantIdentification @@ -1873,12 +1872,12 @@ Finalized unsigned number type (byte) $10 Successful SSA optimization PassNFinalizeNumberTypeConversions Constant right-side identified [18] (word) divr16u::dividend#1 ← > (const dword) div32u16u::dividend#0 Constant right-side identified [22] (word) divr16u::dividend#2 ← < (const dword) div32u16u::dividend#0 -Constant right-side identified [148] (word~) main::$9 ← (const word) main::wavelength#0 * (const byte) SIZEOF_SIGNED_WORD +Constant right-side identified [148] (word~) main::$9 ← (const word) main::wavelength * (const byte) SIZEOF_SIGNED_WORD Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) divr16u::dividend#1 = >div32u16u::dividend#0 Constant (const word) divr16u::dividend#2 = (const dword) PI2_u4f28 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 Constant inlined sin16s_gen::sintab#1 = (const signed word[$78]) main::sintab1 -Constant inlined main::$2 = (const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD +Constant inlined main::$2 = (const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD Constant inlined print_char::ch#1 = (byte) ' ' Constant inlined mulu16_sel::v2#2 = (word)(number) $10000/(number) 6 Constant inlined print_char::ch#0 = (byte) '-' Constant inlined sin16s_gen::x#0 = (byte) 0 Constant inlined print_str::str#2 = (const string) main::str1 Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 -Constant inlined div32u16u::divisor#0 = (const word) main::wavelength#0 +Constant inlined div32u16u::divisor#0 = (const word) main::wavelength Constant inlined print_str::str#1 = (const string) main::str -Constant inlined main::$9 = (const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD +Constant inlined main::$9 = (const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD Successful SSA optimization Pass2ConstantInlining -Identical Phi Values (word) divr16u::divisor#6 (const word) main::wavelength#0 +Identical Phi Values (word) divr16u::divisor#6 (const word) main::wavelength Successful SSA optimization Pass2IdenticalPhiElimination Added new block during phi lifting divr16u::@8(between divr16u::@3 and divr16u::@1) Added new block during phi lifting divr16u::@9(between divr16u::@1 and divr16u::@2) @@ -2139,7 +2138,7 @@ main::@5: scope:[main] from main main::@1: scope:[main] from main::@5 main::@7 [8] (byte*) print_char_cursor#21 ← phi( main::@5/(const byte*) print_line_cursor#0 main::@7/(byte*) print_char_cursor#2 ) [8] (signed word*) main::st1#2 ← phi( main::@5/(const signed word[$78]) main::sintab1 main::@7/(signed word*) main::st1#1 ) - [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 + [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 [10] return @@ -2286,7 +2285,7 @@ sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@3 sin16s_gen::@4 [68] (signed word*) sin16s_gen::sintab#2 ← phi( sin16s_gen::@3/(const signed word[$78]) main::sintab1 sin16s_gen::@4/(signed word*) sin16s_gen::sintab#0 ) [68] (dword) sin16s_gen::x#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(dword) sin16s_gen::x#1 ) [68] (word) sin16s_gen::i#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(word) sin16s_gen::i#1 ) - [69] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 + [69] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 to:sin16s_gen::@return sin16s_gen::@return: scope:[sin16s_gen] from sin16s_gen::@1 [70] return @@ -2462,11 +2461,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [155] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [156] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1 [157] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 + [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [159] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 + [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [161] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) @@ -2528,7 +2527,6 @@ VARIABLE REGISTER WEIGHTS (signed word*) main::st1#2 4.0 (signed word) main::sw (signed word) main::sw#0 6.6000000000000005 -(word) main::wavelength (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c (byte*) memset::dst @@ -2918,7 +2916,7 @@ main: { jmp b1 // main::@1 b1: - // [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 -- pwsz1_lt_pwsc1_then_la1 + // [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 -- pwsz1_lt_pwsc1_then_la1 lda.z st1+1 cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD bcc b2 @@ -3333,7 +3331,7 @@ sin16s_gen: { // u[4.28] // sin16s_gen::@1 b1: - // [69] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 + // [69] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -4094,7 +4092,7 @@ divr16u: { // [157] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -4111,7 +4109,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc # (word) divr16u::dividend#3 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:52 [ divr16u::i#2 divr16u::i#1 ] Statement [154] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [164] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a -Statement [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 [ main::st1#2 print_char_cursor#21 ] ( main:2 [ main::st1#2 print_char_cursor#21 ] ) always clobbers reg byte a +Statement [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 [ main::st1#2 print_char_cursor#21 ] ( main:2 [ main::st1#2 print_char_cursor#21 ] ) always clobbers reg byte a Statement [11] (signed word) main::sw#0 ← *((signed word*) main::st1#2) [ main::st1#2 print_char_cursor#21 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#21 main::sw#0 ] ) always clobbers reg byte a reg byte y Statement [12] if((signed word) main::sw#0<(signed byte) 0) goto main::@3 [ main::st1#2 print_char_cursor#21 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#21 main::sw#0 ] ) always clobbers reg byte a Statement [16] (signed word) print_sword::w#1 ← (signed word) main::sw#0 [ main::st1#2 print_char_cursor#51 print_sword::w#1 ] ( main:2 [ main::st1#2 print_char_cursor#51 print_sword::w#1 ] ) always clobbers reg byte a @@ -4252,7 +4250,7 @@ Statement [60] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [62] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:7::memset:56 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [66] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:2::sin16s_gen:5 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [67] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen::step#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 ] ) always clobbers reg byte a -Statement [69] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [69] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a Statement [71] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ) always clobbers reg byte a Statement [73] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ) always clobbers reg byte a Statement [74] (signed word~) sin16s_gen::$2 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ) always clobbers reg byte a @@ -4306,8 +4304,8 @@ Statement [145] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3 [ d Statement [146] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0 [ div32u16u::return#0 ] ( main:2::sin16s_gen:5::div32u16u:65 [ div32u16u::return#0 ] ) always clobbers reg byte a Statement [151] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Statement [154] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [164] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_gen:5::div32u16u:65::divr16u:139 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:65::divr16u:143 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::st1#2 main::st1#1 ] : zp ZP_WORD:2 , Potential registers zp ZP_WORD:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] : zp ZP_WORD:4 , @@ -4525,7 +4523,7 @@ main: { jmp b1 // main::@1 b1: - // [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 -- pwsz1_lt_pwsc1_then_la1 + // [9] if((signed word*) main::st1#2<(const signed word[$78]) main::sintab1+(const word) main::wavelength*(const byte) SIZEOF_SIGNED_WORD) goto main::@2 -- pwsz1_lt_pwsc1_then_la1 lda.z st1+1 cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD bcc b2 @@ -4904,7 +4902,7 @@ sin16s_gen: { // u[4.28] // sin16s_gen::@1 b1: - // [69] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 + // [69] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -5527,7 +5525,7 @@ divr16u: { // [157] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -5544,7 +5542,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #sintab1+wavelength*SIZEOF_SIGNED_WORD bcc b2 @@ -6469,7 +6466,7 @@ sin16s_gen: { // sin16s_gen::@1 b1: // for( word i=0; imain.wavelength bcc b2 @@ -7079,7 +7076,7 @@ divr16u: { asl.z quotient rol.z quotient+1 // if(rem>=divisor) - // [158] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [158] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3 @@ -7096,7 +7093,7 @@ divr16u: { inc.z quotient+1 !: // rem = rem - divisor - // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [160] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #= (number) 0 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (word) rem16u#0 ← (unumber)(number) 0 @@ -1944,7 +1943,7 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#4 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (word) main::wavelength#0 ← (unumber)(number) $78 +Inlining cast (word) main::wavelength ← (unumber)(number) $78 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant integer cast 0 @@ -2378,7 +2377,7 @@ Constant (const byte) print_char::ch#1 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const word) main::wavelength#0 = $78 +Constant (const word) main::wavelength = $78 Constant (const signed word[$78]) main::sintab1 = { fill( $78, 0) } Constant (const signed word[$78]) main::sintab2 = { fill( $78, 0) } Constant (const byte) main::i#0 = 0 @@ -2388,9 +2387,9 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const dword) div32u16u::dividend#0 = PI2_u4f28 Constant (const dword) div32u16u::dividend#1 = PI2_u4f28 Constant (const signed word*) sin16s_gen::sintab#1 = main::sintab1 -Constant (const word) sin16s_gen::wavelength#0 = main::wavelength#0 +Constant (const word) sin16s_gen::wavelength#0 = main::wavelength Constant (const signed word*) sin16s_genb::sintab#1 = main::sintab2 -Constant (const word) sin16s_genb::wavelength#0 = main::wavelength#0 +Constant (const word) sin16s_genb::wavelength#0 = main::wavelength Successful SSA optimization Pass2ConstantIdentification Constant (const word) div32u16u::divisor#0 = sin16s_gen::wavelength#0 Constant (const word) div32u16u::divisor#1 = sin16s_genb::wavelength#0 @@ -2476,7 +2475,7 @@ Inlining constant with var siblings (const byte) main::i#0 Constant inlined divr16u::rem#3 = (byte) 0 Constant inlined divr16u::i#0 = (byte) 0 Constant inlined div32u16u::dividend#1 = (const dword) PI2_u4f28 -Constant inlined sin16s_gen::wavelength#0 = (const word) main::wavelength#0 +Constant inlined sin16s_gen::wavelength#0 = (const word) main::wavelength Constant inlined div32u16u::dividend#0 = (const dword) PI2_u4f28 Constant inlined sin16s::isUpper#0 = (byte) 0 Constant inlined mulu16_sel::v2#7 = (word)(number) $10000/(number) 6 @@ -2495,7 +2494,7 @@ Constant inlined sin16s_genb::sintab#1 = (const signed word[$78]) main::sintab2 Constant inlined main::i#0 = (byte) 0 Constant inlined sin16s_genb::x#0 = (byte) 0 Constant inlined sin16sb::isUpper#1 = (byte) 1 -Constant inlined sin16s_genb::wavelength#0 = (const word) main::wavelength#0 +Constant inlined sin16s_genb::wavelength#0 = (const word) main::wavelength Constant inlined sin16sb::isUpper#0 = (byte) 0 Constant inlined sin16s_gen::i#0 = (byte) 0 Constant inlined sin16s_genb::i#0 = (byte) 0 @@ -2508,33 +2507,33 @@ Constant inlined print_char::ch#1 = (byte) ' ' Constant inlined mulu16_sel::v2#2 = (word)(number) $10000/(number) 6 Constant inlined print_char::ch#0 = (byte) '-' Constant inlined sin16s_gen::x#0 = (byte) 0 -Constant inlined div32u16u::divisor#1 = (const word) main::wavelength#0 +Constant inlined div32u16u::divisor#1 = (const word) main::wavelength Constant inlined print_str::str#2 = (const string) main::str1 Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 -Constant inlined div32u16u::divisor#0 = (const word) main::wavelength#0 +Constant inlined div32u16u::divisor#0 = (const word) main::wavelength Constant inlined print_str::str#1 = (const string) main::str Successful SSA optimization Pass2ConstantInlining Identical Phi Values (dword) div32u16u::dividend#2 (const dword) PI2_u4f28 -Identical Phi Values (word) div32u16u::divisor#2 (const word) main::wavelength#0 +Identical Phi Values (word) div32u16u::divisor#2 (const word) main::wavelength Successful SSA optimization Pass2IdenticalPhiElimination Constant right-side identified [19] (word) divr16u::dividend#1 ← > (const dword) PI2_u4f28 Constant right-side identified [24] (word) divr16u::dividend#2 ← < (const dword) PI2_u4f28 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) divr16u::dividend#1 = >PI2_u4f28 -Constant (const word) divr16u::divisor#0 = main::wavelength#0 +Constant (const word) divr16u::divisor#0 = main::wavelength Constant (const word) divr16u::dividend#2 = (const dword) PI2_u4f28 -Constant inlined divr16u::divisor#0 = (const word) main::wavelength#0 +Constant inlined divr16u::divisor#0 = (const word) main::wavelength Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28 Successful SSA optimization Pass2ConstantInlining -Identical Phi Values (word) divr16u::divisor#6 (const word) main::wavelength#0 +Identical Phi Values (word) divr16u::divisor#6 (const word) main::wavelength Successful SSA optimization Pass2IdenticalPhiElimination Added new block during phi lifting divr16u::@8(between divr16u::@3 and divr16u::@1) Added new block during phi lifting divr16u::@9(between divr16u::@1 and divr16u::@2) @@ -2914,7 +2913,7 @@ sin16s_genb::@1: scope:[sin16s_genb] from sin16s_genb::@3 sin16s_genb::@4 [72] (signed word*) sin16s_genb::sintab#2 ← phi( sin16s_genb::@3/(const signed word[$78]) main::sintab2 sin16s_genb::@4/(signed word*) sin16s_genb::sintab#0 ) [72] (dword) sin16s_genb::x#2 ← phi( sin16s_genb::@3/(byte) 0 sin16s_genb::@4/(dword) sin16s_genb::x#1 ) [72] (word) sin16s_genb::i#2 ← phi( sin16s_genb::@3/(byte) 0 sin16s_genb::@4/(word) sin16s_genb::i#1 ) - [73] if((word) sin16s_genb::i#2<(const word) main::wavelength#0) goto sin16s_genb::@2 + [73] if((word) sin16s_genb::i#2<(const word) main::wavelength) goto sin16s_genb::@2 to:sin16s_genb::@return sin16s_genb::@return: scope:[sin16s_genb] from sin16s_genb::@1 [74] return @@ -3089,11 +3088,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [158] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [159] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte) 1 [160] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 + [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [162] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 + [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [164] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) @@ -3121,7 +3120,7 @@ sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@3 sin16s_gen::@4 [173] (signed word*) sin16s_gen::sintab#2 ← phi( sin16s_gen::@3/(const signed word[$78]) main::sintab1 sin16s_gen::@4/(signed word*) sin16s_gen::sintab#0 ) [173] (dword) sin16s_gen::x#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(dword) sin16s_gen::x#1 ) [173] (word) sin16s_gen::i#2 ← phi( sin16s_gen::@3/(byte) 0 sin16s_gen::@4/(word) sin16s_gen::i#1 ) - [174] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 + [174] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 to:sin16s_gen::@return sin16s_gen::@return: scope:[sin16s_gen] from sin16s_gen::@1 [175] return @@ -3264,7 +3263,6 @@ VARIABLE REGISTER WEIGHTS (signed word*) main::st2#2 3.0 (signed word) main::sw (signed word) main::sw#0 6.6000000000000005 -(word) main::wavelength (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c (byte*) memset::dst @@ -4239,7 +4237,7 @@ sin16s_genb: { // u[4.28] // sin16s_genb::@1 b1: - // [73] if((word) sin16s_genb::i#2<(const word) main::wavelength#0) goto sin16s_genb::@2 -- vwuz1_lt_vwuc1_then_la1 + // [73] if((word) sin16s_genb::i#2<(const word) main::wavelength) goto sin16s_genb::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -4962,7 +4960,7 @@ divr16u: { // [160] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -4979,7 +4977,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -5541,7 +5539,7 @@ Statement [64] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:9::memset:60 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [70] (dword) div32u16u::return#3 ← (dword) div32u16u::return#0 [ div32u16u::return#3 ] ( main:2::sin16s_genb:7 [ div32u16u::return#3 ] ) always clobbers reg byte a Statement [71] (dword) sin16s_genb::step#0 ← (dword) div32u16u::return#3 [ sin16s_genb::step#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 ] ) always clobbers reg byte a -Statement [73] if((word) sin16s_genb::i#2<(const word) main::wavelength#0) goto sin16s_genb::@2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ) always clobbers reg byte a +Statement [73] if((word) sin16s_genb::i#2<(const word) main::wavelength) goto sin16s_genb::@2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ) always clobbers reg byte a Statement [75] (word) sin16sb::x#0 ← > (dword) sin16s_genb::x#2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::x#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::x#0 ] ) always clobbers reg byte a Statement [77] (signed word) sin16sb::return#0 ← (signed word) sin16sb::return#1 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::return#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::return#0 ] ) always clobbers reg byte a Statement [78] (signed word~) sin16s_genb::$3 ← (signed word) sin16sb::return#0 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16s_genb::$3 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16s_genb::$3 ] ) always clobbers reg byte a @@ -5598,12 +5596,12 @@ Statement [149] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 Statement [154] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:53 [ divr16u::i#2 divr16u::i#1 ] Statement [157] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [167] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a Statement [171] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:2::sin16s_gen:5 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [172] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen::step#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 ] ) always clobbers reg byte a -Statement [174] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [174] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a Statement [176] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ) always clobbers reg byte a Statement [178] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ) always clobbers reg byte a Statement [179] (signed word~) sin16s_gen::$2 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ) always clobbers reg byte a @@ -5660,7 +5658,7 @@ Statement [64] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [66] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:9::memset:60 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [70] (dword) div32u16u::return#3 ← (dword) div32u16u::return#0 [ div32u16u::return#3 ] ( main:2::sin16s_genb:7 [ div32u16u::return#3 ] ) always clobbers reg byte a Statement [71] (dword) sin16s_genb::step#0 ← (dword) div32u16u::return#3 [ sin16s_genb::step#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 ] ) always clobbers reg byte a -Statement [73] if((word) sin16s_genb::i#2<(const word) main::wavelength#0) goto sin16s_genb::@2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ) always clobbers reg byte a +Statement [73] if((word) sin16s_genb::i#2<(const word) main::wavelength) goto sin16s_genb::@2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 ] ) always clobbers reg byte a Statement [75] (word) sin16sb::x#0 ← > (dword) sin16s_genb::x#2 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::x#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::x#0 ] ) always clobbers reg byte a Statement [77] (signed word) sin16sb::return#0 ← (signed word) sin16sb::return#1 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::return#0 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16sb::return#0 ] ) always clobbers reg byte a Statement [78] (signed word~) sin16s_genb::$3 ← (signed word) sin16sb::return#0 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16s_genb::$3 ] ( main:2::sin16s_genb:7 [ sin16s_genb::step#0 sin16s_genb::i#2 sin16s_genb::x#2 sin16s_genb::sintab#2 sin16s_genb::$3 ] ) always clobbers reg byte a @@ -5713,12 +5711,12 @@ Statement [148] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#3 [ d Statement [149] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0 [ div32u16u::return#0 ] ( main:2::sin16s_genb:7::div32u16u:69 [ div32u16u::return#0 ] main:2::sin16s_gen:5::div32u16u:170 [ div32u16u::return#0 ] ) always clobbers reg byte a Statement [154] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Statement [157] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::dividend#3 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [167] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_genb:7::div32u16u:69::divr16u:142 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:142 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_genb:7::div32u16u:69::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:5::div32u16u:170::divr16u:146 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a Statement [171] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:2::sin16s_gen:5 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [172] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen::step#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 ] ) always clobbers reg byte a -Statement [174] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [174] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a Statement [176] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ) always clobbers reg byte a Statement [178] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ) always clobbers reg byte a Statement [179] (signed word~) sin16s_gen::$2 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ) always clobbers reg byte a @@ -6438,7 +6436,7 @@ sin16s_genb: { // u[4.28] // sin16s_genb::@1 b1: - // [73] if((word) sin16s_genb::i#2<(const word) main::wavelength#0) goto sin16s_genb::@2 -- vwuz1_lt_vwuc1_then_la1 + // [73] if((word) sin16s_genb::i#2<(const word) main::wavelength) goto sin16s_genb::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -7021,7 +7019,7 @@ divr16u: { // [160] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -7038,7 +7036,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -7822,8 +7820,7 @@ FINAL SYMBOL TABLE (const string) main::str1 str1 = (string) " " (signed word) main::sw (signed word) main::sw#0 sw zp ZP_WORD:29 6.6000000000000005 -(word) main::wavelength -(const word) main::wavelength#0 wavelength = (byte) $78 +(const word) main::wavelength wavelength = (byte) $78 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -8545,7 +8542,7 @@ sin16s_genb: { // sin16s_genb::@1 b1: // for( word i=0; imain.wavelength bcc b2 @@ -9114,7 +9111,7 @@ divr16u: { asl.z quotient rol.z quotient+1 // if(rem>=divisor) - // [161] if((word) divr16u::rem#6<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [161] if((word) divr16u::rem#6<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3 @@ -9131,7 +9128,7 @@ divr16u: { inc.z quotient+1 !: // rem = rem - divisor - // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [163] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 diff --git a/src/test/ref/sinusgen16b.sym b/src/test/ref/sinusgen16b.sym index 9013c395a..ac496827b 100644 --- a/src/test/ref/sinusgen16b.sym +++ b/src/test/ref/sinusgen16b.sym @@ -85,8 +85,7 @@ (const string) main::str1 str1 = (string) " " (signed word) main::sw (signed word) main::sw#0 sw zp ZP_WORD:29 6.6000000000000005 -(word) main::wavelength -(const word) main::wavelength#0 wavelength = (byte) $78 +(const word) main::wavelength wavelength = (byte) $78 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 diff --git a/src/test/ref/sinusgen8.cfg b/src/test/ref/sinusgen8.cfg index b216eadd5..bb78274d9 100644 --- a/src/test/ref/sinusgen8.cfg +++ b/src/test/ref/sinusgen8.cfg @@ -151,7 +151,7 @@ sin8s_gen::@1: scope:[sin8s_gen] from sin8s_gen::@3 sin8s_gen::@4 [62] (signed byte*) sin8s_gen::sintab#2 ← phi( sin8s_gen::@3/(const signed byte[$c0]) main::sintab2 sin8s_gen::@4/(signed byte*) sin8s_gen::sintab#0 ) [62] (word) sin8s_gen::x#2 ← phi( sin8s_gen::@3/(byte) 0 sin8s_gen::@4/(word) sin8s_gen::x#1 ) [62] (word) sin8s_gen::i#2 ← phi( sin8s_gen::@3/(byte) 0 sin8s_gen::@4/(word) sin8s_gen::i#1 ) - [63] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 + [63] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 to:sin8s_gen::@return sin8s_gen::@return: scope:[sin8s_gen] from sin8s_gen::@1 [64] return @@ -326,11 +326,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [147] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [148] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte) 1 [149] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 + [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [151] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 + [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [153] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) diff --git a/src/test/ref/sinusgen8.log b/src/test/ref/sinusgen8.log index 0eed47282..c6e2e4802 100644 --- a/src/test/ref/sinusgen8.log +++ b/src/test/ref/sinusgen8.log @@ -652,11 +652,11 @@ main: scope:[main] from @57 (byte*) print_char_cursor#49 ← phi( @57/(byte*) print_char_cursor#46 ) (byte*) print_line_cursor#13 ← phi( @57/(byte*) print_line_cursor#12 ) (byte*) print_screen#4 ← phi( @57/(byte*) print_screen#5 ) - (word) main::wavelength#0 ← (number) $c0 + (word) main::wavelength ← (number) $c0 (signed byte[$c0]) main::sintab2 ← { fill( $c0, 0) } (byte[]) main::sintabref ← { (number) 0, (number) 4, (number) 8, (number) $c, (number) $11, (number) $15, (number) $19, (number) $1d, (number) $21, (number) $25, (number) $29, (number) $2d, (number) $31, (number) $35, (number) $38, (number) $3c, (number) $40, (number) $43, (number) $47, (number) $4a, (number) $4e, (number) $51, (number) $54, (number) $57, (number) $5a, (number) $5d, (number) $60, (number) $63, (number) $65, (number) $68, (number) $6a, (number) $6c, (number) $6e, (number) $70, (number) $72, (number) $74, (number) $76, (number) $77, (number) $79, (number) $7a, (number) $7b, (number) $7c, (number) $7d, (number) $7e, (number) $7e, (number) $7f, (number) $7f, (number) $7f, (number) $80, (number) $7f, (number) $7f, (number) $7f, (number) $7e, (number) $7e, (number) $7d, (number) $7c, (number) $7b, (number) $7a, (number) $79, (number) $77, (number) $76, (number) $74, (number) $72, (number) $70, (number) $6e, (number) $6c, (number) $6a, (number) $68, (number) $65, (number) $63, (number) $60, (number) $5d, (number) $5a, (number) $57, (number) $54, (number) $51, (number) $4e, (number) $4a, (number) $47, (number) $43, (number) $40, (number) $3c, (number) $38, (number) $35, (number) $31, (number) $2d, (number) $29, (number) $25, (number) $21, (number) $1d, (number) $19, (number) $15, (number) $11, (number) $c, (number) 8, (number) 4, (number) 0, (number) $fc, (number) $f8, (number) $f4, (number) $ef, (number) $eb, (number) $e7, (number) $e3, (number) $df, (number) $db, (number) $d7, (number) $d3, (number) $cf, (number) $cb, (number) $c8, (number) $c4, (number) $c0, (number) $bd, (number) $b9, (number) $b6, (number) $b2, (number) $af, (number) $ac, (number) $a9, (number) $a6, (number) $a3, (number) $a0, (number) $9d, (number) $9b, (number) $98, (number) $96, (number) $94, (number) $92, (number) $90, (number) $8e, (number) $8c, (number) $8a, (number) $89, (number) $87, (number) $86, (number) $85, (number) $84, (number) $83, (number) $82, (number) $82, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $81, (number) $82, (number) $82, (number) $83, (number) $84, (number) $85, (number) $86, (number) $87, (number) $89, (number) $8a, (number) $8c, (number) $8e, (number) $90, (number) $92, (number) $94, (number) $96, (number) $98, (number) $9b, (number) $9d, (number) $a0, (number) $a3, (number) $a6, (number) $a9, (number) $ac, (number) $af, (number) $b2, (number) $b6, (number) $b9, (number) $bd, (number) $c0, (number) $c4, (number) $c8, (number) $cb, (number) $cf, (number) $d3, (number) $d7, (number) $db, (number) $df, (number) $e3, (number) $e7, (number) $eb, (number) $ef, (number) $f4, (number) $f8, (number) $fc } (signed byte*) sin8s_gen::sintab#1 ← (signed byte[$c0]) main::sintab2 - (word) sin8s_gen::wavelength#0 ← (word) main::wavelength#0 + (word) sin8s_gen::wavelength#0 ← (word) main::wavelength call sin8s_gen to:main::@5 main::@5: scope:[main] from main @@ -882,7 +882,6 @@ SYMBOL TABLE SSA (const string) main::str = (string) " " (const string) main::str1 = (string) " " (word) main::wavelength -(word) main::wavelength#0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (bool~) memset::$0 (bool~) memset::$1 @@ -1332,7 +1331,7 @@ Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) p Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#2 & (number) $f Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#2 & (unumber)(number) $f Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 -Adding number conversion cast (unumber) $c0 in (word) main::wavelength#0 ← (number) $c0 +Adding number conversion cast (unumber) $c0 in (word) main::wavelength ← (number) $c0 Adding number conversion cast (snumber) 0 in (bool~) main::$4 ← (signed byte) main::sb#0 >= (number) 0 Successful SSA optimization PassNAddNumberTypeConversions Added casts to value list in (byte[]) main::sintabref ← (byte[]){ (byte)(number) 0, (byte)(number) 4, (byte)(number) 8, (byte)(number) $c, (byte)(number) $11, (byte)(number) $15, (byte)(number) $19, (byte)(number) $1d, (byte)(number) $21, (byte)(number) $25, (byte)(number) $29, (byte)(number) $2d, (byte)(number) $31, (byte)(number) $35, (byte)(number) $38, (byte)(number) $3c, (byte)(number) $40, (byte)(number) $43, (byte)(number) $47, (byte)(number) $4a, (byte)(number) $4e, (byte)(number) $51, (byte)(number) $54, (byte)(number) $57, (byte)(number) $5a, (byte)(number) $5d, (byte)(number) $60, (byte)(number) $63, (byte)(number) $65, (byte)(number) $68, (byte)(number) $6a, (byte)(number) $6c, (byte)(number) $6e, (byte)(number) $70, (byte)(number) $72, (byte)(number) $74, (byte)(number) $76, (byte)(number) $77, (byte)(number) $79, (byte)(number) $7a, (byte)(number) $7b, (byte)(number) $7c, (byte)(number) $7d, (byte)(number) $7e, (byte)(number) $7e, (byte)(number) $7f, (byte)(number) $7f, (byte)(number) $7f, (byte)(number) $80, (byte)(number) $7f, (byte)(number) $7f, (byte)(number) $7f, (byte)(number) $7e, (byte)(number) $7e, (byte)(number) $7d, (byte)(number) $7c, (byte)(number) $7b, (byte)(number) $7a, (byte)(number) $79, (byte)(number) $77, (byte)(number) $76, (byte)(number) $74, (byte)(number) $72, (byte)(number) $70, (byte)(number) $6e, (byte)(number) $6c, (byte)(number) $6a, (byte)(number) $68, (byte)(number) $65, (byte)(number) $63, (byte)(number) $60, (byte)(number) $5d, (byte)(number) $5a, (byte)(number) $57, (byte)(number) $54, (byte)(number) $51, (byte)(number) $4e, (byte)(number) $4a, (byte)(number) $47, (byte)(number) $43, (byte)(number) $40, (byte)(number) $3c, (byte)(number) $38, (byte)(number) $35, (byte)(number) $31, (byte)(number) $2d, (byte)(number) $29, (byte)(number) $25, (byte)(number) $21, (byte)(number) $1d, (byte)(number) $19, (byte)(number) $15, (byte)(number) $11, (byte)(number) $c, (byte)(number) 8, (byte)(number) 4, (byte)(number) 0, (byte)(number) $fc, (byte)(number) $f8, (byte)(number) $f4, (byte)(number) $ef, (byte)(number) $eb, (byte)(number) $e7, (byte)(number) $e3, (byte)(number) $df, (byte)(number) $db, (byte)(number) $d7, (byte)(number) $d3, (byte)(number) $cf, (byte)(number) $cb, (byte)(number) $c8, (byte)(number) $c4, (byte)(number) $c0, (byte)(number) $bd, (byte)(number) $b9, (byte)(number) $b6, (byte)(number) $b2, (byte)(number) $af, (byte)(number) $ac, (byte)(number) $a9, (byte)(number) $a6, (byte)(number) $a3, (byte)(number) $a0, (byte)(number) $9d, (byte)(number) $9b, (byte)(number) $98, (byte)(number) $96, (byte)(number) $94, (byte)(number) $92, (byte)(number) $90, (byte)(number) $8e, (byte)(number) $8c, (byte)(number) $8a, (byte)(number) $89, (byte)(number) $87, (byte)(number) $86, (byte)(number) $85, (byte)(number) $84, (byte)(number) $83, (byte)(number) $82, (byte)(number) $82, (byte)(number) $81, (byte)(number) $81, (byte)(number) $81, (byte)(number) $81, (byte)(number) $81, (byte)(number) $81, (byte)(number) $81, (byte)(number) $82, (byte)(number) $82, (byte)(number) $83, (byte)(number) $84, (byte)(number) $85, (byte)(number) $86, (byte)(number) $87, (byte)(number) $89, (byte)(number) $8a, (byte)(number) $8c, (byte)(number) $8e, (byte)(number) $90, (byte)(number) $92, (byte)(number) $94, (byte)(number) $96, (byte)(number) $98, (byte)(number) $9b, (byte)(number) $9d, (byte)(number) $a0, (byte)(number) $a3, (byte)(number) $a6, (byte)(number) $a9, (byte)(number) $ac, (byte)(number) $af, (byte)(number) $b2, (byte)(number) $b6, (byte)(number) $b9, (byte)(number) $bd, (byte)(number) $c0, (byte)(number) $c4, (byte)(number) $c8, (byte)(number) $cb, (byte)(number) $cf, (byte)(number) $d3, (byte)(number) $d7, (byte)(number) $db, (byte)(number) $df, (byte)(number) $e3, (byte)(number) $e7, (byte)(number) $eb, (byte)(number) $ef, (byte)(number) $f4, (byte)(number) $f8, (byte)(number) $fc } @@ -1360,7 +1359,7 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#4 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (word) main::wavelength#0 ← (unumber)(number) $c0 +Inlining cast (word) main::wavelength ← (unumber)(number) $c0 Inlining cast (signed byte~) main::$2 ← (signed byte)*((byte[]) main::sintabref + (byte) main::i#2) Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 @@ -1851,7 +1850,7 @@ Constant (const byte) print_char::ch#1 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const word) main::wavelength#0 = $c0 +Constant (const word) main::wavelength = $c0 Constant (const signed byte[$c0]) main::sintab2 = { fill( $c0, 0) } Constant (const byte[]) main::sintabref = { 0, 4, 8, $c, $11, $15, $19, $1d, $21, $25, $29, $2d, $31, $35, $38, $3c, $40, $43, $47, $4a, $4e, $51, $54, $57, $5a, $5d, $60, $63, $65, $68, $6a, $6c, $6e, $70, $72, $74, $76, $77, $79, $7a, $7b, $7c, $7d, $7e, $7e, $7f, $7f, $7f, $80, $7f, $7f, $7f, $7e, $7e, $7d, $7c, $7b, $7a, $79, $77, $76, $74, $72, $70, $6e, $6c, $6a, $68, $65, $63, $60, $5d, $5a, $57, $54, $51, $4e, $4a, $47, $43, $40, $3c, $38, $35, $31, $2d, $29, $25, $21, $1d, $19, $15, $11, $c, 8, 4, 0, $fc, $f8, $f4, $ef, $eb, $e7, $e3, $df, $db, $d7, $d3, $cf, $cb, $c8, $c4, $c0, $bd, $b9, $b6, $b2, $af, $ac, $a9, $a6, $a3, $a0, $9d, $9b, $98, $96, $94, $92, $90, $8e, $8c, $8a, $89, $87, $86, $85, $84, $83, $82, $82, $81, $81, $81, $81, $81, $81, $81, $82, $82, $83, $84, $85, $86, $87, $89, $8a, $8c, $8e, $90, $92, $94, $96, $98, $9b, $9d, $a0, $a3, $a6, $a9, $ac, $af, $b2, $b6, $b9, $bd, $c0, $c4, $c8, $cb, $cf, $d3, $d7, $db, $df, $e3, $e7, $eb, $ef, $f4, $f8, $fc } Constant (const byte) main::i#0 = 0 @@ -1861,7 +1860,7 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const word) div16u::dividend#0 = PI2_u4f12 Constant (const byte) mulu8_sel::v2#2 = sin8s::DIV_6 Constant (const signed byte*) sin8s_gen::sintab#1 = main::sintab2 -Constant (const word) sin8s_gen::wavelength#0 = main::wavelength#0 +Constant (const word) sin8s_gen::wavelength#0 = main::wavelength Successful SSA optimization Pass2ConstantIdentification Constant (const word) divr16u::dividend#1 = div16u::dividend#0 Constant (const word) div16u::divisor#0 = sin8s_gen::wavelength#0 @@ -1933,12 +1932,12 @@ Constant inlined sin8s::isUpper#0 = (byte) 0 Constant inlined sin8s_gen::x#0 = (byte) 0 Constant inlined memset::$2 = (byte*)(const void*) memset::str#0 Constant inlined divr16u::quotient#0 = (byte) 0 -Constant inlined div16u::divisor#0 = (const word) main::wavelength#0 +Constant inlined div16u::divisor#0 = (const word) main::wavelength Constant inlined main::i#0 = (byte) 0 Constant inlined mulu8_sel::select#0 = (byte) 0 Constant inlined div16u::dividend#0 = (const word) PI2_u4f12 Constant inlined mulu8_sel::select#2 = (byte) 1 -Constant inlined divr16u::divisor#0 = (const word) main::wavelength#0 +Constant inlined divr16u::divisor#0 = (const word) main::wavelength Constant inlined mulu8_sel::select#1 = (byte) 1 Constant inlined mulu8_sel::select#4 = (byte) 0 Constant inlined mulu8_sel::select#3 = (byte) 0 @@ -1948,7 +1947,7 @@ Constant inlined mul8u::res#0 = (byte) 0 Constant inlined print_char::ch#1 = (byte) ' ' Constant inlined print_char::ch#0 = (byte) '-' Constant inlined sin8s_gen::sintab#1 = (const signed byte[$c0]) main::sintab2 -Constant inlined sin8s_gen::wavelength#0 = (const word) main::wavelength#0 +Constant inlined sin8s_gen::wavelength#0 = (const word) main::wavelength Constant inlined print_str::str#2 = (const string) main::str1 Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 Constant inlined print_str::str#1 = (const string) main::str @@ -2267,7 +2266,7 @@ sin8s_gen::@1: scope:[sin8s_gen] from sin8s_gen::@3 sin8s_gen::@4 [62] (signed byte*) sin8s_gen::sintab#2 ← phi( sin8s_gen::@3/(const signed byte[$c0]) main::sintab2 sin8s_gen::@4/(signed byte*) sin8s_gen::sintab#0 ) [62] (word) sin8s_gen::x#2 ← phi( sin8s_gen::@3/(byte) 0 sin8s_gen::@4/(word) sin8s_gen::x#1 ) [62] (word) sin8s_gen::i#2 ← phi( sin8s_gen::@3/(byte) 0 sin8s_gen::@4/(word) sin8s_gen::i#1 ) - [63] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 + [63] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 to:sin8s_gen::@return sin8s_gen::@return: scope:[sin8s_gen] from sin8s_gen::@1 [64] return @@ -2442,11 +2441,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [147] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [148] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte) 1 [149] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 + [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [151] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 + [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [153] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) @@ -2496,7 +2495,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i#2 3.3000000000000003 (signed byte) main::sb (signed byte) main::sb#0 6.6000000000000005 -(word) main::wavelength (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c (byte*) memset::dst @@ -3218,7 +3216,7 @@ sin8s_gen: { // u[4.12] // sin8s_gen::@1 b1: - // [63] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 + // [63] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -3812,7 +3810,7 @@ divr16u: { // [149] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -3829,7 +3827,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc # (word) divr16u::dividend#2 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:37 [ divr16u::i#2 divr16u::i#1 ] Statement [146] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [9] (signed byte) main::sb#0 ← *((const signed byte[$c0]) main::sintab2 + (byte) main::i#2) - (signed byte)*((const byte[]) main::sintabref + (byte) main::i#2) [ main::i#2 print_char_cursor#45 main::sb#0 ] ( main:2 [ main::i#2 print_char_cursor#45 main::sb#0 ] ) always clobbers reg byte a Statement [23] if((byte) 0!=*((byte*) print_str::str#3)) goto print_str::@2 [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::i#2 main::sb#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::i#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y Statement [25] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#3) [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::i#2 main::sb#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::i#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y @@ -3922,7 +3920,7 @@ Statement [54] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [56] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:7::memset:50 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [60] (word) div16u::return#2 ← (word) div16u::return#0 [ div16u::return#2 ] ( main:2::sin8s_gen:5 [ div16u::return#2 ] ) always clobbers reg byte a Statement [61] (word) sin8s_gen::step#0 ← (word) div16u::return#2 [ sin8s_gen::step#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 ] ) always clobbers reg byte a -Statement [63] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [63] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a Statement [65] (word) sin8s::x#0 ← (word) sin8s_gen::x#2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ) always clobbers reg byte a Statement [69] *((signed byte*) sin8s_gen::sintab#2) ← (signed byte~) sin8s_gen::$2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte y Statement [71] (word) sin8s_gen::x#1 ← (word) sin8s_gen::x#2 + (word) sin8s_gen::step#0 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ) always clobbers reg byte a @@ -3946,8 +3944,8 @@ Statement [137] (word) divr16u::return#2 ← (word) divr16u::return#0 [ divr16u: Statement [138] (word) div16u::return#0 ← (word) divr16u::return#2 [ div16u::return#0 ] ( main:2::sin8s_gen:5::div16u:59 [ div16u::return#0 ] ) always clobbers reg byte a Statement [143] (byte~) divr16u::$1 ← > (word) divr16u::dividend#2 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Statement [146] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8s_gen:5::div16u:59::divr16u:136 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#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 , Potential registers zp ZP_WORD:3 [ print_str::str#3 print_str::str#5 print_str::str#0 ] : zp ZP_WORD:3 , Potential registers zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , @@ -4493,7 +4491,7 @@ sin8s_gen: { // u[4.12] // sin8s_gen::@1 b1: - // [63] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 + // [63] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -4984,7 +4982,7 @@ divr16u: { // [149] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -5001,7 +4999,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -6340,7 +6337,7 @@ divr16u: { asl.z quotient rol.z quotient+1 // if(rem>=divisor) - // [150] if((word) divr16u::rem#5<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [150] if((word) divr16u::rem#5<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3 @@ -6357,7 +6354,7 @@ divr16u: { inc.z quotient+1 !: // rem = rem - divisor - // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [152] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -5217,7 +5215,7 @@ divr16u: { // [155] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [156] if((word) divr16u::rem#7<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -5234,7 +5232,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -5871,7 +5869,7 @@ Statement [58] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [60] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:9::memset:54 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [64] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:2::sin16s_gen:7 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [65] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen::step#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 ] ) always clobbers reg byte a -Statement [67] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [67] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a Statement [69] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ) always clobbers reg byte a Statement [71] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ) always clobbers reg byte a Statement [72] (signed word~) sin16s_gen::$2 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ) always clobbers reg byte a @@ -5929,12 +5927,12 @@ Statement [144] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 Statement [149] (byte~) divr16u::$1 ← > (word) divr16u::dividend#4 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:49 [ divr16u::i#2 divr16u::i#1 ] Statement [152] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [156] if((word) divr16u::rem#7<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [162] (word) rem16u#1 ← (word) divr16u::rem#10 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a Statement [166] (word) div16u::return#2 ← (word) div16u::return#0 [ div16u::return#2 ] ( main:2::sin8s_gen:5 [ div16u::return#2 ] ) always clobbers reg byte a Statement [167] (word) sin8s_gen::step#0 ← (word) div16u::return#2 [ sin8s_gen::step#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 ] ) always clobbers reg byte a -Statement [169] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [169] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a Statement [171] (word) sin8s::x#0 ← (word) sin8s_gen::x#2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ) always clobbers reg byte a Statement [175] *((signed byte*) sin8s_gen::sintab#2) ← (signed byte~) sin8s_gen::$2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte y Statement [177] (word) sin8s_gen::x#1 ← (word) sin8s_gen::x#2 + (word) sin8s_gen::step#0 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ) always clobbers reg byte a @@ -5977,7 +5975,7 @@ Statement [58] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memse Statement [60] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:9::memset:54 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [64] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0 [ div32u16u::return#2 ] ( main:2::sin16s_gen:7 [ div32u16u::return#2 ] ) always clobbers reg byte a Statement [65] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2 [ sin16s_gen::step#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 ] ) always clobbers reg byte a -Statement [67] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [67] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 ] ) always clobbers reg byte a Statement [69] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#0 ] ) always clobbers reg byte a Statement [71] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::return#0 ] ) always clobbers reg byte a Statement [72] (signed word~) sin16s_gen::$2 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ( main:2::sin16s_gen:7 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::$2 ] ) always clobbers reg byte a @@ -6031,12 +6029,12 @@ Statement [143] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#4 [ d Statement [144] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0 [ div32u16u::return#0 ] ( main:2::sin16s_gen:7::div32u16u:63 [ div32u16u::return#0 ] ) always clobbers reg byte a Statement [149] (byte~) divr16u::$1 ← > (word) divr16u::dividend#4 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Statement [152] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::dividend#4 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [156] if((word) divr16u::rem#7<(const word) main::wavelength) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#7 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [162] (word) rem16u#1 ← (word) divr16u::rem#10 [ divr16u::return#0 rem16u#1 ] ( main:2::sin16s_gen:7::div32u16u:63::divr16u:137 [ divr16u::return#0 rem16u#1 ] main:2::sin16s_gen:7::div32u16u:63::divr16u:141 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] main:2::sin8s_gen:5::div16u:165::divr16u:242 [ divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a Statement [166] (word) div16u::return#2 ← (word) div16u::return#0 [ div16u::return#2 ] ( main:2::sin8s_gen:5 [ div16u::return#2 ] ) always clobbers reg byte a Statement [167] (word) sin8s_gen::step#0 ← (word) div16u::return#2 [ sin8s_gen::step#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 ] ) always clobbers reg byte a -Statement [169] if((word) sin8s_gen::i#2<(const word) main::wavelength#0) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a +Statement [169] if((word) sin8s_gen::i#2<(const word) main::wavelength) goto sin8s_gen::@2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte a Statement [171] (word) sin8s::x#0 ← (word) sin8s_gen::x#2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 sin8s::x#0 ] ) always clobbers reg byte a Statement [175] *((signed byte*) sin8s_gen::sintab#2) ← (signed byte~) sin8s_gen::$2 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#2 sin8s_gen::sintab#2 ] ) always clobbers reg byte y Statement [177] (word) sin8s_gen::x#1 ← (word) sin8s_gen::x#2 + (word) sin8s_gen::step#0 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ( main:2::sin8s_gen:5 [ sin8s_gen::step#0 sin8s_gen::i#2 sin8s_gen::x#1 sin8s_gen::sintab#0 ] ) always clobbers reg byte a @@ -6734,7 +6732,7 @@ sin16s_gen: { // u[4.28] // sin16s_gen::@1 b1: - // [67] if((word) sin16s_gen::i#2<(const word) main::wavelength#0) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 + // [67] if((word) sin16s_gen::i#2<(const word) main::wavelength) goto sin16s_gen::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.wavelength bcc b2 @@ -7357,7 +7355,7 @@ divr16u: { // [155] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [156] if((word) divr16u::rem#7<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3_from_b2 @@ -7374,7 +7372,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 @@ -8246,8 +8244,7 @@ FINAL SYMBOL TABLE (const string) main::str str = (string) " " (signed word) main::sw (signed word) main::sw#0 sw zp ZP_WORD:32 22.0 -(word) main::wavelength -(const word) main::wavelength#0 wavelength = (byte) $c0 +(const word) main::wavelength wavelength = (byte) $c0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -8976,7 +8973,7 @@ sin16s_gen: { // sin16s_gen::@1 b1: // for( word i=0; imain.wavelength bcc b2 @@ -9586,7 +9583,7 @@ divr16u: { asl.z quotient rol.z quotient+1 // if(rem>=divisor) - // [156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [156] if((word) divr16u::rem#7<(const word) main::wavelength) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.wavelength bcc b3 @@ -9603,7 +9600,7 @@ divr16u: { inc.z quotient+1 !: // rem = rem - divisor - // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0 -- vwuz1=vwuz1_minus_vwuc1 + // [158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.wavelength bcc b2 diff --git a/src/test/ref/sinusgen8b.sym b/src/test/ref/sinusgen8b.sym index 1921e67cd..74234df90 100644 --- a/src/test/ref/sinusgen8b.sym +++ b/src/test/ref/sinusgen8b.sym @@ -93,8 +93,7 @@ (const string) main::str str = (string) " " (signed word) main::sw (signed word) main::sw#0 sw zp ZP_WORD:32 22.0 -(word) main::wavelength -(const word) main::wavelength#0 wavelength = (byte) $c0 +(const word) main::wavelength wavelength = (byte) $c0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 diff --git a/src/test/ref/sinusgenscale8.cfg b/src/test/ref/sinusgenscale8.cfg index 1a0316b6e..956fa828e 100644 --- a/src/test/ref/sinusgenscale8.cfg +++ b/src/test/ref/sinusgenscale8.cfg @@ -75,7 +75,7 @@ sin8u_table::@1: scope:[sin8u_table] from sin8u_table::@13 sin8u_table::@24 [34] (byte*) sin8u_table::sintab#2 ← phi( sin8u_table::@13/(const byte[$14]) main::sintab sin8u_table::@24/(byte*) sin8u_table::sintab#1 ) [34] (word) sin8u_table::x#10 ← phi( sin8u_table::@13/(byte) 0 sin8u_table::@24/(word) sin8u_table::x#1 ) [34] (word) sin8u_table::i#10 ← phi( sin8u_table::@13/(byte) 0 sin8u_table::@24/(word) sin8u_table::i#1 ) - [35] if((word) sin8u_table::i#10<(const word) main::tabsize#0) goto sin8u_table::@2 + [35] if((word) sin8u_table::i#10<(const word) main::tabsize) goto sin8u_table::@2 to:sin8u_table::@return sin8u_table::@return: scope:[sin8u_table] from sin8u_table::@1 [36] return @@ -439,11 +439,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [202] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [203] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte) 1 [204] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 + [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [206] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 + [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [208] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) diff --git a/src/test/ref/sinusgenscale8.log b/src/test/ref/sinusgenscale8.log index a148e5766..0b8b29c87 100644 --- a/src/test/ref/sinusgenscale8.log +++ b/src/test/ref/sinusgenscale8.log @@ -739,7 +739,7 @@ main: scope:[main] from @58 (byte*) print_char_cursor#104 ← phi( @58/(byte*) print_char_cursor#108 ) (byte*) print_line_cursor#24 ← phi( @58/(byte*) print_line_cursor#28 ) (byte*) print_screen#3 ← phi( @58/(byte*) print_screen#4 ) - (word) main::tabsize#0 ← (number) $14 + (word) main::tabsize ← (number) $14 (byte[$14]) main::sintab ← { fill( $14, 0) } call print_cls to:main::@1 @@ -749,7 +749,7 @@ main::@1: scope:[main] from main (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#23 ← (byte*) print_char_cursor#69 (byte*) sin8u_table::sintab#0 ← (byte[$14]) main::sintab - (word) sin8u_table::tabsize#0 ← (word) main::tabsize#0 + (word) sin8u_table::tabsize#0 ← (word) main::tabsize (byte) sin8u_table::min#0 ← (number) $a (byte) sin8u_table::max#0 ← (number) $ff call sin8u_table @@ -1286,7 +1286,6 @@ SYMBOL TABLE SSA (label) main::@return (byte[$14]) main::sintab (word) main::tabsize -(word) main::tabsize#0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (bool~) memset::$0 (bool~) memset::$1 @@ -2141,7 +2140,7 @@ Adding number conversion cast (unumber) 4 in (byte~) print_byte::$0 ← (byte) p Adding number conversion cast (unumber) $f in (number~) print_byte::$2 ← (byte) print_byte::b#9 & (number) $f Adding number conversion cast (unumber) print_byte::$2 in (number~) print_byte::$2 ← (byte) print_byte::b#9 & (unumber)(number) $f Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 -Adding number conversion cast (unumber) $14 in (word) main::tabsize#0 ← (number) $14 +Adding number conversion cast (unumber) $14 in (word) main::tabsize ← (number) $14 Adding number conversion cast (unumber) $a in (byte) sin8u_table::min#0 ← (number) $a Adding number conversion cast (unumber) $ff in (byte) sin8u_table::max#0 ← (number) $ff Adding number conversion cast (unumber) 2 in (number~) sin8u_table::$3 ← (word) sin8u_table::sum#0 / (number) 2 @@ -2179,7 +2178,7 @@ Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400 Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#4 Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#4 Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 -Inlining cast (word) main::tabsize#0 ← (unumber)(number) $14 +Inlining cast (word) main::tabsize ← (unumber)(number) $14 Inlining cast (byte) sin8u_table::min#0 ← (unumber)(number) $a Inlining cast (byte) sin8u_table::max#0 ← (unumber)(number) $ff Inlining cast (word~) sin8u_table::$1 ← (word)(byte) sin8u_table::min#1 @@ -2583,7 +2582,7 @@ Constant (const byte) print_char::ch#3 = ' ' Constant (const byte[]) print_hextab = $0 Constant (const byte) memset::c#0 = ' ' Constant (const word) memset::num#0 = $3e8 -Constant (const word) main::tabsize#0 = $14 +Constant (const word) main::tabsize = $14 Constant (const byte[$14]) main::sintab = { fill( $14, 0) } Constant (const byte) sin8u_table::min#0 = $a Constant (const byte) sin8u_table::max#0 = $ff @@ -2601,7 +2600,7 @@ Constant (const byte*) print_str::str#9 = sin8u_table::str8 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) mulu8_sel::v2#2 = sin8s::DIV_6 Constant (const byte*) sin8u_table::sintab#0 = main::sintab -Constant (const word) sin8u_table::tabsize#0 = main::tabsize#0 +Constant (const word) sin8u_table::tabsize#0 = main::tabsize Constant (const word) div16u::dividend#0 = PI2_u4f12 Constant (const byte) print_byte::b#3 = sin8u_table::min#0 Constant (const byte) print_byte::b#4 = sin8u_table::max#0 @@ -2712,17 +2711,17 @@ Constant inlined sin8s::isUpper#0 = (byte) 0 Constant inlined sin8u_table::$4 = (const word) sin8u_table::sum#0/(byte) 2+(byte) 1 Constant inlined memset::$2 = (byte*)(const void*) memset::str#0 Constant inlined divr16u::quotient#0 = (byte) 0 -Constant inlined div16u::divisor#0 = (const word) main::tabsize#0 +Constant inlined div16u::divisor#0 = (const word) main::tabsize Constant inlined sin8u_table::$1 = (word)(const byte) sin8u_table::min#0 Constant inlined sin8u_table::$3 = (const word) sin8u_table::sum#0/(byte) 2 Constant inlined mulu8_sel::select#0 = (byte) 0 Constant inlined div16u::dividend#0 = (const word) PI2_u4f12 Constant inlined mulu8_sel::select#2 = (byte) 1 -Constant inlined divr16u::divisor#0 = (const word) main::tabsize#0 +Constant inlined divr16u::divisor#0 = (const word) main::tabsize Constant inlined mulu8_sel::select#1 = (byte) 1 Constant inlined mulu8_sel::select#4 = (byte) 0 Constant inlined mulu8_sel::select#3 = (byte) 0 -Constant inlined sin8u_table::tabsize#0 = (const word) main::tabsize#0 +Constant inlined sin8u_table::tabsize#0 = (const word) main::tabsize Constant inlined print_line_cursor#0 = (byte*) 1024 Constant inlined print_byte::b#4 = (const byte) sin8u_table::max#0 Constant inlined print_byte::b#3 = (const byte) sin8u_table::min#0 @@ -3059,7 +3058,7 @@ sin8u_table::@1: scope:[sin8u_table] from sin8u_table::@13 sin8u_table::@24 [34] (byte*) sin8u_table::sintab#2 ← phi( sin8u_table::@13/(const byte[$14]) main::sintab sin8u_table::@24/(byte*) sin8u_table::sintab#1 ) [34] (word) sin8u_table::x#10 ← phi( sin8u_table::@13/(byte) 0 sin8u_table::@24/(word) sin8u_table::x#1 ) [34] (word) sin8u_table::i#10 ← phi( sin8u_table::@13/(byte) 0 sin8u_table::@24/(word) sin8u_table::i#1 ) - [35] if((word) sin8u_table::i#10<(const word) main::tabsize#0) goto sin8u_table::@2 + [35] if((word) sin8u_table::i#10<(const word) main::tabsize) goto sin8u_table::@2 to:sin8u_table::@return sin8u_table::@return: scope:[sin8u_table] from sin8u_table::@1 [36] return @@ -3423,11 +3422,11 @@ divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4 [202] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 ) [203] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte) 1 [204] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 - [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 + [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 to:divr16u::@5 divr16u::@5: scope:[divr16u] from divr16u::@2 [206] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1 - [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 + [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize to:divr16u::@3 divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5 [208] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 ) @@ -3497,7 +3496,6 @@ VARIABLE REGISTER WEIGHTS (word) divr16u::return#0 7.000000000000001 (word) divr16u::return#2 4.0 (void()) main() -(word) main::tabsize (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c (byte*) memset::dst @@ -4140,7 +4138,7 @@ sin8u_table: { // u[4.12] // sin8u_table::@1 b1: - // [35] if((word) sin8u_table::i#10<(const word) main::tabsize#0) goto sin8u_table::@2 -- vwuz1_lt_vwuc1_then_la1 + // [35] if((word) sin8u_table::i#10<(const word) main::tabsize) goto sin8u_table::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.tabsize bcc b2 @@ -5267,7 +5265,7 @@ divr16u: { // [204] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.tabsize bcc b3_from_b2 @@ -5284,7 +5282,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 -- vwuz1=vwuz1_minus_vwuc1 + // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc # (word) divr16u::dividend#2 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:43 [ divr16u::i#2 divr16u::i#1 ] Statement [201] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [217] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:213 [ memset::dst#2 ] ) always clobbers reg byte a Statement [219] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:213 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Statement [11] (word) div16u::return#2 ← (word) div16u::return#0 [ div16u::return#2 ] ( main:2::sin8u_table:7 [ div16u::return#2 ] ) always clobbers reg byte a Statement [12] (word) sin8u_table::step#0 ← (word) div16u::return#2 [ sin8u_table::step#0 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 ] ) always clobbers reg byte a Statement [14] (word) print_word::w#1 ← (word) sin8u_table::step#0 [ sin8u_table::step#0 print_word::w#1 print_char_cursor#2 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 print_word::w#1 print_char_cursor#2 ] ) always clobbers reg byte a -Statement [35] if((word) sin8u_table::i#10<(const word) main::tabsize#0) goto sin8u_table::@2 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 print_line_cursor#1 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 print_line_cursor#1 ] ) always clobbers reg byte a +Statement [35] if((word) sin8u_table::i#10<(const word) main::tabsize) goto sin8u_table::@2 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 print_line_cursor#1 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 print_line_cursor#1 ] ) always clobbers reg byte a Statement [37] (word) sin8s::x#2 ← (word) sin8u_table::x#10 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8s::x#2 print_line_cursor#1 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8s::x#2 print_line_cursor#1 ] ) always clobbers reg byte a Statement [43] (signed word) sin8u_table::sinx_sc#0 ← (signed word)(word) mul8su::m#2 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8u_table::sinx#0 sin8u_table::sinx_sc#0 print_line_cursor#1 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8u_table::sinx#0 sin8u_table::sinx_sc#0 print_line_cursor#1 ] ) always clobbers reg byte a Statement [46] *((byte*) sin8u_table::sintab#2) ← (byte) sin8u_table::sinx_tr#0 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8u_table::sinx#0 sin8u_table::sinx_sc#0 sin8u_table::sinx_tr#0 print_line_cursor#1 ] ( main:2::sin8u_table:7 [ sin8u_table::step#0 sin8u_table::i#10 sin8u_table::x#10 sin8u_table::sintab#2 sin8u_table::sinx#0 sin8u_table::sinx_sc#0 sin8u_table::sinx_tr#0 print_line_cursor#1 ] ) always clobbers reg byte a reg byte y @@ -5488,8 +5486,8 @@ Statement [192] (word) divr16u::return#2 ← (word) divr16u::return#0 [ divr16u: Statement [193] (word) div16u::return#0 ← (word) divr16u::return#2 [ div16u::return#0 ] ( main:2::sin8u_table:7::div16u:10 [ div16u::return#0 ] ) always clobbers reg byte a Statement [198] (byte~) divr16u::$1 ← > (word) divr16u::dividend#2 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#0 divr16u::$1 ] ) always clobbers reg byte a Statement [201] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::dividend#2 divr16u::quotient#3 divr16u::i#2 divr16u::rem#1 ] ) always clobbers reg byte a -Statement [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a -Statement [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a +Statement [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#5 divr16u::quotient#1 ] ) always clobbers reg byte a +Statement [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:2::sin8u_table:7::div16u:10::divr16u:191 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [217] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:213 [ memset::dst#2 ] ) always clobbers reg byte a Statement [219] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:213 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y Potential registers zp ZP_WORD:2 [ sin8u_table::i#10 sin8u_table::i#1 ] : zp ZP_WORD:2 , @@ -5925,7 +5923,7 @@ sin8u_table: { // u[4.12] // sin8u_table::@1 b1: - // [35] if((word) sin8u_table::i#10<(const word) main::tabsize#0) goto sin8u_table::@2 -- vwuz1_lt_vwuc1_then_la1 + // [35] if((word) sin8u_table::i#10<(const word) main::tabsize) goto sin8u_table::@2 -- vwuz1_lt_vwuc1_then_la1 lda.z i+1 cmp #>main.tabsize bcc b2 @@ -6910,7 +6908,7 @@ divr16u: { // [204] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 asl.z quotient rol.z quotient+1 - // [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.tabsize bcc b3_from_b2 @@ -6927,7 +6925,7 @@ divr16u: { bne !+ inc.z quotient+1 !: - // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 -- vwuz1=vwuz1_minus_vwuc1 + // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.tabsize bcc b2 @@ -8813,7 +8810,7 @@ divr16u: { asl.z quotient rol.z quotient+1 // if(rem>=divisor) - // [205] if((word) divr16u::rem#5<(const word) main::tabsize#0) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 + // [205] if((word) divr16u::rem#5<(const word) main::tabsize) goto divr16u::@3 -- vwuz1_lt_vwuc1_then_la1 lda.z rem+1 cmp #>main.tabsize bcc b3 @@ -8830,7 +8827,7 @@ divr16u: { inc.z quotient+1 !: // rem = rem - divisor - // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize#0 -- vwuz1=vwuz1_minus_vwuc1 + // [207] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (const word) main::tabsize -- vwuz1=vwuz1_minus_vwuc1 lda.z rem sec sbc #main.name adc.z j+1 sta.z _1+1 - // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name#0 + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 + // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 lda #main.name adc.z j+1 sta.z _1+1 - // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name#0 + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 + // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 lda #main.name adc.z j+1 sta.z _1+1 - // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name#0 + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 + // [12] (byte*~) set_process_name::$2 ← (const byte*) process_name + (signed word) set_process_name::j#2 -- pbuz1=pbuc1_plus_vwsz2 lda #$400 sta.z print_line_cursor+1 - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials#0 [phi:main->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials [phi:main->print_person#1] -- pbuz1=pbuc1 lda #jesper_initials @@ -1579,7 +1571,7 @@ main: { sta.z print_char_cursor lda #>$400 sta.z print_char_cursor+1 - // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id#0 [phi:main->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id [phi:main->print_person#3] -- vduz1=vduc1 lda #jesper_id @@ -1601,13 +1593,13 @@ main: { // [9] phi from main::@1 to print_person [phi:main::@1->print_person] print_person_from_b1: // [9] phi (byte*) print_line_cursor#20 = (byte*) print_line_cursor#1 [phi:main::@1->print_person#0] -- register_copy - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials#0 [phi:main::@1->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials [phi:main::@1->print_person#1] -- pbuz1=pbuc1 lda #henry_initials sta.z print_person.person_initials+1 // [9] phi (byte*) print_char_cursor#39 = (byte*~) print_char_cursor#49 [phi:main::@1->print_person#2] -- register_copy - // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id#0 [phi:main::@1->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id [phi:main::@1->print_person#3] -- vduz1=vduc1 lda #henry_id @@ -2239,7 +2231,7 @@ main: { sta.z print_line_cursor lda #>$400 sta.z print_line_cursor+1 - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials#0 [phi:main->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials [phi:main->print_person#1] -- pbuz1=pbuc1 lda #jesper_initials @@ -2249,7 +2241,7 @@ main: { sta.z print_char_cursor lda #>$400 sta.z print_char_cursor+1 - // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id#0 [phi:main->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id [phi:main->print_person#3] -- vduz1=vduc1 lda #jesper_id @@ -2271,13 +2263,13 @@ main: { // [9] phi from main::@1 to print_person [phi:main::@1->print_person] print_person_from_b1: // [9] phi (byte*) print_line_cursor#20 = (byte*) print_line_cursor#1 [phi:main::@1->print_person#0] -- register_copy - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials#0 [phi:main::@1->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials [phi:main::@1->print_person#1] -- pbuz1=pbuc1 lda #henry_initials sta.z print_person.person_initials+1 // [9] phi (byte*) print_char_cursor#39 = (byte*~) print_char_cursor#49 [phi:main::@1->print_person#2] -- register_copy - // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id#0 [phi:main::@1->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id [phi:main::@1->print_person#3] -- vduz1=vduc1 lda #henry_id @@ -2786,14 +2778,10 @@ FINAL SYMBOL TABLE (const byte) RADIX::OCTAL OCTAL = (number) 8 (const dword[]) RADIX_DECIMAL_VALUES_LONG RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a } (const byte[$b]) decimal_digits_long decimal_digits_long = { fill( $b, 0) } -(dword) henry_id -(const dword) henry_id#0 henry_id = (dword) $4466d -(byte[3]) henry_initials -(const byte[3]) henry_initials#0 henry_initials = (string) "hg" -(dword) jesper_id -(const dword) jesper_id#0 jesper_id = (dword) $1b244 -(byte[3]) jesper_initials -(const byte[3]) jesper_initials#0 jesper_initials = (string) "jg" +(const dword) henry_id henry_id = (dword) $4466d +(const byte[3]) henry_initials henry_initials = (string) "hg" +(const dword) jesper_id jesper_id = (dword) $1b244 +(const byte[3]) jesper_initials jesper_initials = (string) "jg" (void()) main() (label) main::@1 (label) main::@return @@ -2936,7 +2924,7 @@ main: { sta.z print_line_cursor lda #>$400 sta.z print_line_cursor+1 - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials#0 [phi:main->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) jesper_initials [phi:main->print_person#1] -- pbuz1=pbuc1 lda #jesper_initials @@ -2946,7 +2934,7 @@ main: { sta.z print_char_cursor lda #>$400 sta.z print_char_cursor+1 - // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id#0 [phi:main->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) jesper_id [phi:main->print_person#3] -- vduz1=vduc1 lda #jesper_id @@ -2966,13 +2954,13 @@ main: { // [7] call print_person // [9] phi from main::@1 to print_person [phi:main::@1->print_person] // [9] phi (byte*) print_line_cursor#20 = (byte*) print_line_cursor#1 [phi:main::@1->print_person#0] -- register_copy - // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials#0 [phi:main::@1->print_person#1] -- pbuz1=pbuc1 + // [9] phi (byte[3]) print_person::person_initials#2 = (const byte[3]) henry_initials [phi:main::@1->print_person#1] -- pbuz1=pbuc1 lda #henry_initials sta.z print_person.person_initials+1 // [9] phi (byte*) print_char_cursor#39 = (byte*~) print_char_cursor#49 [phi:main::@1->print_person#2] -- register_copy - // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id#0 [phi:main::@1->print_person#3] -- vduz1=vduc1 + // [9] phi (dword) print_person::person_id#2 = (const dword) henry_id [phi:main::@1->print_person#3] -- vduz1=vduc1 lda #henry_id diff --git a/src/test/ref/struct-11.sym b/src/test/ref/struct-11.sym index d26596005..8e261658e 100644 --- a/src/test/ref/struct-11.sym +++ b/src/test/ref/struct-11.sym @@ -10,14 +10,10 @@ (const byte) RADIX::OCTAL OCTAL = (number) 8 (const dword[]) RADIX_DECIMAL_VALUES_LONG RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a } (const byte[$b]) decimal_digits_long decimal_digits_long = { fill( $b, 0) } -(dword) henry_id -(const dword) henry_id#0 henry_id = (dword) $4466d -(byte[3]) henry_initials -(const byte[3]) henry_initials#0 henry_initials = (string) "hg" -(dword) jesper_id -(const dword) jesper_id#0 jesper_id = (dword) $1b244 -(byte[3]) jesper_initials -(const byte[3]) jesper_initials#0 jesper_initials = (string) "jg" +(const dword) henry_id henry_id = (dword) $4466d +(const byte[3]) henry_initials henry_initials = (string) "hg" +(const dword) jesper_id jesper_id = (dword) $1b244 +(const byte[3]) jesper_initials jesper_initials = (string) "jg" (void()) main() (label) main::@1 (label) main::@return diff --git a/src/test/ref/struct-4.cfg b/src/test/ref/struct-4.cfg index 2bc2ab9ad..40074d644 100644 --- a/src/test/ref/struct-4.cfg +++ b/src/test/ref/struct-4.cfg @@ -10,7 +10,7 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::x [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 to:main::@return main::@return: scope:[main] from main diff --git a/src/test/ref/struct-4.log b/src/test/ref/struct-4.log index 7cb837465..e8444a6cb 100644 --- a/src/test/ref/struct-4.log +++ b/src/test/ref/struct-4.log @@ -14,10 +14,10 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::x#0 ← (number) 2 - (byte) main::y#0 ← (number) 3 - (number~) main::$0 ← (byte) main::y#0 + (number) 1 - (byte) main::p_x#0 ← (byte) main::x#0 + (byte) main::x ← (number) 2 + (byte) main::y ← (number) 3 + (number~) main::$0 ← (byte) main::y + (number) 1 + (byte) main::p_x#0 ← (byte) main::x (byte) main::p_y#0 ← (number~) main::$0 (byte*) main::SCREEN ← ((byte*)) (number) $400 *((byte*) main::SCREEN + (number) 0) ← (byte) main::p_x#0 @@ -49,19 +49,17 @@ SYMBOL TABLE SSA (byte) main::p_y (byte) main::p_y#0 (byte) main::x -(byte) main::x#0 (byte) main::y -(byte) main::y#0 -Adding number conversion cast (unumber) 2 in (byte) main::x#0 ← (number) 2 -Adding number conversion cast (unumber) 3 in (byte) main::y#0 ← (number) 3 -Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::y#0 + (number) 1 -Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::y#0 + (unumber)(number) 1 +Adding number conversion cast (unumber) 2 in (byte) main::x ← (number) 2 +Adding number conversion cast (unumber) 3 in (byte) main::y ← (number) 3 +Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::y + (number) 1 +Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::y + (unumber)(number) 1 Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::p_x#0 Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::p_y#0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::x#0 ← (unumber)(number) 2 -Inlining cast (byte) main::y#0 ← (unumber)(number) 3 +Inlining cast (byte) main::x ← (unumber)(number) 2 +Inlining cast (byte) main::y ← (unumber)(number) 3 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 2 @@ -77,19 +75,19 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::y#0 + (byte) 1 -Alias (byte) main::x#0 = (byte) main::p_x#0 +Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::y + (byte) 1 +Alias (byte) main::x = (byte) main::p_x#0 Alias (byte) main::p_y#0 = (byte~) main::$0 Successful SSA optimization Pass2AliasElimination -Constant (const byte) main::x#0 = 2 -Constant (const byte) main::y#0 = 3 +Constant (const byte) main::x = 2 +Constant (const byte) main::y = 3 Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::x#0 +Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::x Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [0] (byte) main::p_y#0 ← (const byte) main::y#0 + (byte) 1 +Constant right-side identified [0] (byte) main::p_y#0 ← (const byte) main::y + (byte) 1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::p_y#0 = main::y#0+1 +Constant (const byte) main::p_y#0 = main::y+1 Successful SSA optimization Pass2ConstantIdentification Consolidated array index constant in *(main::SCREEN+1) Successful SSA optimization Pass2ConstantAdditionElimination @@ -120,7 +118,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::x [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 to:main::@return main::@return: scope:[main] from main @@ -134,8 +132,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte) main::p_x (byte) main::p_y -(byte) main::x -(byte) main::y Initial phi equivalence classes Complete equivalence classes @@ -169,7 +165,7 @@ main: { .const y = 3 .label SCREEN = $400 .const p_y = y+1 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 lda #x sta SCREEN // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 @@ -184,7 +180,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::x [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -224,7 +220,7 @@ main: { .const y = 3 .label SCREEN = $400 .const p_y = y+1 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 lda #x sta SCREEN // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 @@ -267,11 +263,9 @@ FINAL SYMBOL TABLE (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::p_x (byte) main::p_y -(const byte) main::p_y#0 p_y = (const byte) main::y#0+(byte) 1 -(byte) main::x -(const byte) main::x#0 x = (byte) 2 -(byte) main::y -(const byte) main::y#0 y = (byte) 3 +(const byte) main::p_y#0 p_y = (const byte) main::y+(byte) 1 +(const byte) main::x x = (byte) 2 +(const byte) main::y y = (byte) 3 @@ -298,7 +292,7 @@ main: { .label SCREEN = $400 .const p_y = y+1 // SCREEN[0] = p.x - // [4] *((const byte*) main::SCREEN) ← (const byte) main::x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 lda #x sta SCREEN // SCREEN[1] = p.y diff --git a/src/test/ref/struct-4.sym b/src/test/ref/struct-4.sym index b37c92860..62905d045 100644 --- a/src/test/ref/struct-4.sym +++ b/src/test/ref/struct-4.sym @@ -8,9 +8,7 @@ (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::p_x (byte) main::p_y -(const byte) main::p_y#0 p_y = (const byte) main::y#0+(byte) 1 -(byte) main::x -(const byte) main::x#0 x = (byte) 2 -(byte) main::y -(const byte) main::y#0 y = (byte) 3 +(const byte) main::p_y#0 p_y = (const byte) main::y+(byte) 1 +(const byte) main::x x = (byte) 2 +(const byte) main::y y = (byte) 3 diff --git a/src/test/ref/struct-5.cfg b/src/test/ref/struct-5.cfg index 5d181aac5..4eebeee9e 100644 --- a/src/test/ref/struct-5.cfg +++ b/src/test/ref/struct-5.cfg @@ -14,8 +14,8 @@ main: scope:[main] from @1 [5] call point to:main::@1 main::@1: scope:[main] from main - [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 - [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 + [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x + [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y to:main::@return main::@return: scope:[main] from main::@1 [8] return diff --git a/src/test/ref/struct-5.log b/src/test/ref/struct-5.log index a55a262e3..548414fcb 100644 --- a/src/test/ref/struct-5.log +++ b/src/test/ref/struct-5.log @@ -62,10 +62,10 @@ main::@return: scope:[main] from main::@1 (struct Point()) point() point: scope:[point] from main - (byte) point::p_x#0 ← (number) 2 - (byte) point::p_y#0 ← (number) 3 - (byte) point::return_x#1 ← (byte) point::p_x#0 - (byte) point::return_y#1 ← (byte) point::p_y#0 + (byte) point::p_x ← (number) 2 + (byte) point::p_y ← (number) 3 + (byte) point::return_x#1 ← (byte) point::p_x + (byte) point::return_y#1 ← (byte) point::p_y (struct Point) point::return#0 ← struct-unwound {(byte) point::return_x#1, (byte) point::return_y#1} to:point::@return point::@return: scope:[point] from point @@ -106,9 +106,7 @@ SYMBOL TABLE SSA (struct Point()) point() (label) point::@return (byte) point::p_x -(byte) point::p_x#0 (byte) point::p_y -(byte) point::p_y#0 (struct Point) point::return (struct Point) point::return#0 (struct Point) point::return#1 @@ -127,12 +125,12 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::q_x#1 Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::q_y#1 -Adding number conversion cast (unumber) 2 in (byte) point::p_x#0 ← (number) 2 -Adding number conversion cast (unumber) 3 in (byte) point::p_y#0 ← (number) 3 +Adding number conversion cast (unumber) 2 in (byte) point::p_x ← (number) 2 +Adding number conversion cast (unumber) 3 in (byte) point::p_y ← (number) 3 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 -Inlining cast (byte) point::p_x#0 ← (unumber)(number) 2 -Inlining cast (byte) point::p_y#0 ← (unumber)(number) 3 +Inlining cast (byte) point::p_x ← (unumber)(number) 2 +Inlining cast (byte) point::p_y ← (unumber)(number) 3 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 0 @@ -149,32 +147,32 @@ Alias (byte) point::return_x#0 = (byte) point::return_x#3 Alias (byte) point::return_y#0 = (byte) point::return_y#3 Alias (byte) main::q_x#1 = (byte) main::$0_x Alias (byte) main::q_y#1 = (byte) main::$0_y -Alias (byte) point::p_x#0 = (byte) point::return_x#1 (byte) point::return_x#4 (byte) point::return_x#2 -Alias (byte) point::p_y#0 = (byte) point::return_y#1 (byte) point::return_y#4 (byte) point::return_y#2 +Alias (byte) point::p_x = (byte) point::return_x#1 (byte) point::return_x#4 (byte) point::return_x#2 +Alias (byte) point::p_y = (byte) point::return_y#1 (byte) point::return_y#4 (byte) point::return_y#2 Successful SSA optimization Pass2AliasElimination Constant (const byte) main::q_x#0 = 0 Constant (const byte) main::q_y#0 = 0 Constant (const byte*) main::SCREEN = (byte*) 1024 -Constant (const byte) point::p_x#0 = 2 -Constant (const byte) point::p_y#0 = 3 +Constant (const byte) point::p_x = 2 +Constant (const byte) point::p_y = 3 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) point::return_x#0 = point::p_x#0 -Constant (const byte) point::return_y#0 = point::p_y#0 +Constant (const byte) point::return_x#0 = point::p_x +Constant (const byte) point::return_y#0 = point::p_y Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::q_x#1 = point::return_x#0 Constant (const byte) main::q_y#1 = point::return_y#0 Successful SSA optimization Pass2ConstantIdentification Simplifying expression containing zero main::SCREEN in [11] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::q_x#1 Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused variable (struct Point) point::return#0 and assignment [4] (struct Point) point::return#0 ← struct-unwound {(const byte) point::p_x#0, (const byte) point::p_y#0} -Eliminating unused variable (struct Point) point::return#1 and assignment [5] (struct Point) point::return#1 ← struct-unwound {(const byte) point::p_x#0, (const byte) point::p_y#0} +Eliminating unused variable (struct Point) point::return#0 and assignment [4] (struct Point) point::return#0 ← struct-unwound {(const byte) point::p_x, (const byte) point::p_y} +Eliminating unused variable (struct Point) point::return#1 and assignment [5] (struct Point) point::return#1 ← struct-unwound {(const byte) point::p_x, (const byte) point::p_y} Eliminating unused constant (const byte) main::q_x#0 Eliminating unused constant (const byte) main::q_y#0 Successful SSA optimization PassNEliminateUnusedVars -Constant inlined main::q_x#1 = (const byte) point::p_x#0 -Constant inlined point::return_y#0 = (const byte) point::p_y#0 -Constant inlined point::return_x#0 = (const byte) point::p_x#0 -Constant inlined main::q_y#1 = (const byte) point::p_y#0 +Constant inlined main::q_x#1 = (const byte) point::p_x +Constant inlined point::return_y#0 = (const byte) point::p_y +Constant inlined point::return_x#0 = (const byte) point::p_x +Constant inlined main::q_y#1 = (const byte) point::p_y Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(main::SCREEN+1) Successful SSA optimization Pass2ConstantAdditionElimination @@ -215,8 +213,8 @@ main: scope:[main] from @1 [5] call point to:main::@1 main::@1: scope:[main] from main - [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 - [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 + [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x + [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y to:main::@return main::@return: scope:[main] from main::@1 [8] return @@ -239,8 +237,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::q_x (byte) main::q_y (struct Point()) point() -(byte) point::p_x -(byte) point::p_y (struct Point) point::return (byte) point::return_x (byte) point::return_y @@ -283,10 +279,10 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x -- _deref_pbuc1=vbuc2 lda #point.p_x sta SCREEN - // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y -- _deref_pbuc1=vbuc2 lda #point.p_y sta SCREEN+1 jmp breturn @@ -308,8 +304,8 @@ point: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [Point] @@ -356,10 +352,10 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x -- _deref_pbuc1=vbuc2 lda #point.p_x sta SCREEN - // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y -- _deref_pbuc1=vbuc2 lda #point.p_y sta SCREEN+1 jmp breturn @@ -419,10 +415,8 @@ FINAL SYMBOL TABLE (byte) main::q_y (struct Point()) point() (label) point::@return -(byte) point::p_x -(const byte) point::p_x#0 p_x = (byte) 2 -(byte) point::p_y -(const byte) point::p_y#0 p_y = (byte) 3 +(const byte) point::p_x p_x = (byte) 2 +(const byte) point::p_y p_y = (byte) 3 (struct Point) point::return (byte) point::return_x (byte) point::return_y @@ -455,11 +449,11 @@ main: { jsr point // main::@1 // SCREEN[0] = q.x - // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN) ← (const byte) point::p_x -- _deref_pbuc1=vbuc2 lda #point.p_x sta SCREEN // SCREEN[1] = q.y - // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) point::p_y -- _deref_pbuc1=vbuc2 lda #point.p_y sta SCREEN+1 // main::@return diff --git a/src/test/ref/struct-5.sym b/src/test/ref/struct-5.sym index 17af22d1f..7cdb67e51 100644 --- a/src/test/ref/struct-5.sym +++ b/src/test/ref/struct-5.sym @@ -12,10 +12,8 @@ (byte) main::q_y (struct Point()) point() (label) point::@return -(byte) point::p_x -(const byte) point::p_x#0 p_x = (byte) 2 -(byte) point::p_y -(const byte) point::p_y#0 p_y = (byte) 3 +(const byte) point::p_x p_x = (byte) 2 +(const byte) point::p_y p_y = (byte) 3 (struct Point) point::return (byte) point::return_x (byte) point::return_y diff --git a/src/test/ref/struct-6.cfg b/src/test/ref/struct-6.cfg index 6719456ff..288d57ae7 100644 --- a/src/test/ref/struct-6.cfg +++ b/src/test/ref/struct-6.cfg @@ -10,9 +10,9 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 - [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y + [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius to:main::@return main::@return: scope:[main] from main [7] return diff --git a/src/test/ref/struct-6.log b/src/test/ref/struct-6.log index 2f3ebdcb3..0aea4be62 100644 --- a/src/test/ref/struct-6.log +++ b/src/test/ref/struct-6.log @@ -28,15 +28,15 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::p_x#0 ← (number) $a - (byte) main::p_y#0 ← (number) $a - (byte) main::c_center_x#0 ← (byte) main::p_x#0 - (byte) main::c_center_y#0 ← (byte) main::p_y#0 - (byte) main::c_radius#0 ← (number) 5 + (byte) main::p_x ← (number) $a + (byte) main::p_y ← (number) $a + (byte) main::c_center_x#0 ← (byte) main::p_x + (byte) main::c_center_y#0 ← (byte) main::p_y + (byte) main::c_radius ← (number) 5 (byte*) main::SCREEN ← ((byte*)) (number) $400 *((byte*) main::SCREEN + (number) 0) ← (byte) main::c_center_x#0 *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_center_y#0 - *((byte*) main::SCREEN + (number) 2) ← (byte) main::c_radius#0 + *((byte*) main::SCREEN + (number) 2) ← (byte) main::c_radius to:main::@return main::@return: scope:[main] from main return @@ -65,22 +65,19 @@ SYMBOL TABLE SSA (byte) main::c_center_y (byte) main::c_center_y#0 (byte) main::c_radius -(byte) main::c_radius#0 (byte) main::p_x -(byte) main::p_x#0 (byte) main::p_y -(byte) main::p_y#0 -Adding number conversion cast (unumber) $a in (byte) main::p_x#0 ← (number) $a -Adding number conversion cast (unumber) $a in (byte) main::p_y#0 ← (number) $a -Adding number conversion cast (unumber) 5 in (byte) main::c_radius#0 ← (number) 5 +Adding number conversion cast (unumber) $a in (byte) main::p_x ← (number) $a +Adding number conversion cast (unumber) $a in (byte) main::p_y ← (number) $a +Adding number conversion cast (unumber) 5 in (byte) main::c_radius ← (number) 5 Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::c_center_x#0 Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_center_y#0 -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::c_radius#0 +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::c_radius Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::p_x#0 ← (unumber)(number) $a -Inlining cast (byte) main::p_y#0 ← (unumber)(number) $a -Inlining cast (byte) main::c_radius#0 ← (unumber)(number) 5 +Inlining cast (byte) main::p_x ← (unumber)(number) $a +Inlining cast (byte) main::p_y ← (unumber)(number) $a +Inlining cast (byte) main::c_radius ← (unumber)(number) 5 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $a @@ -98,15 +95,15 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte) main::p_x#0 = (byte) main::c_center_x#0 -Alias (byte) main::p_y#0 = (byte) main::c_center_y#0 +Alias (byte) main::p_x = (byte) main::c_center_x#0 +Alias (byte) main::p_y = (byte) main::c_center_y#0 Successful SSA optimization Pass2AliasElimination -Constant (const byte) main::p_x#0 = $a -Constant (const byte) main::p_y#0 = $a -Constant (const byte) main::c_radius#0 = 5 +Constant (const byte) main::p_x = $a +Constant (const byte) main::p_y = $a +Constant (const byte) main::c_radius = 5 Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x#0 +Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x Successful SSA optimization PassNSimplifyExpressionWithZero Consolidated array index constant in *(main::SCREEN+1) Consolidated array index constant in *(main::SCREEN+2) @@ -138,9 +135,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 - [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y + [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius to:main::@return main::@return: scope:[main] from main [7] return @@ -155,9 +152,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(byte) main::p_x -(byte) main::p_y Initial phi equivalence classes Complete equivalence classes @@ -191,13 +185,13 @@ main: { .const p_y = $a .const c_radius = 5 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+2 jmp breturn @@ -209,9 +203,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [Point] @@ -252,13 +246,13 @@ main: { .const p_y = $a .const c_radius = 5 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+2 jmp breturn @@ -300,12 +294,9 @@ FINAL SYMBOL TABLE (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(const byte) main::c_radius#0 c_radius = (byte) 5 -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::c_radius c_radius = (byte) 5 +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a @@ -332,15 +323,15 @@ main: { .const c_radius = 5 .label SCREEN = $400 // SCREEN[0] = c.center.x - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN // SCREEN[1] = c.center.y - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 // SCREEN[2] = c.radius - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+2 // main::@return diff --git a/src/test/ref/struct-6.sym b/src/test/ref/struct-6.sym index 45dd5adfe..266e091fa 100644 --- a/src/test/ref/struct-6.sym +++ b/src/test/ref/struct-6.sym @@ -10,10 +10,7 @@ (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(const byte) main::c_radius#0 c_radius = (byte) 5 -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::c_radius c_radius = (byte) 5 +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a diff --git a/src/test/ref/struct-7.cfg b/src/test/ref/struct-7.cfg index d11b3e6e2..1800c34c9 100644 --- a/src/test/ref/struct-7.cfg +++ b/src/test/ref/struct-7.cfg @@ -10,12 +10,12 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 - [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 - [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 - [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 - [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y + [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius + [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x + [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y + [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius to:main::@return main::@return: scope:[main] from main [10] return diff --git a/src/test/ref/struct-7.log b/src/test/ref/struct-7.log index b6c75d99d..2a374f685 100644 --- a/src/test/ref/struct-7.log +++ b/src/test/ref/struct-7.log @@ -52,19 +52,19 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::t_c1_center_x#0 ← (number) 1 - (byte) main::t_c1_center_y#0 ← (number) 2 - (byte) main::t_c1_radius#0 ← (number) 3 - (byte) main::t_c2_center_x#0 ← (number) 4 - (byte) main::t_c2_center_y#0 ← (number) 5 - (byte) main::t_c2_radius#0 ← (number) 6 + (byte) main::t_c1_center_x ← (number) 1 + (byte) main::t_c1_center_y ← (number) 2 + (byte) main::t_c1_radius ← (number) 3 + (byte) main::t_c2_center_x ← (number) 4 + (byte) main::t_c2_center_y ← (number) 5 + (byte) main::t_c2_radius ← (number) 6 (byte*) main::SCREEN ← ((byte*)) (number) $400 - *((byte*) main::SCREEN + (number) 0) ← (byte) main::t_c1_center_x#0 - *((byte*) main::SCREEN + (number) 1) ← (byte) main::t_c1_center_y#0 - *((byte*) main::SCREEN + (number) 2) ← (byte) main::t_c1_radius#0 - *((byte*) main::SCREEN + (number) 3) ← (byte) main::t_c2_center_x#0 - *((byte*) main::SCREEN + (number) 4) ← (byte) main::t_c2_center_y#0 - *((byte*) main::SCREEN + (number) 5) ← (byte) main::t_c2_radius#0 + *((byte*) main::SCREEN + (number) 0) ← (byte) main::t_c1_center_x + *((byte*) main::SCREEN + (number) 1) ← (byte) main::t_c1_center_y + *((byte*) main::SCREEN + (number) 2) ← (byte) main::t_c1_radius + *((byte*) main::SCREEN + (number) 3) ← (byte) main::t_c2_center_x + *((byte*) main::SCREEN + (number) 4) ← (byte) main::t_c2_center_y + *((byte*) main::SCREEN + (number) 5) ← (byte) main::t_c2_radius to:main::@return main::@return: scope:[main] from main return @@ -91,37 +91,31 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte) main::t_c1_center_x -(byte) main::t_c1_center_x#0 (byte) main::t_c1_center_y -(byte) main::t_c1_center_y#0 (byte) main::t_c1_radius -(byte) main::t_c1_radius#0 (byte) main::t_c2_center_x -(byte) main::t_c2_center_x#0 (byte) main::t_c2_center_y -(byte) main::t_c2_center_y#0 (byte) main::t_c2_radius -(byte) main::t_c2_radius#0 -Adding number conversion cast (unumber) 1 in (byte) main::t_c1_center_x#0 ← (number) 1 -Adding number conversion cast (unumber) 2 in (byte) main::t_c1_center_y#0 ← (number) 2 -Adding number conversion cast (unumber) 3 in (byte) main::t_c1_radius#0 ← (number) 3 -Adding number conversion cast (unumber) 4 in (byte) main::t_c2_center_x#0 ← (number) 4 -Adding number conversion cast (unumber) 5 in (byte) main::t_c2_center_y#0 ← (number) 5 -Adding number conversion cast (unumber) 6 in (byte) main::t_c2_radius#0 ← (number) 6 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::t_c1_center_x#0 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::t_c1_center_y#0 -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::t_c1_radius#0 -Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN + (number) 3) ← (byte) main::t_c2_center_x#0 -Adding number conversion cast (unumber) 4 in *((byte*) main::SCREEN + (number) 4) ← (byte) main::t_c2_center_y#0 -Adding number conversion cast (unumber) 5 in *((byte*) main::SCREEN + (number) 5) ← (byte) main::t_c2_radius#0 +Adding number conversion cast (unumber) 1 in (byte) main::t_c1_center_x ← (number) 1 +Adding number conversion cast (unumber) 2 in (byte) main::t_c1_center_y ← (number) 2 +Adding number conversion cast (unumber) 3 in (byte) main::t_c1_radius ← (number) 3 +Adding number conversion cast (unumber) 4 in (byte) main::t_c2_center_x ← (number) 4 +Adding number conversion cast (unumber) 5 in (byte) main::t_c2_center_y ← (number) 5 +Adding number conversion cast (unumber) 6 in (byte) main::t_c2_radius ← (number) 6 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::t_c1_center_x +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::t_c1_center_y +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::t_c1_radius +Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN + (number) 3) ← (byte) main::t_c2_center_x +Adding number conversion cast (unumber) 4 in *((byte*) main::SCREEN + (number) 4) ← (byte) main::t_c2_center_y +Adding number conversion cast (unumber) 5 in *((byte*) main::SCREEN + (number) 5) ← (byte) main::t_c2_radius Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::t_c1_center_x#0 ← (unumber)(number) 1 -Inlining cast (byte) main::t_c1_center_y#0 ← (unumber)(number) 2 -Inlining cast (byte) main::t_c1_radius#0 ← (unumber)(number) 3 -Inlining cast (byte) main::t_c2_center_x#0 ← (unumber)(number) 4 -Inlining cast (byte) main::t_c2_center_y#0 ← (unumber)(number) 5 -Inlining cast (byte) main::t_c2_radius#0 ← (unumber)(number) 6 +Inlining cast (byte) main::t_c1_center_x ← (unumber)(number) 1 +Inlining cast (byte) main::t_c1_center_y ← (unumber)(number) 2 +Inlining cast (byte) main::t_c1_radius ← (unumber)(number) 3 +Inlining cast (byte) main::t_c2_center_x ← (unumber)(number) 4 +Inlining cast (byte) main::t_c2_center_y ← (unumber)(number) 5 +Inlining cast (byte) main::t_c2_radius ← (unumber)(number) 6 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 1 @@ -151,15 +145,15 @@ Finalized unsigned number type (byte) 3 Finalized unsigned number type (byte) 4 Finalized unsigned number type (byte) 5 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant (const byte) main::t_c1_center_x#0 = 1 -Constant (const byte) main::t_c1_center_y#0 = 2 -Constant (const byte) main::t_c1_radius#0 = 3 -Constant (const byte) main::t_c2_center_x#0 = 4 -Constant (const byte) main::t_c2_center_y#0 = 5 -Constant (const byte) main::t_c2_radius#0 = 6 +Constant (const byte) main::t_c1_center_x = 1 +Constant (const byte) main::t_c1_center_y = 2 +Constant (const byte) main::t_c1_radius = 3 +Constant (const byte) main::t_c2_center_x = 4 +Constant (const byte) main::t_c2_center_y = 5 +Constant (const byte) main::t_c2_radius = 6 Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [7] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::t_c1_center_x#0 +Simplifying expression containing zero main::SCREEN in [7] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::t_c1_center_x Successful SSA optimization PassNSimplifyExpressionWithZero Consolidated array index constant in *(main::SCREEN+1) Consolidated array index constant in *(main::SCREEN+2) @@ -194,12 +188,12 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 - [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 - [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 - [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 - [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y + [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius + [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x + [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y + [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius to:main::@return main::@return: scope:[main] from main [10] return @@ -214,12 +208,6 @@ VARIABLE REGISTER WEIGHTS (struct Circle) TwoCircles::c1 (struct Circle) TwoCircles::c2 (void()) main() -(byte) main::t_c1_center_x -(byte) main::t_c1_center_y -(byte) main::t_c1_radius -(byte) main::t_c2_center_x -(byte) main::t_c2_center_y -(byte) main::t_c2_radius Initial phi equivalence classes Complete equivalence classes @@ -256,22 +244,22 @@ main: { .const t_c2_center_y = 5 .const t_c2_radius = 6 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x -- _deref_pbuc1=vbuc2 lda #t_c1_center_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y -- _deref_pbuc1=vbuc2 lda #t_c1_center_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius -- _deref_pbuc1=vbuc2 lda #t_c1_radius sta SCREEN+2 - // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x -- _deref_pbuc1=vbuc2 lda #t_c2_center_x sta SCREEN+3 - // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y -- _deref_pbuc1=vbuc2 lda #t_c2_center_y sta SCREEN+4 - // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius -- _deref_pbuc1=vbuc2 lda #t_c2_radius sta SCREEN+5 jmp breturn @@ -283,12 +271,12 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [Point] @@ -334,22 +322,22 @@ main: { .const t_c2_center_y = 5 .const t_c2_radius = 6 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x -- _deref_pbuc1=vbuc2 lda #t_c1_center_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y -- _deref_pbuc1=vbuc2 lda #t_c1_center_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius -- _deref_pbuc1=vbuc2 lda #t_c1_radius sta SCREEN+2 - // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x -- _deref_pbuc1=vbuc2 lda #t_c2_center_x sta SCREEN+3 - // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y -- _deref_pbuc1=vbuc2 lda #t_c2_center_y sta SCREEN+4 - // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius -- _deref_pbuc1=vbuc2 lda #t_c2_radius sta SCREEN+5 jmp breturn @@ -391,18 +379,12 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::t_c1_center_x -(const byte) main::t_c1_center_x#0 t_c1_center_x = (byte) 1 -(byte) main::t_c1_center_y -(const byte) main::t_c1_center_y#0 t_c1_center_y = (byte) 2 -(byte) main::t_c1_radius -(const byte) main::t_c1_radius#0 t_c1_radius = (byte) 3 -(byte) main::t_c2_center_x -(const byte) main::t_c2_center_x#0 t_c2_center_x = (byte) 4 -(byte) main::t_c2_center_y -(const byte) main::t_c2_center_y#0 t_c2_center_y = (byte) 5 -(byte) main::t_c2_radius -(const byte) main::t_c2_radius#0 t_c2_radius = (byte) 6 +(const byte) main::t_c1_center_x t_c1_center_x = (byte) 1 +(const byte) main::t_c1_center_y t_c1_center_y = (byte) 2 +(const byte) main::t_c1_radius t_c1_radius = (byte) 3 +(const byte) main::t_c2_center_x t_c2_center_x = (byte) 4 +(const byte) main::t_c2_center_y t_c2_center_y = (byte) 5 +(const byte) main::t_c2_radius t_c2_radius = (byte) 6 @@ -432,27 +414,27 @@ main: { .const t_c2_radius = 6 .label SCREEN = $400 // SCREEN[0] = t.c1.center.x - // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::t_c1_center_x -- _deref_pbuc1=vbuc2 lda #t_c1_center_x sta SCREEN // SCREEN[1] = t.c1.center.y - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::t_c1_center_y -- _deref_pbuc1=vbuc2 lda #t_c1_center_y sta SCREEN+1 // SCREEN[2] = t.c1.radius - // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::t_c1_radius -- _deref_pbuc1=vbuc2 lda #t_c1_radius sta SCREEN+2 // SCREEN[3] = t.c2.center.x - // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x#0 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← (const byte) main::t_c2_center_x -- _deref_pbuc1=vbuc2 lda #t_c2_center_x sta SCREEN+3 // SCREEN[4] = t.c2.center.y - // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y#0 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::SCREEN+(byte) 4) ← (const byte) main::t_c2_center_y -- _deref_pbuc1=vbuc2 lda #t_c2_center_y sta SCREEN+4 // SCREEN[5] = t.c2.radius - // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius#0 -- _deref_pbuc1=vbuc2 + // [9] *((const byte*) main::SCREEN+(byte) 5) ← (const byte) main::t_c2_radius -- _deref_pbuc1=vbuc2 lda #t_c2_radius sta SCREEN+5 // main::@return diff --git a/src/test/ref/struct-7.sym b/src/test/ref/struct-7.sym index f4fbc08b0..53d7981db 100644 --- a/src/test/ref/struct-7.sym +++ b/src/test/ref/struct-7.sym @@ -10,16 +10,10 @@ (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(byte) main::t_c1_center_x -(const byte) main::t_c1_center_x#0 t_c1_center_x = (byte) 1 -(byte) main::t_c1_center_y -(const byte) main::t_c1_center_y#0 t_c1_center_y = (byte) 2 -(byte) main::t_c1_radius -(const byte) main::t_c1_radius#0 t_c1_radius = (byte) 3 -(byte) main::t_c2_center_x -(const byte) main::t_c2_center_x#0 t_c2_center_x = (byte) 4 -(byte) main::t_c2_center_y -(const byte) main::t_c2_center_y#0 t_c2_center_y = (byte) 5 -(byte) main::t_c2_radius -(const byte) main::t_c2_radius#0 t_c2_radius = (byte) 6 +(const byte) main::t_c1_center_x t_c1_center_x = (byte) 1 +(const byte) main::t_c1_center_y t_c1_center_y = (byte) 2 +(const byte) main::t_c1_radius t_c1_radius = (byte) 3 +(const byte) main::t_c2_center_x t_c2_center_x = (byte) 4 +(const byte) main::t_c2_center_y t_c2_center_y = (byte) 5 +(const byte) main::t_c2_radius t_c2_radius = (byte) 6 diff --git a/src/test/ref/struct-8.cfg b/src/test/ref/struct-8.cfg index 268b1038d..14e005794 100644 --- a/src/test/ref/struct-8.cfg +++ b/src/test/ref/struct-8.cfg @@ -10,9 +10,9 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 - [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y + [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius to:main::@return main::@return: scope:[main] from main [7] return diff --git a/src/test/ref/struct-8.log b/src/test/ref/struct-8.log index d2d6a59e2..683a2a0d1 100644 --- a/src/test/ref/struct-8.log +++ b/src/test/ref/struct-8.log @@ -32,17 +32,17 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::p_x#0 ← (number) $a - (byte) main::p_y#0 ← (number) $a - (byte) main::c_center_x#0 ← (byte) main::p_x#0 - (byte) main::c_center_y#0 ← (byte) main::p_y#0 - (byte) main::c_radius#0 ← (number) 5 + (byte) main::p_x ← (number) $a + (byte) main::p_y ← (number) $a + (byte) main::c_center_x#0 ← (byte) main::p_x + (byte) main::c_center_y#0 ← (byte) main::p_y + (byte) main::c_radius ← (number) 5 (byte) main::point_x#0 ← (byte) main::c_center_x#0 (byte) main::point_y#0 ← (byte) main::c_center_y#0 (byte*) main::SCREEN ← ((byte*)) (number) $400 *((byte*) main::SCREEN + (number) 0) ← (byte) main::point_x#0 *((byte*) main::SCREEN + (number) 1) ← (byte) main::point_y#0 - *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_radius#0 + *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_radius to:main::@return main::@return: scope:[main] from main return @@ -71,26 +71,23 @@ SYMBOL TABLE SSA (byte) main::c_center_y (byte) main::c_center_y#0 (byte) main::c_radius -(byte) main::c_radius#0 (byte) main::p_x -(byte) main::p_x#0 (byte) main::p_y -(byte) main::p_y#0 (byte) main::point_x (byte) main::point_x#0 (byte) main::point_y (byte) main::point_y#0 -Adding number conversion cast (unumber) $a in (byte) main::p_x#0 ← (number) $a -Adding number conversion cast (unumber) $a in (byte) main::p_y#0 ← (number) $a -Adding number conversion cast (unumber) 5 in (byte) main::c_radius#0 ← (number) 5 +Adding number conversion cast (unumber) $a in (byte) main::p_x ← (number) $a +Adding number conversion cast (unumber) $a in (byte) main::p_y ← (number) $a +Adding number conversion cast (unumber) 5 in (byte) main::c_radius ← (number) 5 Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::point_x#0 Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::point_y#0 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_radius#0 +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_radius Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::p_x#0 ← (unumber)(number) $a -Inlining cast (byte) main::p_y#0 ← (unumber)(number) $a -Inlining cast (byte) main::c_radius#0 ← (unumber)(number) 5 +Inlining cast (byte) main::p_x ← (unumber)(number) $a +Inlining cast (byte) main::p_y ← (unumber)(number) $a +Inlining cast (byte) main::c_radius ← (unumber)(number) 5 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $a @@ -108,15 +105,15 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte) main::p_x#0 = (byte) main::c_center_x#0 (byte) main::point_x#0 -Alias (byte) main::p_y#0 = (byte) main::c_center_y#0 (byte) main::point_y#0 +Alias (byte) main::p_x = (byte) main::c_center_x#0 (byte) main::point_x#0 +Alias (byte) main::p_y = (byte) main::c_center_y#0 (byte) main::point_y#0 Successful SSA optimization Pass2AliasElimination -Constant (const byte) main::p_x#0 = $a -Constant (const byte) main::p_y#0 = $a -Constant (const byte) main::c_radius#0 = 5 +Constant (const byte) main::p_x = $a +Constant (const byte) main::p_y = $a +Constant (const byte) main::c_radius = 5 Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [8] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x#0 +Simplifying expression containing zero main::SCREEN in [8] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x Successful SSA optimization PassNSimplifyExpressionWithZero Consolidated array index constant in *(main::SCREEN+1) Consolidated array index constant in *(main::SCREEN+1) @@ -148,9 +145,9 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 - [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y + [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius to:main::@return main::@return: scope:[main] from main [7] return @@ -165,9 +162,6 @@ VARIABLE REGISTER WEIGHTS (void()) main() (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(byte) main::p_x -(byte) main::p_y (byte) main::point_x (byte) main::point_y @@ -203,13 +197,13 @@ main: { .const p_y = $a .const c_radius = 5 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+1 jmp breturn @@ -221,9 +215,9 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [Point] @@ -264,13 +258,13 @@ main: { .const p_y = $a .const c_radius = 5 .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 - // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+1 jmp breturn @@ -312,12 +306,9 @@ FINAL SYMBOL TABLE (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(const byte) main::c_radius#0 c_radius = (byte) 5 -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::c_radius c_radius = (byte) 5 +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a (byte) main::point_x (byte) main::point_y @@ -346,15 +337,15 @@ main: { .const c_radius = 5 .label SCREEN = $400 // SCREEN[0] = point.x - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN // SCREEN[1] = point.y - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 // SCREEN[1] = c.radius - // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius#0 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::c_radius -- _deref_pbuc1=vbuc2 lda #c_radius sta SCREEN+1 // main::@return diff --git a/src/test/ref/struct-8.sym b/src/test/ref/struct-8.sym index e7eb57779..701cf4ba3 100644 --- a/src/test/ref/struct-8.sym +++ b/src/test/ref/struct-8.sym @@ -10,12 +10,9 @@ (const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::c_center_x (byte) main::c_center_y -(byte) main::c_radius -(const byte) main::c_radius#0 c_radius = (byte) 5 -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::c_radius c_radius = (byte) 5 +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a (byte) main::point_x (byte) main::point_y diff --git a/src/test/ref/struct-9.cfg b/src/test/ref/struct-9.cfg index 2f4363cb0..d62de61c3 100644 --- a/src/test/ref/struct-9.cfg +++ b/src/test/ref/struct-9.cfg @@ -10,8 +10,8 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#1 to:main::@return main::@return: scope:[main] from main diff --git a/src/test/ref/struct-9.log b/src/test/ref/struct-9.log index c7bb740d5..fb15b91eb 100644 --- a/src/test/ref/struct-9.log +++ b/src/test/ref/struct-9.log @@ -31,13 +31,13 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte) main::p_x#0 ← (number) $a - (byte) main::p_y#0 ← (number) $a + (byte) main::p_x ← (number) $a + (byte) main::p_y ← (number) $a (byte) main::c_center_x#0 ← (byte) 0 (byte) main::c_center_y#0 ← (byte) 0 (byte) main::c_radius#0 ← (byte) 0 - (byte) main::c_center_x#1 ← (byte) main::p_x#0 - (byte) main::c_center_y#1 ← (byte) main::p_y#0 + (byte) main::c_center_x#1 ← (byte) main::p_x + (byte) main::c_center_y#1 ← (byte) main::p_y (byte) main::c_radius#1 ← (number) $c (byte*) main::SCREEN ← ((byte*)) (number) $400 *((byte*) main::SCREEN + (number) 0) ← (byte) main::c_center_x#1 @@ -76,19 +76,17 @@ SYMBOL TABLE SSA (byte) main::c_radius#0 (byte) main::c_radius#1 (byte) main::p_x -(byte) main::p_x#0 (byte) main::p_y -(byte) main::p_y#0 -Adding number conversion cast (unumber) $a in (byte) main::p_x#0 ← (number) $a -Adding number conversion cast (unumber) $a in (byte) main::p_y#0 ← (number) $a +Adding number conversion cast (unumber) $a in (byte) main::p_x ← (number) $a +Adding number conversion cast (unumber) $a in (byte) main::p_y ← (number) $a Adding number conversion cast (unumber) $c in (byte) main::c_radius#1 ← (number) $c Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::c_center_x#1 Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte) main::c_center_y#1 Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte) main::c_radius#1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::p_x#0 ← (unumber)(number) $a -Inlining cast (byte) main::p_y#0 ← (unumber)(number) $a +Inlining cast (byte) main::p_x ← (unumber)(number) $a +Inlining cast (byte) main::p_y ← (unumber)(number) $a Inlining cast (byte) main::c_radius#1 ← (unumber)(number) $c Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast @@ -107,18 +105,18 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Alias (byte) main::p_x#0 = (byte) main::c_center_x#1 -Alias (byte) main::p_y#0 = (byte) main::c_center_y#1 +Alias (byte) main::p_x = (byte) main::c_center_x#1 +Alias (byte) main::p_y = (byte) main::c_center_y#1 Successful SSA optimization Pass2AliasElimination -Constant (const byte) main::p_x#0 = $a -Constant (const byte) main::p_y#0 = $a +Constant (const byte) main::p_x = $a +Constant (const byte) main::p_y = $a Constant (const byte) main::c_center_x#0 = 0 Constant (const byte) main::c_center_y#0 = 0 Constant (const byte) main::c_radius#0 = 0 Constant (const byte) main::c_radius#1 = $c Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x#0 +Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::c_center_x#0 Eliminating unused constant (const byte) main::c_center_y#0 @@ -154,8 +152,8 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 - [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 + [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x + [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#1 to:main::@return main::@return: scope:[main] from main @@ -172,8 +170,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::c_center_x (byte) main::c_center_y (byte) main::c_radius -(byte) main::p_x -(byte) main::p_y Initial phi equivalence classes Complete equivalence classes @@ -207,10 +203,10 @@ main: { .const p_y = $a .const c_radius = $c .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#1 -- _deref_pbuc1=vbuc2 @@ -225,8 +221,8 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES @@ -268,10 +264,10 @@ main: { .const p_y = $a .const c_radius = $c .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 // [6] *((const byte*) main::SCREEN+(byte) 2) ← (const byte) main::c_radius#1 -- _deref_pbuc1=vbuc2 @@ -318,10 +314,8 @@ FINAL SYMBOL TABLE (byte) main::c_center_y (byte) main::c_radius (const byte) main::c_radius#1 c_radius = (byte) $c -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a @@ -348,11 +342,11 @@ main: { .const c_radius = $c .label SCREEN = $400 // SCREEN[0] = c.center.x - // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← (const byte) main::p_x -- _deref_pbuc1=vbuc2 lda #p_x sta SCREEN // SCREEN[1] = c.center.y - // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y -- _deref_pbuc1=vbuc2 lda #p_y sta SCREEN+1 // SCREEN[2] = c.radius diff --git a/src/test/ref/struct-9.sym b/src/test/ref/struct-9.sym index 4f710b6a7..282dcfbe9 100644 --- a/src/test/ref/struct-9.sym +++ b/src/test/ref/struct-9.sym @@ -12,8 +12,6 @@ (byte) main::c_center_y (byte) main::c_radius (const byte) main::c_radius#1 c_radius = (byte) $c -(byte) main::p_x -(const byte) main::p_x#0 p_x = (byte) $a -(byte) main::p_y -(const byte) main::p_y#0 p_y = (byte) $a +(const byte) main::p_x p_x = (byte) $a +(const byte) main::p_y p_y = (byte) $a diff --git a/src/test/ref/struct-pos-fill.cfg b/src/test/ref/struct-pos-fill.cfg index d3fb90e69..52e24ecd5 100644 --- a/src/test/ref/struct-pos-fill.cfg +++ b/src/test/ref/struct-pos-fill.cfg @@ -32,7 +32,7 @@ main::@3: scope:[main] from main::@2 main::@4 [10] if((byte) row#12<(byte) 8) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@3 - [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 + [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE [12] (byte) line#2 ← ++ (byte) line#11 to:main::@1 main::@4: scope:[main] from main::@3 @@ -40,6 +40,6 @@ main::@4: scope:[main] from main::@3 [14] *((byte*)(const struct pos[$40]) p+(const byte) OFFSET_STRUCT_POS_Y + (byte~) main::$3) ← (byte) y#12 [15] *((byte*)(const struct pos[$40]) p + (byte~) main::$3) ← (byte) x#10 [16] (byte) idx#1 ← ++ (byte) idx#11 - [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 + [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE [18] (byte) row#2 ← ++ (byte) row#12 to:main::@3 diff --git a/src/test/ref/struct-pos-fill.log b/src/test/ref/struct-pos-fill.log index 5352ff5e2..f582290c6 100644 --- a/src/test/ref/struct-pos-fill.log +++ b/src/test/ref/struct-pos-fill.log @@ -15,8 +15,8 @@ Culled Empty Block (label) main::@10 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte) XSPACE#0 ← (number) $14 - (byte) YSPACE#0 ← (number) $14 + (byte) XSPACE ← (number) $14 + (byte) YSPACE ← (number) $14 (struct pos[$40]) p ← { fill( $40, 0) } (byte) idx#0 ← (byte) 0 (byte) line#0 ← (byte) 0 @@ -72,7 +72,7 @@ main::@5: scope:[main] from main::@4 (byte*) main::$5 ← (byte*)(struct pos[$40]) p + (const byte) OFFSET_STRUCT_POS_X *((byte*) main::$5 + (byte~) main::$3) ← (byte) x#6 (byte) idx#1 ← ++ (byte) idx#4 - (byte) x#2 ← (byte) x#6 + (byte) XSPACE#0 + (byte) x#2 ← (byte) x#6 + (byte) XSPACE (byte) row#2 ← ++ (byte) row#6 to:main::@4 main::@6: scope:[main] from main::@4 @@ -81,7 +81,7 @@ main::@6: scope:[main] from main::@4 (byte) x#13 ← phi( main::@4/(byte) x#10 ) (byte) line#6 ← phi( main::@4/(byte) line#9 ) (byte) y#5 ← phi( main::@4/(byte) y#8 ) - (byte) y#1 ← (byte) y#5 + (byte) YSPACE#0 + (byte) y#1 ← (byte) y#5 + (byte) YSPACE (byte) line#2 ← ++ (byte) line#6 to:main::@1 main::@return: scope:[main] from main::@1 @@ -128,9 +128,7 @@ SYMBOL TABLE SSA (const byte) OFFSET_STRUCT_POS_Y = (byte) 1 (const byte) SIZEOF_STRUCT_POS = (byte) 2 (byte) XSPACE -(byte) XSPACE#0 (byte) YSPACE -(byte) YSPACE#0 (byte) idx (byte) idx#0 (byte) idx#1 @@ -219,15 +217,15 @@ SYMBOL TABLE SSA (byte) y#8 (byte) y#9 -Adding number conversion cast (unumber) $14 in (byte) XSPACE#0 ← (number) $14 -Adding number conversion cast (unumber) $14 in (byte) YSPACE#0 ← (number) $14 +Adding number conversion cast (unumber) $14 in (byte) XSPACE ← (number) $14 +Adding number conversion cast (unumber) $14 in (byte) YSPACE ← (number) $14 Adding number conversion cast (unumber) 0 in (byte) line#1 ← (number) 0 Adding number conversion cast (unumber) 8 in (bool~) main::$0 ← (byte) line#5 < (number) 8 Adding number conversion cast (unumber) 0 in (byte) row#1 ← (number) 0 Adding number conversion cast (unumber) 8 in (bool~) main::$1 ← (byte) row#5 < (number) 8 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) XSPACE#0 ← (unumber)(number) $14 -Inlining cast (byte) YSPACE#0 ← (unumber)(number) $14 +Inlining cast (byte) XSPACE ← (unumber)(number) $14 +Inlining cast (byte) YSPACE ← (unumber)(number) $14 Inlining cast (byte) line#1 ← (unumber)(number) 0 Inlining cast (byte) row#1 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -285,8 +283,8 @@ Simple Condition (bool~) main::$1 [18] if((byte) row#12<(byte) 8) goto main::@5 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [2] (struct pos[$40]) p ← { fill( $40, 0) } Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) XSPACE#0 = $14 -Constant (const byte) YSPACE#0 = $14 +Constant (const byte) XSPACE = $14 +Constant (const byte) YSPACE = $14 Constant (const struct pos[$40]) p = { fill( $40, 0) } Constant (const byte) idx#0 = 0 Constant (const byte) line#0 = 0 @@ -394,7 +392,7 @@ main::@3: scope:[main] from main::@2 main::@4 [10] if((byte) row#12<(byte) 8) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@3 - [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 + [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE [12] (byte) line#2 ← ++ (byte) line#11 to:main::@1 main::@4: scope:[main] from main::@3 @@ -402,14 +400,12 @@ main::@4: scope:[main] from main::@3 [14] *((byte*)(const struct pos[$40]) p+(const byte) OFFSET_STRUCT_POS_Y + (byte~) main::$3) ← (byte) y#12 [15] *((byte*)(const struct pos[$40]) p + (byte~) main::$3) ← (byte) x#10 [16] (byte) idx#1 ← ++ (byte) idx#11 - [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 + [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE [18] (byte) row#2 ← ++ (byte) row#12 to:main::@3 VARIABLE REGISTER WEIGHTS -(byte) XSPACE -(byte) YSPACE (byte) idx (byte) idx#1 67.33333333333333 (byte) idx#11 46.42857142857143 @@ -538,7 +534,7 @@ main: { jmp b5 // main::@5 b5: - // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z y axs #-[YSPACE] stx.z y @@ -567,7 +563,7 @@ main: { sta p,y // [16] (byte) idx#1 ← ++ (byte) idx#11 -- vbuz1=_inc_vbuz1 inc.z idx - // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z x axs #-[XSPACE] stx.z x @@ -584,7 +580,7 @@ main: { p: .fill 2*$40, 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 [ line#11 x#10 idx#11 y#1 ] ( main:2 [ line#11 x#10 idx#11 y#1 ] ) always clobbers reg byte a +Statement [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE [ line#11 x#10 idx#11 y#1 ] ( main:2 [ line#11 x#10 idx#11 y#1 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ line#11 line#2 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ x#3 x#10 x#1 x#2 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ idx#12 idx#11 idx#1 ] @@ -594,12 +590,12 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ ro Statement [14] *((byte*)(const struct pos[$40]) p+(const byte) OFFSET_STRUCT_POS_Y + (byte~) main::$3) ← (byte) y#12 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ( main:2 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ main::$3 ] Statement [15] *((byte*)(const struct pos[$40]) p + (byte~) main::$3) ← (byte) x#10 [ line#11 y#12 x#10 idx#11 row#12 ] ( main:2 [ line#11 y#12 x#10 idx#11 row#12 ] ) always clobbers reg byte a -Statement [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 [ line#11 y#12 row#12 idx#1 x#2 ] ( main:2 [ line#11 y#12 row#12 idx#1 x#2 ] ) always clobbers reg byte a -Statement [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 [ line#11 x#10 idx#11 y#1 ] ( main:2 [ line#11 x#10 idx#11 y#1 ] ) always clobbers reg byte a +Statement [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE [ line#11 y#12 row#12 idx#1 x#2 ] ( main:2 [ line#11 y#12 row#12 idx#1 x#2 ] ) always clobbers reg byte a +Statement [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE [ line#11 x#10 idx#11 y#1 ] ( main:2 [ line#11 x#10 idx#11 y#1 ] ) always clobbers reg byte a Statement [13] (byte~) main::$3 ← (byte) idx#11 << (byte) 1 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ( main:2 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ) always clobbers reg byte a Statement [14] *((byte*)(const struct pos[$40]) p+(const byte) OFFSET_STRUCT_POS_Y + (byte~) main::$3) ← (byte) y#12 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ( main:2 [ line#11 y#12 x#10 idx#11 row#12 main::$3 ] ) always clobbers reg byte a Statement [15] *((byte*)(const struct pos[$40]) p + (byte~) main::$3) ← (byte) x#10 [ line#11 y#12 x#10 idx#11 row#12 ] ( main:2 [ line#11 y#12 x#10 idx#11 row#12 ] ) always clobbers reg byte a -Statement [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 [ line#11 y#12 row#12 idx#1 x#2 ] ( main:2 [ line#11 y#12 row#12 idx#1 x#2 ] ) always clobbers reg byte a +Statement [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE [ line#11 y#12 row#12 idx#1 x#2 ] ( main:2 [ line#11 y#12 row#12 idx#1 x#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ line#11 line#2 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ x#3 x#10 x#1 x#2 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ idx#12 idx#11 idx#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -706,7 +702,7 @@ main: { jmp b5 // main::@5 b5: - // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z y axs #-[YSPACE] stx.z y @@ -733,7 +729,7 @@ main: { sta p,x // [16] (byte) idx#1 ← ++ (byte) idx#11 -- vbuz1=_inc_vbuz1 inc.z idx - // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z x axs #-[XSPACE] stx.z x @@ -785,10 +781,8 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte) OFFSET_STRUCT_POS_Y OFFSET_STRUCT_POS_Y = (byte) 1 -(byte) XSPACE -(const byte) XSPACE#0 XSPACE = (byte) $14 -(byte) YSPACE -(const byte) YSPACE#0 YSPACE = (byte) $14 +(const byte) XSPACE XSPACE = (byte) $14 +(const byte) YSPACE YSPACE = (byte) $14 (byte) idx (byte) idx#1 idx zp ZP_BYTE:4 67.33333333333333 (byte) idx#11 idx zp ZP_BYTE:4 46.42857142857143 @@ -893,7 +887,7 @@ main: { bcc b4 // main::@5 // y+=YSPACE - // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [11] (byte) y#1 ← (byte) y#12 + (const byte) YSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z y axs #-[YSPACE] stx.z y @@ -924,7 +918,7 @@ main: { // [16] (byte) idx#1 ← ++ (byte) idx#11 -- vbuz1=_inc_vbuz1 inc.z idx // x+=XSPACE - // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE#0 -- vbuz1=vbuz1_plus_vbuc1 + // [17] (byte) x#2 ← (byte) x#10 + (const byte) XSPACE -- vbuz1=vbuz1_plus_vbuc1 lax.z x axs #-[XSPACE] stx.z x diff --git a/src/test/ref/struct-pos-fill.sym b/src/test/ref/struct-pos-fill.sym index 199ba1ae9..0fa882159 100644 --- a/src/test/ref/struct-pos-fill.sym +++ b/src/test/ref/struct-pos-fill.sym @@ -2,10 +2,8 @@ (label) @begin (label) @end (const byte) OFFSET_STRUCT_POS_Y OFFSET_STRUCT_POS_Y = (byte) 1 -(byte) XSPACE -(const byte) XSPACE#0 XSPACE = (byte) $14 -(byte) YSPACE -(const byte) YSPACE#0 YSPACE = (byte) $14 +(const byte) XSPACE XSPACE = (byte) $14 +(const byte) YSPACE YSPACE = (byte) $14 (byte) idx (byte) idx#1 idx zp ZP_BYTE:4 67.33333333333333 (byte) idx#11 idx zp ZP_BYTE:4 46.42857142857143 diff --git a/src/test/ref/struct-ptr-13.cfg b/src/test/ref/struct-ptr-13.cfg index 7d7d73084..5bb655a6b 100644 --- a/src/test/ref/struct-ptr-13.cfg +++ b/src/test/ref/struct-ptr-13.cfg @@ -10,10 +10,10 @@ (void()) main() main: scope:[main] from @1 - [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 - [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 - [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) - [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 + [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 + [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) + [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) to:main::@return main::@return: scope:[main] from main [8] return diff --git a/src/test/ref/struct-ptr-13.log b/src/test/ref/struct-ptr-13.log index 2a6a2ad44..85d87d1ce 100644 --- a/src/test/ref/struct-ptr-13.log +++ b/src/test/ref/struct-ptr-13.log @@ -8,21 +8,21 @@ Identified constant variable (struct Point*) points CONTROL FLOW GRAPH SSA @begin: scope:[] from - (struct Point*) points#0 ← ((struct Point*)) (number) $1000 + (struct Point*) points ← ((struct Point*)) (number) $1000 to:@1 (void()) main() main: scope:[main] from @1 - (byte*) main::$0 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X - (byte*) main::$1 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X + (byte*) main::$0 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X + (byte*) main::$1 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X *((byte*) main::$1) ← *((byte*) main::$0) + (number) 5 - (byte*) main::$2 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y - (byte*) main::$3 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) main::$2 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) main::$3 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y *((byte*) main::$3) ← *((byte*) main::$2) + (number) 5 (byte*) main::SCREEN ← ((byte*)) (number) $400 - (byte*) main::$4 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X + (byte*) main::$4 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X *((byte*) main::SCREEN + (number) 0) ← *((byte*) main::$4) - (byte*) main::$5 ← (byte*)(struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) main::$5 ← (byte*)(struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y *((byte*) main::SCREEN + (number) 1) ← *((byte*) main::$5) to:main::@return main::@return: scope:[main] from main @@ -54,14 +54,13 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (struct Point*) points -(struct Point*) points#0 Adding number conversion cast (unumber) 5 in *((byte*) main::$1) ← *((byte*) main::$0) + (number) 5 Adding number conversion cast (unumber) 5 in *((byte*) main::$3) ← *((byte*) main::$2) + (number) 5 Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← *((byte*) main::$4) Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← *((byte*) main::$5) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (struct Point*) points#0 ← (struct Point*)(number) $1000 +Inlining cast (struct Point*) points ← (struct Point*)(number) $1000 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (struct Point*) 4096 @@ -76,42 +75,42 @@ Finalized unsigned number type (byte) 5 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant (const struct Point*) points#0 = (struct Point*) 4096 +Constant (const struct Point*) points = (struct Point*) 4096 Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (byte*)points#0 in [1] (byte*) main::$0 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)points#0 in [2] (byte*) main::$1 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)points#0 in [4] (byte*) main::$2 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y -Constant value identified (byte*)points#0 in [5] (byte*) main::$3 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y -Constant value identified (byte*)points#0 in [8] (byte*) main::$4 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)points#0 in [10] (byte*) main::$5 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)points in [1] (byte*) main::$0 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)points in [2] (byte*) main::$1 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)points in [4] (byte*) main::$2 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)points in [5] (byte*) main::$3 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)points in [8] (byte*) main::$4 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)points in [10] (byte*) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y Successful SSA optimization Pass2ConstantValues -Converting *(pointer+n) to pointer[n] [3] *((byte*) main::$1) ← *((byte*) main::$0) + (byte) 5 -- *((byte*)points#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [3] *((byte*) main::$1) ← *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X) + (byte) 5 -- *((byte*)points#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [6] *((byte*) main::$3) ← *((byte*) main::$2) + (byte) 5 -- *((byte*)points#0 + OFFSET_STRUCT_POINT_Y) -Converting *(pointer+n) to pointer[n] [6] *((byte*) main::$3) ← *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- *((byte*)points#0 + OFFSET_STRUCT_POINT_Y) -Converting *(pointer+n) to pointer[n] [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*) main::$4) -- *((byte*)points#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [11] *((const byte*) main::SCREEN + (byte) 1) ← *((byte*) main::$5) -- *((byte*)points#0 + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [3] *((byte*) main::$1) ← *((byte*) main::$0) + (byte) 5 -- *((byte*)points + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [3] *((byte*) main::$1) ← *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X) + (byte) 5 -- *((byte*)points + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [6] *((byte*) main::$3) ← *((byte*) main::$2) + (byte) 5 -- *((byte*)points + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [6] *((byte*) main::$3) ← *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- *((byte*)points + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*) main::$4) -- *((byte*)points + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [11] *((const byte*) main::SCREEN + (byte) 1) ← *((byte*) main::$5) -- *((byte*)points + OFFSET_STRUCT_POINT_Y) Successful SSA optimization Pass2InlineDerefIdx -Simplifying expression containing zero (byte*)points#0 in [1] (byte*) main::$0 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)points#0 in [2] (byte*) main::$1 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)points#0 in [3] *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X) + (byte) 5 -Simplifying expression containing zero (byte*)points#0 in [3] *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)(const struct Point*) points#0) + (byte) 5 -Simplifying expression containing zero (byte*)points#0 in [8] (byte*) main::$4 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)points#0 in [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_X) -Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points#0) +Simplifying expression containing zero (byte*)points in [1] (byte*) main::$0 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)points in [2] (byte*) main::$1 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)points in [3] *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X) + (byte) 5 +Simplifying expression containing zero (byte*)points in [3] *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)(const struct Point*) points) + (byte) 5 +Simplifying expression containing zero (byte*)points in [8] (byte*) main::$4 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)points in [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X) +Simplifying expression containing zero main::SCREEN in [9] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points) Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused variable (byte*) main::$0 and assignment [0] (byte*) main::$0 ← (byte*)(const struct Point*) points#0 -Eliminating unused variable (byte*) main::$1 and assignment [1] (byte*) main::$1 ← (byte*)(const struct Point*) points#0 -Eliminating unused variable (byte*) main::$2 and assignment [3] (byte*) main::$2 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y -Eliminating unused variable (byte*) main::$3 and assignment [4] (byte*) main::$3 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y -Eliminating unused variable (byte*) main::$4 and assignment [6] (byte*) main::$4 ← (byte*)(const struct Point*) points#0 -Eliminating unused variable (byte*) main::$5 and assignment [8] (byte*) main::$5 ← (byte*)(const struct Point*) points#0 + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) main::$0 and assignment [0] (byte*) main::$0 ← (byte*)(const struct Point*) points +Eliminating unused variable (byte*) main::$1 and assignment [1] (byte*) main::$1 ← (byte*)(const struct Point*) points +Eliminating unused variable (byte*) main::$2 and assignment [3] (byte*) main::$2 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) main::$3 and assignment [4] (byte*) main::$3 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) main::$4 and assignment [6] (byte*) main::$4 ← (byte*)(const struct Point*) points +Eliminating unused variable (byte*) main::$5 and assignment [8] (byte*) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X Successful SSA optimization PassNEliminateUnusedVars -Consolidated array index constant in *((byte*)points#0+OFFSET_STRUCT_POINT_Y) -Consolidated array index constant in *((byte*)points#0+OFFSET_STRUCT_POINT_Y) -Consolidated array index constant in *((byte*)points#0+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)points+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)points+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)points+OFFSET_STRUCT_POINT_Y) Consolidated array index constant in *(main::SCREEN+1) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin @@ -141,10 +140,10 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 - [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 - [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) - [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 + [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 + [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) + [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) to:main::@return main::@return: scope:[main] from main [8] return @@ -155,7 +154,6 @@ VARIABLE REGISTER WEIGHTS (byte) Point::x (byte) Point::y (void()) main() -(struct Point*) points Initial phi equivalence classes Complete equivalence classes @@ -188,20 +186,20 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 + // [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 lda #5 clc adc points sta points - // [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 + // [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 lda #5 clc adc points+OFFSET_STRUCT_POINT_Y sta points+OFFSET_STRUCT_POINT_Y - // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2 lda points sta SCREEN - // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 lda points+OFFSET_STRUCT_POINT_Y sta SCREEN+1 jmp breturn @@ -213,10 +211,10 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [Point] @@ -254,20 +252,20 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 + // [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 lda #5 clc adc points sta points - // [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 + // [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 lda #5 clc adc points+OFFSET_STRUCT_POINT_Y sta points+OFFSET_STRUCT_POINT_Y - // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2 lda points sta SCREEN - // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 lda points+OFFSET_STRUCT_POINT_Y sta SCREEN+1 jmp breturn @@ -306,8 +304,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(struct Point*) points -(const struct Point*) points#0 points = (struct Point*) 4096 +(const struct Point*) points points = (struct Point*) 4096 @@ -333,23 +330,23 @@ Score: 46 main: { .label SCREEN = $400 // points->x += 5 - // [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 + // [4] *((byte*)(const struct Point*) points) ← *((byte*)(const struct Point*) points) + (byte) 5 -- _deref_pbuc1=_deref_pbuc1_plus_vbuc2 lda #5 clc adc points sta points // points->y += 5 - // [5] *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 + // [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) + (byte) 5 -- _deref_pbuc1=_deref_pbuc2_plus_vbuc3 lda #5 clc adc points+OFFSET_STRUCT_POINT_Y sta points+OFFSET_STRUCT_POINT_Y // SCREEN[0] = points->x - // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points#0) -- _deref_pbuc1=_deref_pbuc2 + // [6] *((const byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2 lda points sta SCREEN // SCREEN[1] = points->y - // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points#0+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2 lda points+OFFSET_STRUCT_POINT_Y sta SCREEN+1 // main::@return diff --git a/src/test/ref/struct-ptr-13.sym b/src/test/ref/struct-ptr-13.sym index b8b840155..b9d516767 100644 --- a/src/test/ref/struct-ptr-13.sym +++ b/src/test/ref/struct-ptr-13.sym @@ -7,6 +7,5 @@ (void()) main() (label) main::@return (const byte*) main::SCREEN SCREEN = (byte*) 1024 -(struct Point*) points -(const struct Point*) points#0 points = (struct Point*) 4096 +(const struct Point*) points points = (struct Point*) 4096 diff --git a/src/test/ref/struct-ptr-16.cfg b/src/test/ref/struct-ptr-16.cfg index be73e2424..0e608a2af 100644 --- a/src/test/ref/struct-ptr-16.cfg +++ b/src/test/ref/struct-ptr-16.cfg @@ -50,8 +50,8 @@ get::@3: scope:[get] from get [27] if((byte) get::i#2==(byte) 1) goto get::@2 to:get::@4 get::@4: scope:[get] from get::@3 - [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0) - [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2#0+(const byte) OFFSET_STRUCT_POINT_Y) + [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2) + [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return get::@return: scope:[get] from get::@1 get::@2 get::@4 [30] (byte) get::return_y#5 ← phi( get::@1/(byte) get::return_y#2 get::@2/(byte) get::return_y#3 get::@4/(byte) get::return_y#4 ) @@ -59,10 +59,10 @@ get::@return: scope:[get] from get::@1 get::@2 get::@4 [31] return to:@return get::@2: scope:[get] from get::@3 - [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0) - [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1#0+(const byte) OFFSET_STRUCT_POINT_Y) + [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1) + [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return get::@1: scope:[get] from get - [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0) - [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0#0+(const byte) OFFSET_STRUCT_POINT_Y) + [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0) + [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return diff --git a/src/test/ref/struct-ptr-16.log b/src/test/ref/struct-ptr-16.log index 50a955b09..d86835526 100644 --- a/src/test/ref/struct-ptr-16.log +++ b/src/test/ref/struct-ptr-16.log @@ -93,9 +93,9 @@ main::@return: scope:[main] from main::@4 return to:@return @1: scope:[] from @begin - (struct Point*) p0#0 ← ((struct Point*)) (number) $a000 - (struct Point*) p1#0 ← ((struct Point*)) (number) $b000 - (struct Point*) p2#0 ← ((struct Point*)) (number) $e000 + (struct Point*) p0 ← ((struct Point*)) (number) $a000 + (struct Point*) p1 ← ((struct Point*)) (number) $b000 + (struct Point*) p2 ← ((struct Point*)) (number) $e000 to:@2 (struct Point()) get((byte) get::i) @@ -105,9 +105,9 @@ get: scope:[get] from main main::@1 if((bool~) get::$0) goto get::@1 to:get::@5 get::@1: scope:[get] from get - (byte*) get::$2 ← (byte*)(struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_X + (byte*) get::$2 ← (byte*)(struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X (byte) get::return_x#2 ← *((byte*) get::$2) - (byte*) get::$3 ← (byte*)(struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) get::$3 ← (byte*)(struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_Y (byte) get::return_y#2 ← *((byte*) get::$3) (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (byte) get::return_y#2} to:get::@return @@ -117,16 +117,16 @@ get::@5: scope:[get] from get if((bool~) get::$1) goto get::@2 to:get::@6 get::@2: scope:[get] from get::@5 - (byte*) get::$4 ← (byte*)(struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_X + (byte*) get::$4 ← (byte*)(struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X (byte) get::return_x#3 ← *((byte*) get::$4) - (byte*) get::$5 ← (byte*)(struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) get::$5 ← (byte*)(struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_Y (byte) get::return_y#3 ← *((byte*) get::$5) (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#3, (byte) get::return_y#3} to:get::@return get::@6: scope:[get] from get::@5 - (byte*) get::$6 ← (byte*)(struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_X + (byte*) get::$6 ← (byte*)(struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X (byte) get::return_x#4 ← *((byte*) get::$6) - (byte*) get::$7 ← (byte*)(struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_Y + (byte*) get::$7 ← (byte*)(struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_Y (byte) get::return_y#4 ← *((byte*) get::$7) (struct Point) get::return#2 ← struct-unwound {(byte) get::return_x#4, (byte) get::return_y#4} to:get::@return @@ -224,11 +224,8 @@ SYMBOL TABLE SSA (byte) main::i#2 (byte) main::i#3 (struct Point*) p0 -(struct Point*) p0#0 (struct Point*) p1 -(struct Point*) p1#0 (struct Point*) p2 -(struct Point*) p2#0 Adding number conversion cast (unumber) 0 in (byte) get::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) get::$0 ← (byte) get::i#2 == (number) 0 @@ -236,9 +233,9 @@ Adding number conversion cast (unumber) 1 in (bool~) get::$1 ← (byte) get::i#3 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (struct Point*) SCREEN ← (struct Point*)(number) $400 Inlining cast (byte) get::i#0 ← (unumber)(number) 0 -Inlining cast (struct Point*) p0#0 ← (struct Point*)(number) $a000 -Inlining cast (struct Point*) p1#0 ← (struct Point*)(number) $b000 -Inlining cast (struct Point*) p2#0 ← (struct Point*)(number) $e000 +Inlining cast (struct Point*) p0 ← (struct Point*)(number) $a000 +Inlining cast (struct Point*) p1 ← (struct Point*)(number) $b000 +Inlining cast (struct Point*) p2 ← (struct Point*)(number) $e000 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (struct Point*) 1024 Simplifying constant integer cast 0 @@ -268,52 +265,52 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const struct Point*) SCREEN = (struct Point*) 1024 Constant (const byte) get::i#0 = 0 Constant (const byte) main::i#0 = 1 -Constant (const struct Point*) p0#0 = (struct Point*) 40960 -Constant (const struct Point*) p1#0 = (struct Point*) 45056 -Constant (const struct Point*) p2#0 = (struct Point*) 57344 +Constant (const struct Point*) p0 = (struct Point*) 40960 +Constant (const struct Point*) p1 = (struct Point*) 45056 +Constant (const struct Point*) p2 = (struct Point*) 57344 Successful SSA optimization Pass2ConstantIdentification Constant value identified (byte*)SCREEN in [8] (byte*) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X Constant value identified (byte*)SCREEN in [10] (byte*) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y Constant value identified (byte*)SCREEN in [22] (byte*) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X Constant value identified (byte*)SCREEN in [24] (byte*) main::$7 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y -Constant value identified (byte*)p0#0 in [36] (byte*) get::$2 ← (byte*)(const struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)p0#0 in [38] (byte*) get::$3 ← (byte*)(const struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_Y -Constant value identified (byte*)p1#0 in [44] (byte*) get::$4 ← (byte*)(const struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)p1#0 in [46] (byte*) get::$5 ← (byte*)(const struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_Y -Constant value identified (byte*)p2#0 in [49] (byte*) get::$6 ← (byte*)(const struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_X -Constant value identified (byte*)p2#0 in [51] (byte*) get::$7 ← (byte*)(const struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)p0 in [36] (byte*) get::$2 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)p0 in [38] (byte*) get::$3 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)p1 in [44] (byte*) get::$4 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)p1 in [46] (byte*) get::$5 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_Y +Constant value identified (byte*)p2 in [49] (byte*) get::$6 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X +Constant value identified (byte*)p2 in [51] (byte*) get::$7 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_Y Successful SSA optimization Pass2ConstantValues Resolved ranged next value [26] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [28] if(main::i#1!=rangelast(1,2)) goto main::@1 to (number) 3 Converting *(pointer+n) to pointer[n] [9] *((byte*) main::$4) ← (byte) main::$0_x -- *((byte*)SCREEN + OFFSET_STRUCT_POINT_X) Converting *(pointer+n) to pointer[n] [11] *((byte*) main::$5) ← (byte) main::$0_y -- *((byte*)SCREEN + OFFSET_STRUCT_POINT_Y) -Converting *(pointer+n) to pointer[n] [37] (byte) get::return_x#2 ← *((byte*) get::$2) -- *((byte*)p0#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [39] (byte) get::return_y#2 ← *((byte*) get::$3) -- *((byte*)p0#0 + OFFSET_STRUCT_POINT_Y) -Converting *(pointer+n) to pointer[n] [45] (byte) get::return_x#3 ← *((byte*) get::$4) -- *((byte*)p1#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [47] (byte) get::return_y#3 ← *((byte*) get::$5) -- *((byte*)p1#0 + OFFSET_STRUCT_POINT_Y) -Converting *(pointer+n) to pointer[n] [50] (byte) get::return_x#4 ← *((byte*) get::$6) -- *((byte*)p2#0 + OFFSET_STRUCT_POINT_X) -Converting *(pointer+n) to pointer[n] [52] (byte) get::return_y#4 ← *((byte*) get::$7) -- *((byte*)p2#0 + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [37] (byte) get::return_x#2 ← *((byte*) get::$2) -- *((byte*)p0 + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [39] (byte) get::return_y#2 ← *((byte*) get::$3) -- *((byte*)p0 + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [45] (byte) get::return_x#3 ← *((byte*) get::$4) -- *((byte*)p1 + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [47] (byte) get::return_y#3 ← *((byte*) get::$5) -- *((byte*)p1 + OFFSET_STRUCT_POINT_Y) +Converting *(pointer+n) to pointer[n] [50] (byte) get::return_x#4 ← *((byte*) get::$6) -- *((byte*)p2 + OFFSET_STRUCT_POINT_X) +Converting *(pointer+n) to pointer[n] [52] (byte) get::return_y#4 ← *((byte*) get::$7) -- *((byte*)p2 + OFFSET_STRUCT_POINT_Y) Successful SSA optimization Pass2InlineDerefIdx Simplifying expression containing zero (byte*)SCREEN in [8] (byte*) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X Simplifying expression containing zero (byte*)SCREEN in [9] *((byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) main::$0_x Simplifying expression containing zero (byte*)SCREEN in [22] (byte*) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)p0#0 in [36] (byte*) get::$2 ← (byte*)(const struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)p0#0 in [37] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_X) -Simplifying expression containing zero (byte*)p1#0 in [44] (byte*) get::$4 ← (byte*)(const struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)p1#0 in [45] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_X) -Simplifying expression containing zero (byte*)p2#0 in [49] (byte*) get::$6 ← (byte*)(const struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_X -Simplifying expression containing zero (byte*)p2#0 in [50] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_X) +Simplifying expression containing zero (byte*)p0 in [36] (byte*) get::$2 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)p0 in [37] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X) +Simplifying expression containing zero (byte*)p1 in [44] (byte*) get::$4 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)p1 in [45] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X) +Simplifying expression containing zero (byte*)p2 in [49] (byte*) get::$6 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X +Simplifying expression containing zero (byte*)p2 in [50] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X) Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused variable (byte*) main::$4 and assignment [5] (byte*) main::$4 ← (byte*)(const struct Point*) SCREEN Eliminating unused variable (byte*) main::$5 and assignment [7] (byte*) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y -Eliminating unused variable (byte*) get::$2 and assignment [26] (byte*) get::$2 ← (byte*)(const struct Point*) p0#0 -Eliminating unused variable (byte*) get::$3 and assignment [28] (byte*) get::$3 ← (byte*)(const struct Point*) p0#0 + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) get::$2 and assignment [26] (byte*) get::$2 ← (byte*)(const struct Point*) p0 +Eliminating unused variable (byte*) get::$3 and assignment [28] (byte*) get::$3 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_Y Eliminating unused variable (struct Point) get::return#0 and assignment [30] (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (byte) get::return_y#2} -Eliminating unused variable (byte*) get::$4 and assignment [32] (byte*) get::$4 ← (byte*)(const struct Point*) p1#0 -Eliminating unused variable (byte*) get::$5 and assignment [34] (byte*) get::$5 ← (byte*)(const struct Point*) p1#0 + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) get::$4 and assignment [32] (byte*) get::$4 ← (byte*)(const struct Point*) p1 +Eliminating unused variable (byte*) get::$5 and assignment [34] (byte*) get::$5 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_Y Eliminating unused variable (struct Point) get::return#1 and assignment [36] (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#3, (byte) get::return_y#3} -Eliminating unused variable (byte*) get::$6 and assignment [37] (byte*) get::$6 ← (byte*)(const struct Point*) p2#0 -Eliminating unused variable (byte*) get::$7 and assignment [39] (byte*) get::$7 ← (byte*)(const struct Point*) p2#0 + (const byte) OFFSET_STRUCT_POINT_Y +Eliminating unused variable (byte*) get::$6 and assignment [37] (byte*) get::$6 ← (byte*)(const struct Point*) p2 +Eliminating unused variable (byte*) get::$7 and assignment [39] (byte*) get::$7 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_Y Eliminating unused variable (struct Point) get::return#2 and assignment [41] (struct Point) get::return#2 ← struct-unwound {(byte) get::return_x#4, (byte) get::return_y#4} Eliminating unused variable (struct Point) get::return#3 and assignment [43] (struct Point) get::return#3 ← struct-unwound {(byte) get::return_x#5, (byte) get::return_y#5} Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X @@ -339,9 +336,9 @@ Constant inlined get::i#0 = (byte) 0 Constant inlined main::$7 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *((byte*)SCREEN+OFFSET_STRUCT_POINT_Y) -Consolidated array index constant in *((byte*)p0#0+OFFSET_STRUCT_POINT_Y) -Consolidated array index constant in *((byte*)p1#0+OFFSET_STRUCT_POINT_Y) -Consolidated array index constant in *((byte*)p2#0+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)p0+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)p1+OFFSET_STRUCT_POINT_Y) +Consolidated array index constant in *((byte*)p2+OFFSET_STRUCT_POINT_Y) Successful SSA optimization Pass2ConstantAdditionElimination Eliminating unused constant (const byte) SIZEOF_STRUCT_POINT Successful SSA optimization PassNEliminateUnusedVars @@ -432,8 +429,8 @@ get::@3: scope:[get] from get [27] if((byte) get::i#2==(byte) 1) goto get::@2 to:get::@4 get::@4: scope:[get] from get::@3 - [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0) - [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2#0+(const byte) OFFSET_STRUCT_POINT_Y) + [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2) + [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return get::@return: scope:[get] from get::@1 get::@2 get::@4 [30] (byte) get::return_y#5 ← phi( get::@1/(byte) get::return_y#2 get::@2/(byte) get::return_y#3 get::@4/(byte) get::return_y#4 ) @@ -441,12 +438,12 @@ get::@return: scope:[get] from get::@1 get::@2 get::@4 [31] return to:@return get::@2: scope:[get] from get::@3 - [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0) - [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1#0+(const byte) OFFSET_STRUCT_POINT_Y) + [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1) + [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return get::@1: scope:[get] from get - [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0) - [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0#0+(const byte) OFFSET_STRUCT_POINT_Y) + [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0) + [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y) to:get::@return @@ -483,9 +480,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 4.4 -(struct Point*) p0 -(struct Point*) p1 -(struct Point*) p2 Initial phi equivalence classes [ main::i#2 main::i#1 ] @@ -684,10 +678,10 @@ get: { jmp b4 // get::@4 b4: - // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0) -- vbuz1=_deref_pbuc1 + // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2) -- vbuz1=_deref_pbuc1 lda p2 sta.z return_x_4 - // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p2+OFFSET_STRUCT_POINT_Y sta.z return_y_4 // [30] phi from get::@1 get::@2 get::@4 to get::@return [phi:get::@1/get::@2/get::@4->get::@return] @@ -703,19 +697,19 @@ get: { rts // get::@2 b2: - // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0) -- vbuz1=_deref_pbuc1 + // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1) -- vbuz1=_deref_pbuc1 lda p1 sta.z return_x_3 - // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p1+OFFSET_STRUCT_POINT_Y sta.z return_y_3 jmp breturn_from_b2 // get::@1 b1: - // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0) -- vbuz1=_deref_pbuc1 + // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0) -- vbuz1=_deref_pbuc1 lda p0 sta.z return_x_2 - // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p0+OFFSET_STRUCT_POINT_Y sta.z return_y_2 jmp breturn_from_b1 @@ -895,9 +889,9 @@ get: { jmp b4 // get::@4 b4: - // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0) -- vbuxx=_deref_pbuc1 + // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2) -- vbuxx=_deref_pbuc1 ldx p2 - // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p2+OFFSET_STRUCT_POINT_Y sta.z return_y // [30] phi from get::@1 get::@2 get::@4 to get::@return [phi:get::@1/get::@2/get::@4->get::@return] @@ -913,17 +907,17 @@ get: { rts // get::@2 b2: - // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0) -- vbuxx=_deref_pbuc1 + // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1) -- vbuxx=_deref_pbuc1 ldx p1 - // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p1+OFFSET_STRUCT_POINT_Y sta.z return_y jmp breturn_from_b2 // get::@1 b1: - // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0) -- vbuxx=_deref_pbuc1 + // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0) -- vbuxx=_deref_pbuc1 ldx p0 - // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p0+OFFSET_STRUCT_POINT_Y sta.z return_y jmp breturn_from_b1 @@ -1022,12 +1016,9 @@ FINAL SYMBOL TABLE (byte) main::i (byte) main::i#1 reg byte y 16.5 (byte) main::i#2 reg byte y 4.4 -(struct Point*) p0 -(const struct Point*) p0#0 p0 = (struct Point*) 40960 -(struct Point*) p1 -(const struct Point*) p1#0 p1 = (struct Point*) 45056 -(struct Point*) p2 -(const struct Point*) p2#0 p2 = (struct Point*) 57344 +(const struct Point*) p0 p0 = (struct Point*) 40960 +(const struct Point*) p1 p1 = (struct Point*) 45056 +(const struct Point*) p2 p2 = (struct Point*) 57344 reg byte y [ main::i#2 main::i#1 ] reg byte a [ get::i#2 get::i#1 ] @@ -1147,9 +1138,9 @@ get: { beq b2 // get::@4 // return *p2; - // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2#0) -- vbuxx=_deref_pbuc1 + // [28] (byte) get::return_x#4 ← *((byte*)(const struct Point*) p2) -- vbuxx=_deref_pbuc1 ldx p2 - // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [29] (byte) get::return_y#4 ← *((byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p2+OFFSET_STRUCT_POINT_Y sta.z return_y // [30] phi from get::@1 get::@2 get::@4 to get::@return [phi:get::@1/get::@2/get::@4->get::@return] @@ -1162,18 +1153,18 @@ get: { // get::@2 b2: // return *p1; - // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1#0) -- vbuxx=_deref_pbuc1 + // [32] (byte) get::return_x#3 ← *((byte*)(const struct Point*) p1) -- vbuxx=_deref_pbuc1 ldx p1 - // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [33] (byte) get::return_y#3 ← *((byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p1+OFFSET_STRUCT_POINT_Y sta.z return_y rts // get::@1 b1: // return *p0; - // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0#0) -- vbuxx=_deref_pbuc1 + // [34] (byte) get::return_x#2 ← *((byte*)(const struct Point*) p0) -- vbuxx=_deref_pbuc1 ldx p0 - // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0#0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 + // [35] (byte) get::return_y#2 ← *((byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y) -- vbuz1=_deref_pbuc1 lda p0+OFFSET_STRUCT_POINT_Y sta.z return_y rts diff --git a/src/test/ref/struct-ptr-16.sym b/src/test/ref/struct-ptr-16.sym index a03d37fb6..49a15c968 100644 --- a/src/test/ref/struct-ptr-16.sym +++ b/src/test/ref/struct-ptr-16.sym @@ -44,12 +44,9 @@ (byte) main::i (byte) main::i#1 reg byte y 16.5 (byte) main::i#2 reg byte y 4.4 -(struct Point*) p0 -(const struct Point*) p0#0 p0 = (struct Point*) 40960 -(struct Point*) p1 -(const struct Point*) p1#0 p1 = (struct Point*) 45056 -(struct Point*) p2 -(const struct Point*) p2#0 p2 = (struct Point*) 57344 +(const struct Point*) p0 p0 = (struct Point*) 40960 +(const struct Point*) p1 p1 = (struct Point*) 45056 +(const struct Point*) p2 p2 = (struct Point*) 57344 reg byte y [ main::i#2 main::i#1 ] reg byte a [ get::i#2 get::i#1 ] diff --git a/src/test/ref/struct-ptr-17.cfg b/src/test/ref/struct-ptr-17.cfg index 3e1e1f0ce..a88be133a 100644 --- a/src/test/ref/struct-ptr-17.cfg +++ b/src/test/ref/struct-ptr-17.cfg @@ -17,7 +17,7 @@ main: scope:[main] from @1 main::@2: scope:[main] from main [7] (byte) main::$0_x ← (byte) get::return_x#0 [8] *((byte*)(const struct Point*) SCREEN) ← (byte) main::$0_x - [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 + [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y to:main::@1 main::@1: scope:[main] from main::@2 main::@3 [10] (byte) main::i#2 ← phi( main::@2/(byte) 1 main::@3/(byte) main::i#1 ) @@ -29,7 +29,7 @@ main::@3: scope:[main] from main::@1 [14] (byte) main::$1_x ← (byte) get::return_x#1 [15] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x - [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 + [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y [18] (byte) main::i#1 ← ++ (byte) main::i#2 [19] if((byte) main::i#1!=(byte) 3) goto main::@1 to:main::@return diff --git a/src/test/ref/struct-ptr-17.log b/src/test/ref/struct-ptr-17.log index 1d2768e3a..2635af611 100644 --- a/src/test/ref/struct-ptr-17.log +++ b/src/test/ref/struct-ptr-17.log @@ -89,9 +89,9 @@ main::@return: scope:[main] from main::@4 get: scope:[get] from main main::@1 (byte) get::i#2 ← phi( main/(byte) get::i#0 main::@1/(byte) get::i#1 ) (byte) get::p_x#0 ← (byte) get::i#2 - (byte) get::p_y#0 ← (number) 7 + (byte) get::p_y ← (number) 7 (byte) get::return_x#2 ← (byte) get::p_x#0 - (byte) get::return_y#2 ← (byte) get::p_y#0 + (byte) get::return_y#2 ← (byte) get::p_y (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (byte) get::return_y#2} to:get::@return get::@return: scope:[get] from get @@ -129,7 +129,6 @@ SYMBOL TABLE SSA (byte) get::p_x (byte) get::p_x#0 (byte) get::p_y -(byte) get::p_y#0 (struct Point) get::return (struct Point) get::return#0 (struct Point) get::return#1 @@ -173,11 +172,11 @@ SYMBOL TABLE SSA (byte) main::i#3 Adding number conversion cast (unumber) 0 in (byte) get::i#0 ← (number) 0 -Adding number conversion cast (unumber) 7 in (byte) get::p_y#0 ← (number) 7 +Adding number conversion cast (unumber) 7 in (byte) get::p_y ← (number) 7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (struct Point*) SCREEN ← (struct Point*)(number) $400 Inlining cast (byte) get::i#0 ← (unumber)(number) 0 -Inlining cast (byte) get::p_y#0 ← (unumber)(number) 7 +Inlining cast (byte) get::p_y ← (unumber)(number) 7 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (struct Point*) 1024 Simplifying constant integer cast 0 @@ -192,17 +191,17 @@ Alias (byte) get::return_x#1 = (byte) get::return_x#5 Alias (byte) get::return_y#1 = (byte) get::return_y#5 Alias (byte) main::i#2 = (byte) main::i#3 Alias (byte) get::return_x#2 = (byte) get::p_x#0 (byte) get::i#2 (byte) get::return_x#6 (byte) get::return_x#3 -Alias (byte) get::p_y#0 = (byte) get::return_y#2 (byte) get::return_y#6 (byte) get::return_y#3 +Alias (byte) get::p_y = (byte) get::return_y#2 (byte) get::return_y#6 (byte) get::return_y#3 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [28] if((byte) main::i#1!=rangelast(1,2)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const struct Point*) SCREEN = (struct Point*) 1024 Constant (const byte) get::i#0 = 0 Constant (const byte) main::i#0 = 1 -Constant (const byte) get::p_y#0 = 7 +Constant (const byte) get::p_y = 7 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) get::return_y#0 = get::p_y#0 -Constant (const byte) get::return_y#1 = get::p_y#0 +Constant (const byte) get::return_y#0 = get::p_y +Constant (const byte) get::return_y#1 = get::p_y Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::$0_y = get::return_y#0 Constant (const byte) main::$1_y = get::return_y#1 @@ -223,8 +222,8 @@ Simplifying expression containing zero (byte*)SCREEN in [22] (byte*) main::$6 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused variable (byte*) main::$4 and assignment [3] (byte*) main::$4 ← (byte*)(const struct Point*) SCREEN Eliminating unused variable (byte*) main::$5 and assignment [5] (byte*) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y -Eliminating unused variable (struct Point) get::return#0 and assignment [21] (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (const byte) get::p_y#0} -Eliminating unused variable (struct Point) get::return#1 and assignment [22] (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#2, (const byte) get::p_y#0} +Eliminating unused variable (struct Point) get::return#0 and assignment [21] (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (const byte) get::p_y} +Eliminating unused variable (struct Point) get::return#1 and assignment [22] (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#2, (const byte) get::p_y} Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X Successful SSA optimization PassNEliminateUnusedVars Adding number conversion cast (unumber) 3 in if((byte) main::i#1!=(number) 3) goto main::@1 @@ -242,13 +241,13 @@ Rewriting multiplication to use shift [10] (byte~) main::$3 ← (byte) main::i#2 Successful SSA optimization Pass2MultiplyToShiftRewriting Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) get::i#0 -Constant inlined main::$1_y = (const byte) get::p_y#0 -Constant inlined main::$0_y = (const byte) get::p_y#0 +Constant inlined main::$1_y = (const byte) get::p_y +Constant inlined main::$0_y = (const byte) get::p_y Constant inlined main::i#0 = (byte) 1 Constant inlined main::$6 = (byte*)(const struct Point*) SCREEN -Constant inlined get::return_y#0 = (const byte) get::p_y#0 +Constant inlined get::return_y#0 = (const byte) get::p_y Constant inlined get::i#0 = (byte) 0 -Constant inlined get::return_y#1 = (const byte) get::p_y#0 +Constant inlined get::return_y#1 = (const byte) get::p_y Constant inlined main::$7 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *((byte*)SCREEN+OFFSET_STRUCT_POINT_Y) @@ -299,7 +298,7 @@ main: scope:[main] from @1 main::@2: scope:[main] from main [7] (byte) main::$0_x ← (byte) get::return_x#0 [8] *((byte*)(const struct Point*) SCREEN) ← (byte) main::$0_x - [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 + [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y to:main::@1 main::@1: scope:[main] from main::@2 main::@3 [10] (byte) main::i#2 ← phi( main::@2/(byte) 1 main::@3/(byte) main::i#1 ) @@ -311,7 +310,7 @@ main::@3: scope:[main] from main::@1 [14] (byte) main::$1_x ← (byte) get::return_x#1 [15] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x - [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 + [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y [18] (byte) main::i#1 ← ++ (byte) main::i#2 [19] if((byte) main::i#1!=(byte) 3) goto main::@1 to:main::@return @@ -335,7 +334,6 @@ VARIABLE REGISTER WEIGHTS (byte) get::i (byte) get::i#1 22.0 (byte) get::p_x -(byte) get::p_y (struct Point) get::return (byte) get::return_x (byte) get::return_x#0 4.0 @@ -428,7 +426,7 @@ main: { // [8] *((byte*)(const struct Point*) SCREEN) ← (byte) main::$0_x -- _deref_pbuc1=vbuz1 lda.z _0_x sta SCREEN - // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 -- _deref_pbuc1=vbuc2 + // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y -- _deref_pbuc1=vbuc2 lda #get.p_y sta SCREEN+OFFSET_STRUCT_POINT_Y // [10] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -468,7 +466,7 @@ main: { lda.z _1_x ldy.z _3 sta SCREEN,y - // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y -- pbuc1_derefidx_vbuz1=vbuc2 lda #get.p_y ldy.z _3 sta SCREEN+OFFSET_STRUCT_POINT_Y,y @@ -501,17 +499,17 @@ get: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [15] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$1_x main::$3 ] ( main:2 [ main::i#2 main::$1_x main::$3 ] ) 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 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ main::$1_x ] Statement [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ main::$3 ] -Statement [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [15] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$1_x main::$3 ] ( main:2 [ main::i#2 main::$1_x main::$3 ] ) always clobbers reg byte a Statement [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a -Statement [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y [ main::i#2 ] ( main:2 [ main::i#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 , Potential registers zp ZP_BYTE:3 [ get::return_x#2 get::i#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ get::return_x#0 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y , @@ -577,7 +575,7 @@ main: { // [7] (byte) main::$0_x ← (byte) get::return_x#0 // [8] *((byte*)(const struct Point*) SCREEN) ← (byte) main::$0_x -- _deref_pbuc1=vbuaa sta SCREEN - // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 -- _deref_pbuc1=vbuc2 + // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y -- _deref_pbuc1=vbuc2 lda #get.p_y sta SCREEN+OFFSET_STRUCT_POINT_Y // [10] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -611,7 +609,7 @@ main: { // [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x -- pbuc1_derefidx_vbuxx=vbuz1 lda.z _1_x sta SCREEN,x - // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y -- pbuc1_derefidx_vbuxx=vbuc2 lda #get.p_y sta SCREEN+OFFSET_STRUCT_POINT_Y,x // [18] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy @@ -683,8 +681,7 @@ FINAL SYMBOL TABLE (byte) get::i (byte) get::i#1 reg byte a 22.0 (byte) get::p_x -(byte) get::p_y -(const byte) get::p_y#0 p_y = (byte) 7 +(const byte) get::p_y p_y = (byte) 7 (struct Point) get::return (byte) get::return_x (byte) get::return_x#0 reg byte a 4.0 @@ -749,7 +746,7 @@ main: { // *SCREEN = get(0) // [8] *((byte*)(const struct Point*) SCREEN) ← (byte) main::$0_x -- _deref_pbuc1=vbuaa sta SCREEN - // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y#0 -- _deref_pbuc1=vbuc2 + // [9] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) get::p_y -- _deref_pbuc1=vbuc2 lda #get.p_y sta SCREEN+OFFSET_STRUCT_POINT_Y // [10] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -779,7 +776,7 @@ main: { // [16] *((byte*)(const struct Point*) SCREEN + (byte~) main::$3) ← (byte) main::$1_x -- pbuc1_derefidx_vbuxx=vbuz1 lda.z _1_x sta SCREEN,x - // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y#0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [17] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (const byte) get::p_y -- pbuc1_derefidx_vbuxx=vbuc2 lda #get.p_y sta SCREEN+OFFSET_STRUCT_POINT_Y,x // for ( char i: 1..2) diff --git a/src/test/ref/struct-ptr-17.sym b/src/test/ref/struct-ptr-17.sym index d17add299..7bee1d08d 100644 --- a/src/test/ref/struct-ptr-17.sym +++ b/src/test/ref/struct-ptr-17.sym @@ -10,8 +10,7 @@ (byte) get::i (byte) get::i#1 reg byte a 22.0 (byte) get::p_x -(byte) get::p_y -(const byte) get::p_y#0 p_y = (byte) 7 +(const byte) get::p_y p_y = (byte) 7 (struct Point) get::return (byte) get::return_x (byte) get::return_x#0 reg byte a 4.0 diff --git a/src/test/ref/struct-ptr-24.cfg b/src/test/ref/struct-ptr-24.cfg index 657b08314..950245ae1 100644 --- a/src/test/ref/struct-ptr-24.cfg +++ b/src/test/ref/struct-ptr-24.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@3 [5] (struct fileentry*) main::file#2 ← phi( main/(struct fileentry*) 0 main::@3/(struct fileentry*) main::file#1 ) - [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 + [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 [7] return @@ -29,7 +29,7 @@ main::@3: scope:[main] from main::@2 (void()) PrintName((struct fileentry*) PrintName::file) PrintName: scope:[PrintName] from main::@2 - [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return + [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return to:PrintName::@1 PrintName::@1: scope:[PrintName] from PrintName [12] *((byte*) 199) ← (byte) 1 diff --git a/src/test/ref/struct-ptr-24.log b/src/test/ref/struct-ptr-24.log index fdf294224..4c9a301a7 100644 --- a/src/test/ref/struct-ptr-24.log +++ b/src/test/ref/struct-ptr-24.log @@ -10,8 +10,8 @@ Culled Empty Block (label) PrintName::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (struct fileentry*) filesEnd#0 ← (struct fileentry*) 0 - (struct fileentry*) dir#0 ← (struct fileentry*) 0 + (struct fileentry*) filesEnd ← (struct fileentry*) 0 + (struct fileentry*) dir ← (struct fileentry*) 0 to:@2 (void()) main() @@ -20,7 +20,7 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main main::@7 (struct fileentry*) main::file#2 ← phi( main/(struct fileentry*) main::file#0 main::@7/(struct fileentry*) main::file#1 ) - (bool~) main::$0 ← (struct fileentry*) main::file#2 != (struct fileentry*) filesEnd#0 + (bool~) main::$0 ← (struct fileentry*) main::file#2 != (struct fileentry*) filesEnd if((bool~) main::$0) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 @@ -39,7 +39,7 @@ main::@return: scope:[main] from main::@1 (void()) PrintName((struct fileentry*) PrintName::file) PrintName: scope:[PrintName] from main::@2 (struct fileentry*) PrintName::file#1 ← phi( main::@2/(struct fileentry*) PrintName::file#0 ) - (bool~) PrintName::$0 ← (struct fileentry*) PrintName::file#1 == (struct fileentry*) dir#0 + (bool~) PrintName::$0 ← (struct fileentry*) PrintName::file#1 == (struct fileentry*) dir (bool~) PrintName::$1 ← ! (bool~) PrintName::$0 if((bool~) PrintName::$1) goto PrintName::@return to:PrintName::@2 @@ -73,11 +73,9 @@ SYMBOL TABLE SSA (struct fileentry*) PrintName::file#1 (const byte) SIZEOF_STRUCT_FILEENTRY = (byte) 2 (struct fileentry*) dir -(struct fileentry*) dir#0 (byte) fileentry::bError (byte) fileentry::bFlag (struct fileentry*) filesEnd -(struct fileentry*) filesEnd#0 (void()) main() (bool~) main::$0 (label) main::@1 @@ -101,17 +99,17 @@ Simplifying constant integer cast 1 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) 1 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inversing boolean not [14] (bool~) PrintName::$1 ← (struct fileentry*) PrintName::file#1 != (struct fileentry*) dir#0 from [13] (bool~) PrintName::$0 ← (struct fileentry*) PrintName::file#1 == (struct fileentry*) dir#0 +Inversing boolean not [14] (bool~) PrintName::$1 ← (struct fileentry*) PrintName::file#1 != (struct fileentry*) dir from [13] (bool~) PrintName::$0 ← (struct fileentry*) PrintName::file#1 == (struct fileentry*) dir Successful SSA optimization Pass2UnaryNotSimplification Alias (struct fileentry*) main::file#2 = (struct fileentry*) main::file#3 (struct fileentry*) main::file#4 Successful SSA optimization Pass2AliasElimination Identical Phi Values (struct fileentry*) PrintName::file#1 (struct fileentry*) PrintName::file#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$0 [5] if((struct fileentry*) main::file#2!=(struct fileentry*) filesEnd#0) goto main::@2 -Simple Condition (bool~) PrintName::$1 [15] if((struct fileentry*) PrintName::file#0!=(struct fileentry*) dir#0) goto PrintName::@return +Simple Condition (bool~) main::$0 [5] if((struct fileentry*) main::file#2!=(struct fileentry*) filesEnd) goto main::@2 +Simple Condition (bool~) PrintName::$1 [15] if((struct fileentry*) PrintName::file#0!=(struct fileentry*) dir) goto PrintName::@return Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const struct fileentry*) filesEnd#0 = (struct fileentry*) 0 -Constant (const struct fileentry*) dir#0 = (struct fileentry*) 0 +Constant (const struct fileentry*) filesEnd = (struct fileentry*) 0 +Constant (const struct fileentry*) dir = (struct fileentry*) 0 Constant (const struct fileentry*) main::file#0 = (struct fileentry*) 0 Constant (const byte*) PrintName::$2 = (byte*) 199 Successful SSA optimization Pass2ConstantIdentification @@ -157,7 +155,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@3 [5] (struct fileentry*) main::file#2 ← phi( main/(struct fileentry*) 0 main::@3/(struct fileentry*) main::file#1 ) - [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 + [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 [7] return @@ -172,7 +170,7 @@ main::@3: scope:[main] from main::@2 (void()) PrintName((struct fileentry*) PrintName::file) PrintName: scope:[PrintName] from main::@2 - [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return + [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return to:PrintName::@1 PrintName::@1: scope:[PrintName] from PrintName [12] *((byte*) 199) ← (byte) 1 @@ -186,10 +184,8 @@ VARIABLE REGISTER WEIGHTS (void()) PrintName((struct fileentry*) PrintName::file) (struct fileentry*) PrintName::file (struct fileentry*) PrintName::file#0 13.0 -(struct fileentry*) dir (byte) fileentry::bError (byte) fileentry::bFlag -(struct fileentry*) filesEnd (void()) main() (struct fileentry*) main::file (struct fileentry*) main::file#1 22.0 @@ -244,7 +240,7 @@ main: { jmp b1 // main::@1 b1: - // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 -- pssz1_neq_pssc1_then_la1 + // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>filesEnd bne b2 @@ -285,7 +281,7 @@ main: { // PrintName(struct fileentry* zeropage(4) file) PrintName: { .label file = 4 - // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 + // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>dir bne breturn @@ -307,10 +303,10 @@ PrintName: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 [ main::file#2 ] ( main:2 [ main::file#2 ] ) always clobbers reg byte a +Statement [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 [ main::file#2 ] ( main:2 [ main::file#2 ] ) always clobbers reg byte a Statement [8] (struct fileentry*) PrintName::file#0 ← (struct fileentry*) main::file#2 [ main::file#2 PrintName::file#0 ] ( main:2 [ main::file#2 PrintName::file#0 ] ) always clobbers reg byte a Statement [10] (struct fileentry*) main::file#1 ← (struct fileentry*) main::file#2 + (const byte) SIZEOF_STRUCT_FILEENTRY [ main::file#1 ] ( main:2 [ main::file#1 ] ) always clobbers reg byte a -Statement [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return [ ] ( main:2::PrintName:9 [ main::file#2 ] ) always clobbers reg byte a +Statement [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return [ ] ( main:2::PrintName:9 [ main::file#2 ] ) always clobbers reg byte a Statement [12] *((byte*) 199) ← (byte) 1 [ ] ( main:2::PrintName:9 [ main::file#2 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::file#2 main::file#1 ] : zp ZP_WORD:2 , Potential registers zp ZP_WORD:4 [ PrintName::file#0 ] : zp ZP_WORD:4 , @@ -366,7 +362,7 @@ main: { jmp b1 // main::@1 b1: - // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 -- pssz1_neq_pssc1_then_la1 + // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>filesEnd bne b2 @@ -403,7 +399,7 @@ main: { // PrintName(struct fileentry* zeropage(2) file) PrintName: { .label file = 2 - // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 + // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>dir bne breturn @@ -463,12 +459,10 @@ FINAL SYMBOL TABLE (struct fileentry*) PrintName::file (struct fileentry*) PrintName::file#0 file zp ZP_WORD:2 13.0 (const byte) SIZEOF_STRUCT_FILEENTRY SIZEOF_STRUCT_FILEENTRY = (byte) 2 -(struct fileentry*) dir -(const struct fileentry*) dir#0 dir = (struct fileentry*) 0 +(const struct fileentry*) dir dir = (struct fileentry*) 0 (byte) fileentry::bError (byte) fileentry::bFlag -(struct fileentry*) filesEnd -(const struct fileentry*) filesEnd#0 filesEnd = (struct fileentry*) 0 +(const struct fileentry*) filesEnd filesEnd = (struct fileentry*) 0 (void()) main() (label) main::@1 (label) main::@2 @@ -511,7 +505,7 @@ main: { // main::@1 b1: // while(file != filesEnd) - // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd#0) goto main::@2 -- pssz1_neq_pssc1_then_la1 + // [6] if((struct fileentry*) main::file#2!=(const struct fileentry*) filesEnd) goto main::@2 -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>filesEnd bne b2 @@ -547,7 +541,7 @@ main: { PrintName: { .label file = 2 // if (file == dir) - // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir#0) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 + // [11] if((struct fileentry*) PrintName::file#0!=(const struct fileentry*) dir) goto PrintName::@return -- pssz1_neq_pssc1_then_la1 lda.z file+1 cmp #>dir bne breturn diff --git a/src/test/ref/struct-ptr-24.sym b/src/test/ref/struct-ptr-24.sym index c2e5a5f10..fe59eed68 100644 --- a/src/test/ref/struct-ptr-24.sym +++ b/src/test/ref/struct-ptr-24.sym @@ -7,12 +7,10 @@ (struct fileentry*) PrintName::file (struct fileentry*) PrintName::file#0 file zp ZP_WORD:2 13.0 (const byte) SIZEOF_STRUCT_FILEENTRY SIZEOF_STRUCT_FILEENTRY = (byte) 2 -(struct fileentry*) dir -(const struct fileentry*) dir#0 dir = (struct fileentry*) 0 +(const struct fileentry*) dir dir = (struct fileentry*) 0 (byte) fileentry::bError (byte) fileentry::bFlag -(struct fileentry*) filesEnd -(const struct fileentry*) filesEnd#0 filesEnd = (struct fileentry*) 0 +(const struct fileentry*) filesEnd filesEnd = (struct fileentry*) 0 (void()) main() (label) main::@1 (label) main::@2 diff --git a/src/test/ref/struct-ptr-25.log b/src/test/ref/struct-ptr-25.log index e02c6dac3..57fddd172 100644 --- a/src/test/ref/struct-ptr-25.log +++ b/src/test/ref/struct-ptr-25.log @@ -6,22 +6,22 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) fileCur#0 ← (byte*) 0 (byte*) fileTop#0 ← (byte*) 0 - (byte*) filesEnd#0 ← (byte*) 0 - (byte*) file#0 ← (byte*) 0 + (byte*) filesEnd ← (byte*) 0 + (byte*) file ← (byte*) 0 to:@1 (void()) main() main: scope:[main] from @1 (byte*) fileCur#10 ← phi( @1/(byte*) fileCur#12 ) (byte*) fileTop#4 ← phi( @1/(byte*) fileTop#10 ) - (bool~) main::$0 ← (byte*) fileTop#4 == (byte*) filesEnd#0 + (bool~) main::$0 ← (byte*) fileTop#4 == (byte*) filesEnd (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@1 to:main::@4 main::@1: scope:[main] from main main::@4 (byte*) fileTop#11 ← phi( main/(byte*) fileTop#4 main::@4/(byte*) fileTop#1 ) (byte*) fileCur#5 ← phi( main/(byte*) fileCur#10 main::@4/(byte*) fileCur#11 ) - (bool~) main::$2 ← (byte*) file#0 <= (byte*) fileCur#5 + (bool~) main::$2 ← (byte*) file <= (byte*) fileCur#5 (bool~) main::$3 ← ! (bool~) main::$2 if((bool~) main::$3) goto main::@2 to:main::@5 @@ -72,7 +72,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) file -(byte*) file#0 (byte*) fileCur (byte*) fileCur#0 (byte*) fileCur#1 @@ -102,7 +101,6 @@ SYMBOL TABLE SSA (byte*) fileTop#8 (byte*) fileTop#9 (byte*) filesEnd -(byte*) filesEnd#0 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -117,8 +115,8 @@ SYMBOL TABLE SSA (label) main::@6 (label) main::@return -Inversing boolean not [6] (bool~) main::$1 ← (byte*) fileTop#4 != (byte*) filesEnd#0 from [5] (bool~) main::$0 ← (byte*) fileTop#4 == (byte*) filesEnd#0 -Inversing boolean not [10] (bool~) main::$3 ← (byte*) file#0 > (byte*) fileCur#5 from [9] (bool~) main::$2 ← (byte*) file#0 <= (byte*) fileCur#5 +Inversing boolean not [6] (bool~) main::$1 ← (byte*) fileTop#4 != (byte*) filesEnd from [5] (bool~) main::$0 ← (byte*) fileTop#4 == (byte*) filesEnd +Inversing boolean not [10] (bool~) main::$3 ← (byte*) file > (byte*) fileCur#5 from [9] (bool~) main::$2 ← (byte*) file <= (byte*) fileCur#5 Inversing boolean not [16] (bool~) main::$5 ← (byte*) fileCur#6 >= (byte*) fileTop#6 from [15] (bool~) main::$4 ← (byte*) fileCur#6 < (byte*) fileTop#6 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) fileTop#4 = (byte*) fileTop#5 @@ -144,23 +142,23 @@ Identical Phi Values (byte*) fileTop#2 (byte*) fileTop#6 Identical Phi Values (byte*) fileTop#3 (byte*) fileTop#2 Identical Phi Values (byte*) fileCur#4 (byte*) fileCur#3 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) main::$1 [7] if((byte*) fileTop#0!=(byte*) filesEnd#0) goto main::@1 -Simple Condition (bool~) main::$3 [11] if((byte*) file#0>(byte*) fileCur#0) goto main::@2 +Simple Condition (bool~) main::$1 [7] if((byte*) fileTop#0!=(byte*) filesEnd) goto main::@1 +Simple Condition (bool~) main::$3 [11] if((byte*) file>(byte*) fileCur#0) goto main::@2 Simple Condition (bool~) main::$5 [17] if((byte*) fileCur#6>=(byte*) fileTop#11) goto main::@return Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) fileCur#0 = (byte*) 0 Constant (const byte*) fileTop#0 = (byte*) 0 -Constant (const byte*) filesEnd#0 = (byte*) 0 -Constant (const byte*) file#0 = (byte*) 0 +Constant (const byte*) filesEnd = (byte*) 0 +Constant (const byte*) file = (byte*) 0 Successful SSA optimization Pass2ConstantIdentification Removing PHI-reference to removed block (main) in block main::@1 -if() condition always false - eliminating [7] if((const byte*) fileTop#0!=(const byte*) filesEnd#0) goto main::@1 +if() condition always false - eliminating [7] if((const byte*) fileTop#0!=(const byte*) filesEnd) goto main::@1 Removing PHI-reference to removed block (main::@1) in block main::@2 -if() condition always false - eliminating [11] if((const byte*) file#0>(const byte*) fileCur#0) goto main::@2 +if() condition always false - eliminating [11] if((const byte*) file>(const byte*) fileCur#0) goto main::@2 Successful SSA optimization Pass2ConstantIfs Eliminating unused variable - keeping the phi block (byte*) fileCur#3 -Eliminating unused constant (const byte*) filesEnd#0 -Eliminating unused constant (const byte*) file#0 +Eliminating unused constant (const byte*) filesEnd +Eliminating unused constant (const byte*) file Successful SSA optimization PassNEliminateUnusedVars Alias (byte*) fileTop#1 = (byte*) fileTop#11 Alias (byte*) fileCur#1 = (byte*) fileCur#6 @@ -226,10 +224,8 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte*) file (byte*) fileCur (byte*) fileTop -(byte*) filesEnd (void()) main() Initial phi equivalence classes @@ -334,10 +330,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) file (byte*) fileCur (byte*) fileTop -(byte*) filesEnd (void()) main() (label) main::@return diff --git a/src/test/ref/struct-ptr-25.sym b/src/test/ref/struct-ptr-25.sym index 4a933e357..ec2bd23bd 100644 --- a/src/test/ref/struct-ptr-25.sym +++ b/src/test/ref/struct-ptr-25.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) file (byte*) fileCur (byte*) fileTop -(byte*) filesEnd (void()) main() (label) main::@return diff --git a/src/test/ref/struct-ptr-34.cfg b/src/test/ref/struct-ptr-34.cfg index 48e752863..e6dc4d42d 100644 --- a/src/test/ref/struct-ptr-34.cfg +++ b/src/test/ref/struct-ptr-34.cfg @@ -23,9 +23,9 @@ main::@return: scope:[main] from main::@1 (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) print_person: scope:[print_person] from main main::@1 - [9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name#0 main::@1/(const byte[$10]) main::henriette_name#0 ) + [9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name main::@1/(const byte[$10]) main::henriette_name ) [9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 ) - [9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id#0 main::@1/(const byte) main::henriette_id#0 ) + [9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id main::@1/(const byte) main::henriette_id ) [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) [11] (byte) idx#4 ← ++ (byte) idx#13 [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' diff --git a/src/test/ref/struct-ptr-34.log b/src/test/ref/struct-ptr-34.log index 0c6e7b97d..2e54affbe 100644 --- a/src/test/ref/struct-ptr-34.log +++ b/src/test/ref/struct-ptr-34.log @@ -36,19 +36,19 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @2 (byte) idx#18 ← phi( @2/(byte) idx#20 ) - (byte) main::jesper_id#0 ← (number) 4 - (byte[$10]) main::jesper_name#0 ← (const string) main::$2 - (byte) print_person::person_id#0 ← (byte) main::jesper_id#0 - (byte[$10]) print_person::person_name#0 ← (byte[$10]) main::jesper_name#0 + (byte) main::jesper_id ← (number) 4 + (byte[$10]) main::jesper_name ← (const string) main::$2 + (byte) print_person::person_id#0 ← (byte) main::jesper_id + (byte[$10]) print_person::person_name#0 ← (byte[$10]) main::jesper_name call print_person to:main::@1 main::@1: scope:[main] from main (byte) idx#10 ← phi( main/(byte) idx#8 ) (byte) idx#0 ← (byte) idx#10 - (byte) main::henriette_id#0 ← (number) 7 - (byte[$10]) main::henriette_name#0 ← (const string) main::$3 - (byte) print_person::person_id#1 ← (byte) main::henriette_id#0 - (byte[$10]) print_person::person_name#1 ← (byte[$10]) main::henriette_name#0 + (byte) main::henriette_id ← (number) 7 + (byte[$10]) main::henriette_name ← (const string) main::$3 + (byte) print_person::person_id#1 ← (byte) main::henriette_id + (byte[$10]) print_person::person_name#1 ← (byte[$10]) main::henriette_name call print_person to:main::@2 main::@2: scope:[main] from main::@1 @@ -152,13 +152,9 @@ SYMBOL TABLE SSA (label) main::@2 (label) main::@return (byte) main::henriette_id -(byte) main::henriette_id#0 (byte[$10]) main::henriette_name -(byte[$10]) main::henriette_name#0 (byte) main::jesper_id -(byte) main::jesper_id#0 (byte[$10]) main::jesper_name -(byte[$10]) main::jesper_name#0 (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) (bool~) print_person::$0 (label) print_person::@1 @@ -182,14 +178,14 @@ SYMBOL TABLE SSA (byte[$10]) print_person::person_name#3 (byte[$10]) print_person::person_name#4 -Adding number conversion cast (unumber) 4 in (byte) main::jesper_id#0 ← (number) 4 -Adding number conversion cast (unumber) 7 in (byte) main::henriette_id#0 ← (number) 7 +Adding number conversion cast (unumber) 4 in (byte) main::jesper_id ← (number) 4 +Adding number conversion cast (unumber) 7 in (byte) main::henriette_id ← (number) 7 Adding number conversion cast (unumber) 0 in (byte) idx#3 ← (number) 0 Adding number conversion cast (unumber) 0 in (byte) print_person::i#0 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) print_person::$0 ← (number) 0 != *((byte[$10]) print_person::person_name#2 + (byte) print_person::i#2) Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::jesper_id#0 ← (unumber)(number) 4 -Inlining cast (byte) main::henriette_id#0 ← (unumber)(number) 7 +Inlining cast (byte) main::jesper_id ← (unumber)(number) 4 +Inlining cast (byte) main::henriette_id ← (unumber)(number) 7 Inlining cast (byte*) SCREEN ← (byte*)(number) $400 Inlining cast (byte) idx#3 ← (unumber)(number) 0 Inlining cast (byte) print_person::i#0 ← (unumber)(number) 0 @@ -224,19 +220,19 @@ Identical Phi Values (byte) idx#17 (byte) idx#1 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) print_person::$0 [29] if((byte) 0!=*((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)) goto print_person::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte) main::jesper_id#0 = 4 -Constant (const byte[$10]) main::jesper_name#0 = main::$2 -Constant (const byte) main::henriette_id#0 = 7 -Constant (const byte[$10]) main::henriette_name#0 = main::$3 +Constant (const byte) main::jesper_id = 4 +Constant (const byte[$10]) main::jesper_name = main::$2 +Constant (const byte) main::henriette_id = 7 +Constant (const byte[$10]) main::henriette_name = main::$3 Constant (const byte*) SCREEN = (byte*) 1024 Constant (const byte) idx#20 = 0 Constant (const byte[]) DIGIT = $0 Constant (const byte) print_person::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) print_person::person_id#0 = main::jesper_id#0 -Constant (const byte[$10]) print_person::person_name#0 = main::jesper_name#0 -Constant (const byte) print_person::person_id#1 = main::henriette_id#0 -Constant (const byte[$10]) print_person::person_name#1 = main::henriette_name#0 +Constant (const byte) print_person::person_id#0 = main::jesper_id +Constant (const byte[$10]) print_person::person_name#0 = main::jesper_name +Constant (const byte) print_person::person_id#1 = main::henriette_id +Constant (const byte[$10]) print_person::person_name#1 = main::henriette_name Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) print_person::i#0 Inlining constant with var siblings (const byte) print_person::person_id#0 @@ -245,14 +241,14 @@ Inlining constant with var siblings (const byte) print_person::person_id#1 Inlining constant with var siblings (const byte[$10]) print_person::person_name#1 Inlining constant with var siblings (const byte) idx#20 Constant inlined idx#20 = (byte) 0 -Constant inlined print_person::person_id#1 = (const byte) main::henriette_id#0 -Constant inlined print_person::person_id#0 = (const byte) main::jesper_id#0 -Constant inlined main::$2 = (const byte[$10]) main::jesper_name#0 +Constant inlined print_person::person_id#1 = (const byte) main::henriette_id +Constant inlined print_person::person_id#0 = (const byte) main::jesper_id +Constant inlined main::$2 = (const byte[$10]) main::jesper_name Constant inlined print_person::i#0 = (byte) 0 -Constant inlined print_person::person_name#1 = (const byte[$10]) main::henriette_name#0 -Constant inlined main::$3 = (const byte[$10]) main::henriette_name#0 +Constant inlined print_person::person_name#1 = (const byte[$10]) main::henriette_name +Constant inlined main::$3 = (const byte[$10]) main::henriette_name Constant inlined $0 = (const byte[]) DIGIT -Constant inlined print_person::person_name#0 = (const byte[$10]) main::jesper_name#0 +Constant inlined print_person::person_name#0 = (const byte[$10]) main::jesper_name Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -307,9 +303,9 @@ main::@return: scope:[main] from main::@1 (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) print_person: scope:[print_person] from main main::@1 - [9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name#0 main::@1/(const byte[$10]) main::henriette_name#0 ) + [9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name main::@1/(const byte[$10]) main::henriette_name ) [9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 ) - [9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id#0 main::@1/(const byte) main::henriette_id#0 ) + [9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id main::@1/(const byte) main::henriette_id ) [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) [11] (byte) idx#4 ← ++ (byte) idx#13 [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' @@ -345,10 +341,6 @@ VARIABLE REGISTER WEIGHTS (byte) idx#5 4.0 (byte) idx#6 11.0 (void()) main() -(byte) main::henriette_id -(byte[$10]) main::henriette_name -(byte) main::jesper_id -(byte[$10]) main::jesper_name (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) (byte) print_person::i (byte) print_person::i#1 22.0 @@ -419,7 +411,7 @@ main: { // [5] call print_person // [9] phi from main to print_person [phi:main->print_person] print_person_from_main: - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name#0 [phi:main->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name [phi:main->print_person#0] -- pbuz1=pbuc1 lda #jesper_name @@ -427,7 +419,7 @@ main: { // [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#1] -- vbuz1=vbuc1 lda #0 sta.z idx_13 - // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id#0 [phi:main->print_person#2] -- vbuz1=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id [phi:main->print_person#2] -- vbuz1=vbuc1 lda #jesper_id sta.z print_person.person_id jsr print_person @@ -439,13 +431,13 @@ main: { // [7] call print_person // [9] phi from main::@1 to print_person [phi:main::@1->print_person] print_person_from_b1: - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name#0 [phi:main::@1->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name [phi:main::@1->print_person#0] -- pbuz1=pbuc1 lda #henriette_name sta.z print_person.person_name+1 // [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#1] -- register_copy - // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id#0 [phi:main::@1->print_person#2] -- vbuz1=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id [phi:main::@1->print_person#2] -- vbuz1=vbuc1 lda #henriette_id sta.z print_person.person_id jsr print_person @@ -601,14 +593,14 @@ main: { // [5] call print_person // [9] phi from main to print_person [phi:main->print_person] print_person_from_main: - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name#0 [phi:main->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name [phi:main->print_person#0] -- pbuz1=pbuc1 lda #jesper_name sta.z print_person.person_name+1 // [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#1] -- vbuyy=vbuc1 ldy #0 - // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id#0 [phi:main->print_person#2] -- vbuxx=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id [phi:main->print_person#2] -- vbuxx=vbuc1 ldx #jesper_id jsr print_person // [6] phi from main to main::@1 [phi:main->main::@1] @@ -619,13 +611,13 @@ main: { // [7] call print_person // [9] phi from main::@1 to print_person [phi:main::@1->print_person] print_person_from_b1: - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name#0 [phi:main::@1->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name [phi:main::@1->print_person#0] -- pbuz1=pbuc1 lda #henriette_name sta.z print_person.person_name+1 // [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#1] -- register_copy - // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id#0 [phi:main::@1->print_person#2] -- vbuxx=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id [phi:main::@1->print_person#2] -- vbuxx=vbuc1 ldx #henriette_id jsr print_person jmp breturn @@ -751,14 +743,10 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte) main::henriette_id -(const byte) main::henriette_id#0 henriette_id = (byte) 7 -(byte[$10]) main::henriette_name -(const byte[$10]) main::henriette_name#0 henriette_name = (string) "henriette" -(byte) main::jesper_id -(const byte) main::jesper_id#0 jesper_id = (byte) 4 -(byte[$10]) main::jesper_name -(const byte[$10]) main::jesper_name#0 jesper_name = (string) "jesper" +(const byte) main::henriette_id henriette_id = (byte) 7 +(const byte[$10]) main::henriette_name henriette_name = (string) "henriette" +(const byte) main::jesper_id jesper_id = (byte) 4 +(const byte[$10]) main::jesper_name jesper_name = (string) "jesper" (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) (label) print_person::@1 (label) print_person::@2 @@ -806,14 +794,14 @@ main: { // print_person(jesper) // [5] call print_person // [9] phi from main to print_person [phi:main->print_person] - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name#0 [phi:main->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::jesper_name [phi:main->print_person#0] -- pbuz1=pbuc1 lda #jesper_name sta.z print_person.person_name+1 // [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#1] -- vbuyy=vbuc1 ldy #0 - // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id#0 [phi:main->print_person#2] -- vbuxx=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::jesper_id [phi:main->print_person#2] -- vbuxx=vbuc1 ldx #jesper_id jsr print_person // [6] phi from main to main::@1 [phi:main->main::@1] @@ -821,13 +809,13 @@ main: { // print_person(henriette) // [7] call print_person // [9] phi from main::@1 to print_person [phi:main::@1->print_person] - // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name#0 [phi:main::@1->print_person#0] -- pbuz1=pbuc1 + // [9] phi (byte[$10]) print_person::person_name#4 = (const byte[$10]) main::henriette_name [phi:main::@1->print_person#0] -- pbuz1=pbuc1 lda #henriette_name sta.z print_person.person_name+1 // [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#1] -- register_copy - // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id#0 [phi:main::@1->print_person#2] -- vbuxx=vbuc1 + // [9] phi (byte) print_person::person_id#2 = (const byte) main::henriette_id [phi:main::@1->print_person#2] -- vbuxx=vbuc1 ldx #henriette_id jsr print_person // main::@return diff --git a/src/test/ref/struct-ptr-34.sym b/src/test/ref/struct-ptr-34.sym index 9777b3125..4044ceb69 100644 --- a/src/test/ref/struct-ptr-34.sym +++ b/src/test/ref/struct-ptr-34.sym @@ -15,14 +15,10 @@ (void()) main() (label) main::@1 (label) main::@return -(byte) main::henriette_id -(const byte) main::henriette_id#0 henriette_id = (byte) 7 -(byte[$10]) main::henriette_name -(const byte[$10]) main::henriette_name#0 henriette_name = (string) "henriette" -(byte) main::jesper_id -(const byte) main::jesper_id#0 jesper_id = (byte) 4 -(byte[$10]) main::jesper_name -(const byte[$10]) main::jesper_name#0 jesper_name = (string) "jesper" +(const byte) main::henriette_id henriette_id = (byte) 7 +(const byte[$10]) main::henriette_name henriette_name = (string) "henriette" +(const byte) main::jesper_id jesper_id = (byte) 4 +(const byte[$10]) main::jesper_name jesper_name = (string) "jesper" (void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name) (label) print_person::@1 (label) print_person::@2 diff --git a/src/test/ref/struct-ptr-4.cfg b/src/test/ref/struct-ptr-4.cfg index 1d5659bab..a49cfd8cd 100644 --- a/src/test/ref/struct-ptr-4.cfg +++ b/src/test/ref/struct-ptr-4.cfg @@ -14,7 +14,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [5] (struct Point*) main::points#4 ← phi( main/(const struct Point*) POINTS#0 main::@1/(struct Point*) main::points#1 ) + [5] (struct Point*) main::points#4 ← phi( main/(const struct Point*) POINTS main::@1/(struct Point*) main::points#1 ) [6] *((byte*)(struct Point*) main::points#4) ← (byte) main::i#2 [7] (byte~) main::$0 ← (byte) main::i#2 + (byte) 5 [8] *((byte*)(struct Point*) main::points#4 + (const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0 @@ -25,7 +25,7 @@ main::@1: scope:[main] from main main::@1 main::@2: scope:[main] from main::@1 main::@2 [12] (byte) main::i1#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::i1#1 ) [12] (byte) main::idx#4 ← phi( main::@1/(byte) 0 main::@2/(byte) main::idx#3 ) - [12] (struct Point*) main::points#5 ← phi( main::@1/(const struct Point*) POINTS#0 main::@2/(struct Point*) main::points#3 ) + [12] (struct Point*) main::points#5 ← phi( main::@1/(const struct Point*) POINTS main::@2/(struct Point*) main::points#3 ) [13] *((const byte*) main::SCREEN + (byte) main::idx#4) ← *((byte*)(struct Point*) main::points#5) [14] (byte) main::idx#1 ← ++ (byte) main::idx#4 [15] *((const byte*) main::SCREEN + (byte) main::idx#1) ← *((byte*)(struct Point*) main::points#5 + (const byte) OFFSET_STRUCT_POINT_Y) diff --git a/src/test/ref/struct-ptr-4.log b/src/test/ref/struct-ptr-4.log index 1d8f65907..4becd1a7d 100644 --- a/src/test/ref/struct-ptr-4.log +++ b/src/test/ref/struct-ptr-4.log @@ -9,12 +9,12 @@ Culled Empty Block (label) main::@4 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (struct Point*) POINTS#0 ← ((struct Point*)) (number) $1000 + (struct Point*) POINTS ← ((struct Point*)) (number) $1000 to:@1 (void()) main() main: scope:[main] from @1 - (struct Point*) main::points#0 ← (struct Point*) POINTS#0 + (struct Point*) main::points#0 ← (struct Point*) POINTS (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -33,7 +33,7 @@ main::@1: scope:[main] from main main::@1 main::@2: scope:[main] from main::@1 (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::idx#0 ← (number) 0 - (struct Point*) main::points#2 ← (struct Point*) POINTS#0 + (struct Point*) main::points#2 ← (struct Point*) POINTS (byte) main::i1#0 ← (byte) 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 @@ -71,7 +71,6 @@ SYMBOL TABLE SSA (const byte) OFFSET_STRUCT_POINT_X = (byte) 0 (const byte) OFFSET_STRUCT_POINT_Y = (byte) 1 (struct Point*) POINTS -(struct Point*) POINTS#0 (byte) Point::x (byte) Point::y (const byte) SIZEOF_STRUCT_POINT = (byte) 2 @@ -114,7 +113,7 @@ Adding number conversion cast (unumber) 5 in (number~) main::$0 ← (byte) main: Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 + (unumber)(number) 5 Adding number conversion cast (unumber) 0 in (byte) main::idx#0 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (struct Point*) POINTS#0 ← (struct Point*)(number) $1000 +Inlining cast (struct Point*) POINTS ← (struct Point*)(number) $1000 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::idx#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast @@ -130,14 +129,14 @@ Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::i#2 + (byt Simple Condition (bool~) main::$1 [12] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 Simple Condition (bool~) main::$2 [29] if((byte) main::i1#1!=rangelast(0,3)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const struct Point*) POINTS#0 = (struct Point*) 4096 +Constant (const struct Point*) POINTS = (struct Point*) 4096 Constant (const byte) main::i#0 = 0 Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::idx#0 = 0 Constant (const byte) main::i1#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const struct Point*) main::points#0 = POINTS#0 -Constant (const struct Point*) main::points#2 = POINTS#0 +Constant (const struct Point*) main::points#0 = POINTS +Constant (const struct Point*) main::points#2 = POINTS Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [10] main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value [12] if(main::i#1!=rangelast(0,3)) goto main::@1 to (number) 4 @@ -173,11 +172,11 @@ Inlining constant with var siblings (const byte) main::idx#0 Inlining constant with var siblings (const byte) main::i1#0 Inlining constant with var siblings (const struct Point*) main::points#0 Inlining constant with var siblings (const struct Point*) main::points#2 -Constant inlined main::points#2 = (const struct Point*) POINTS#0 +Constant inlined main::points#2 = (const struct Point*) POINTS Constant inlined main::i#0 = (byte) 0 Constant inlined main::i1#0 = (byte) 0 Constant inlined main::idx#0 = (byte) 0 -Constant inlined main::points#0 = (const struct Point*) POINTS#0 +Constant inlined main::points#0 = (const struct Point*) POINTS Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@1 and main::@1) Added new block during phi lifting main::@6(between main::@3 and main::@3) @@ -224,7 +223,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [5] (struct Point*) main::points#4 ← phi( main/(const struct Point*) POINTS#0 main::@1/(struct Point*) main::points#1 ) + [5] (struct Point*) main::points#4 ← phi( main/(const struct Point*) POINTS main::@1/(struct Point*) main::points#1 ) [6] *((byte*)(struct Point*) main::points#4) ← (byte) main::i#2 [7] (byte~) main::$0 ← (byte) main::i#2 + (byte) 5 [8] *((byte*)(struct Point*) main::points#4 + (const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0 @@ -235,7 +234,7 @@ main::@1: scope:[main] from main main::@1 main::@2: scope:[main] from main::@1 main::@2 [12] (byte) main::i1#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::i1#1 ) [12] (byte) main::idx#4 ← phi( main::@1/(byte) 0 main::@2/(byte) main::idx#3 ) - [12] (struct Point*) main::points#5 ← phi( main::@1/(const struct Point*) POINTS#0 main::@2/(struct Point*) main::points#3 ) + [12] (struct Point*) main::points#5 ← phi( main::@1/(const struct Point*) POINTS main::@2/(struct Point*) main::points#3 ) [13] *((const byte*) main::SCREEN + (byte) main::idx#4) ← *((byte*)(struct Point*) main::points#5) [14] (byte) main::idx#1 ← ++ (byte) main::idx#4 [15] *((const byte*) main::SCREEN + (byte) main::idx#1) ← *((byte*)(struct Point*) main::points#5 + (const byte) OFFSET_STRUCT_POINT_Y) @@ -252,7 +251,6 @@ main::@return: scope:[main] from main::@2 VARIABLE REGISTER WEIGHTS -(struct Point*) POINTS (byte) Point::x (byte) Point::y (void()) main() @@ -348,7 +346,7 @@ main: { // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z i - // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS [phi:main->main::@1#1] -- pssz1=pssc1 lda #POINTS @@ -395,7 +393,7 @@ main: { // [12] phi (byte) main::idx#4 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuz1=vbuc1 lda #0 sta.z idx_4 - // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS#0 [phi:main::@1->main::@2#2] -- pssz1=pssc1 + // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS [phi:main::@1->main::@2#2] -- pssz1=pssc1 lda #POINTS @@ -546,7 +544,7 @@ main: { b1_from_main: // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS [phi:main->main::@1#1] -- pssz1=pssc1 lda #POINTS @@ -590,7 +588,7 @@ main: { sta.z i1 // [12] phi (byte) main::idx#4 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuxx=vbuc1 ldx #0 - // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS#0 [phi:main::@1->main::@2#2] -- pssz1=pssc1 + // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS [phi:main::@1->main::@2#2] -- pssz1=pssc1 lda #POINTS @@ -679,8 +677,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte) OFFSET_STRUCT_POINT_Y OFFSET_STRUCT_POINT_Y = (byte) 1 -(struct Point*) POINTS -(const struct Point*) POINTS#0 POINTS = (struct Point*) 4096 +(const struct Point*) POINTS POINTS = (struct Point*) 4096 (byte) Point::x (byte) Point::y (const byte) SIZEOF_STRUCT_POINT SIZEOF_STRUCT_POINT = (byte) 2 @@ -748,7 +745,7 @@ main: { // [5] phi from main to main::@1 [phi:main->main::@1] // [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [5] phi (struct Point*) main::points#4 = (const struct Point*) POINTS [phi:main->main::@1#1] -- pssz1=pssc1 lda #POINTS @@ -793,7 +790,7 @@ main: { sta.z i1 // [12] phi (byte) main::idx#4 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuxx=vbuc1 tax - // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS#0 [phi:main::@1->main::@2#2] -- pssz1=pssc1 + // [12] phi (struct Point*) main::points#5 = (const struct Point*) POINTS [phi:main::@1->main::@2#2] -- pssz1=pssc1 lda #POINTS diff --git a/src/test/ref/struct-ptr-4.sym b/src/test/ref/struct-ptr-4.sym index 0caa08297..b48fb1911 100644 --- a/src/test/ref/struct-ptr-4.sym +++ b/src/test/ref/struct-ptr-4.sym @@ -2,8 +2,7 @@ (label) @begin (label) @end (const byte) OFFSET_STRUCT_POINT_Y OFFSET_STRUCT_POINT_Y = (byte) 1 -(struct Point*) POINTS -(const struct Point*) POINTS#0 POINTS = (struct Point*) 4096 +(const struct Point*) POINTS POINTS = (struct Point*) 4096 (byte) Point::x (byte) Point::y (const byte) SIZEOF_STRUCT_POINT SIZEOF_STRUCT_POINT = (byte) 2 diff --git a/src/test/ref/struct-ptr-5.cfg b/src/test/ref/struct-ptr-5.cfg index 3c231f355..607c60a3a 100644 --- a/src/test/ref/struct-ptr-5.cfg +++ b/src/test/ref/struct-ptr-5.cfg @@ -10,8 +10,8 @@ (void()) main() main: scope:[main] from @1 - [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 - [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 + [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 + [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 [7] *((byte*)(const struct Entry*) main::entry2#0) ← (byte) 2 [8] *((struct Entry**)(const struct Entry*) main::entry1#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (struct Entry*) 0 @@ -19,7 +19,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 [10] (byte) main::idx#5 ← phi( main/(byte) 0 main::@2/(byte) main::idx#4 ) - [10] (struct Entry*) main::entry#2 ← phi( main/(const struct Entry*) ENTRIES#0 main::@2/(struct Entry*) main::entry#1 ) + [10] (struct Entry*) main::entry#2 ← phi( main/(const struct Entry*) ENTRIES main::@2/(struct Entry*) main::entry#1 ) [11] if((struct Entry*)(word) 0!=(struct Entry*) main::entry#2) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 diff --git a/src/test/ref/struct-ptr-5.log b/src/test/ref/struct-ptr-5.log index e63143cf9..4ed0c59e5 100644 --- a/src/test/ref/struct-ptr-5.log +++ b/src/test/ref/struct-ptr-5.log @@ -20,17 +20,17 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (struct Entry*) ENTRIES#0 ← ((struct Entry*)) (number) $1000 + (struct Entry*) ENTRIES ← ((struct Entry*)) (number) $1000 to:@1 (void()) main() main: scope:[main] from @1 - (struct Entry*) main::entry0#0 ← (struct Entry*) ENTRIES#0 + (struct Entry*) main::entry0#0 ← (struct Entry*) ENTRIES (number~) main::$5 ← (number) 1 * (const byte) SIZEOF_STRUCT_ENTRY - (struct Entry*~) main::$0 ← (struct Entry*) ENTRIES#0 + (number~) main::$5 + (struct Entry*~) main::$0 ← (struct Entry*) ENTRIES + (number~) main::$5 (struct Entry*) main::entry1#0 ← (struct Entry*~) main::$0 (number~) main::$6 ← (number) 2 * (const byte) SIZEOF_STRUCT_ENTRY - (struct Entry*~) main::$1 ← (struct Entry*) ENTRIES#0 + (number~) main::$6 + (struct Entry*~) main::$1 ← (struct Entry*) ENTRIES + (number~) main::$6 (struct Entry*) main::entry2#0 ← (struct Entry*~) main::$1 (struct Entry**) main::$7 ← (struct Entry**)(struct Entry*) main::entry0#0 + (const byte) OFFSET_STRUCT_ENTRY_NEXT *((struct Entry**) main::$7) ← (struct Entry*) main::entry2#0 @@ -46,7 +46,7 @@ main: scope:[main] from @1 *((byte*) main::$12) ← (number) 3 (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::idx#0 ← (number) 0 - (struct Entry*) main::entry#0 ← (struct Entry*) ENTRIES#0 + (struct Entry*) main::entry#0 ← (struct Entry*) ENTRIES to:main::@1 main::@1: scope:[main] from main main::@2 (byte) main::idx#6 ← phi( main/(byte) main::idx#0 main::@2/(byte) main::idx#4 ) @@ -90,7 +90,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (struct Entry*) ENTRIES -(struct Entry*) ENTRIES#0 (struct Entry*) Entry::next (byte) Entry::value (const byte) OFFSET_STRUCT_ENTRY_NEXT = (byte) 1 @@ -148,7 +147,7 @@ Adding number conversion cast (unumber) 2 in *((byte*) main::$10) ← (number) 2 Adding number conversion cast (unumber) 3 in *((byte*) main::$12) ← (number) 3 Adding number conversion cast (unumber) 0 in (byte) main::idx#0 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (struct Entry*) ENTRIES#0 ← (struct Entry*)(number) $1000 +Inlining cast (struct Entry*) ENTRIES ← (struct Entry*)(number) $1000 Inlining cast *((byte*) main::$8) ← (unumber)(number) 1 Inlining cast *((byte*) main::$10) ← (unumber)(number) 2 Inlining cast *((struct Entry**) main::$11) ← (struct Entry*)(number) 0 @@ -185,14 +184,14 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [2] (byte~) main::$5 ← (byte) 1 * (const byte) SIZEOF_STRUCT_ENTRY Constant right-side identified [5] (byte~) main::$6 ← (byte) 2 * (const byte) SIZEOF_STRUCT_ENTRY Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const struct Entry*) ENTRIES#0 = (struct Entry*) 4096 +Constant (const struct Entry*) ENTRIES = (struct Entry*) 4096 Constant (const byte) main::$5 = 1*SIZEOF_STRUCT_ENTRY Constant (const byte) main::$6 = 2*SIZEOF_STRUCT_ENTRY Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::idx#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const struct Entry*) main::entry0#0 = ENTRIES#0 -Constant (const struct Entry*) main::entry#0 = ENTRIES#0 +Constant (const struct Entry*) main::entry0#0 = ENTRIES +Constant (const struct Entry*) main::entry#0 = ENTRIES Successful SSA optimization Pass2ConstantIdentification Constant value identified (struct Entry**)main::entry0#0 in [8] (struct Entry**) main::$7 ← (struct Entry**)(const struct Entry*) main::entry0#0 + (const byte) OFFSET_STRUCT_ENTRY_NEXT Constant value identified (byte*)main::entry0#0 in [10] (byte*) main::$8 ← (byte*)(const struct Entry*) main::entry0#0 + (const byte) OFFSET_STRUCT_ENTRY_VALUE @@ -229,11 +228,11 @@ Eliminating unused variable (struct Entry**) main::$15 and assignment [24] (stru Eliminating unused variable (struct Entry**) main::$16 and assignment [30] (struct Entry**) main::$16 ← (struct Entry**)(struct Entry*) main::entry#2 + (const byte) OFFSET_STRUCT_ENTRY_NEXT Eliminating unused constant (const byte) OFFSET_STRUCT_ENTRY_VALUE Successful SSA optimization PassNEliminateUnusedVars -Constant right-side identified [0] (struct Entry*) main::entry1#0 ← (const struct Entry*) ENTRIES#0 + (const byte) main::$5 -Constant right-side identified [1] (struct Entry*) main::entry2#0 ← (const struct Entry*) ENTRIES#0 + (const byte) main::$6 +Constant right-side identified [0] (struct Entry*) main::entry1#0 ← (const struct Entry*) ENTRIES + (const byte) main::$5 +Constant right-side identified [1] (struct Entry*) main::entry2#0 ← (const struct Entry*) ENTRIES + (const byte) main::$6 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const struct Entry*) main::entry1#0 = ENTRIES#0+main::$5 -Constant (const struct Entry*) main::entry2#0 = ENTRIES#0+main::$6 +Constant (const struct Entry*) main::entry1#0 = ENTRIES+main::$5 +Constant (const struct Entry*) main::entry2#0 = ENTRIES+main::$6 Successful SSA optimization Pass2ConstantIdentification Constant value identified (struct Entry**)main::entry2#0 in [4] *((struct Entry**)(const struct Entry*) main::entry2#0 + (const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 Constant value identified (byte*)main::entry2#0 in [5] *((byte*)(const struct Entry*) main::entry2#0) ← (byte) 2 @@ -245,10 +244,10 @@ Inlining constant with var siblings (const struct Entry*) main::entry#0 Constant inlined main::$5 = (byte) 1*(const byte) SIZEOF_STRUCT_ENTRY Constant inlined main::$6 = (byte) 2*(const byte) SIZEOF_STRUCT_ENTRY Constant inlined main::idx#0 = (byte) 0 -Constant inlined main::entry0#0 = (const struct Entry*) ENTRIES#0 -Constant inlined main::entry#0 = (const struct Entry*) ENTRIES#0 +Constant inlined main::entry0#0 = (const struct Entry*) ENTRIES +Constant inlined main::entry#0 = (const struct Entry*) ENTRIES Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *((struct Entry**)ENTRIES#0+OFFSET_STRUCT_ENTRY_NEXT) +Consolidated array index constant in *((struct Entry**)ENTRIES+OFFSET_STRUCT_ENTRY_NEXT) Consolidated array index constant in *((struct Entry**)main::entry2#0+OFFSET_STRUCT_ENTRY_NEXT) Consolidated array index constant in *((struct Entry**)main::entry1#0+OFFSET_STRUCT_ENTRY_NEXT) Successful SSA optimization Pass2ConstantAdditionElimination @@ -281,8 +280,8 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 - [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 + [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 + [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 [7] *((byte*)(const struct Entry*) main::entry2#0) ← (byte) 2 [8] *((struct Entry**)(const struct Entry*) main::entry1#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (struct Entry*) 0 @@ -290,7 +289,7 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 [10] (byte) main::idx#5 ← phi( main/(byte) 0 main::@2/(byte) main::idx#4 ) - [10] (struct Entry*) main::entry#2 ← phi( main/(const struct Entry*) ENTRIES#0 main::@2/(struct Entry*) main::entry#1 ) + [10] (struct Entry*) main::entry#2 ← phi( main/(const struct Entry*) ENTRIES main::@2/(struct Entry*) main::entry#1 ) [11] if((struct Entry*)(word) 0!=(struct Entry*) main::entry#2) goto main::@2 to:main::@return main::@return: scope:[main] from main::@1 @@ -313,7 +312,6 @@ main::@2: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS -(struct Entry*) ENTRIES (struct Entry*) Entry::next (byte) Entry::value (void()) main() @@ -401,12 +399,12 @@ main: { .label idx_4 = 4 .label entry = 2 .label idx_5 = 4 - // [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 + // [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 lda #entry2 sta ENTRIES+OFFSET_STRUCT_ENTRY_NEXT+1 - // [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta ENTRIES // [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 -- _deref_pptc1=pssc2 @@ -430,7 +428,7 @@ main: { // [10] phi (byte) main::idx#5 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z idx_5 - // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES [phi:main->main::@1#1] -- pssz1=pssc1 lda #ENTRIES @@ -516,8 +514,8 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((byte*)(const struct Entry*) main::entry2#0) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [8] *((struct Entry**)(const struct Entry*) main::entry1#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (struct Entry*) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -535,8 +533,8 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:8 [ ma Statement [22] *((const byte*) main::SCREEN + (byte) main::idx#3) ← (byte) ' ' [ main::entry#2 main::idx#3 ] ( main:2 [ main::entry#2 main::idx#3 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ main::idx#3 ] Statement [24] (struct Entry*) main::entry#1 ← *((struct Entry**)(struct Entry*) main::entry#2 + (const byte) OFFSET_STRUCT_ENTRY_NEXT) [ main::entry#1 main::idx#4 ] ( main:2 [ main::entry#1 main::idx#4 ] ) always clobbers reg byte a reg byte y -Statement [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((byte*)(const struct Entry*) main::entry2#0) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [8] *((struct Entry**)(const struct Entry*) main::entry1#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (struct Entry*) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -604,12 +602,12 @@ main: { .label entry1 = ENTRIES+1*SIZEOF_STRUCT_ENTRY .label entry2 = ENTRIES+2*SIZEOF_STRUCT_ENTRY .label entry = 2 - // [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 + // [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 lda #entry2 sta ENTRIES+OFFSET_STRUCT_ENTRY_NEXT+1 - // [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta ENTRIES // [6] *((struct Entry**)(const struct Entry*) main::entry2#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry1#0 -- _deref_pptc1=pssc2 @@ -632,7 +630,7 @@ main: { b1_from_main: // [10] phi (byte) main::idx#5 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES [phi:main->main::@1#1] -- pssz1=pssc1 lda #ENTRIES @@ -726,8 +724,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(struct Entry*) ENTRIES -(const struct Entry*) ENTRIES#0 ENTRIES = (struct Entry*) 4096 +(const struct Entry*) ENTRIES ENTRIES = (struct Entry*) 4096 (struct Entry*) Entry::next (byte) Entry::value (const byte) OFFSET_STRUCT_ENTRY_NEXT OFFSET_STRUCT_ENTRY_NEXT = (byte) 1 @@ -745,9 +742,9 @@ FINAL SYMBOL TABLE (struct Entry*) main::entry#2 entry zp ZP_WORD:2 1.6923076923076923 (struct Entry*) main::entry0 (struct Entry*) main::entry1 -(const struct Entry*) main::entry1#0 entry1 = (const struct Entry*) ENTRIES#0+(byte) 1*(const byte) SIZEOF_STRUCT_ENTRY +(const struct Entry*) main::entry1#0 entry1 = (const struct Entry*) ENTRIES+(byte) 1*(const byte) SIZEOF_STRUCT_ENTRY (struct Entry*) main::entry2 -(const struct Entry*) main::entry2#0 entry2 = (const struct Entry*) ENTRIES#0+(byte) 2*(const byte) SIZEOF_STRUCT_ENTRY +(const struct Entry*) main::entry2#0 entry2 = (const struct Entry*) ENTRIES+(byte) 2*(const byte) SIZEOF_STRUCT_ENTRY (byte) main::idx (byte) main::idx#1 reg byte x 11.0 (byte) main::idx#2 reg byte x 11.0 @@ -792,13 +789,13 @@ main: { .label entry2 = ENTRIES+2*SIZEOF_STRUCT_ENTRY .label entry = 2 // entry0->next = entry2 - // [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 + // [4] *((struct Entry**)(const struct Entry*) ENTRIES+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 -- _deref_pptc1=pssc2 lda #entry2 sta ENTRIES+OFFSET_STRUCT_ENTRY_NEXT+1 // entry0->value = 1 - // [5] *((byte*)(const struct Entry*) ENTRIES#0) ← (byte) 1 -- _deref_pbuc1=vbuc2 + // [5] *((byte*)(const struct Entry*) ENTRIES) ← (byte) 1 -- _deref_pbuc1=vbuc2 lda #1 sta ENTRIES // entry2->next = entry1 @@ -823,7 +820,7 @@ main: { // [10] phi from main to main::@1 [phi:main->main::@1] // [10] phi (byte) main::idx#5 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES#0 [phi:main->main::@1#1] -- pssz1=pssc1 + // [10] phi (struct Entry*) main::entry#2 = (const struct Entry*) ENTRIES [phi:main->main::@1#1] -- pssz1=pssc1 lda #ENTRIES diff --git a/src/test/ref/struct-ptr-5.sym b/src/test/ref/struct-ptr-5.sym index 5e732c85a..ff0d5bca8 100644 --- a/src/test/ref/struct-ptr-5.sym +++ b/src/test/ref/struct-ptr-5.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(struct Entry*) ENTRIES -(const struct Entry*) ENTRIES#0 ENTRIES = (struct Entry*) 4096 +(const struct Entry*) ENTRIES ENTRIES = (struct Entry*) 4096 (struct Entry*) Entry::next (byte) Entry::value (const byte) OFFSET_STRUCT_ENTRY_NEXT OFFSET_STRUCT_ENTRY_NEXT = (byte) 1 @@ -20,9 +19,9 @@ (struct Entry*) main::entry#2 entry zp ZP_WORD:2 1.6923076923076923 (struct Entry*) main::entry0 (struct Entry*) main::entry1 -(const struct Entry*) main::entry1#0 entry1 = (const struct Entry*) ENTRIES#0+(byte) 1*(const byte) SIZEOF_STRUCT_ENTRY +(const struct Entry*) main::entry1#0 entry1 = (const struct Entry*) ENTRIES+(byte) 1*(const byte) SIZEOF_STRUCT_ENTRY (struct Entry*) main::entry2 -(const struct Entry*) main::entry2#0 entry2 = (const struct Entry*) ENTRIES#0+(byte) 2*(const byte) SIZEOF_STRUCT_ENTRY +(const struct Entry*) main::entry2#0 entry2 = (const struct Entry*) ENTRIES+(byte) 2*(const byte) SIZEOF_STRUCT_ENTRY (byte) main::idx (byte) main::idx#1 reg byte x 11.0 (byte) main::idx#2 reg byte x 11.0 diff --git a/src/test/ref/subexpr-optimize-1.cfg b/src/test/ref/subexpr-optimize-1.cfg index bccbcff17..691603fea 100644 --- a/src/test/ref/subexpr-optimize-1.cfg +++ b/src/test/ref/subexpr-optimize-1.cfg @@ -14,10 +14,10 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) - [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) - [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) - [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) + [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) + [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) + [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) [10] (byte) main::i#1 ← ++ (byte) main::i#2 [11] if((byte) main::i#1!=(byte) $27) goto main::@1 to:main::@return diff --git a/src/test/ref/subexpr-optimize-1.log b/src/test/ref/subexpr-optimize-1.log index e353e5fae..7f56a784d 100644 --- a/src/test/ref/subexpr-optimize-1.log +++ b/src/test/ref/subexpr-optimize-1.log @@ -7,23 +7,23 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) (number~) main::$0 ← (byte) main::i#2 + (number) 1 - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← *((byte*) main::SCREEN#0 + (number~) main::$0) - (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (number) $28 - (byte*~) main::$2 ← (byte*) main::SCREEN#0 + (number) $28 + *((byte*) main::SCREEN + (byte) main::i#2) ← *((byte*) main::SCREEN + (number~) main::$0) + (byte*~) main::$1 ← (byte*) main::SCREEN + (number) $28 + (byte*~) main::$2 ← (byte*) main::SCREEN + (number) $28 (number~) main::$3 ← (byte) main::i#2 + (number) 1 *((byte*~) main::$1 + (byte) main::i#2) ← *((byte*~) main::$2 + (number~) main::$3) - (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) $50 - (byte*~) main::$5 ← (byte*) main::SCREEN#0 + (number) $50 + (byte*~) main::$4 ← (byte*) main::SCREEN + (number) $50 + (byte*~) main::$5 ← (byte*) main::SCREEN + (number) $50 (number~) main::$6 ← (byte) main::i#2 + (number) 1 *((byte*~) main::$4 + (byte) main::i#2) ← *((byte*~) main::$5 + (number~) main::$6) - (byte*~) main::$7 ← (byte*) main::SCREEN#0 + (number) $78 - (byte*~) main::$8 ← (byte*) main::SCREEN#0 + (number) $78 + (byte*~) main::$7 ← (byte*) main::SCREEN + (number) $78 + (byte*~) main::$8 ← (byte*) main::SCREEN + (number) $78 (number~) main::$9 ← (byte) main::i#2 + (number) 1 *((byte*~) main::$7 + (byte) main::i#2) ← *((byte*~) main::$8 + (number~) main::$9) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$26) @@ -60,7 +60,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -68,20 +67,20 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 + (number) 1 Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 + (unumber)(number) 1 -Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (number) $28 -Adding number conversion cast (unumber) $28 in (byte*~) main::$2 ← (byte*) main::SCREEN#0 + (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) main::$1 ← (byte*) main::SCREEN + (number) $28 +Adding number conversion cast (unumber) $28 in (byte*~) main::$2 ← (byte*) main::SCREEN + (number) $28 Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (byte) main::i#2 + (number) 1 Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) main::i#2 + (unumber)(number) 1 -Adding number conversion cast (unumber) $50 in (byte*~) main::$4 ← (byte*) main::SCREEN#0 + (number) $50 -Adding number conversion cast (unumber) $50 in (byte*~) main::$5 ← (byte*) main::SCREEN#0 + (number) $50 +Adding number conversion cast (unumber) $50 in (byte*~) main::$4 ← (byte*) main::SCREEN + (number) $50 +Adding number conversion cast (unumber) $50 in (byte*~) main::$5 ← (byte*) main::SCREEN + (number) $50 Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte) main::i#2 + (number) 1 Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::i#2 + (unumber)(number) 1 -Adding number conversion cast (unumber) $78 in (byte*~) main::$7 ← (byte*) main::SCREEN#0 + (number) $78 -Adding number conversion cast (unumber) $78 in (byte*~) main::$8 ← (byte*) main::SCREEN#0 + (number) $78 +Adding number conversion cast (unumber) $78 in (byte*~) main::$7 ← (byte*) main::SCREEN + (number) $78 +Adding number conversion cast (unumber) $78 in (byte*~) main::$8 ← (byte*) main::SCREEN + (number) $78 Adding number conversion cast (unumber) 1 in (number~) main::$9 ← (byte) main::i#2 + (number) 1 Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (byte) main::i#2 + (unumber)(number) 1 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -112,7 +111,7 @@ Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::i#2 + (byt Inferred type updated to byte in (unumber~) main::$9 ← (byte) main::i#2 + (byte) 1 Simple Condition (bool~) main::$10 [19] if((byte) main::i#1!=rangelast(0,$26)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [17] main::i#1 ← ++ main::i#2 to ++ @@ -123,33 +122,33 @@ Simplifying constant integer cast $27 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $27 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [3] (byte*~) main::$1 ← (const byte*) main::SCREEN#0 + (byte) $28 -Constant right-side identified [4] (byte*~) main::$2 ← (const byte*) main::SCREEN#0 + (byte) $28 -Constant right-side identified [7] (byte*~) main::$4 ← (const byte*) main::SCREEN#0 + (byte) $50 -Constant right-side identified [8] (byte*~) main::$5 ← (const byte*) main::SCREEN#0 + (byte) $50 -Constant right-side identified [11] (byte*~) main::$7 ← (const byte*) main::SCREEN#0 + (byte) $78 -Constant right-side identified [12] (byte*~) main::$8 ← (const byte*) main::SCREEN#0 + (byte) $78 +Constant right-side identified [3] (byte*~) main::$1 ← (const byte*) main::SCREEN + (byte) $28 +Constant right-side identified [4] (byte*~) main::$2 ← (const byte*) main::SCREEN + (byte) $28 +Constant right-side identified [7] (byte*~) main::$4 ← (const byte*) main::SCREEN + (byte) $50 +Constant right-side identified [8] (byte*~) main::$5 ← (const byte*) main::SCREEN + (byte) $50 +Constant right-side identified [11] (byte*~) main::$7 ← (const byte*) main::SCREEN + (byte) $78 +Constant right-side identified [12] (byte*~) main::$8 ← (const byte*) main::SCREEN + (byte) $78 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) main::$1 = main::SCREEN#0+$28 -Constant (const byte*) main::$2 = main::SCREEN#0+$28 -Constant (const byte*) main::$4 = main::SCREEN#0+$50 -Constant (const byte*) main::$5 = main::SCREEN#0+$50 -Constant (const byte*) main::$7 = main::SCREEN#0+$78 -Constant (const byte*) main::$8 = main::SCREEN#0+$78 +Constant (const byte*) main::$1 = main::SCREEN+$28 +Constant (const byte*) main::$2 = main::SCREEN+$28 +Constant (const byte*) main::$4 = main::SCREEN+$50 +Constant (const byte*) main::$5 = main::SCREEN+$50 +Constant (const byte*) main::$7 = main::SCREEN+$78 +Constant (const byte*) main::$8 = main::SCREEN+$78 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::i#0 -Constant inlined main::$1 = (const byte*) main::SCREEN#0+(byte) $28 -Constant inlined main::$2 = (const byte*) main::SCREEN#0+(byte) $28 -Constant inlined main::$5 = (const byte*) main::SCREEN#0+(byte) $50 +Constant inlined main::$1 = (const byte*) main::SCREEN+(byte) $28 +Constant inlined main::$2 = (const byte*) main::SCREEN+(byte) $28 +Constant inlined main::$5 = (const byte*) main::SCREEN+(byte) $50 Constant inlined main::i#0 = (byte) 0 -Constant inlined main::$4 = (const byte*) main::SCREEN#0+(byte) $50 -Constant inlined main::$7 = (const byte*) main::SCREEN#0+(byte) $78 -Constant inlined main::$8 = (const byte*) main::SCREEN#0+(byte) $78 +Constant inlined main::$4 = (const byte*) main::SCREEN+(byte) $50 +Constant inlined main::$7 = (const byte*) main::SCREEN+(byte) $78 +Constant inlined main::$8 = (const byte*) main::SCREEN+(byte) $78 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in assignment *(main::SCREEN#0+1 + main::$0) -Consolidated array index constant in assignment *(main::SCREEN#0+$28+1 + main::$3) -Consolidated array index constant in assignment *(main::SCREEN#0+$50+1 + main::$6) -Consolidated array index constant in assignment *(main::SCREEN#0+$78+1 + main::$9) +Consolidated array index constant in assignment *(main::SCREEN+1 + main::$0) +Consolidated array index constant in assignment *(main::SCREEN+$28+1 + main::$3) +Consolidated array index constant in assignment *(main::SCREEN+$50+1 + main::$6) +Consolidated array index constant in assignment *(main::SCREEN+$78+1 + main::$9) Successful SSA optimization Pass2ConstantAdditionElimination Alias (byte) main::i#2 = (byte~) main::$0 (byte~) main::$3 (byte~) main::$6 (byte~) main::$9 Successful SSA optimization Pass2AliasElimination @@ -189,10 +188,10 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@1 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) - [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) - [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) - [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) - [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) + [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) + [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) + [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) + [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) [10] (byte) main::i#1 ← ++ (byte) main::i#2 [11] if((byte) main::i#1!=(byte) $27) goto main::@1 to:main::@return @@ -203,7 +202,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 21.999999999999996 @@ -255,19 +253,19 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+1,y sta SCREEN,y - // [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$28+1,y sta SCREEN+$28,y - // [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$50+1,y sta SCREEN+$50,y - // [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z i lda SCREEN+$78+1,y sta SCREEN+$78,y @@ -286,15 +284,15 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (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 [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a -Statement [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -342,16 +340,16 @@ main: { jmp b1 // main::@1 b1: - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+1,x sta SCREEN,x - // [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28+1,x sta SCREEN+$28,x - // [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$50+1,x sta SCREEN+$50,x - // [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$78+1,x sta SCREEN+$78,x // [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -399,8 +397,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 21.999999999999996 @@ -436,19 +433,19 @@ main: { // main::@1 b1: // SCREEN[i] = SCREEN[i+1] - // [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::SCREEN + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+1,x sta SCREEN,x // (SCREEN+40)[i] = (SCREEN+40)[i+1] - // [7] *((const byte*) main::SCREEN#0+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [7] *((const byte*) main::SCREEN+(byte) $28 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $28+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$28+1,x sta SCREEN+$28,x // (SCREEN+80)[i] = (SCREEN+80)[i+1] - // [8] *((const byte*) main::SCREEN#0+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [8] *((const byte*) main::SCREEN+(byte) $50 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $50+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$50+1,x sta SCREEN+$50,x // (SCREEN+120)[i] = (SCREEN+120)[i+1] - // [9] *((const byte*) main::SCREEN#0+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [9] *((const byte*) main::SCREEN+(byte) $78 + (byte) main::i#2) ← *((const byte*) main::SCREEN+(byte) $78+(byte) 1 + (byte) main::i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda SCREEN+$78+1,x sta SCREEN+$78,x // for(byte i: 0..38) diff --git a/src/test/ref/subexpr-optimize-1.sym b/src/test/ref/subexpr-optimize-1.sym index 295a749fc..81192ca09 100644 --- a/src/test/ref/subexpr-optimize-1.sym +++ b/src/test/ref/subexpr-optimize-1.sym @@ -4,8 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 21.999999999999996 diff --git a/src/test/ref/summin.cfg b/src/test/ref/summin.cfg index ce37debe0..d442e09c4 100644 --- a/src/test/ref/summin.cfg +++ b/src/test/ref/summin.cfg @@ -28,7 +28,7 @@ main::@3: scope:[main] from main::@2 [13] (byte) main::s3#0 ← (byte) sum::return#2 [14] (byte~) main::$3 ← (byte) main::s1#0 + (byte) main::s2#0 [15] (byte) main::s4#0 ← (byte~) main::$3 + (byte) main::s3#0 - [16] *((const byte*) screen#0) ← (byte) main::s4#0 + [16] *((const byte*) screen) ← (byte) main::s4#0 to:main::@return main::@return: scope:[main] from main::@3 [17] return diff --git a/src/test/ref/summin.log b/src/test/ref/summin.log index 5cb20b84a..5f8a62f45 100644 --- a/src/test/ref/summin.log +++ b/src/test/ref/summin.log @@ -4,7 +4,7 @@ Culled Empty Block (label) sum::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) screen#0 ← ((byte*)) (number) $400 + (byte*) screen ← ((byte*)) (number) $400 to:@2 (void()) main() @@ -42,7 +42,7 @@ main::@3: scope:[main] from main::@2 (byte~) main::$3 ← (byte) main::s1#1 + (byte) main::s2#1 (byte~) main::$4 ← (byte~) main::$3 + (byte) main::s3#0 (byte) main::s4#0 ← (byte~) main::$4 - *((byte*) screen#0) ← (byte) main::s4#0 + *((byte*) screen) ← (byte) main::s4#0 to:main::@return main::@return: scope:[main] from main::@3 return @@ -94,7 +94,6 @@ SYMBOL TABLE SSA (byte) main::s4 (byte) main::s4#0 (byte*) screen -(byte*) screen#0 (byte()) sum((byte) sum::a , (byte) sum::b) (byte~) sum::$0 (label) sum::@return @@ -126,7 +125,7 @@ Adding number conversion cast (unumber) 4 in (byte) sum::b#1 ← (number) 4 Adding number conversion cast (unumber) 9 in (byte) sum::a#2 ← (number) 9 Adding number conversion cast (unumber) $d in (byte) sum::b#2 ← (number) $d Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) screen ← (byte*)(number) $400 Inlining cast (byte) sum::a#0 ← (unumber)(number) 1 Inlining cast (byte) sum::b#0 ← (unumber)(number) 2 Inlining cast (byte) sum::a#1 ← (unumber)(number) 3 @@ -158,7 +157,7 @@ Alias (byte) main::s3#0 = (byte~) main::$2 Alias (byte) main::s4#0 = (byte~) main::$4 Alias (byte) sum::return#3 = (byte~) sum::$0 (byte) sum::return#8 (byte) sum::return#4 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) screen#0 = (byte*) 1024 +Constant (const byte*) screen = (byte*) 1024 Constant (const byte) sum::a#0 = 1 Constant (const byte) sum::b#0 = 2 Constant (const byte) sum::a#1 = 3 @@ -228,7 +227,7 @@ main::@3: scope:[main] from main::@2 [13] (byte) main::s3#0 ← (byte) sum::return#2 [14] (byte~) main::$3 ← (byte) main::s1#0 + (byte) main::s2#0 [15] (byte) main::s4#0 ← (byte~) main::$3 + (byte) main::s3#0 - [16] *((const byte*) screen#0) ← (byte) main::s4#0 + [16] *((const byte*) screen) ← (byte) main::s4#0 to:main::@return main::@return: scope:[main] from main::@3 [17] return @@ -256,7 +255,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::s3#0 2.0 (byte) main::s4 (byte) main::s4#0 4.0 -(byte*) screen (byte()) sum((byte) sum::a , (byte) sum::b) (byte) sum::a (byte) sum::a#3 2.0 @@ -403,7 +401,7 @@ main: { clc adc.z s3 sta.z s4 - // [16] *((const byte*) screen#0) ← (byte) main::s4#0 -- _deref_pbuc1=vbuz1 + // [16] *((const byte*) screen) ← (byte) main::s4#0 -- _deref_pbuc1=vbuz1 lda.z s4 sta screen jmp breturn @@ -556,7 +554,7 @@ main: { // [15] (byte) main::s4#0 ← (byte~) main::$3 + (byte) main::s3#0 -- vbuaa=vbuaa_plus_vbuz1 clc adc.z s3 - // [16] *((const byte*) screen#0) ← (byte) main::s4#0 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) screen) ← (byte) main::s4#0 -- _deref_pbuc1=vbuaa sta screen jmp breturn // main::@return @@ -627,8 +625,7 @@ FINAL SYMBOL TABLE (byte) main::s3#0 s3 zp ZP_BYTE:3 2.0 (byte) main::s4 (byte) main::s4#0 reg byte a 4.0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 (byte()) sum((byte) sum::a , (byte) sum::b) (label) sum::@return (byte) sum::a @@ -727,7 +724,7 @@ main: { clc adc.z s3 // *screen = s4 - // [16] *((const byte*) screen#0) ← (byte) main::s4#0 -- _deref_pbuc1=vbuaa + // [16] *((const byte*) screen) ← (byte) main::s4#0 -- _deref_pbuc1=vbuaa sta screen // main::@return // } diff --git a/src/test/ref/summin.sym b/src/test/ref/summin.sym index dcf7f4311..9c55a7976 100644 --- a/src/test/ref/summin.sym +++ b/src/test/ref/summin.sym @@ -15,8 +15,7 @@ (byte) main::s3#0 s3 zp ZP_BYTE:3 2.0 (byte) main::s4 (byte) main::s4#0 reg byte a 4.0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 (byte()) sum((byte) sum::a , (byte) sum::b) (label) sum::@return (byte) sum::a diff --git a/src/test/ref/switch-2.cfg b/src/test/ref/switch-2.cfg index 5cf117640..41ec776be 100644 --- a/src/test/ref/switch-2.cfg +++ b/src/test/ref/switch-2.cfg @@ -13,7 +13,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 + [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 to:main::@return main::@return: scope:[main] from main::@1 [6] return diff --git a/src/test/ref/switch-2.log b/src/test/ref/switch-2.log index 70b3e8e73..9178324dd 100644 --- a/src/test/ref/switch-2.log +++ b/src/test/ref/switch-2.log @@ -9,17 +9,17 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::b#0 ← (number) 0 - (byte) main::v64#0 ← (number) 0 - if((byte) main::v64#0==(number) 0) goto main::@3 + (byte) main::v64 ← (number) 0 + if((byte) main::v64==(number) 0) goto main::@3 to:main::@4 main::@3: scope:[main] from main (byte) main::b#1 ← (number) 1 to:main::@4 main::@4: scope:[main] from main main::@3 (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@3/(byte) main::b#1 ) - *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b#2 + *((byte*) main::SCREEN + (number) 0) ← (byte) main::b#2 to:main::@return main::@return: scope:[main] from main::@4 return @@ -41,23 +41,21 @@ SYMBOL TABLE SSA (label) main::@4 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::b (byte) main::b#0 (byte) main::b#1 (byte) main::b#2 (byte) main::v64 -(byte) main::v64#0 Adding number conversion cast (unumber) 0 in (byte) main::b#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in (byte) main::v64#0 ← (number) 0 -Adding number conversion cast (unumber) 0 in if((byte) main::v64#0==(number) 0) goto main::@3 +Adding number conversion cast (unumber) 0 in (byte) main::v64 ← (number) 0 +Adding number conversion cast (unumber) 0 in if((byte) main::v64==(number) 0) goto main::@3 Adding number conversion cast (unumber) 1 in (byte) main::b#1 ← (number) 1 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b#2 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte) main::b#2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Inlining cast (byte) main::b#0 ← (unumber)(number) 0 -Inlining cast (byte) main::v64#0 ← (unumber)(number) 0 +Inlining cast (byte) main::v64 ← (unumber)(number) 0 Inlining cast (byte) main::b#1 ← (unumber)(number) 1 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 @@ -73,20 +71,20 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Negating conditional jump and destination [3] if((byte) main::v64#0!=(byte) 0) goto main::@4 +Negating conditional jump and destination [3] if((byte) main::v64!=(byte) 0) goto main::@4 Successful SSA optimization Pass2ConditionalJumpSequenceImprovement -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::b#0 = 0 -Constant (const byte) main::v64#0 = 0 +Constant (const byte) main::v64 = 0 Constant (const byte) main::b#1 = 1 Successful SSA optimization Pass2ConstantIdentification Removing PHI-reference to removed block (main) in block main::@4 -if() condition always false - eliminating [3] if((const byte) main::v64#0!=(byte) 0) goto main::@4 +if() condition always false - eliminating [3] if((const byte) main::v64!=(byte) 0) goto main::@4 Successful SSA optimization Pass2ConstantIfs -Simplifying expression containing zero main::SCREEN#0 in [6] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte) main::b#2 +Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (byte) main::b#2 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const byte) main::b#0 -Eliminating unused constant (const byte) main::v64#0 +Eliminating unused constant (const byte) main::v64 Successful SSA optimization PassNEliminateUnusedVars Identical Phi Values (byte) main::b#2 (const byte) main::b#1 Successful SSA optimization Pass2IdenticalPhiElimination @@ -125,7 +123,7 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main - [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 + [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 to:main::@return main::@return: scope:[main] from main::@1 [6] return @@ -134,9 +132,7 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN (byte) main::b -(byte) main::v64 Initial phi equivalence classes Complete equivalence classes @@ -173,7 +169,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 lda #b sta SCREEN jmp breturn @@ -185,7 +181,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -225,7 +221,7 @@ main: { jmp b1 // main::@1 b1: - // [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 lda #b sta SCREEN jmp breturn @@ -264,11 +260,9 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b (const byte) main::b#1 b = (byte) 1 -(byte) main::v64 @@ -295,7 +289,7 @@ main: { .const b = 1 // main::@1 // SCREEN[0] = b - // [5] *((const byte*) main::SCREEN#0) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN) ← (const byte) main::b#1 -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // main::@return diff --git a/src/test/ref/switch-2.sym b/src/test/ref/switch-2.sym index dc7971eb1..9fb364d4c 100644 --- a/src/test/ref/switch-2.sym +++ b/src/test/ref/switch-2.sym @@ -4,9 +4,7 @@ (void()) main() (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::b (const byte) main::b#1 b = (byte) 1 -(byte) main::v64 diff --git a/src/test/ref/test-comments-block.cfg b/src/test/ref/test-comments-block.cfg index dc8df13c6..74faa3a59 100644 --- a/src/test/ref/test-comments-block.cfg +++ b/src/test/ref/test-comments-block.cfg @@ -32,7 +32,7 @@ main::@return: scope:[main] from main::@2 (byte()) sum((byte) sum::a , (byte) sum::b) sum: scope:[sum] from main::@1 - [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 + [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 to:sum::@return sum::@return: scope:[sum] from sum [16] return diff --git a/src/test/ref/test-comments-block.log b/src/test/ref/test-comments-block.log index 898cde91b..2504ded10 100644 --- a/src/test/ref/test-comments-block.log +++ b/src/test/ref/test-comments-block.log @@ -6,7 +6,7 @@ Culled Empty Block (label) sum::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN ← ((byte*)) (number) $400 - (byte) a#0 ← (byte) 'a' + (byte) a ← (byte) 'a' to:@2 (void()) main() @@ -17,7 +17,7 @@ main: scope:[main] from @2 main::@1: scope:[main] from main main::@3 (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@3/(byte) main::b#1 ) - (byte) sum::a#0 ← (byte) a#0 + (byte) sum::a#0 ← (byte) a (byte) sum::b#0 ← (byte) main::b#2 call sum (byte) sum::return#0 ← (byte) sum::return#2 @@ -64,7 +64,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte) a -(byte) a#0 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -120,11 +119,11 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$1 [15] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN = (byte*) 1024 -Constant (const byte) a#0 = 'a' +Constant (const byte) a = 'a' Constant (const byte) main::i#0 = 0 Constant (const byte) main::b#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) sum::a#0 = a#0 +Constant (const byte) sum::a#0 = a Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [13] main::b#1 ← ++ main::b#2 to ++ Resolved ranged comparison value [15] if(main::b#1!=rangelast(0,$a)) goto main::@1 to (number) $b @@ -137,7 +136,7 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::b#0 Constant inlined main::i#0 = (byte) 0 -Constant inlined sum::a#0 = (const byte) a#0 +Constant inlined sum::a#0 = (const byte) a Constant inlined main::b#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@4(between main::@3 and main::@1) @@ -198,7 +197,7 @@ main::@return: scope:[main] from main::@2 (byte()) sum((byte) sum::a , (byte) sum::b) sum: scope:[sum] from main::@1 - [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 + [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 to:sum::@return sum::@return: scope:[sum] from sum [16] return @@ -206,7 +205,6 @@ sum::@return: scope:[sum] from sum VARIABLE REGISTER WEIGHTS -(byte) a (void()) main() (byte~) main::$0 22.0 (byte) main::b @@ -343,7 +341,7 @@ sum: { .label b = 4 .label return = 5 .label return_1 = 7 - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuz1=vbuc1_plus_vbuz2 + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuz1=vbuc1_plus_vbuz2 lax.z b axs #-[a] stx.z return_1 @@ -455,7 +453,7 @@ main: { */ // sum(byte register(A) b) sum: { - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa clc adc #a jmp breturn @@ -500,8 +498,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) SCREEN SCREEN = (byte*) 1024 -(byte) a -(const byte) a#0 a = (byte) 'a' +(const byte) a a = (byte) 'a' (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 @@ -603,7 +600,7 @@ main: { // sum(byte register(A) b) sum: { // a+b - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa clc adc #a // sum::@return diff --git a/src/test/ref/test-comments-block.sym b/src/test/ref/test-comments-block.sym index 3d512cdb3..a11ec025c 100644 --- a/src/test/ref/test-comments-block.sym +++ b/src/test/ref/test-comments-block.sym @@ -2,8 +2,7 @@ (label) @begin (label) @end (const byte*) SCREEN SCREEN = (byte*) 1024 -(byte) a -(const byte) a#0 a = (byte) 'a' +(const byte) a a = (byte) 'a' (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 diff --git a/src/test/ref/test-comments-single.cfg b/src/test/ref/test-comments-single.cfg index dc8df13c6..74faa3a59 100644 --- a/src/test/ref/test-comments-single.cfg +++ b/src/test/ref/test-comments-single.cfg @@ -32,7 +32,7 @@ main::@return: scope:[main] from main::@2 (byte()) sum((byte) sum::a , (byte) sum::b) sum: scope:[sum] from main::@1 - [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 + [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 to:sum::@return sum::@return: scope:[sum] from sum [16] return diff --git a/src/test/ref/test-comments-single.log b/src/test/ref/test-comments-single.log index 20a833afd..5388d668c 100644 --- a/src/test/ref/test-comments-single.log +++ b/src/test/ref/test-comments-single.log @@ -6,7 +6,7 @@ Culled Empty Block (label) sum::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN ← ((byte*)) (number) $400 - (byte) a#0 ← (byte) 'a' + (byte) a ← (byte) 'a' to:@2 (void()) main() @@ -17,7 +17,7 @@ main: scope:[main] from @2 main::@1: scope:[main] from main main::@3 (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@3/(byte) main::b#1 ) - (byte) sum::a#0 ← (byte) a#0 + (byte) sum::a#0 ← (byte) a (byte) sum::b#0 ← (byte) main::b#2 call sum (byte) sum::return#0 ← (byte) sum::return#2 @@ -64,7 +64,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte) a -(byte) a#0 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -120,11 +119,11 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$1 [15] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN = (byte*) 1024 -Constant (const byte) a#0 = 'a' +Constant (const byte) a = 'a' Constant (const byte) main::i#0 = 0 Constant (const byte) main::b#0 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) sum::a#0 = a#0 +Constant (const byte) sum::a#0 = a Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [13] main::b#1 ← ++ main::b#2 to ++ Resolved ranged comparison value [15] if(main::b#1!=rangelast(0,$a)) goto main::@1 to (number) $b @@ -137,7 +136,7 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::b#0 Constant inlined main::i#0 = (byte) 0 -Constant inlined sum::a#0 = (const byte) a#0 +Constant inlined sum::a#0 = (const byte) a Constant inlined main::b#0 = (byte) 0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@4(between main::@3 and main::@1) @@ -198,7 +197,7 @@ main::@return: scope:[main] from main::@2 (byte()) sum((byte) sum::a , (byte) sum::b) sum: scope:[sum] from main::@1 - [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 + [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 to:sum::@return sum::@return: scope:[sum] from sum [16] return @@ -206,7 +205,6 @@ sum::@return: scope:[sum] from sum VARIABLE REGISTER WEIGHTS -(byte) a (void()) main() (byte~) main::$0 22.0 (byte) main::b @@ -341,7 +339,7 @@ sum: { .label b = 4 .label return = 5 .label return_1 = 7 - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuz1=vbuc1_plus_vbuz2 + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuz1=vbuc1_plus_vbuz2 lax.z b axs #-[a] stx.z return_1 @@ -451,7 +449,7 @@ main: { // Returns the sum pf the two bytes // sum(byte register(A) b) sum: { - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa clc adc #a jmp breturn @@ -496,8 +494,7 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) SCREEN SCREEN = (byte*) 1024 -(byte) a -(const byte) a#0 a = (byte) 'a' +(const byte) a a = (byte) 'a' (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 @@ -597,7 +594,7 @@ main: { // sum(byte register(A) b) sum: { // a+b - // [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa + // [15] (byte) sum::return#1 ← (const byte) a + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuaa clc adc #a // sum::@return diff --git a/src/test/ref/test-comments-single.sym b/src/test/ref/test-comments-single.sym index 3d512cdb3..a11ec025c 100644 --- a/src/test/ref/test-comments-single.sym +++ b/src/test/ref/test-comments-single.sym @@ -2,8 +2,7 @@ (label) @begin (label) @end (const byte*) SCREEN SCREEN = (byte*) 1024 -(byte) a -(const byte) a#0 a = (byte) 'a' +(const byte) a a = (byte) 'a' (void()) main() (byte~) main::$0 reg byte a 22.0 (label) main::@1 diff --git a/src/test/ref/test-kasm-pc.cfg b/src/test/ref/test-kasm-pc.cfg index cc64ca098..d40962909 100644 --- a/src/test/ref/test-kasm-pc.cfg +++ b/src/test/ref/test-kasm-pc.cfg @@ -2,7 +2,7 @@ [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) TABLE#0) {{ .byte 1, 2, 3 + kickasm(location (const byte*) TABLE) {{ .byte 1, 2, 3 }} [2] call main to:@end @@ -17,6 +17,6 @@ main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) to:main::@2 main::@2: scope:[main] from main::@1 - [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) + [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 diff --git a/src/test/ref/test-kasm-pc.log b/src/test/ref/test-kasm-pc.log index a814370d1..e746a7cd4 100644 --- a/src/test/ref/test-kasm-pc.log +++ b/src/test/ref/test-kasm-pc.log @@ -7,12 +7,12 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) TABLE#0 ← ((byte*)) (number) $2000 + (byte*) TABLE ← ((byte*)) (number) $2000 to:@1 (void()) main() main: scope:[main] from @1 - (byte*) main::BORDERCOL#0 ← ((byte*)) (number) $d020 + (byte*) main::BORDERCOL ← ((byte*)) (number) $d020 (byte) main::i#0 ← (number) 0 to:main::@1 main::@1: scope:[main] from main main::@2 @@ -21,14 +21,14 @@ main::@1: scope:[main] from main main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) - *((byte*) main::BORDERCOL#0) ← *((byte*) TABLE#0 + (byte) main::i#2) + *((byte*) main::BORDERCOL) ← *((byte*) TABLE + (byte) main::i#2) (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - kickasm(location (byte*) TABLE#0) {{ .byte 1, 2, 3 + kickasm(location (byte*) TABLE) {{ .byte 1, 2, 3 }} call main to:@2 @@ -42,13 +42,11 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) TABLE -(byte*) TABLE#0 (void()) main() (label) main::@1 (label) main::@2 (label) main::@return (byte*) main::BORDERCOL -(byte*) main::BORDERCOL#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -57,8 +55,8 @@ SYMBOL TABLE SSA Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) TABLE#0 ← (byte*)(number) $2000 -Inlining cast (byte*) main::BORDERCOL#0 ← (byte*)(number) $d020 +Inlining cast (byte*) TABLE ← (byte*)(number) $2000 +Inlining cast (byte*) main::BORDERCOL ← (byte*)(number) $d020 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 8192 @@ -69,8 +67,8 @@ Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Alias (byte) main::i#2 = (byte) main::i#3 Successful SSA optimization Pass2AliasElimination -Constant (const byte*) TABLE#0 = (byte*) 8192 -Constant (const byte*) main::BORDERCOL#0 = (byte*) 53280 +Constant (const byte*) TABLE = (byte*) 8192 +Constant (const byte*) main::BORDERCOL = (byte*) 53280 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [4] if(true) goto main::@2 @@ -100,7 +98,7 @@ FINAL CONTROL FLOW GRAPH [0] phi() to:@1 @1: scope:[] from @begin - kickasm(location (const byte*) TABLE#0) {{ .byte 1, 2, 3 + kickasm(location (const byte*) TABLE) {{ .byte 1, 2, 3 }} [2] call main to:@end @@ -115,15 +113,13 @@ main::@1: scope:[main] from main main::@2 [5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 ) to:main::@2 main::@2: scope:[main] from main::@1 - [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) + [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) [7] (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 VARIABLE REGISTER WEIGHTS -(byte*) TABLE (void()) main() -(byte*) main::BORDERCOL (byte) main::i (byte) main::i#1 22.0 (byte) main::i#2 16.5 @@ -149,7 +145,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) TABLE#0) {{ .byte 1, 2, 3 }} + // kickasm(location (const byte*) TABLE) {{ .byte 1, 2, 3 }} // [2] call main // [4] phi from @1 to main [phi:@1->main] main_from_b1: @@ -174,7 +170,7 @@ main: { jmp b2 // main::@2 b2: - // [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + // [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuz1 ldy.z i lda TABLE,y sta BORDERCOL @@ -191,9 +187,9 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (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 [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#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 , REGISTER UPLIFT SCOPES @@ -217,7 +213,7 @@ bbegin: jmp b1 // @1 b1: - // kickasm(location (const byte*) TABLE#0) {{ .byte 1, 2, 3 }} + // kickasm(location (const byte*) TABLE) {{ .byte 1, 2, 3 }} // [2] call main // [4] phi from @1 to main [phi:@1->main] main_from_b1: @@ -240,7 +236,7 @@ main: { jmp b2 // main::@2 b2: - // [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuxx lda TABLE,x sta BORDERCOL // [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx @@ -281,13 +277,11 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) TABLE -(const byte*) TABLE#0 TABLE = (byte*) 8192 +(const byte*) TABLE TABLE = (byte*) 8192 (void()) main() (label) main::@1 (label) main::@2 -(byte*) main::BORDERCOL -(const byte*) main::BORDERCOL#0 BORDERCOL = (byte*) 53280 +(const byte*) main::BORDERCOL BORDERCOL = (byte*) 53280 (byte) main::i (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 16.5 @@ -309,7 +303,7 @@ Score: 2715 // @begin // @1 // kickasm - // kickasm(location (const byte*) TABLE#0) {{ .byte 1, 2, 3 }} + // kickasm(location (const byte*) TABLE) {{ .byte 1, 2, 3 }} // [2] call main // [4] phi from @1 to main [phi:@1->main] // [3] phi from @1 to @end [phi:@1->@end] @@ -324,7 +318,7 @@ main: { // main::@2 b2: // *BORDERCOL = TABLE[i++] - // [6] *((const byte*) main::BORDERCOL#0) ← *((const byte*) TABLE#0 + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuxx + // [6] *((const byte*) main::BORDERCOL) ← *((const byte*) TABLE + (byte) main::i#2) -- _deref_pbuc1=pbuc2_derefidx_vbuxx lda TABLE,x sta BORDERCOL // *BORDERCOL = TABLE[i++]; diff --git a/src/test/ref/test-kasm-pc.sym b/src/test/ref/test-kasm-pc.sym index ef19abb91..69c49e410 100644 --- a/src/test/ref/test-kasm-pc.sym +++ b/src/test/ref/test-kasm-pc.sym @@ -1,13 +1,11 @@ (label) @1 (label) @begin (label) @end -(byte*) TABLE -(const byte*) TABLE#0 TABLE = (byte*) 8192 +(const byte*) TABLE TABLE = (byte*) 8192 (void()) main() (label) main::@1 (label) main::@2 -(byte*) main::BORDERCOL -(const byte*) main::BORDERCOL#0 BORDERCOL = (byte*) 53280 +(const byte*) main::BORDERCOL BORDERCOL = (byte*) 53280 (byte) main::i (byte) main::i#1 reg byte x 22.0 (byte) main::i#2 reg byte x 16.5 diff --git a/src/test/ref/test-lohiconst.cfg b/src/test/ref/test-lohiconst.cfg index d1447740f..15b9eb031 100644 --- a/src/test/ref/test-lohiconst.cfg +++ b/src/test/ref/test-lohiconst.cfg @@ -10,10 +10,10 @@ (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28 - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 - [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 - [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 + [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 + [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 + [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 + [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 to:main::@return main::@return: scope:[main] from main [8] return diff --git a/src/test/ref/test-lohiconst.log b/src/test/ref/test-lohiconst.log index 8ff59a75b..8d791d943 100644 --- a/src/test/ref/test-lohiconst.log +++ b/src/test/ref/test-lohiconst.log @@ -7,19 +7,19 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (word~) main::$0 ← > (dword) PI_u4f28 (byte~) main::$1 ← > (word~) main::$0 - *((byte*) main::SCREEN#0 + (number) 0) ← (byte~) main::$1 + *((byte*) main::SCREEN + (number) 0) ← (byte~) main::$1 (word~) main::$2 ← > (dword) PI_u4f28 (byte~) main::$3 ← < (word~) main::$2 - *((byte*) main::SCREEN#0 + (number) 1) ← (byte~) main::$3 + *((byte*) main::SCREEN + (number) 1) ← (byte~) main::$3 (word~) main::$4 ← < (dword) PI_u4f28 (byte~) main::$5 ← > (word~) main::$4 - *((byte*) main::SCREEN#0 + (number) 2) ← (byte~) main::$5 + *((byte*) main::SCREEN + (number) 2) ← (byte~) main::$5 (word~) main::$6 ← < (dword) PI_u4f28 (byte~) main::$7 ← < (word~) main::$6 - *((byte*) main::SCREEN#0 + (number) 3) ← (byte~) main::$7 + *((byte*) main::SCREEN + (number) 3) ← (byte~) main::$7 to:main::@return main::@return: scope:[main] from main return @@ -48,16 +48,15 @@ SYMBOL TABLE SSA (byte~) main::$7 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 Adding number conversion cast (unumber) $3243f6a9 in (dword) PI_u4f28 ← (number) $3243f6a9 -Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte~) main::$1 -Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte~) main::$3 -Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 2) ← (byte~) main::$5 -Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN#0 + (number) 3) ← (byte~) main::$7 +Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← (byte~) main::$1 +Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← (byte~) main::$3 +Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte~) main::$5 +Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN + (number) 3) ← (byte~) main::$7 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (dword) PI_u4f28 ← (unumber)(number) $3243f6a9 -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast $3243f6a9 Simplifying constant pointer cast (byte*) 1024 @@ -76,9 +75,9 @@ Identified duplicate assignment right side [5] (word~) main::$2 ← > (dword) PI Identified duplicate assignment right side [11] (word~) main::$6 ← < (dword) PI_u4f28 Successful SSA optimization Pass2DuplicateRValueIdentification Constant (const dword) PI_u4f28 = $3243f6a9 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::SCREEN#0 in [4] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte~) main::$1 +Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (byte) 0) ← (byte~) main::$1 Successful SSA optimization PassNSimplifyExpressionWithZero Alias (word~) main::$2 = (word~) main::$0 Alias (word~) main::$6 = (word~) main::$4 @@ -106,9 +105,9 @@ Constant inlined main::$6 = <(const dword) PI_u4f28 Constant inlined main::$3 = <>(const dword) PI_u4f28 Constant inlined main::$7 = <<(const dword) PI_u4f28 Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::SCREEN#0+1) -Consolidated array index constant in *(main::SCREEN#0+2) -Consolidated array index constant in *(main::SCREEN#0+3) +Consolidated array index constant in *(main::SCREEN+1) +Consolidated array index constant in *(main::SCREEN+2) +Consolidated array index constant in *(main::SCREEN+3) Successful SSA optimization Pass2ConstantAdditionElimination Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -137,10 +136,10 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28 - [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 - [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 - [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 + [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 + [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 + [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 + [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 to:main::@return main::@return: scope:[main] from main [8] return @@ -149,7 +148,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(byte*) main::SCREEN Initial phi equivalence classes Complete equivalence classes @@ -181,16 +179,16 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28&$ffff sta SCREEN+2 - // [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -240,16 +238,16 @@ bend: // main main: { .label SCREEN = $400 - // [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 sta SCREEN - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28&$ffff sta SCREEN+2 - // [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda # > PI_u4f28 - // [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) main::SCREEN) ← >>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28>>$10 sta SCREEN // SCREEN[1] = < > PI_u4f28 - // [5] *((const byte*) main::SCREEN#0+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [5] *((const byte*) main::SCREEN+(byte) 1) ← <>(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>$10 sta SCREEN+1 // SCREEN[2] = > < PI_u4f28 - // [6] *((const byte*) main::SCREEN#0+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::SCREEN+(byte) 2) ← ><(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda #>PI_u4f28&$ffff sta SCREEN+2 // SCREEN[3] = < < PI_u4f28 - // [7] *((const byte*) main::SCREEN#0+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 + // [7] *((const byte*) main::SCREEN+(byte) 3) ← <<(const dword) PI_u4f28 -- _deref_pbuc1=vbuc2 lda # (number) 0 Adding number conversion cast (snumber) 0 in (signed byte) muls8s::j#0 ← (number) 0 Adding number conversion cast (unumber) $200*4 in (byte*~) mulf_tables_cmp::$2 ← (byte[$200]) mulf_sqr1_lo + (number) $200*(number) 4 -Adding number conversion cast (unumber) 2 in *((byte*) BGCOL#0) ← (number) 2 +Adding number conversion cast (unumber) 2 in *((byte*) BGCOL) ← (number) 2 Adding number conversion cast (unumber) 1 in (byte) mul8u_compare::ok#0 ← (number) 1 Adding number conversion cast (unumber) 0 in (byte) mul8u_compare::ok#1 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) mul8u_compare::$9 ← (byte) mul8u_compare::ok#3 == (number) 0 Adding number conversion cast (unumber) 0 in (byte) mul8u_compare::ok#2 ← (number) 0 -Adding number conversion cast (unumber) 2 in *((byte*) BGCOL#0) ← (number) 2 +Adding number conversion cast (unumber) 2 in *((byte*) BGCOL) ← (number) 2 Adding number conversion cast (snumber) -$80 in (signed byte) mul8s_compare::a#0 ← (number) -$80 Adding number conversion cast (snumber) -$80 in (bool~) mul8s_compare::$2 ← (signed byte) mul8s_compare::a#2 != (number) -$80 Adding number conversion cast (snumber) -$80 in (signed byte) mul8s_compare::b#0 ← (number) -$80 @@ -3017,7 +3015,7 @@ Adding number conversion cast (unumber) 1 in (byte) mul8s_compare::ok#0 ← (num Adding number conversion cast (unumber) 0 in (byte) mul8s_compare::ok#1 ← (number) 0 Adding number conversion cast (unumber) 0 in (bool~) mul8s_compare::$11 ← (byte) mul8s_compare::ok#3 == (number) 0 Adding number conversion cast (unumber) 0 in (byte) mul8s_compare::ok#2 ← (number) 0 -Adding number conversion cast (unumber) 2 in *((byte*) BGCOL#0) ← (number) 2 +Adding number conversion cast (unumber) 2 in *((byte*) BGCOL) ← (number) 2 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 @@ -3046,27 +3044,27 @@ Inlining cast (byte~) mulf8s_prepared::$9 ← (byte)(signed byte) mulf8s_prepare Inlining cast (signed word~) mulf8s_prepared::$6 ← (signed word)(word) mulf8s_prepared::m#4 Inlining cast (byte~) mulf8s_prepared::$13 ← (byte)*((signed byte*) mulf8s_prepared::memA) Inlining cast (byte~) mulf8s::mulf8s_prepare1_$0 ← (byte)(signed byte) mulf8s::mulf8s_prepare1_a#1 -Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 5 +Inlining cast (byte*) BGCOL ← (byte*)(number) $d021 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 5 Inlining cast (word) muls8u::m#0 ← (unumber)(number) 0 Inlining cast (byte) muls8u::i#0 ← (unumber)(number) 0 Inlining cast (signed word) muls8s::m#0 ← (snumber)(number) 0 Inlining cast (signed byte) muls8s::i#0 ← (snumber)(number) 0 Inlining cast (signed byte) muls8s::j#0 ← (snumber)(number) 0 -Inlining cast (byte*) mulf_init_asm::mem#0 ← (byte*)(number) $ff -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 2 +Inlining cast (byte*) mulf_init_asm::mem ← (byte*)(number) $ff +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 2 Inlining cast (word~) mulf_tables_cmp::$7 ← (word)(byte*) mulf_tables_cmp::asm_sqr#4 Inlining cast (word~) mulf_tables_cmp::$10 ← (word)(byte*) mulf_tables_cmp::kc_sqr#5 Inlining cast (byte) mul8u_compare::ok#0 ← (unumber)(number) 1 Inlining cast (byte) mul8u_compare::ok#1 ← (unumber)(number) 0 Inlining cast (byte) mul8u_compare::ok#2 ← (unumber)(number) 0 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 2 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 2 Inlining cast (signed byte) mul8s_compare::a#0 ← (snumber)(number) -$80 Inlining cast (signed byte) mul8s_compare::b#0 ← (snumber)(number) -$80 Inlining cast (byte) mul8s_compare::ok#0 ← (unumber)(number) 1 Inlining cast (byte) mul8s_compare::ok#1 ← (unumber)(number) 0 Inlining cast (byte) mul8s_compare::ok#2 ← (unumber)(number) 0 -Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 2 +Inlining cast *((byte*) BGCOL) ← (unumber)(number) 2 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant pointer cast (byte*) 1024 @@ -3680,7 +3678,7 @@ Constant (const byte*) mulf8u_prepare::memA = (byte*) 253 Constant (const byte*) mulf8u_prepared::resL = (byte*) 254 Constant (const byte*) mulf8u_prepared::memB = (byte*) 255 Constant (const signed byte*) mulf8s_prepared::memA = (signed byte*) 253 -Constant (const byte*) BGCOL#0 = (byte*) 53281 +Constant (const byte*) BGCOL = (byte*) 53281 Constant (const word) muls8u::m#0 = 0 Constant (const byte) muls8u::i#0 = 0 Constant (const signed word) muls8s::m#0 = 0 @@ -3690,7 +3688,7 @@ Constant (const byte[$200]) mula_sqr1_lo = { fill( $200, 0) } Constant (const byte[$200]) mula_sqr1_hi = { fill( $200, 0) } Constant (const byte[$200]) mula_sqr2_lo = { fill( $200, 0) } Constant (const byte[$200]) mula_sqr2_hi = { fill( $200, 0) } -Constant (const byte*) mulf_init_asm::mem#0 = (byte*) 255 +Constant (const byte*) mulf_init_asm::mem = (byte*) 255 Constant (const byte*) print_str::str#1 = mulf_tables_cmp::str Constant (const byte*) print_str::str#2 = mulf_tables_cmp::str1 Constant (const byte*) print_str::str#3 = mulf_tables_cmp::str2 @@ -4265,7 +4263,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) BGCOL#0) ← (byte) 5 + [4] *((const byte*) BGCOL) ← (byte) 5 [5] call print_cls to:main::@1 main::@1: scope:[main] from main @@ -4356,7 +4354,7 @@ mul8s_compare::@7: scope:[mul8s_compare] from mul8s_compare::@15 mul8s_compare: [48] if((byte) mul8s_compare::ok#3!=(byte) 0) goto mul8s_compare::@8 to:mul8s_compare::@10 mul8s_compare::@10: scope:[mul8s_compare] from mul8s_compare::@7 - [49] *((const byte*) BGCOL#0) ← (byte) 2 + [49] *((const byte*) BGCOL) ← (byte) 2 [50] (signed byte) mul8s_error::a#0 ← (signed byte) mul8s_compare::a#10 [51] (signed byte) mul8s_error::b#0 ← (signed byte) mul8s_compare::b#10 [52] (signed word) mul8s_error::ms#0 ← (signed word) mul8s_compare::ms#0 @@ -4752,7 +4750,7 @@ mul8u_compare::@4: scope:[mul8u_compare] from mul8u_compare::@14 mul8u_compare: [225] if((byte) mul8u_compare::ok#3!=(byte) 0) goto mul8u_compare::@5 to:mul8u_compare::@7 mul8u_compare::@7: scope:[mul8u_compare] from mul8u_compare::@4 - [226] *((const byte*) BGCOL#0) ← (byte) 2 + [226] *((const byte*) BGCOL) ← (byte) 2 [227] (byte) mul8u_error::a#0 ← (byte) mul8u_compare::a#7 [228] (byte) mul8u_error::b#0 ← (byte) mul8u_compare::b#10 [229] (word) mul8u_error::ms#0 ← (word) mul8u_compare::ms#0 @@ -4895,7 +4893,7 @@ mulf_tables_cmp::@2: scope:[mulf_tables_cmp] from mulf_tables_cmp::@1 [289] if(*((byte*) mulf_tables_cmp::kc_sqr#2)==*((byte*) mulf_tables_cmp::asm_sqr#2)) goto mulf_tables_cmp::@4 to:mulf_tables_cmp::@5 mulf_tables_cmp::@5: scope:[mulf_tables_cmp] from mulf_tables_cmp::@2 - [290] *((const byte*) BGCOL#0) ← (byte) 2 + [290] *((const byte*) BGCOL) ← (byte) 2 [291] call print_str to:mulf_tables_cmp::@8 mulf_tables_cmp::@8: scope:[mulf_tables_cmp] from mulf_tables_cmp::@5 @@ -4918,10 +4916,10 @@ mulf_tables_cmp::@4: scope:[mulf_tables_cmp] from mulf_tables_cmp::@2 (void()) mulf_init_asm() mulf_init_asm: scope:[mulf_init_asm] from main::@2 asm { ldx#$00 txa .byte$c9 lb1: tya adc#$00 ml1: stamula_sqr1_hi,x tay cmp#$40 txa ror ml9: adc#$00 staml9+1 inx ml0: stamula_sqr1_lo,x bnelb1 incml0+2 incml1+2 clc iny bnelb1 ldx#$00 ldy#$ff !: ldamula_sqr1_hi+1,x stamula_sqr2_hi+$100,x ldamula_sqr1_hi,x stamula_sqr2_hi,y ldamula_sqr1_lo+1,x stamula_sqr2_lo+$100,x ldamula_sqr1_lo,x stamula_sqr2_lo,y dey inx bne!- } - [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) - [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) - [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) - [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) + [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) + [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) + [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) + [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) to:mulf_init_asm::@return mulf_init_asm::@return: scope:[mulf_init_asm] from mulf_init_asm [305] return @@ -5015,7 +5013,6 @@ memset::@2: scope:[memset] from memset::@1 VARIABLE REGISTER WEIGHTS -(byte*) BGCOL (void()) main() (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (byte) memset::c @@ -5198,7 +5195,6 @@ VARIABLE REGISTER WEIGHTS (byte) mulf_init::x_255#1 6.6000000000000005 (byte) mulf_init::x_255#2 8.8 (void()) mulf_init_asm() -(byte*) mulf_init_asm::mem (void()) mulf_tables_cmp() (byte*) mulf_tables_cmp::asm_sqr (byte*) mulf_tables_cmp::asm_sqr#1 11.0 @@ -5614,7 +5610,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL // [5] call print_cls @@ -5867,7 +5863,7 @@ mul8s_compare: { jmp b10 // mul8s_compare::@10 b10: - // [49] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [49] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [50] (signed byte) mul8s_error::a#0 ← (signed byte) mul8s_compare::a#10 -- vbsz1=vbsz2 @@ -7027,7 +7023,7 @@ mul8u_compare: { jmp b7 // mul8u_compare::@7 b7: - // [226] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [226] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [227] (byte) mul8u_error::a#0 ← (byte) mul8u_compare::a#7 -- vbuz1=vbuz2 @@ -7477,7 +7473,7 @@ mulf_tables_cmp: { jmp b5 // mulf_tables_cmp::@5 b5: - // [290] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [290] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [291] call print_str @@ -7615,16 +7611,16 @@ mulf_init_asm: { dey inx bne !- - // [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 + // [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_lo sta mem - // [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 + // [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_hi sta mem - // [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 + // [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_lo sta mem - // [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 + // [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_hi sta mem jmp breturn @@ -7947,7 +7943,7 @@ memset: { .byte 0 REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) BGCOL#0) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) BGCOL) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [20] (byte*~) print_char_cursor#193 ← (byte*) print_line_cursor#1 [ print_char_cursor#193 print_line_cursor#1 ] ( main:2::mul8s_compare:15 [ print_char_cursor#193 print_line_cursor#1 ] ) always clobbers reg byte a Statement [31] (signed word) muls8s::return#2 ← (signed word) muls8s::return#0 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 muls8s::return#2 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 muls8s::return#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ mul8s_compare::a#10 mul8s_compare::a#1 ] @@ -7959,7 +7955,7 @@ Statement [41] (signed word) mul8s_compare::mn#0 ← (signed word)(word) mul8s:: Statement [42] if((signed word) mul8s_compare::ms#0==(signed word) mul8s_compare::mf#0) goto mul8s_compare::@6 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a Statement [45] if((signed word) mul8s_compare::ms#0==(signed word) mul8s_compare::mn#0) goto mul8s_compare::@15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_compare::ok#4 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_compare::ok#4 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ mul8s_compare::ok#3 mul8s_compare::ok#4 ] -Statement [49] *((const byte*) BGCOL#0) ← (byte) 2 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a +Statement [49] *((const byte*) BGCOL) ← (byte) 2 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a Statement [52] (signed word) mul8s_error::ms#0 ← (signed word) mul8s_compare::ms#0 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 ] ( main:2::mul8s_compare:15 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:77 [ mul8s_error::a#0 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:78 [ mul8s_error::b#0 ] @@ -8037,7 +8033,7 @@ Statement [218] (word) mul8u_compare::mn#0 ← (word) mul8u::return#3 [ print_li Statement [219] if((word) mul8u_compare::ms#0==(word) mul8u_compare::mf#0) goto mul8u_compare::@3 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a Statement [222] if((word) mul8u_compare::ms#0==(word) mul8u_compare::mn#0) goto mul8u_compare::@14 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_compare::ok#4 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_compare::ok#4 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:37 [ mul8u_compare::ok#3 mul8u_compare::ok#4 ] -Statement [226] *((const byte*) BGCOL#0) ← (byte) 2 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a +Statement [226] *((const byte*) BGCOL) ← (byte) 2 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a Statement [229] (word) mul8u_error::ms#0 ← (word) mul8u_compare::ms#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 ] ) always clobbers reg byte a Statement [230] (word) mul8u_error::mn#0 ← (word) mul8u_compare::mn#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 ] ) always clobbers reg byte a Statement [231] (word) mul8u_error::mf#0 ← (word) mul8u_compare::mf#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 mul8u_error::mf#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 mul8u_error::mf#0 ] ) always clobbers reg byte a @@ -8053,14 +8049,14 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:38 [ m Statement [281] if((byte*) mulf_tables_cmp::kc_sqr#2<(const byte[$200]) mulf_sqr1_lo+(word)(number) $200*(number) 4) goto mulf_tables_cmp::@2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a Statement [286] (byte*~) print_char_cursor#230 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#230 ] ( main:2::mulf_tables_cmp:11 [ print_line_cursor#1 print_char_cursor#230 ] ) always clobbers reg byte a Statement [289] if(*((byte*) mulf_tables_cmp::kc_sqr#2)==*((byte*) mulf_tables_cmp::asm_sqr#2)) goto mulf_tables_cmp::@4 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a reg byte y -Statement [290] *((const byte*) BGCOL#0) ← (byte) 2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a +Statement [290] *((const byte*) BGCOL) ← (byte) 2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a Statement [292] (word) print_word::w#1 ← (word)(byte*) mulf_tables_cmp::asm_sqr#2 [ print_char_cursor#134 print_word::w#1 mulf_tables_cmp::kc_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ print_char_cursor#134 print_word::w#1 mulf_tables_cmp::kc_sqr#2 ] ) always clobbers reg byte a Statement [296] (word) print_word::w#2 ← (word)(byte*) mulf_tables_cmp::kc_sqr#2 [ print_char_cursor#134 print_word::w#2 ] ( main:2::mulf_tables_cmp:11 [ print_char_cursor#134 print_word::w#2 ] ) always clobbers reg byte a Statement asm { ldx#$00 txa .byte$c9 lb1: tya adc#$00 ml1: stamula_sqr1_hi,x tay cmp#$40 txa ror ml9: adc#$00 staml9+1 inx ml0: stamula_sqr1_lo,x bnelb1 incml0+2 incml1+2 clc iny bnelb1 ldx#$00 ldy#$ff !: ldamula_sqr1_hi+1,x stamula_sqr2_hi+$100,x ldamula_sqr1_hi,x stamula_sqr2_hi,y ldamula_sqr1_lo+1,x stamula_sqr2_lo+$100,x ldamula_sqr1_lo,x stamula_sqr2_lo,y dey inx bne!- } always clobbers reg byte a reg byte x reg byte y -Statement [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a Statement [308] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::mulf_init:7 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:47 [ mulf_init::c#2 mulf_init::c#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:50 [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ] @@ -8084,7 +8080,7 @@ Statement [331] *((byte*) mulf_init::sqr1_hi#2) ← (byte~) mulf_init::$13 [ mul Statement [333] (word) mulf_init::sqr#1 ← (word) mulf_init::sqr#3 + (byte) mulf_init::x_2#2 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ( main:2::mulf_init:7 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ) always clobbers reg byte a Statement [340] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:336 [ memset::dst#2 ] ) always clobbers reg byte a Statement [342] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:336 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y -Statement [4] *((const byte*) BGCOL#0) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) BGCOL) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [20] (byte*~) print_char_cursor#193 ← (byte*) print_line_cursor#1 [ print_char_cursor#193 print_line_cursor#1 ] ( main:2::mul8s_compare:15 [ print_char_cursor#193 print_line_cursor#1 ] ) always clobbers reg byte a Statement [31] (signed word) muls8s::return#2 ← (signed word) muls8s::return#0 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 muls8s::return#2 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 muls8s::return#2 ] ) always clobbers reg byte a Statement [32] (signed word) mul8s_compare::ms#0 ← (signed word) muls8s::return#2 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 ] ) always clobbers reg byte a @@ -8093,7 +8089,7 @@ Statement [37] (signed word) mul8s_compare::mf#0 ← (signed word) mulf8s::retur Statement [41] (signed word) mul8s_compare::mn#0 ← (signed word)(word) mul8s::m#4 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a Statement [42] if((signed word) mul8s_compare::ms#0==(signed word) mul8s_compare::mf#0) goto mul8s_compare::@6 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a Statement [45] if((signed word) mul8s_compare::ms#0==(signed word) mul8s_compare::mn#0) goto mul8s_compare::@15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_compare::ok#4 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_compare::ok#4 ] ) always clobbers reg byte a -Statement [49] *((const byte*) BGCOL#0) ← (byte) 2 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a +Statement [49] *((const byte*) BGCOL) ← (byte) 2 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ( main:2::mul8s_compare:15 [ mul8s_compare::a#10 print_line_cursor#1 mul8s_compare::b#10 mul8s_compare::ms#0 mul8s_compare::mf#0 mul8s_compare::mn#0 ] ) always clobbers reg byte a Statement [52] (signed word) mul8s_error::ms#0 ← (signed word) mul8s_compare::ms#0 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 ] ( main:2::mul8s_compare:15 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_compare::mn#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 ] ) always clobbers reg byte a Statement [53] (signed word) mul8s_error::mn#0 ← (signed word) mul8s_compare::mn#0 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 mul8s_error::mn#0 ] ( main:2::mul8s_compare:15 [ print_line_cursor#1 mul8s_compare::mf#0 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 mul8s_error::mn#0 ] ) always clobbers reg byte a Statement [54] (signed word) mul8s_error::mf#0 ← (signed word) mul8s_compare::mf#0 [ print_line_cursor#1 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 mul8s_error::mn#0 mul8s_error::mf#0 ] ( main:2::mul8s_compare:15 [ print_line_cursor#1 mul8s_error::a#0 mul8s_error::b#0 mul8s_error::ms#0 mul8s_error::mn#0 mul8s_error::mf#0 ] ) always clobbers reg byte a @@ -8143,7 +8139,7 @@ Statement [217] (word) mul8u::return#3 ← (word) mul8u::res#2 [ print_line_curs Statement [218] (word) mul8u_compare::mn#0 ← (word) mul8u::return#3 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a Statement [219] if((word) mul8u_compare::ms#0==(word) mul8u_compare::mf#0) goto mul8u_compare::@3 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a Statement [222] if((word) mul8u_compare::ms#0==(word) mul8u_compare::mn#0) goto mul8u_compare::@14 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_compare::ok#4 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_compare::ok#4 ] ) always clobbers reg byte a -Statement [226] *((const byte*) BGCOL#0) ← (byte) 2 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a +Statement [226] *((const byte*) BGCOL) ← (byte) 2 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::a#7 mul8u_compare::b#10 mul8u_compare::ms#0 mul8u_compare::mf#0 mul8u_compare::mn#0 ] ) always clobbers reg byte a Statement [229] (word) mul8u_error::ms#0 ← (word) mul8u_compare::ms#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_compare::mn#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 ] ) always clobbers reg byte a Statement [230] (word) mul8u_error::mn#0 ← (word) mul8u_compare::mn#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_compare::mf#0 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 ] ) always clobbers reg byte a Statement [231] (word) mul8u_error::mf#0 ← (word) mul8u_compare::mf#0 [ print_line_cursor#11 print_char_cursor#100 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 mul8u_error::mf#0 ] ( main:2::mul8u_compare:13 [ print_line_cursor#11 print_char_cursor#100 mul8u_error::a#0 mul8u_error::b#0 mul8u_error::ms#0 mul8u_error::mn#0 mul8u_error::mf#0 ] ) always clobbers reg byte a @@ -8156,14 +8152,14 @@ Statement [277] (word) muls8u::m#1 ← (word) muls8u::m#3 + (byte) muls8u::b#0 [ Statement [281] if((byte*) mulf_tables_cmp::kc_sqr#2<(const byte[$200]) mulf_sqr1_lo+(word)(number) $200*(number) 4) goto mulf_tables_cmp::@2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a Statement [286] (byte*~) print_char_cursor#230 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#230 ] ( main:2::mulf_tables_cmp:11 [ print_line_cursor#1 print_char_cursor#230 ] ) always clobbers reg byte a Statement [289] if(*((byte*) mulf_tables_cmp::kc_sqr#2)==*((byte*) mulf_tables_cmp::asm_sqr#2)) goto mulf_tables_cmp::@4 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a reg byte y -Statement [290] *((const byte*) BGCOL#0) ← (byte) 2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a +Statement [290] *((const byte*) BGCOL) ← (byte) 2 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::asm_sqr#2 ] ) always clobbers reg byte a Statement [292] (word) print_word::w#1 ← (word)(byte*) mulf_tables_cmp::asm_sqr#2 [ print_char_cursor#134 print_word::w#1 mulf_tables_cmp::kc_sqr#2 ] ( main:2::mulf_tables_cmp:11 [ print_char_cursor#134 print_word::w#1 mulf_tables_cmp::kc_sqr#2 ] ) always clobbers reg byte a Statement [296] (word) print_word::w#2 ← (word)(byte*) mulf_tables_cmp::kc_sqr#2 [ print_char_cursor#134 print_word::w#2 ] ( main:2::mulf_tables_cmp:11 [ print_char_cursor#134 print_word::w#2 ] ) always clobbers reg byte a Statement asm { ldx#$00 txa .byte$c9 lb1: tya adc#$00 ml1: stamula_sqr1_hi,x tay cmp#$40 txa ror ml9: adc#$00 staml9+1 inx ml0: stamula_sqr1_lo,x bnelb1 incml0+2 incml1+2 clc iny bnelb1 ldx#$00 ldy#$ff !: ldamula_sqr1_hi+1,x stamula_sqr2_hi+$100,x ldamula_sqr1_hi,x stamula_sqr2_hi,y ldamula_sqr1_lo+1,x stamula_sqr2_lo+$100,x ldamula_sqr1_lo,x stamula_sqr2_lo,y dey inx bne!- } always clobbers reg byte a reg byte x reg byte y -Statement [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a -Statement [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a +Statement [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) [ ] ( main:2::mulf_init_asm:9 [ ] ) always clobbers reg byte a Statement [308] if((byte*) mulf_init::sqr1_lo#2!=(const byte[$200]) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::mulf_init:7 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ) always clobbers reg byte a Statement [310] if((byte*) mulf_init::sqr2_lo#2!=(const byte[$200]) mulf_sqr2_lo+(word) $1ff) goto mulf_init::@6 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ( main:2::mulf_init:7 [ mulf_init::sqr2_lo#2 mulf_init::x_255#2 mulf_init::sqr2_hi#2 mulf_init::dir#2 ] ) always clobbers reg byte a Statement [311] *((const byte[$200]) mulf_sqr2_lo+(word) $1ff) ← *((const byte[$200]) mulf_sqr1_lo+(word) $100) [ ] ( main:2::mulf_init:7 [ ] ) always clobbers reg byte a @@ -8446,7 +8442,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL // [5] call print_cls @@ -8666,7 +8662,7 @@ mul8s_compare: { jmp b10 // mul8s_compare::@10 b10: - // [49] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [49] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [50] (signed byte) mul8s_error::a#0 ← (signed byte) mul8s_compare::a#10 -- vbsxx=vbsz1 @@ -9670,7 +9666,7 @@ mul8u_compare: { jmp b7 // mul8u_compare::@7 b7: - // [226] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [226] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [227] (byte) mul8u_error::a#0 ← (byte) mul8u_compare::a#7 -- vbuxx=vbuz1 @@ -10077,7 +10073,7 @@ mulf_tables_cmp: { jmp b5 // mulf_tables_cmp::@5 b5: - // [290] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [290] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // [291] call print_str @@ -10211,16 +10207,16 @@ mulf_init_asm: { dey inx bne !- - // [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 + // [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_lo sta mem - // [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 + // [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_hi sta mem - // [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 + // [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_lo sta mem - // [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 + // [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_hi sta mem jmp breturn @@ -10979,8 +10975,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 +(const byte*) BGCOL BGCOL = (byte*) 53281 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -11282,8 +11277,7 @@ FINAL SYMBOL TABLE (byte) mulf_init::x_255#2 reg byte x 8.8 (void()) mulf_init_asm() (label) mulf_init_asm::@return -(byte*) mulf_init_asm::mem -(const byte*) mulf_init_asm::mem#0 mem = (byte*) 255 +(const byte*) mulf_init_asm::mem mem = (byte*) 255 (const byte[$200]) mulf_sqr1_hi mulf_sqr1_hi = { fill( $200, 0) } (const byte[$200]) mulf_sqr1_lo mulf_sqr1_lo = { fill( $200, 0) } (const byte[$200]) mulf_sqr2_hi mulf_sqr2_hi = { fill( $200, 0) } @@ -11515,7 +11509,7 @@ Score: 238859 // main main: { // *BGCOL = 5 - // [4] *((const byte*) BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) BGCOL) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta BGCOL // print_cls() @@ -11701,7 +11695,7 @@ mul8s_compare: { bne b8 // mul8s_compare::@10 // *BGCOL = 2 - // [49] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [49] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // mul8s_error(a,b, ms, mn, mf) @@ -12610,7 +12604,7 @@ mul8u_compare: { bne b5 // mul8u_compare::@7 // *BGCOL = 2 - // [226] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [226] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // mul8u_error(a,b, ms, mn, mf) @@ -12963,7 +12957,7 @@ mulf_tables_cmp: { beq b4 // mulf_tables_cmp::@5 // *BGCOL = 2 - // [290] *((const byte*) BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [290] *((const byte*) BGCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta BGCOL // print_str("multiply table mismatch at ") @@ -13092,19 +13086,19 @@ mulf_init_asm: { inx bne !- // *mem = *mula_sqr1_lo - // [301] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 + // [301] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_lo sta mem // *mem = *mula_sqr1_hi - // [302] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 + // [302] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr1_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr1_hi sta mem // *mem = *mula_sqr2_lo - // [303] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 + // [303] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_lo) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_lo sta mem // *mem = *mula_sqr2_hi - // [304] *((const byte*) mulf_init_asm::mem#0) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 + // [304] *((const byte*) mulf_init_asm::mem) ← *((const byte[$200]) mula_sqr2_hi) -- _deref_pbuc1=_deref_pbuc2 lda mula_sqr2_hi sta mem // mulf_init_asm::@return diff --git a/src/test/ref/test-multiply-8bit.sym b/src/test/ref/test-multiply-8bit.sym index 79559740c..8a14716dd 100644 --- a/src/test/ref/test-multiply-8bit.sym +++ b/src/test/ref/test-multiply-8bit.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(byte*) BGCOL -(const byte*) BGCOL#0 BGCOL = (byte*) 53281 +(const byte*) BGCOL BGCOL = (byte*) 53281 (const byte) RADIX::BINARY BINARY = (number) 2 (const byte) RADIX::DECIMAL DECIMAL = (number) $a (const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10 @@ -304,8 +303,7 @@ (byte) mulf_init::x_255#2 reg byte x 8.8 (void()) mulf_init_asm() (label) mulf_init_asm::@return -(byte*) mulf_init_asm::mem -(const byte*) mulf_init_asm::mem#0 mem = (byte*) 255 +(const byte*) mulf_init_asm::mem mem = (byte*) 255 (const byte[$200]) mulf_sqr1_hi mulf_sqr1_hi = { fill( $200, 0) } (const byte[$200]) mulf_sqr1_lo mulf_sqr1_lo = { fill( $200, 0) } (const byte[$200]) mulf_sqr2_hi mulf_sqr2_hi = { fill( $200, 0) } diff --git a/src/test/ref/test-word-size-arrays.cfg b/src/test/ref/test-word-size-arrays.cfg index 7221bdec3..f10ff8ebd 100644 --- a/src/test/ref/test-word-size-arrays.cfg +++ b/src/test/ref/test-word-size-arrays.cfg @@ -25,7 +25,7 @@ main::@return: scope:[main] from main::@5 to:@return main::@6: scope:[main] from main::@5 [10] (word~) main::$6 ← (word) main::line#10 + (byte) main::c1#2 - [11] (byte*~) main::$9 ← (const byte*) main::screen#0 + (word~) main::$6 + [11] (byte*~) main::$9 ← (const byte*) main::screen + (word~) main::$6 [12] *((byte*~) main::$9) ← (byte) ' ' [13] (byte) main::c1#1 ← ++ (byte) main::c1#2 to:main::@5 @@ -39,8 +39,8 @@ main::@4: scope:[main] from main::@2 main::@3: scope:[main] from main::@2 [17] (word~) main::$2 ← (word) main::line#10 + (byte) main::c#2 [18] (word~) main::$4 ← (word) main::line#10 + (byte) main::c#2 - [19] (byte*~) main::$7 ← (const byte*) main::screen#0+(byte) $28 + (word~) main::$4 - [20] (byte*~) main::$8 ← (const byte*) main::screen#0 + (word~) main::$2 + [19] (byte*~) main::$7 ← (const byte*) main::screen+(byte) $28 + (word~) main::$4 + [20] (byte*~) main::$8 ← (const byte*) main::screen + (word~) main::$2 [21] *((byte*~) main::$8) ← *((byte*~) main::$7) [22] (byte) main::c#1 ← ++ (byte) main::c#2 to:main::@2 diff --git a/src/test/ref/test-word-size-arrays.log b/src/test/ref/test-word-size-arrays.log index ac2307dfe..fa5063d2a 100644 --- a/src/test/ref/test-word-size-arrays.log +++ b/src/test/ref/test-word-size-arrays.log @@ -16,7 +16,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::screen#0 ← ((byte*)) (number) $400 + (byte*) main::screen ← ((byte*)) (number) $400 (word) main::line#0 ← (word) 0 (word) main::line#1 ← (number) 0 to:main::@1 @@ -45,7 +45,7 @@ main::@5: scope:[main] from main::@4 (word~) main::$2 ← (word) main::line#4 + (byte) main::c#3 (word~) main::$3 ← (word) main::line#4 + (byte) main::c#3 (number~) main::$4 ← (word~) main::$3 + (number) $28 - *((byte*) main::screen#0 + (word~) main::$2) ← *((byte*) main::screen#0 + (number~) main::$4) + *((byte*) main::screen + (word~) main::$2) ← *((byte*) main::screen + (number~) main::$4) (byte) main::c#1 ← ++ (byte) main::c#3 to:main::@4 main::@6: scope:[main] from main::@4 @@ -62,7 +62,7 @@ main::@14: scope:[main] from main::@13 (byte) main::c1#3 ← phi( main::@13/(byte) main::c1#2 ) (word) main::line#6 ← phi( main::@13/(word) main::line#8 ) (word~) main::$6 ← (word) main::line#6 + (byte) main::c1#3 - *((byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' + *((byte*) main::screen + (word~) main::$6) ← (byte) ' ' (byte) main::c1#1 ← ++ (byte) main::c1#3 to:main::@13 main::@return: scope:[main] from main::@13 @@ -120,7 +120,6 @@ SYMBOL TABLE SSA (word) main::line#8 (word) main::line#9 (byte*) main::screen -(byte*) main::screen#0 Adding number conversion cast (unumber) 0 in (word) main::line#1 ← (number) 0 Adding number conversion cast (unumber) $28*$18 in (bool~) main::$0 ← (word) main::line#3 < (number) $28*(number) $18 @@ -132,7 +131,7 @@ Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (word Adding number conversion cast (unumber) $28 in (word) main::line#2 ← (word) main::line#5 + (number) $28 Adding number conversion cast (unumber) $28 in (bool~) main::$5 ← (byte) main::c1#2 < (number) $28 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::screen ← (byte*)(number) $400 Inlining cast (word) main::line#1 ← (unumber)(number) 0 Inlining cast (byte) main::c#0 ← (unumber)(number) 0 Inlining cast (byte) main::c1#0 ← (unumber)(number) 0 @@ -168,15 +167,15 @@ Simple Condition (bool~) main::$0 [5] if((word) main::line#10<(word)(number) $28 Simple Condition (bool~) main::$1 [12] if((byte) main::c#2<(byte) $28) goto main::@5 Simple Condition (bool~) main::$5 [23] if((byte) main::c1#2<(byte) $28) goto main::@14 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::screen#0 = (byte*) 1024 +Constant (const byte*) main::screen = (byte*) 1024 Constant (const word) main::line#0 = 0 Constant (const word) main::line#1 = 0 Constant (const byte) main::c#0 = 0 Constant (const byte) main::c1#0 = 0 Successful SSA optimization Pass2ConstantIdentification -De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) main::screen#0 + (word~) main::$2) ← *((const byte*) main::screen#0 + (word~) main::$4) -De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) main::screen#0 + (word~) main::$2) ← *((byte*~) main::$7) -De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' +De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) main::screen + (word~) main::$2) ← *((const byte*) main::screen + (word~) main::$4) +De-inlining pointer[w] to *(pointer+w) [17] *((const byte*) main::screen + (word~) main::$2) ← *((byte*~) main::$7) +De-inlining pointer[w] to *(pointer+w) [26] *((const byte*) main::screen + (word~) main::$6) ← (byte) ' ' Successful SSA optimization Pass2DeInlineWordDerefIdx Eliminating unused constant (const word) main::line#0 Successful SSA optimization PassNEliminateUnusedVars @@ -247,7 +246,7 @@ main::@return: scope:[main] from main::@5 to:@return main::@6: scope:[main] from main::@5 [10] (word~) main::$6 ← (word) main::line#10 + (byte) main::c1#2 - [11] (byte*~) main::$9 ← (const byte*) main::screen#0 + (word~) main::$6 + [11] (byte*~) main::$9 ← (const byte*) main::screen + (word~) main::$6 [12] *((byte*~) main::$9) ← (byte) ' ' [13] (byte) main::c1#1 ← ++ (byte) main::c1#2 to:main::@5 @@ -261,8 +260,8 @@ main::@4: scope:[main] from main::@2 main::@3: scope:[main] from main::@2 [17] (word~) main::$2 ← (word) main::line#10 + (byte) main::c#2 [18] (word~) main::$4 ← (word) main::line#10 + (byte) main::c#2 - [19] (byte*~) main::$7 ← (const byte*) main::screen#0+(byte) $28 + (word~) main::$4 - [20] (byte*~) main::$8 ← (const byte*) main::screen#0 + (word~) main::$2 + [19] (byte*~) main::$7 ← (const byte*) main::screen+(byte) $28 + (word~) main::$4 + [20] (byte*~) main::$8 ← (const byte*) main::screen + (word~) main::$2 [21] *((byte*~) main::$8) ← *((byte*~) main::$7) [22] (byte) main::c#1 ← ++ (byte) main::c#2 to:main::@2 @@ -285,7 +284,6 @@ VARIABLE REGISTER WEIGHTS (word) main::line (word) main::line#10 15.375 (word) main::line#2 22.0 -(byte*) main::screen Initial phi equivalence classes [ main::line#10 main::line#2 ] @@ -400,7 +398,7 @@ main: { lda #0 adc.z line+1 sta.z _6+1 - // [11] (byte*~) main::$9 ← (const byte*) main::screen#0 + (word~) main::$6 -- pbuz1=pbuc1_plus_vwuz2 + // [11] (byte*~) main::$9 ← (const byte*) main::screen + (word~) main::$6 -- pbuz1=pbuc1_plus_vwuz2 lda.z _6 clc adc #screen+$28 sta.z _7+1 - // [20] (byte*~) main::$8 ← (const byte*) main::screen#0 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz2 + // [20] (byte*~) main::$8 ← (const byte*) main::screen + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz2 lda.z _2 clc adc #screen+$28 sta.z _7+1 - // [20] (byte*~) main::$8 ← (const byte*) main::screen#0 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1 + // [20] (byte*~) main::$8 ← (const byte*) main::screen + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z _8 adc #screen+$28 sta.z _7+1 - // [20] (byte*~) main::$8 ← (const byte*) main::screen#0 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1 + // [20] (byte*~) main::$8 ← (const byte*) main::screen + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1 clc lda.z _8 adc #main::@1#0] -- vbuz1=vbuc1 lda #0 sta.z ypos - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main->main::@1#1] -- vbuz1=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main->main::@1#1] -- vbuz1=vbuc1 lda #RATE sta.z counter jmp b1 @@ -305,7 +299,7 @@ main: { jmp b2 // main::@2 b2: - // [6] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [6] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 @@ -323,13 +317,13 @@ main: { b4: // [9] (byte) ypos#1 ← ++ (byte) ypos#2 -- vbuz1=_inc_vbuz1 inc.z ypos - // [10] *((const byte*) SCREEN#0) ← (byte) ypos#1 -- _deref_pbuc1=vbuz1 + // [10] *((const byte*) SCREEN) ← (byte) ypos#1 -- _deref_pbuc1=vbuz1 lda.z ypos sta SCREEN // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] b1_from_b4: // [5] phi (byte) ypos#2 = (byte) ypos#1 [phi:main::@4->main::@1#0] -- register_copy - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main::@4->main::@1#1] -- vbuz1=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main::@4->main::@1#1] -- vbuz1=vbuc1 lda #RATE sta.z counter jmp b1 @@ -337,10 +331,10 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [6] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ counter#3 ypos#2 ] ( main:2 [ counter#3 ypos#2 ] ) always clobbers reg byte a +Statement [6] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ counter#3 ypos#2 ] ( main:2 [ counter#3 ypos#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ counter#3 counter#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ ypos#2 ypos#1 ] -Statement [6] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 [ counter#3 ypos#2 ] ( main:2 [ counter#3 ypos#2 ] ) always clobbers reg byte a +Statement [6] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ counter#3 ypos#2 ] ( main:2 [ counter#3 ypos#2 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ counter#3 counter#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ ypos#2 ypos#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , @@ -384,7 +378,7 @@ main: { b1_from_main: // [5] phi (byte) ypos#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main->main::@1#1] -- vbuyy=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main->main::@1#1] -- vbuyy=vbuc1 ldy #RATE jmp b1 // [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1] @@ -397,7 +391,7 @@ main: { jmp b2 // main::@2 b2: - // [6] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [6] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 @@ -414,12 +408,12 @@ main: { b4: // [9] (byte) ypos#1 ← ++ (byte) ypos#2 -- vbuxx=_inc_vbuxx inx - // [10] *((const byte*) SCREEN#0) ← (byte) ypos#1 -- _deref_pbuc1=vbuxx + // [10] *((const byte*) SCREEN) ← (byte) ypos#1 -- _deref_pbuc1=vbuxx stx SCREEN // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] b1_from_b4: // [5] phi (byte) ypos#2 = (byte) ypos#1 [phi:main::@4->main::@1#0] -- register_copy - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main::@4->main::@1#1] -- vbuyy=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main::@4->main::@1#1] -- vbuyy=vbuc1 ldy #RATE jmp b1 } @@ -461,12 +455,9 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte) RATE -(const byte) RATE#0 RATE = (byte) $32 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte) RATE RATE = (byte) $32 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte) counter (byte) counter#1 reg byte y 151.5 (byte) counter#3 reg byte y 101.0 @@ -508,7 +499,7 @@ main: { // [5] phi from main to main::@1 [phi:main->main::@1] // [5] phi (byte) ypos#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 ldx #0 - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main->main::@1#1] -- vbuyy=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main->main::@1#1] -- vbuyy=vbuc1 ldy #RATE // [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1] // [5] phi (byte) ypos#2 = (byte) ypos#2 [phi:main::@3->main::@1#0] -- register_copy @@ -517,7 +508,7 @@ main: { // main::@2 b2: // while(*RASTER!=$ff) - // [6] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [6] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff cmp RASTER bne b2 @@ -533,11 +524,11 @@ main: { // [9] (byte) ypos#1 ← ++ (byte) ypos#2 -- vbuxx=_inc_vbuxx inx // *SCREEN = ypos - // [10] *((const byte*) SCREEN#0) ← (byte) ypos#1 -- _deref_pbuc1=vbuxx + // [10] *((const byte*) SCREEN) ← (byte) ypos#1 -- _deref_pbuc1=vbuxx stx SCREEN // [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] // [5] phi (byte) ypos#2 = (byte) ypos#1 [phi:main::@4->main::@1#0] -- register_copy - // [5] phi (byte) counter#3 = (const byte) RATE#0 [phi:main::@4->main::@1#1] -- vbuyy=vbuc1 + // [5] phi (byte) counter#3 = (const byte) RATE [phi:main::@4->main::@1#1] -- vbuyy=vbuc1 ldy #RATE jmp b2 } diff --git a/src/test/ref/tetris-npe.sym b/src/test/ref/tetris-npe.sym index e78a0ba81..cbc5a4344 100644 --- a/src/test/ref/tetris-npe.sym +++ b/src/test/ref/tetris-npe.sym @@ -1,12 +1,9 @@ (label) @1 (label) @begin (label) @end -(byte*) RASTER -(const byte*) RASTER#0 RASTER = (byte*) 53266 -(byte) RATE -(const byte) RATE#0 RATE = (byte) $32 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) RASTER RASTER = (byte*) 53266 +(const byte) RATE RATE = (byte) $32 +(const byte*) SCREEN SCREEN = (byte*) 1024 (byte) counter (byte) counter#1 reg byte y 151.5 (byte) counter#3 reg byte y 101.0 diff --git a/src/test/ref/true-inline-words.cfg b/src/test/ref/true-inline-words.cfg index c970db0f2..1cb5c81f2 100644 --- a/src/test/ref/true-inline-words.cfg +++ b/src/test/ref/true-inline-words.cfg @@ -11,14 +11,14 @@ (void()) main() main: scope:[main] from @1 [4] *((const byte*) main::sc#0) ← *((const byte[]) main::bs+(byte) 1) - [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 + [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 to:main::@2 main::@2: scope:[main] from main - [6] *((const byte*) main::bgcol#0) ← (byte) 2 + [6] *((const byte*) main::bgcol) ← (byte) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@2 [7] return to:@return main::@1: scope:[main] from main - [8] *((const byte*) main::bgcol#0) ← (byte) 5 + [8] *((const byte*) main::bgcol) ← (byte) 5 to:main::@return diff --git a/src/test/ref/true-inline-words.log b/src/test/ref/true-inline-words.log index b63b58f6f..c5218ad40 100644 --- a/src/test/ref/true-inline-words.log +++ b/src/test/ref/true-inline-words.log @@ -11,8 +11,8 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (byte[]) main::bs ← { (byte) 'c', (byte) 'm' } - (byte) main::b#0 ← (number) 4 - (word) main::w#0 ← ((word)) { (byte) main::b#0, (number) 0 } + (byte) main::b ← (number) 4 + (word) main::w#0 ← ((word)) { (byte) main::b, (number) 0 } (word~) main::$0 ← ((word)) { (number) 1, (number) 1 } (word~) main::$1 ← (word~) main::$0 + (word) main::w#0 (word~) main::$2 ← ((word)) { (number) 0, (number) 0 } @@ -20,16 +20,16 @@ main: scope:[main] from @1 (word) main::w2#0 ← (word~) main::$3 (byte*) main::sc#0 ← ((byte*)) (word) main::w2#0 *((byte*) main::sc#0) ← *((byte[]) main::bs + (number) 1) - (byte*) main::pos#0 ← ((byte*)) (number) $501 - (byte*) main::bgcol#0 ← ((byte*)) (number) $d021 - (bool~) main::$4 ← *((byte*) main::pos#0) == (byte) 'm' + (byte*) main::pos ← ((byte*)) (number) $501 + (byte*) main::bgcol ← ((byte*)) (number) $d021 + (bool~) main::$4 ← *((byte*) main::pos) == (byte) 'm' if((bool~) main::$4) goto main::@1 to:main::@3 main::@1: scope:[main] from main - *((byte*) main::bgcol#0) ← (number) 5 + *((byte*) main::bgcol) ← (number) 5 to:main::@return main::@3: scope:[main] from main - *((byte*) main::bgcol#0) ← (number) 2 + *((byte*) main::bgcol) ← (number) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -56,12 +56,9 @@ SYMBOL TABLE SSA (label) main::@3 (label) main::@return (byte) main::b -(byte) main::b#0 (byte*) main::bgcol -(byte*) main::bgcol#0 (byte[]) main::bs (byte*) main::pos -(byte*) main::pos#0 (byte*) main::sc (byte*) main::sc#0 (word) main::w @@ -69,24 +66,24 @@ SYMBOL TABLE SSA (word) main::w2 (word) main::w2#0 -Fixing inline constructor with main::$5 ← (byte)main::b#0 w= (byte)0 +Fixing inline constructor with main::$5 ← (byte)main::b w= (byte)0 Fixing inline constructor with main::$6 ← (byte)1 w= (byte)1 Fixing inline constructor with main::$7 ← (byte)0 w= (byte)0 Successful SSA optimization Pass2FixInlineConstructors -Adding number conversion cast (unumber) 4 in (byte) main::b#0 ← (number) 4 +Adding number conversion cast (unumber) 4 in (byte) main::b ← (number) 4 Adding number conversion cast (unumber) 1 in *((byte*) main::sc#0) ← *((byte[]) main::bs + (number) 1) -Adding number conversion cast (unumber) 5 in *((byte*) main::bgcol#0) ← (number) 5 -Adding number conversion cast (unumber) 2 in *((byte*) main::bgcol#0) ← (number) 2 +Adding number conversion cast (unumber) 5 in *((byte*) main::bgcol) ← (number) 5 +Adding number conversion cast (unumber) 2 in *((byte*) main::bgcol) ← (number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte) main::b#0 ← (unumber)(number) 4 +Inlining cast (byte) main::b ← (unumber)(number) 4 Inlining cast (byte*) main::sc#0 ← (byte*)(word) main::w2#0 -Inlining cast (byte*) main::pos#0 ← (byte*)(number) $501 -Inlining cast (byte*) main::bgcol#0 ← (byte*)(number) $d021 -Inlining cast *((byte*) main::bgcol#0) ← (unumber)(number) 5 -Inlining cast *((byte*) main::bgcol#0) ← (unumber)(number) 2 +Inlining cast (byte*) main::pos ← (byte*)(number) $501 +Inlining cast (byte*) main::bgcol ← (byte*)(number) $d021 +Inlining cast *((byte*) main::bgcol) ← (unumber)(number) 5 +Inlining cast *((byte*) main::bgcol) ← (unumber)(number) 2 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 4 -Simplifying constant integer cast (byte) main::b#0 +Simplifying constant integer cast (byte) main::b Simplifying constant integer cast 0 Simplifying constant integer cast 1 Simplifying constant integer cast 1 @@ -108,7 +105,7 @@ Alias (word~) main::$0 = (word~) main::$6 Alias (word~) main::$2 = (word~) main::$7 Alias (word) main::w2#0 = (word~) main::$3 Successful SSA optimization Pass2AliasElimination -Simple Condition (bool~) main::$4 [16] if(*((byte*) main::pos#0)==(byte) 'm') goto main::@1 +Simple Condition (bool~) main::$4 [16] if(*((byte*) main::pos)==(byte) 'm') goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [4] (word~) main::$0 ← (byte) 1 w= (byte) 1 Constant right-side identified [7] (word~) main::$2 ← (byte) 0 w= (byte) 0 @@ -116,9 +113,9 @@ Successful SSA optimization Pass2ConstantRValueConsolidation Identified constant from value list (byte[]) { (byte) 'c', (byte) 'm' } Successful SSA optimization Pass2ConstantInitializerValueLists Constant (const byte[]) main::bs = { 'c', 'm' } -Constant (const byte) main::b#0 = 4 -Constant (const byte*) main::pos#0 = (byte*) 1281 -Constant (const byte*) main::bgcol#0 = (byte*) 53281 +Constant (const byte) main::b = 4 +Constant (const byte*) main::pos = (byte*) 1281 +Constant (const byte*) main::bgcol = (byte*) 53281 Successful SSA optimization Pass2ConstantIdentification Simplifying constant evaluating to zero (byte) 0*(number) $100+(byte) 0 in [7] (word~) main::$2 ← (byte) 0*(number) $100+(byte) 0 Successful SSA optimization PassNSimplifyConstantZero @@ -138,29 +135,29 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (word) $100 Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [0] (word) main::w#0 ← (const byte) main::b#0 w= (byte) 0 +Constant right-side identified [0] (word) main::w#0 ← (const byte) main::b w= (byte) 0 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) main::$0 = 1*$100+1 Constant (const word) main::$2 = 0 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero main::b#0*$100 in [0] (word) main::w#0 ← (const byte) main::b#0*(number) $100+(byte) 0 +Simplifying expression containing zero main::b*$100 in [0] (word) main::w#0 ← (const byte) main::b*(number) $100+(byte) 0 Simplifying expression containing zero main::$1 in [4] (word) main::w2#0 ← (word~) main::$1 + (const word) main::$2 Successful SSA optimization PassNSimplifyExpressionWithZero Eliminating unused constant (const word) main::$2 Successful SSA optimization PassNEliminateUnusedVars -Adding number conversion cast (unumber) main::b#0*$100 in (word) main::w#0 ← (const byte) main::b#0*(number) $100 -Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (const byte) main::b#0*(number) $100 +Adding number conversion cast (unumber) main::b*$100 in (word) main::w#0 ← (const byte) main::b*(number) $100 +Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (const byte) main::b*(number) $100 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word) main::w#0 ← (unumber)(const byte) main::b#0*(unumber)(number) $100 +Inlining cast (word) main::w#0 ← (unumber)(const byte) main::b*(unumber)(number) $100 Successful SSA optimization Pass2InlineCast -Simplifying constant integer cast (const byte) main::b#0*(unumber)(number) $100 +Simplifying constant integer cast (const byte) main::b*(unumber)(number) $100 Simplifying constant integer cast $100 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (word) $100 Successful SSA optimization PassNFinalizeNumberTypeConversions Alias (word) main::w2#0 = (word~) main::$1 Successful SSA optimization Pass2AliasElimination -Constant (const word) main::w#0 = main::b#0*$100 +Constant (const word) main::w#0 = main::b*$100 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (word) main::w2#0 ← (const word) main::$0 + (const word) main::w#0 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -203,24 +200,21 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 [4] *((const byte*) main::sc#0) ← *((const byte[]) main::bs+(byte) 1) - [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 + [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 to:main::@2 main::@2: scope:[main] from main - [6] *((const byte*) main::bgcol#0) ← (byte) 2 + [6] *((const byte*) main::bgcol) ← (byte) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@2 [7] return to:@return main::@1: scope:[main] from main - [8] *((const byte*) main::bgcol#0) ← (byte) 5 + [8] *((const byte*) main::bgcol) ← (byte) 5 to:main::@return VARIABLE REGISTER WEIGHTS (void()) main() -(byte) main::b -(byte*) main::bgcol -(byte*) main::pos (byte*) main::sc (word) main::w (word) main::w2 @@ -265,14 +259,14 @@ main: { // implicit cast to (byte*) lda bs+1 sta sc - // [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 + // [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 lda #'m' cmp pos beq b1 jmp b2 // main::@2 b2: - // [6] *((const byte*) main::bgcol#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::bgcol) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta bgcol jmp breturn @@ -282,7 +276,7 @@ main: { rts // main::@1 b1: - // [8] *((const byte*) main::bgcol#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::bgcol) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta bgcol jmp breturn @@ -292,9 +286,9 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::sc#0) ← *((const byte[]) main::bs+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [6] *((const byte*) main::bgcol#0) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a -Statement [8] *((const byte*) main::bgcol#0) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::bgcol) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::bgcol) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a REGISTER UPLIFT SCOPES Uplift Scope [main] @@ -339,14 +333,14 @@ main: { // implicit cast to (byte*) lda bs+1 sta sc - // [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 + // [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 lda #'m' cmp pos beq b1 jmp b2 // main::@2 b2: - // [6] *((const byte*) main::bgcol#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::bgcol) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta bgcol jmp breturn @@ -356,7 +350,7 @@ main: { rts // main::@1 b1: - // [8] *((const byte*) main::bgcol#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::bgcol) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta bgcol jmp breturn @@ -394,17 +388,14 @@ FINAL SYMBOL TABLE (label) main::@1 (label) main::@2 (label) main::@return -(byte) main::b -(const byte) main::b#0 b = (byte) 4 -(byte*) main::bgcol -(const byte*) main::bgcol#0 bgcol = (byte*) 53281 +(const byte) main::b b = (byte) 4 +(const byte*) main::bgcol bgcol = (byte*) 53281 (const byte[]) main::bs bs = { (byte) 'c', (byte) 'm' } -(byte*) main::pos -(const byte*) main::pos#0 pos = (byte*) 1281 +(const byte*) main::pos pos = (byte*) 1281 (byte*) main::sc (const byte*) main::sc#0 sc = (byte*)(const word) main::w2#0 (word) main::w -(const word) main::w#0 w = (const byte) main::b#0*(word) $100 +(const word) main::w#0 w = (const byte) main::b*(word) $100 (word) main::w2 (const word) main::w2#0 w2 = (byte) 1*(word) $100+(byte) 1+(const word) main::w#0 @@ -442,13 +433,13 @@ main: { lda bs+1 sta sc // if(*pos=='m') - // [5] if(*((const byte*) main::pos#0)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 + // [5] if(*((const byte*) main::pos)==(byte) 'm') goto main::@1 -- _deref_pbuc1_eq_vbuc2_then_la1 lda #'m' cmp pos beq b1 // main::@2 // *bgcol = 2 - // [6] *((const byte*) main::bgcol#0) ← (byte) 2 -- _deref_pbuc1=vbuc2 + // [6] *((const byte*) main::bgcol) ← (byte) 2 -- _deref_pbuc1=vbuc2 lda #2 sta bgcol // main::@return @@ -458,7 +449,7 @@ main: { // main::@1 b1: // *bgcol = 5 - // [8] *((const byte*) main::bgcol#0) ← (byte) 5 -- _deref_pbuc1=vbuc2 + // [8] *((const byte*) main::bgcol) ← (byte) 5 -- _deref_pbuc1=vbuc2 lda #5 sta bgcol rts diff --git a/src/test/ref/true-inline-words.sym b/src/test/ref/true-inline-words.sym index 7d3305540..8a8b619b2 100644 --- a/src/test/ref/true-inline-words.sym +++ b/src/test/ref/true-inline-words.sym @@ -5,17 +5,14 @@ (label) main::@1 (label) main::@2 (label) main::@return -(byte) main::b -(const byte) main::b#0 b = (byte) 4 -(byte*) main::bgcol -(const byte*) main::bgcol#0 bgcol = (byte*) 53281 +(const byte) main::b b = (byte) 4 +(const byte*) main::bgcol bgcol = (byte*) 53281 (const byte[]) main::bs bs = { (byte) 'c', (byte) 'm' } -(byte*) main::pos -(const byte*) main::pos#0 pos = (byte*) 1281 +(const byte*) main::pos pos = (byte*) 1281 (byte*) main::sc (const byte*) main::sc#0 sc = (byte*)(const word) main::w2#0 (word) main::w -(const word) main::w#0 w = (const byte) main::b#0*(word) $100 +(const word) main::w#0 w = (const byte) main::b*(word) $100 (word) main::w2 (const word) main::w2#0 w2 = (byte) 1*(word) $100+(byte) 1+(const word) main::w#0 diff --git a/src/test/ref/type-mix.cfg b/src/test/ref/type-mix.cfg index 589662bab..05485f368 100644 --- a/src/test/ref/type-mix.cfg +++ b/src/test/ref/type-mix.cfg @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@1 [5] (signed word) main::w#2 ← phi( main/(signed byte) 0 main::@1/(signed word) main::w#1 ) [6] (signed word) main::w#1 ← (signed word) main::w#2 - (signed byte) $c [7] (byte~) main::$1 ← < (signed word) main::w#1 - [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 + [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$1 [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/type-mix.log b/src/test/ref/type-mix.log index 544439cc9..a211cf0a2 100644 --- a/src/test/ref/type-mix.log +++ b/src/test/ref/type-mix.log @@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 (signed word) main::w#0 ← (number) 0 - (byte*) main::SCREEN#0 ← ((byte*)) (number) $400 + (byte*) main::SCREEN ← ((byte*)) (number) $400 (byte) main::i#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -17,7 +17,7 @@ main::@1: scope:[main] from main main::@1 (number~) main::$0 ← (signed word) main::w#2 - (number) $c (signed word) main::w#1 ← (number~) main::$0 (byte~) main::$1 ← < (signed word) main::w#1 - *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 + *((byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$1 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$2) goto main::@1 @@ -44,7 +44,6 @@ SYMBOL TABLE SSA (label) main::@1 (label) main::@return (byte*) main::SCREEN -(byte*) main::SCREEN#0 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -59,7 +58,7 @@ Adding number conversion cast (snumber) $c in (number~) main::$0 ← (signed wor Adding number conversion cast (snumber) main::$0 in (number~) main::$0 ← (signed word) main::w#2 - (snumber)(number) $c Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (signed word) main::w#0 ← (snumber)(number) 0 -Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant integer cast 0 Simplifying constant pointer cast (byte*) 1024 @@ -74,7 +73,7 @@ Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [10] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const signed word) main::w#0 = 0 -Constant (const byte*) main::SCREEN#0 = (byte*) 1024 +Constant (const byte*) main::SCREEN = (byte*) 1024 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [8] main::i#1 ← ++ main::i#2 to ++ @@ -130,7 +129,7 @@ main::@1: scope:[main] from main main::@1 [5] (signed word) main::w#2 ← phi( main/(signed byte) 0 main::@1/(signed word) main::w#1 ) [6] (signed word) main::w#1 ← (signed word) main::w#2 - (signed byte) $c [7] (byte~) main::$1 ← < (signed word) main::w#1 - [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 + [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$1 [9] (byte) main::i#1 ← ++ (byte) main::i#2 [10] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return @@ -142,7 +141,6 @@ main::@return: scope:[main] from main::@1 VARIABLE REGISTER WEIGHTS (void()) main() (byte~) main::$1 22.0 -(byte*) main::SCREEN (byte) main::i (byte) main::i#1 16.5 (byte) main::i#2 8.25 @@ -222,7 +220,7 @@ main: { // [7] (byte~) main::$1 ← < (signed word) main::w#1 -- vbuz1=_lo_vwsz2 lda.z w sta.z _1 - // [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 -- pbuc1_derefidx_vbuz1=vbuz2 + // [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$1 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _1 ldy.z i sta SCREEN,y @@ -312,7 +310,7 @@ main: { sta.z w+1 // [7] (byte~) main::$1 ← < (signed word) main::w#1 -- vbuaa=_lo_vwsz1 lda.z w - // [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 -- pbuc1_derefidx_vbuxx=vbuaa + // [8] *((const byte*) main::SCREEN + (byte) main::i#2) ← (byte~) main::$1 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx inx @@ -363,8 +361,7 @@ FINAL SYMBOL TABLE (byte~) main::$1 reg byte a 22.0 (label) main::@1 (label) main::@return -(byte*) main::SCREEN -(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) main::SCREEN SCREEN = (byte*) 1024 (byte) main::i (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 8.25 @@ -423,7 +420,7 @@ main: { // [7] (byte~) main::$1 ← < (signed word) main::w#1 -- vbuaa=_lo_vwsz1 lda.z w // SCREEN[i] = (word) w#0 + (byte~) main::$1 ← > (word) w *((byte*) SCREEN + (number) 3) ← (byte~) main::$1 - (byte~) main::$2 ← < (byte*) ptr#0 + (byte~) main::$2 ← < (byte*) ptr (byte~) main::$3 ← ((byte)) (byte~) main::$2 *((byte*) SCREEN + (number) 5) ← (byte~) main::$3 - (byte~) main::$4 ← > (byte*) ptr#0 + (byte~) main::$4 ← > (byte*) ptr (byte~) main::$5 ← ((byte)) (byte~) main::$4 *((byte*) SCREEN + (number) 5) ← (byte~) main::$5 to:main::@return @@ -41,7 +41,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte) b -(byte) b#0 (void()) main() (byte~) main::$0 (byte~) main::$1 @@ -51,11 +50,9 @@ SYMBOL TABLE SSA (byte~) main::$5 (label) main::@return (byte*) ptr -(byte*) ptr#0 (word) w -(word) w#0 -Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) b#0 +Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (number) 0) ← (byte) b Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (number) 2) ← (byte~) main::$0 Adding number conversion cast (unumber) 3 in *((byte*) SCREEN + (number) 3) ← (byte~) main::$1 Adding number conversion cast (unumber) 5 in *((byte*) SCREEN + (number) 5) ← (byte~) main::$3 @@ -83,30 +80,30 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions Alias (byte~) main::$3 = (byte~) main::$2 Alias (byte~) main::$5 = (byte~) main::$4 Successful SSA optimization Pass2AliasElimination -Constant (const byte) b#0 = 0 -Constant (const word) w#0 = 0 -Constant (const byte*) ptr#0 = (byte*) 0 +Constant (const byte) b = 0 +Constant (const word) w = 0 +Constant (const byte*) ptr = (byte*) 0 Constant (const byte*) SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification -Simplifying expression containing zero SCREEN in [4] *((const byte*) SCREEN + (byte) 0) ← (const byte) b#0 +Simplifying expression containing zero SCREEN in [4] *((const byte*) SCREEN + (byte) 0) ← (const byte) b Successful SSA optimization PassNSimplifyExpressionWithZero -Constant right-side identified [1] (byte~) main::$0 ← < (const word) w#0 -Constant right-side identified [3] (byte~) main::$1 ← > (const word) w#0 -Constant right-side identified [5] (byte~) main::$3 ← < (const byte*) ptr#0 -Constant right-side identified [7] (byte~) main::$5 ← > (const byte*) ptr#0 +Constant right-side identified [1] (byte~) main::$0 ← < (const word) w +Constant right-side identified [3] (byte~) main::$1 ← > (const word) w +Constant right-side identified [5] (byte~) main::$3 ← < (const byte*) ptr +Constant right-side identified [7] (byte~) main::$5 ← > (const byte*) ptr Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte) main::$0 = w#0 -Constant (const byte) main::$3 = ptr#0 +Constant (const byte) main::$0 = w +Constant (const byte) main::$3 = ptr Successful SSA optimization Pass2ConstantIdentification -Simplifying constant evaluating to zero <(const word) w#0 in -Simplifying constant evaluating to zero >(const word) w#0 in -Simplifying constant evaluating to zero <(const byte*) ptr#0 in -Simplifying constant evaluating to zero >(const byte*) ptr#0 in +Simplifying constant evaluating to zero <(const word) w in +Simplifying constant evaluating to zero >(const word) w in +Simplifying constant evaluating to zero <(const byte*) ptr in +Simplifying constant evaluating to zero >(const byte*) ptr in Successful SSA optimization PassNSimplifyConstantZero -Eliminating unused constant (const word) w#0 -Eliminating unused constant (const byte*) ptr#0 +Eliminating unused constant (const word) w +Eliminating unused constant (const byte*) ptr Successful SSA optimization PassNEliminateUnusedVars Constant inlined main::$5 = (byte) 0 Constant inlined main::$3 = (byte) 0 @@ -145,7 +142,7 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] *((const byte*) SCREEN) ← (const byte) b#0 + [4] *((const byte*) SCREEN) ← (const byte) b [5] *((const byte*) SCREEN+(byte) 2) ← (byte) 0 [6] *((const byte*) SCREEN+(byte) 3) ← (byte) 0 [7] *((const byte*) SCREEN+(byte) 5) ← (byte) 0 @@ -157,10 +154,7 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS -(byte) b (void()) main() -(byte*) ptr -(word) w Initial phi equivalence classes Complete equivalence classes @@ -192,7 +186,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN) ← (const byte) b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // [5] *((const byte*) SCREEN+(byte) 2) ← (byte) 0 -- _deref_pbuc1=vbuc2 @@ -216,7 +210,7 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((const byte*) SCREEN) ← (const byte) b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN) ← (const byte) b [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [5] *((const byte*) SCREEN+(byte) 2) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) SCREEN+(byte) 3) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) SCREEN+(byte) 5) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -255,7 +249,7 @@ bend_from_b1: bend: // main main: { - // [4] *((const byte*) SCREEN) ← (const byte) b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // [5] *((const byte*) SCREEN+(byte) 2) ← (byte) 0 -- _deref_pbuc1=vbuc2 @@ -305,12 +299,9 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (const byte*) SCREEN SCREEN = (byte*) 1024 -(byte) b -(const byte) b#0 b = (byte) 0 +(const byte) b b = (byte) 0 (void()) main() (label) main::@return -(byte*) ptr -(word) w @@ -335,7 +326,7 @@ Score: 30 // main main: { // SCREEN[0] = b - // [4] *((const byte*) SCREEN) ← (const byte) b#0 -- _deref_pbuc1=vbuc2 + // [4] *((const byte*) SCREEN) ← (const byte) b -- _deref_pbuc1=vbuc2 lda #b sta SCREEN // SCREEN[2] = print2::@1#0] -- vbuz1=vbuc1 lda #0 sta.z j - // [8] phi (byte*) print2::at#1 = (const byte*) screen#0 [phi:print2->print2::@1#1] -- pbuz1=pbuc1 + // [8] phi (byte*) print2::at#1 = (const byte*) screen [phi:print2->print2::@1#1] -- pbuz1=pbuc1 lda #screen @@ -525,7 +523,7 @@ print2: { b1_from_print2: // [8] phi (byte) print2::j#2 = (byte) 0 [phi:print2->print2::@1#0] -- vbuxx=vbuc1 ldx #0 - // [8] phi (byte*) print2::at#1 = (const byte*) screen#0 [phi:print2->print2::@1#1] -- pbuz1=pbuc1 + // [8] phi (byte*) print2::at#1 = (const byte*) screen [phi:print2->print2::@1#1] -- pbuz1=pbuc1 lda #screen @@ -661,8 +659,7 @@ FINAL SYMBOL TABLE (byte) print_char::idx !reg byte x (byte) print_char::idx#0 !reg byte x 11.0 (byte) print_char::idx#1 !reg byte x 13.0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 zp ZP_WORD:252 [ print2::msg#1 ] zp ZP_BYTE:2 [ print2::i#2 print2::i#1 ] @@ -712,7 +709,7 @@ print2: { // [8] phi from print2 to print2::@1 [phi:print2->print2::@1] // [8] phi (byte) print2::j#2 = (byte) 0 [phi:print2->print2::@1#0] -- vbuxx=vbuc1 ldx #0 - // [8] phi (byte*) print2::at#1 = (const byte*) screen#0 [phi:print2->print2::@1#1] -- pbuz1=pbuc1 + // [8] phi (byte*) print2::at#1 = (const byte*) screen [phi:print2->print2::@1#1] -- pbuz1=pbuc1 lda #screen diff --git a/src/test/ref/var-register-zp-3.sym b/src/test/ref/var-register-zp-3.sym index 03e630d4b..de29a733c 100644 --- a/src/test/ref/var-register-zp-3.sym +++ b/src/test/ref/var-register-zp-3.sym @@ -30,8 +30,7 @@ (byte) print_char::idx !reg byte x (byte) print_char::idx#0 !reg byte x 11.0 (byte) print_char::idx#1 !reg byte x 13.0 -(byte*) screen -(const byte*) screen#0 screen = (byte*) 1024 +(const byte*) screen screen = (byte*) 1024 zp ZP_WORD:252 [ print2::msg#1 ] zp ZP_BYTE:2 [ print2::i#2 print2::i#1 ] diff --git a/src/test/ref/var-register-zp.cfg b/src/test/ref/var-register-zp.cfg index 25a89fc2e..4e6fbcb8b 100644 --- a/src/test/ref/var-register-zp.cfg +++ b/src/test/ref/var-register-zp.cfg @@ -22,12 +22,12 @@ main::@return: scope:[main] from main::@1 to:@return main::@2: scope:[main] from main::@1 [8] (byte~) main::$3 ← (byte) main::i#3 << (byte) 1 - [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 + [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 [10] (byte) main::i#1 ← ++ (byte) main::i#3 [11] (signed word) main::j#1 ← ++ (signed word) main::j#2 [12] (signed word~) main::$1 ← (signed word)(byte) main::i#1 [13] (signed word) main::k#0 ← (signed word~) main::$1 << (byte) 1 [14] (byte~) main::$4 ← (byte) main::i#1 << (byte) 1 - [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 + [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 [16] (byte) main::i#2 ← ++ (byte) main::i#1 to:main::@1 diff --git a/src/test/ref/var-register-zp.log b/src/test/ref/var-register-zp.log index a101965ad..1f7a9d422 100644 --- a/src/test/ref/var-register-zp.log +++ b/src/test/ref/var-register-zp.log @@ -8,7 +8,7 @@ Culled Empty Block (label) main::@6 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (signed word*) SCREEN#0 ← ((signed word*)) (number) $400 + (signed word*) SCREEN ← ((signed word*)) (number) $400 to:@1 (void()) main() @@ -26,14 +26,14 @@ main::@2: scope:[main] from main::@1 (signed word) main::j#2 ← phi( main::@1/(signed word) main::j#3 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#3 ) (byte~) main::$3 ← (byte) main::i#4 * (const byte) SIZEOF_SIGNED_WORD - *((signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 + *((signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 (byte) main::i#1 ← ++ (byte) main::i#4 (signed word) main::j#1 ← ++ (signed word) main::j#2 (signed word~) main::$1 ← ((signed word)) (byte) main::i#1 (number~) main::$2 ← (signed word~) main::$1 * (number) 2 (signed word) main::k#0 ← (number~) main::$2 (byte~) main::$4 ← (byte) main::i#1 * (const byte) SIZEOF_SIGNED_WORD - *((signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 + *((signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 (byte) main::i#2 ← ++ (byte) main::i#1 to:main::@1 main::@return: scope:[main] from main::@1 @@ -52,7 +52,6 @@ SYMBOL TABLE SSA (label) @begin (label) @end (signed word*) SCREEN -(signed word*) SCREEN#0 (const byte) SIZEOF_SIGNED_WORD = (byte) 2 (void()) main() (bool~) main::$0 @@ -83,7 +82,7 @@ Adding number conversion cast (unumber) 4 in (bool~) main::$0 ← (byte) main::i Adding number conversion cast (snumber) 2 in (number~) main::$2 ← (signed word~) main::$1 * (number) 2 Adding number conversion cast (snumber) main::$2 in (number~) main::$2 ← (signed word~) main::$1 * (snumber)(number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (signed word*) SCREEN#0 ← (signed word*)(number) $400 +Inlining cast (signed word*) SCREEN ← (signed word*)(number) $400 Inlining cast (byte) main::i#0 ← (unumber)(number) 0 Inlining cast (signed word) main::j#0 ← (snumber)(number) 0 Inlining cast (signed word~) main::$1 ← (signed word)(byte) main::i#1 @@ -106,7 +105,7 @@ Alias (signed word) main::k#0 = (signed word~) main::$2 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [5] if((byte) main::i#3<(byte) 4) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const signed word*) SCREEN#0 = (signed word*) 1024 +Constant (const signed word*) SCREEN = (signed word*) 1024 Constant (const byte) main::i#0 = 0 Constant (const signed word) main::j#0 = 0 Successful SSA optimization Pass2ConstantIdentification @@ -164,19 +163,18 @@ main::@return: scope:[main] from main::@1 to:@return main::@2: scope:[main] from main::@1 [8] (byte~) main::$3 ← (byte) main::i#3 << (byte) 1 - [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 + [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 [10] (byte) main::i#1 ← ++ (byte) main::i#3 [11] (signed word) main::j#1 ← ++ (signed word) main::j#2 [12] (signed word~) main::$1 ← (signed word)(byte) main::i#1 [13] (signed word) main::k#0 ← (signed word~) main::$1 << (byte) 1 [14] (byte~) main::$4 ← (byte) main::i#1 << (byte) 1 - [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 + [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 [16] (byte) main::i#2 ← ++ (byte) main::i#1 to:main::@1 VARIABLE REGISTER WEIGHTS -(signed word*) SCREEN (void()) main() (signed word~) main::$1 22.0 (byte~) main::$3 22.0 @@ -276,7 +274,7 @@ main: { lda.z i asl sta.z _3 - // [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuz1=vwsz2 + // [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuz1=vwsz2 ldy.z _3 lda.z j sta SCREEN,y @@ -305,7 +303,7 @@ main: { lda.z i asl sta.z _4 - // [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuz1=vwsz2 + // [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuz1=vwsz2 ldy.z _4 lda.z k sta SCREEN,y @@ -324,11 +322,11 @@ main: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if((byte) main::i#3<(byte) 4) goto main::@2 [ main::i#3 main::j#2 ] ( main:2 [ main::i#3 main::j#2 ] ) always clobbers reg byte a Statement [8] (byte~) main::$3 ← (byte) main::i#3 << (byte) 1 [ main::i#3 main::j#2 main::$3 ] ( main:2 [ main::i#3 main::j#2 main::$3 ] ) always clobbers reg byte a -Statement [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 [ main::i#3 main::j#2 ] ( main:2 [ main::i#3 main::j#2 ] ) always clobbers reg byte a +Statement [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 [ main::i#3 main::j#2 ] ( main:2 [ main::i#3 main::j#2 ] ) always clobbers reg byte a Statement [12] (signed word~) main::$1 ← (signed word)(byte) main::i#1 [ main::j#1 main::i#1 main::$1 ] ( main:2 [ main::j#1 main::i#1 main::$1 ] ) always clobbers reg byte a Statement [13] (signed word) main::k#0 ← (signed word~) main::$1 << (byte) 1 [ main::j#1 main::i#1 main::k#0 ] ( main:2 [ main::j#1 main::i#1 main::k#0 ] ) always clobbers reg byte a Statement [14] (byte~) main::$4 ← (byte) main::i#1 << (byte) 1 [ main::j#1 main::i#1 main::k#0 main::$4 ] ( main:2 [ main::j#1 main::i#1 main::k#0 main::$4 ] ) always clobbers reg byte a -Statement [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 [ main::j#1 main::i#1 ] ( main:2 [ main::j#1 main::i#1 ] ) always clobbers reg byte a +Statement [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 [ main::j#1 main::i#1 ] ( main:2 [ main::j#1 main::i#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::i#3 main::i#2 ] : zp ZP_BYTE:2 , Potential registers zp ZP_WORD:4 [ main::j#2 main::j#1 ] : zp ZP_WORD:4 , Potential registers zp ZP_BYTE:3 [ main::$3 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , @@ -408,7 +406,7 @@ main: { // [8] (byte~) main::$3 ← (byte) main::i#3 << (byte) 1 -- vbuaa=vbuz1_rol_1 lda.z i asl - // [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuaa=vwsz1 + // [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z j sta SCREEN,y @@ -432,7 +430,7 @@ main: { // [14] (byte~) main::$4 ← (byte) main::i#1 << (byte) 1 -- vbuaa=vbuz1_rol_1 lda.z i asl - // [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuaa=vwsz1 + // [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z k sta SCREEN,y @@ -477,8 +475,7 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(signed word*) SCREEN -(const signed word*) SCREEN#0 SCREEN = (signed word*) 1024 +(const signed word*) SCREEN SCREEN = (signed word*) 1024 (void()) main() (signed word~) main::$1 $1 zp ZP_WORD:6 22.0 (byte~) main::$3 reg byte a 22.0 @@ -551,7 +548,7 @@ main: { // [8] (byte~) main::$3 ← (byte) main::i#3 << (byte) 1 -- vbuaa=vbuz1_rol_1 lda.z i asl - // [9] *((const signed word*) SCREEN#0 + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuaa=vwsz1 + // [9] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::j#2 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z j sta SCREEN,y @@ -579,7 +576,7 @@ main: { // [14] (byte~) main::$4 ← (byte) main::i#1 << (byte) 1 -- vbuaa=vbuz1_rol_1 lda.z i asl - // [15] *((const signed word*) SCREEN#0 + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuaa=vwsz1 + // [15] *((const signed word*) SCREEN + (byte~) main::$4) ← (signed word) main::k#0 -- pwsc1_derefidx_vbuaa=vwsz1 tay lda.z k sta SCREEN,y diff --git a/src/test/ref/var-register-zp.sym b/src/test/ref/var-register-zp.sym index bb54e835b..fc95f769a 100644 --- a/src/test/ref/var-register-zp.sym +++ b/src/test/ref/var-register-zp.sym @@ -1,8 +1,7 @@ (label) @1 (label) @begin (label) @end -(signed word*) SCREEN -(const signed word*) SCREEN#0 SCREEN = (signed word*) 1024 +(const signed word*) SCREEN SCREEN = (signed word*) 1024 (void()) main() (signed word~) main::$1 $1 zp ZP_WORD:6 22.0 (byte~) main::$3 reg byte a 22.0 diff --git a/src/test/ref/var-register.cfg b/src/test/ref/var-register.cfg index 539e4594c..2c724b5c5 100644 --- a/src/test/ref/var-register.cfg +++ b/src/test/ref/var-register.cfg @@ -46,7 +46,7 @@ main::@return: scope:[main] from main::@5 (void()) print((byte) print::idx , (byte) print::val) print: scope:[print] from main::@3 [19] (byte) print::idx#1 ← phi( main::@3/(byte) print::idx#0 ) - [20] *((const byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#0 + [20] *((const byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#0 to:print::@return print::@return: scope:[print] from print [21] return diff --git a/src/test/ref/var-register.log b/src/test/ref/var-register.log index 1d030cae9..a2d64b181 100644 --- a/src/test/ref/var-register.log +++ b/src/test/ref/var-register.log @@ -58,8 +58,8 @@ main::@return: scope:[main] from main::@5 print: scope:[print] from main::@3 (byte) print::idx#1 ← phi( main::@3/(byte) print::idx#0 ) (byte) print::val#1 ← phi( main::@3/(byte) print::val#0 ) - (byte*) print::SCREEN#0 ← ((byte*)) (number) $400 - *((byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#1 + (byte*) print::SCREEN ← ((byte*)) (number) $400 + *((byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#1 to:print::@return print::@return: scope:[print] from print return @@ -114,7 +114,6 @@ SYMBOL TABLE SSA (void()) print((byte) print::idx , (byte) print::val) (label) print::@return (byte*) print::SCREEN -(byte*) print::SCREEN#0 (byte) print::idx !reg byte x (byte) print::idx#0 !reg byte x (byte) print::idx#1 !reg byte x @@ -122,7 +121,7 @@ SYMBOL TABLE SSA (byte) print::val#0 (byte) print::val#1 -Inlining cast (byte*) print::SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) print::SCREEN ← (byte*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Successful SSA optimization PassNCastSimplification @@ -141,7 +140,7 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) main::x#0 = 0 Constant (const byte) main::y#0 = 0 Constant (const byte) main::a#0 = 0 -Constant (const byte*) print::SCREEN#0 = (byte*) 1024 +Constant (const byte*) print::SCREEN = (byte*) 1024 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [12] main::a#1 ← ++ main::a#2 to ++ Resolved ranged comparison value [14] if(main::a#1!=rangelast(0,$64)) goto main::@3 to (number) $65 @@ -250,7 +249,7 @@ main::@return: scope:[main] from main::@5 (void()) print((byte) print::idx , (byte) print::val) print: scope:[print] from main::@3 [19] (byte) print::idx#1 ← phi( main::@3/(byte) print::idx#0 ) - [20] *((const byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#0 + [20] *((const byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#0 to:print::@return print::@return: scope:[print] from print [21] return @@ -273,7 +272,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::y#1 151.5 (byte) main::y#4 150.375 (void()) print((byte) print::idx , (byte) print::val) -(byte*) print::SCREEN (byte) print::idx !reg byte x (byte) print::idx#0 !reg byte x 1001.0 (byte) print::idx#1 !reg byte x 1003.0 @@ -415,7 +413,7 @@ main: { print: { .label SCREEN = $400 .label val = 4 - // [20] *((const byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuz1 + // [20] *((const byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuz1 lda.z val sta SCREEN,x jmp breturn @@ -562,7 +560,7 @@ main: { // print(byte register(X) idx, byte register(A) val) print: { .label SCREEN = $400 - // [20] *((const byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuaa + // [20] *((const byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x jmp breturn // print::@return @@ -643,8 +641,7 @@ FINAL SYMBOL TABLE (byte) main::y#4 reg byte x 150.375 (void()) print((byte) print::idx , (byte) print::val) (label) print::@return -(byte*) print::SCREEN -(const byte*) print::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) print::SCREEN SCREEN = (byte*) 1024 (byte) print::idx !reg byte x (byte) print::idx#0 !reg byte x 1001.0 (byte) print::idx#1 !reg byte x 1003.0 @@ -748,7 +745,7 @@ main: { print: { .label SCREEN = $400 // SCREEN[idx] = val - // [20] *((const byte*) print::SCREEN#0 + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuaa + // [20] *((const byte*) print::SCREEN + (byte) print::idx#1) ← (byte) print::val#0 -- pbuc1_derefidx_vbuxx=vbuaa sta SCREEN,x // print::@return // } diff --git a/src/test/ref/var-register.sym b/src/test/ref/var-register.sym index 57d3a084f..09a6669c5 100644 --- a/src/test/ref/var-register.sym +++ b/src/test/ref/var-register.sym @@ -24,8 +24,7 @@ (byte) main::y#4 reg byte x 150.375 (void()) print((byte) print::idx , (byte) print::val) (label) print::@return -(byte*) print::SCREEN -(const byte*) print::SCREEN#0 SCREEN = (byte*) 1024 +(const byte*) print::SCREEN SCREEN = (byte*) 1024 (byte) print::idx !reg byte x (byte) print::idx#0 !reg byte x 1001.0 (byte) print::idx#1 !reg byte x 1003.0 diff --git a/src/test/ref/voronoi.cfg b/src/test/ref/voronoi.cfg index b2b3e6568..ae9e8aa07 100644 --- a/src/test/ref/voronoi.cfg +++ b/src/test/ref/voronoi.cfg @@ -79,7 +79,7 @@ render: scope:[render] from main::@1 [36] phi() to:render::@1 render::@1: scope:[render] from render render::@3 - [37] (byte*) render::colline#5 ← phi( render/(const byte*) COLORS#0 render::@3/(byte*) render::colline#1 ) + [37] (byte*) render::colline#5 ← phi( render/(const byte*) COLORS render::@3/(byte*) render::colline#1 ) [37] (byte) render::y#4 ← phi( render/(byte) 0 render::@3/(byte) render::y#1 ) to:render::@2 render::@2: scope:[render] from render::@1 render::@4 @@ -112,7 +112,7 @@ findcol::@1: scope:[findcol] from findcol findcol::@8 [52] (byte) findcol::mindiff#10 ← phi( findcol/(byte) $ff findcol::@8/(byte~) findcol::mindiff#13 ) [52] (byte) findcol::mincol#10 ← phi( findcol/(byte) 0 findcol::@8/(byte) findcol::mincol#4 ) [52] (byte) findcol::i#10 ← phi( findcol/(byte) 0 findcol::@8/(byte) findcol::i#1 ) - [53] if((byte) findcol::i#10<(const byte) numpoints#0) goto findcol::@2 + [53] if((byte) findcol::i#10<(const byte) numpoints) goto findcol::@2 to:findcol::@return findcol::@return: scope:[findcol] from findcol::@1 findcol::@9 [54] (byte) findcol::return#3 ← phi( findcol::@9/(byte) 0 findcol::@1/(byte) findcol::mincol#10 ) @@ -169,13 +169,13 @@ initscreen: scope:[initscreen] from main [76] phi() to:initscreen::@1 initscreen::@1: scope:[initscreen] from initscreen initscreen::@2 - [77] (byte*) initscreen::screen#2 ← phi( initscreen/(const byte*) SCREEN#0 initscreen::@2/(byte*) initscreen::screen#1 ) - [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 + [77] (byte*) initscreen::screen#2 ← phi( initscreen/(const byte*) SCREEN initscreen::@2/(byte*) initscreen::screen#1 ) + [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 to:initscreen::@return initscreen::@return: scope:[initscreen] from initscreen::@1 [79] return to:@return initscreen::@2: scope:[initscreen] from initscreen::@1 - [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 + [80] *((byte*) initscreen::screen#2) ← (const byte) FILL [81] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 to:initscreen::@1 diff --git a/src/test/ref/voronoi.log b/src/test/ref/voronoi.log index 2e66cf3df..2f81b6d5f 100644 --- a/src/test/ref/voronoi.log +++ b/src/test/ref/voronoi.log @@ -25,10 +25,10 @@ Culled Empty Block (label) findcol::@22 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) COLORS#0 ← ((byte*)) (number) $d800 - (byte) FILL#0 ← (number) $e6 - (byte) numpoints#0 ← (number) 6 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) COLORS ← ((byte*)) (number) $d800 + (byte) FILL ← (number) $e6 + (byte) numpoints ← (number) 6 (byte[]) XPOS ← { (number) 5, (number) $f, (number) 6, (number) $22, (number) $15, (number) $1f } (byte[]) YPOS ← { (number) 5, (number) 8, (number) $e, (number) 2, (number) $11, (number) $16 } (byte[]) COLS ← { (number) 1, (number) 2, (number) 3, (number) 4, (number) 5, (number) 7 } @@ -119,17 +119,17 @@ animate::@return: scope:[animate] from animate::@10 animate::@11 animate::@4 (void()) initscreen() initscreen: scope:[initscreen] from main - (byte*) initscreen::screen#0 ← (byte*) SCREEN#0 + (byte*) initscreen::screen#0 ← (byte*) SCREEN to:initscreen::@1 initscreen::@1: scope:[initscreen] from initscreen initscreen::@2 (byte*) initscreen::screen#2 ← phi( initscreen/(byte*) initscreen::screen#0 initscreen::@2/(byte*) initscreen::screen#1 ) - (byte*~) initscreen::$0 ← (byte*) SCREEN#0 + (number) $3e8 + (byte*~) initscreen::$0 ← (byte*) SCREEN + (number) $3e8 (bool~) initscreen::$1 ← (byte*) initscreen::screen#2 < (byte*~) initscreen::$0 if((bool~) initscreen::$1) goto initscreen::@2 to:initscreen::@return initscreen::@2: scope:[initscreen] from initscreen::@1 (byte*) initscreen::screen#3 ← phi( initscreen::@1/(byte*) initscreen::screen#2 ) - *((byte*) initscreen::screen#3) ← (byte) FILL#0 + *((byte*) initscreen::screen#3) ← (byte) FILL (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#3 to:initscreen::@1 initscreen::@return: scope:[initscreen] from initscreen::@1 @@ -138,7 +138,7 @@ initscreen::@return: scope:[initscreen] from initscreen::@1 (void()) render() render: scope:[render] from main::@1 - (byte*) render::colline#0 ← (byte*) COLORS#0 + (byte*) render::colline#0 ← (byte*) COLORS (byte) render::y#0 ← (byte) 0 to:render::@1 render::@1: scope:[render] from render render::@3 @@ -194,7 +194,7 @@ findcol::@1: scope:[findcol] from findcol findcol::@10 (byte) findcol::mincol#3 ← phi( findcol/(byte) findcol::mincol#0 findcol::@10/(byte) findcol::mincol#4 ) (byte) findcol::x#5 ← phi( findcol/(byte) findcol::x#7 findcol::@10/(byte) findcol::x#8 ) (byte) findcol::i#2 ← phi( findcol/(byte) findcol::i#0 findcol::@10/(byte) findcol::i#1 ) - (bool~) findcol::$0 ← (byte) findcol::i#2 < (byte) numpoints#0 + (bool~) findcol::$0 ← (byte) findcol::i#2 < (byte) numpoints if((bool~) findcol::$0) goto findcol::@2 to:findcol::@3 findcol::@2: scope:[findcol] from findcol::@1 @@ -342,12 +342,9 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) COLORS -(byte*) COLORS#0 (byte[]) COLS (byte) FILL -(byte) FILL#0 (byte*) SCREEN -(byte*) SCREEN#0 (byte[]) XPOS (byte[]) YPOS (void()) animate() @@ -537,7 +534,6 @@ SYMBOL TABLE SSA (label) main::@5 (label) main::@return (byte) numpoints -(byte) numpoints#0 (void()) render() (byte~) render::$0 (bool~) render::$1 @@ -570,8 +566,8 @@ SYMBOL TABLE SSA (byte) render::y#4 (byte) render::y#5 -Adding number conversion cast (unumber) $e6 in (byte) FILL#0 ← (number) $e6 -Adding number conversion cast (unumber) 6 in (byte) numpoints#0 ← (number) 6 +Adding number conversion cast (unumber) $e6 in (byte) FILL ← (number) $e6 +Adding number conversion cast (unumber) 6 in (byte) numpoints ← (number) 6 Adding number conversion cast (unumber) 1 in (number~) animate::$0 ← *((byte[]) XPOS + (number) 0) + (number) 1 Adding number conversion cast (unumber) animate::$0 in (number~) animate::$0 ← *((byte[]) XPOS + (number) 0) + (unumber)(number) 1 Adding number conversion cast (unumber) 0 in (unumber~) animate::$0 ← *((byte[]) XPOS + (number) 0) + (unumber)(number) 1 @@ -622,7 +618,7 @@ Adding number conversion cast (unumber) $28 in (number~) animate::$18 ← *((byt Adding number conversion cast (unumber) animate::$18 in (number~) animate::$18 ← *((byte[]) XPOS + (number) 3) - (unumber)(number) $28 Adding number conversion cast (unumber) 3 in (unumber~) animate::$18 ← *((byte[]) XPOS + (number) 3) - (unumber)(number) $28 Adding number conversion cast (unumber) 3 in *((byte[]) XPOS + (number) 3) ← (unumber~) animate::$18 -Adding number conversion cast (unumber) $3e8 in (byte*~) initscreen::$0 ← (byte*) SCREEN#0 + (number) $3e8 +Adding number conversion cast (unumber) $3e8 in (byte*~) initscreen::$0 ← (byte*) SCREEN + (number) $3e8 Adding number conversion cast (unumber) $28 in (byte*~) render::$2 ← (byte*) render::colline#3 + (number) $28 Adding number conversion cast (unumber) $ff in (byte) findcol::mindiff#0 ← (number) $ff Adding number conversion cast (unumber) 0 in (byte) findcol::mincol#0 ← (number) 0 @@ -633,10 +629,10 @@ Added casts to value list in (byte[]) XPOS ← (byte[]){ (byte)(number) 5, (byte Added casts to value list in (byte[]) YPOS ← (byte[]){ (byte)(number) 5, (byte)(number) 8, (byte)(number) $e, (byte)(number) 2, (byte)(number) $11, (byte)(number) $16 } Added casts to value list in (byte[]) COLS ← (byte[]){ (byte)(number) 1, (byte)(number) 2, (byte)(number) 3, (byte)(number) 4, (byte)(number) 5, (byte)(number) 7 } Successful SSA optimization PassNAddInitializerValueListTypeCasts -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) COLORS#0 ← (byte*)(number) $d800 -Inlining cast (byte) FILL#0 ← (unumber)(number) $e6 -Inlining cast (byte) numpoints#0 ← (unumber)(number) 6 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) COLORS ← (byte*)(number) $d800 +Inlining cast (byte) FILL ← (unumber)(number) $e6 +Inlining cast (byte) numpoints ← (unumber)(number) 6 Inlining cast *((byte[]) XPOS + (unumber)(number) 0) ← (unumber)(number) 0 Inlining cast *((byte[]) YPOS + (unumber)(number) 0) ← (unumber)(number) 0 Inlining cast *((byte[]) XPOS + (unumber)(number) 1) ← (unumber)(number) $28 @@ -850,7 +846,7 @@ Simple Condition (bool~) animate::$17 [46] if(*((byte[]) XPOS + (byte) 3)<(byte) Simple Condition (bool~) initscreen::$1 [54] if((byte*) initscreen::screen#2<(byte*~) initscreen::$0) goto initscreen::@2 Simple Condition (bool~) render::$1 [74] if((byte) render::x#1!=rangelast(0,$27)) goto render::@2 Simple Condition (bool~) render::$3 [80] if((byte) render::y#1!=rangelast(0,$18)) goto render::@1 -Simple Condition (bool~) findcol::$0 [88] if((byte) findcol::i#10<(byte) numpoints#0) goto findcol::@2 +Simple Condition (bool~) findcol::$0 [88] if((byte) findcol::i#10<(byte) numpoints) goto findcol::@2 Simple Condition (bool~) findcol::$2 [94] if((byte) findcol::x#0!=(byte) findcol::xp#0) goto findcol::@4 Simple Condition (bool~) findcol::$5 [100] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@6 Simple Condition (bool~) findcol::$4 [104] if((byte) findcol::y#0!=(byte) findcol::yp#0) goto findcol::@4 @@ -861,10 +857,10 @@ Identified constant from value list (byte[]) { (byte) 5, (byte) $f, (byte) 6, (b Identified constant from value list (byte[]) { (byte) 5, (byte) 8, (byte) $e, (byte) 2, (byte) $11, (byte) $16 } Identified constant from value list (byte[]) { (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 7 } Successful SSA optimization Pass2ConstantInitializerValueLists -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) COLORS#0 = (byte*) 55296 -Constant (const byte) FILL#0 = $e6 -Constant (const byte) numpoints#0 = 6 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) COLORS = (byte*) 55296 +Constant (const byte) FILL = $e6 +Constant (const byte) numpoints = 6 Constant (const byte[]) XPOS = { 5, $f, 6, $22, $15, $1f } Constant (const byte[]) YPOS = { 5, 8, $e, 2, $11, $16 } Constant (const byte[]) COLS = { 1, 2, 3, 4, 5, 7 } @@ -876,8 +872,8 @@ Constant (const byte) findcol::i#0 = 0 Constant (const byte) findcol::diff#0 = 0 Constant (const byte) findcol::return#2 = 0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) initscreen::screen#0 = SCREEN#0 -Constant (const byte*) render::colline#0 = COLORS#0 +Constant (const byte*) initscreen::screen#0 = SCREEN +Constant (const byte*) render::colline#0 = COLORS Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [10] if(true) goto main::@1 Successful SSA optimization Pass2ConstantIfs @@ -907,9 +903,9 @@ Successful SSA optimization PassNCastSimplification Finalized unsigned number type (byte) $28 Finalized unsigned number type (byte) $19 Successful SSA optimization PassNFinalizeNumberTypeConversions -Constant right-side identified [30] (byte*~) initscreen::$0 ← (const byte*) SCREEN#0 + (word) $3e8 +Constant right-side identified [30] (byte*~) initscreen::$0 ← (const byte*) SCREEN + (word) $3e8 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) initscreen::$0 = SCREEN#0+$3e8 +Constant (const byte*) initscreen::$0 = SCREEN+$3e8 Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte*) initscreen::screen#0 Inlining constant with var siblings (const byte) render::y#0 @@ -921,13 +917,13 @@ Inlining constant with var siblings (const byte) findcol::i#0 Inlining constant with var siblings (const byte) findcol::return#2 Constant inlined findcol::i#0 = (byte) 0 Constant inlined findcol::return#2 = (byte) 0 -Constant inlined render::colline#0 = (const byte*) COLORS#0 +Constant inlined render::colline#0 = (const byte*) COLORS Constant inlined render::x#0 = (byte) 0 -Constant inlined initscreen::screen#0 = (const byte*) SCREEN#0 +Constant inlined initscreen::screen#0 = (const byte*) SCREEN Constant inlined render::y#0 = (byte) 0 Constant inlined findcol::mincol#0 = (byte) 0 Constant inlined findcol::mindiff#0 = (byte) $ff -Constant inlined initscreen::$0 = (const byte*) SCREEN#0+(word) $3e8 +Constant inlined initscreen::$0 = (const byte*) SCREEN+(word) $3e8 Successful SSA optimization Pass2ConstantInlining Consolidated array index constant in *(XPOS+1) Consolidated array index constant in *(XPOS+1) @@ -1105,7 +1101,7 @@ render: scope:[render] from main::@1 [36] phi() to:render::@1 render::@1: scope:[render] from render render::@3 - [37] (byte*) render::colline#5 ← phi( render/(const byte*) COLORS#0 render::@3/(byte*) render::colline#1 ) + [37] (byte*) render::colline#5 ← phi( render/(const byte*) COLORS render::@3/(byte*) render::colline#1 ) [37] (byte) render::y#4 ← phi( render/(byte) 0 render::@3/(byte) render::y#1 ) to:render::@2 render::@2: scope:[render] from render::@1 render::@4 @@ -1138,7 +1134,7 @@ findcol::@1: scope:[findcol] from findcol findcol::@8 [52] (byte) findcol::mindiff#10 ← phi( findcol/(byte) $ff findcol::@8/(byte~) findcol::mindiff#13 ) [52] (byte) findcol::mincol#10 ← phi( findcol/(byte) 0 findcol::@8/(byte) findcol::mincol#4 ) [52] (byte) findcol::i#10 ← phi( findcol/(byte) 0 findcol::@8/(byte) findcol::i#1 ) - [53] if((byte) findcol::i#10<(const byte) numpoints#0) goto findcol::@2 + [53] if((byte) findcol::i#10<(const byte) numpoints) goto findcol::@2 to:findcol::@return findcol::@return: scope:[findcol] from findcol::@1 findcol::@9 [54] (byte) findcol::return#3 ← phi( findcol::@9/(byte) 0 findcol::@1/(byte) findcol::mincol#10 ) @@ -1195,22 +1191,19 @@ initscreen: scope:[initscreen] from main [76] phi() to:initscreen::@1 initscreen::@1: scope:[initscreen] from initscreen initscreen::@2 - [77] (byte*) initscreen::screen#2 ← phi( initscreen/(const byte*) SCREEN#0 initscreen::@2/(byte*) initscreen::screen#1 ) - [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 + [77] (byte*) initscreen::screen#2 ← phi( initscreen/(const byte*) SCREEN initscreen::@2/(byte*) initscreen::screen#1 ) + [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 to:initscreen::@return initscreen::@return: scope:[initscreen] from initscreen::@1 [79] return to:@return initscreen::@2: scope:[initscreen] from initscreen::@1 - [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 + [80] *((byte*) initscreen::screen#2) ← (const byte) FILL [81] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 to:initscreen::@1 VARIABLE REGISTER WEIGHTS -(byte*) COLORS -(byte) FILL -(byte*) SCREEN (void()) animate() (byte~) animate::$0 4.0 (byte~) animate::$12 4.0 @@ -1257,7 +1250,6 @@ VARIABLE REGISTER WEIGHTS (byte*) initscreen::screen#1 22.0 (byte*) initscreen::screen#2 14.666666666666666 (void()) main() -(byte) numpoints (void()) render() (byte) render::col (byte) render::col#0 2002.0 @@ -1544,7 +1536,7 @@ render: { .label y = 2 // [37] phi from render to render::@1 [phi:render->render::@1] b1_from_render: - // [37] phi (byte*) render::colline#5 = (const byte*) COLORS#0 [phi:render->render::@1#0] -- pbuz1=pbuc1 + // [37] phi (byte*) render::colline#5 = (const byte*) COLORS [phi:render->render::@1#0] -- pbuz1=pbuc1 lda #COLORS @@ -1658,7 +1650,7 @@ findcol: { jmp b1 // findcol::@1 b1: - // [53] if((byte) findcol::i#10<(const byte) numpoints#0) goto findcol::@2 -- vbuz1_lt_vbuc1_then_la1 + // [53] if((byte) findcol::i#10<(const byte) numpoints) goto findcol::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z i cmp #numpoints bcc b2 @@ -1805,7 +1797,7 @@ initscreen: { .label screen = $b // [77] phi from initscreen to initscreen::@1 [phi:initscreen->initscreen::@1] b1_from_initscreen: - // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN#0 [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 + // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -1813,7 +1805,7 @@ initscreen: { jmp b1 // initscreen::@1 b1: - // [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z screen+1 cmp #>SCREEN+$3e8 bcc b2 @@ -1829,7 +1821,7 @@ initscreen: { rts // initscreen::@2 b2: - // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 -- _deref_pbuz1=vbuc1 + // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL -- _deref_pbuz1=vbuc1 lda #FILL ldy #0 sta (screen),y @@ -1879,8 +1871,8 @@ Statement [65] (byte) findcol::diff#4 ← (byte) findcol::diff#5 + (byte~) findc Statement [73] (byte~) findcol::$11 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::diff#5 findcol::$11 ] ( 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::mincol#10 findcol::mindiff#10 findcol::diff#5 findcol::$11 ] ) always clobbers reg byte a Statement [74] (byte) findcol::diff#3 ← (byte) findcol::diff#5 + (byte~) findcol::$11 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::diff#3 ] ( 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::mincol#10 findcol::mindiff#10 findcol::diff#3 ] ) always clobbers reg byte a Statement [75] (byte) findcol::diff#1 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::yp#0 findcol::diff#1 ] ( 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::mincol#10 findcol::mindiff#10 findcol::yp#0 findcol::diff#1 ] ) always clobbers reg byte a -Statement [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a -Statement [80] *((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 [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a +Statement [80] *((byte*) initscreen::screen#2) ← (const byte) FILL [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a reg byte y Statement [12] if(*((const byte[]) XPOS)!=(byte) $28) goto animate::@1 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [13] *((const byte[]) XPOS) ← (byte) 0 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a Statement [16] if(*((const byte[]) YPOS)!=(byte) $19) goto animate::@2 [ ] ( main:2::animate:9 [ ] ) always clobbers reg byte a @@ -1901,8 +1893,8 @@ Statement [65] (byte) findcol::diff#4 ← (byte) findcol::diff#5 + (byte~) findc Statement [73] (byte~) findcol::$11 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::diff#5 findcol::$11 ] ( 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::mincol#10 findcol::mindiff#10 findcol::diff#5 findcol::$11 ] ) always clobbers reg byte a Statement [74] (byte) findcol::diff#3 ← (byte) findcol::diff#5 + (byte~) findcol::$11 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::diff#3 ] ( 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::mincol#10 findcol::mindiff#10 findcol::diff#3 ] ) always clobbers reg byte a Statement [75] (byte) findcol::diff#1 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ findcol::x#0 findcol::y#0 findcol::i#10 findcol::mincol#10 findcol::mindiff#10 findcol::yp#0 findcol::diff#1 ] ( 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::mincol#10 findcol::mindiff#10 findcol::yp#0 findcol::diff#1 ] ) always clobbers reg byte a -Statement [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a -Statement [80] *((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 [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a +Statement [80] *((byte*) initscreen::screen#2) ← (const byte) FILL [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) always clobbers reg byte a reg byte y Potential registers zp ZP_BYTE:2 [ render::y#4 render::y#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_WORD:3 [ render::colline#5 render::colline#1 ] : zp ZP_WORD:3 , Potential registers zp ZP_BYTE:5 [ render::x#2 render::x#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , @@ -2159,7 +2151,7 @@ render: { .label y = 2 // [37] phi from render to render::@1 [phi:render->render::@1] b1_from_render: - // [37] phi (byte*) render::colline#5 = (const byte*) COLORS#0 [phi:render->render::@1#0] -- pbuz1=pbuc1 + // [37] phi (byte*) render::colline#5 = (const byte*) COLORS [phi:render->render::@1#0] -- pbuz1=pbuc1 lda #COLORS @@ -2253,7 +2245,7 @@ findcol: { jmp b1 // findcol::@1 b1: - // [53] if((byte) findcol::i#10<(const byte) numpoints#0) goto findcol::@2 -- vbuz1_lt_vbuc1_then_la1 + // [53] if((byte) findcol::i#10<(const byte) numpoints) goto findcol::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z i cmp #numpoints bcc b2 @@ -2391,7 +2383,7 @@ initscreen: { .label screen = 6 // [77] phi from initscreen to initscreen::@1 [phi:initscreen->initscreen::@1] b1_from_initscreen: - // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN#0 [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 + // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -2399,7 +2391,7 @@ initscreen: { jmp b1 // initscreen::@1 b1: - // [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN#0+(word) $3e8) goto initscreen::@2 -- pbuz1_lt_pbuc1_then_la1 + // [78] if((byte*) initscreen::screen#2<(const byte*) SCREEN+(word) $3e8) goto initscreen::@2 -- pbuz1_lt_pbuc1_then_la1 lda.z screen+1 cmp #>SCREEN+$3e8 bcc b2 @@ -2415,7 +2407,7 @@ initscreen: { rts // initscreen::@2 b2: - // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 -- _deref_pbuz1=vbuc1 + // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL -- _deref_pbuz1=vbuc1 lda #FILL ldy #0 sta (screen),y @@ -2543,13 +2535,10 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) COLORS -(const byte*) COLORS#0 COLORS = (byte*) 55296 +(const byte*) COLORS COLORS = (byte*) 55296 (const byte[]) COLS COLS = { (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 7 } -(byte) FILL -(const byte) FILL#0 FILL = (byte) $e6 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte) FILL FILL = (byte) $e6 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) XPOS XPOS = { (byte) 5, (byte) $f, (byte) 6, (byte) $22, (byte) $15, (byte) $1f } (const byte[]) YPOS YPOS = { (byte) 5, (byte) 8, (byte) $e, (byte) 2, (byte) $11, (byte) $16 } (void()) animate() @@ -2628,8 +2617,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@1 (label) main::@2 -(byte) numpoints -(const byte) numpoints#0 numpoints = (byte) 6 +(const byte) numpoints numpoints = (byte) 6 (void()) render() (label) render::@1 (label) render::@2 @@ -2842,7 +2830,7 @@ render: { .label colline = 6 .label y = 2 // [37] phi from render to render::@1 [phi:render->render::@1] - // [37] phi (byte*) render::colline#5 = (const byte*) COLORS#0 [phi:render->render::@1#0] -- pbuz1=pbuc1 + // [37] phi (byte*) render::colline#5 = (const byte*) COLORS [phi:render->render::@1#0] -- pbuz1=pbuc1 lda #COLORS @@ -2928,7 +2916,7 @@ findcol: { // findcol::@1 b1: // for( byte i=0; iinitscreen::@1] - // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN#0 [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 + // [77] phi (byte*) initscreen::screen#2 = (const byte*) SCREEN [phi:initscreen->initscreen::@1#0] -- pbuz1=pbuc1 lda #SCREEN @@ -3064,7 +3052,7 @@ initscreen: { // initscreen::@1 b1: // for( byte* screen = SCREEN; screenSCREEN+$3e8 bcc b2 @@ -3080,7 +3068,7 @@ initscreen: { // initscreen::@2 b2: // *screen = FILL - // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 -- _deref_pbuz1=vbuc1 + // [80] *((byte*) initscreen::screen#2) ← (const byte) FILL -- _deref_pbuz1=vbuc1 lda #FILL ldy #0 sta (screen),y diff --git a/src/test/ref/voronoi.sym b/src/test/ref/voronoi.sym index b16e8014d..ecd7f9eda 100644 --- a/src/test/ref/voronoi.sym +++ b/src/test/ref/voronoi.sym @@ -1,13 +1,10 @@ (label) @1 (label) @begin (label) @end -(byte*) COLORS -(const byte*) COLORS#0 COLORS = (byte*) 55296 +(const byte*) COLORS COLORS = (byte*) 55296 (const byte[]) COLS COLS = { (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 7 } -(byte) FILL -(const byte) FILL#0 FILL = (byte) $e6 -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(const byte) FILL FILL = (byte) $e6 +(const byte*) SCREEN SCREEN = (byte*) 1024 (const byte[]) XPOS XPOS = { (byte) 5, (byte) $f, (byte) 6, (byte) $22, (byte) $15, (byte) $1f } (const byte[]) YPOS YPOS = { (byte) 5, (byte) 8, (byte) $e, (byte) 2, (byte) $11, (byte) $16 } (void()) animate() @@ -86,8 +83,7 @@ (void()) main() (label) main::@1 (label) main::@2 -(byte) numpoints -(const byte) numpoints#0 numpoints = (byte) 6 +(const byte) numpoints numpoints = (byte) 6 (void()) render() (label) render::@1 (label) render::@2 diff --git a/src/test/ref/word-pointer-math-0.cfg b/src/test/ref/word-pointer-math-0.cfg index 7dd49e255..745a04178 100644 --- a/src/test/ref/word-pointer-math-0.cfg +++ b/src/test/ref/word-pointer-math-0.cfg @@ -10,12 +10,12 @@ (void()) main() main: scope:[main] from @1 - [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) + [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) [5] (byte~) main::$1 ← < (word) main::w1#0 [6] *((const byte*) main::SCREEN) ← (byte~) main::$1 [7] (byte~) main::$2 ← > (word) main::w1#0 [8] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$2 - [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) + [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) [10] (byte~) main::$4 ← < (word) main::w2#0 [11] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$4 [12] (byte~) main::$5 ← > (word) main::w2#0 diff --git a/src/test/ref/word-pointer-math-0.log b/src/test/ref/word-pointer-math-0.log index 809e14417..3e3cef0c7 100644 --- a/src/test/ref/word-pointer-math-0.log +++ b/src/test/ref/word-pointer-math-0.log @@ -8,17 +8,17 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (word*) main::words#0 ← ((word*)) (number) $400 + (word*) main::words ← ((word*)) (number) $400 (byte*) main::SCREEN ← ((byte*)) (number) $400+(number) 6*(number) $28 (number~) main::$6 ← (number) 1 * (const byte) SIZEOF_WORD - (word*~) main::$0 ← (word*) main::words#0 + (number~) main::$6 + (word*~) main::$0 ← (word*) main::words + (number~) main::$6 (word) main::w1#0 ← *((word*~) main::$0) (byte~) main::$1 ← < (word) main::w1#0 *((byte*) main::SCREEN + (number) 0) ← (byte~) main::$1 (byte~) main::$2 ← > (word) main::w1#0 *((byte*) main::SCREEN + (number) 1) ← (byte~) main::$2 (number~) main::$7 ← (number) 2 * (const byte) SIZEOF_WORD - (word*~) main::$3 ← (word*) main::words#0 + (number~) main::$7 + (word*~) main::$3 ← (word*) main::words + (number~) main::$7 (word) main::w2#0 ← *((word*~) main::$3) (byte~) main::$4 ← < (word) main::w2#0 *((byte*) main::SCREEN + (number) 2) ← (byte~) main::$4 @@ -57,7 +57,6 @@ SYMBOL TABLE SSA (word) main::w2 (word) main::w2#0 (word*) main::words -(word*) main::words#0 Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (number) 1 * (const byte) SIZEOF_WORD Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (unumber)(number) 1 * (const byte) SIZEOF_WORD @@ -68,7 +67,7 @@ Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (unum Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 2) ← (byte~) main::$4 Adding number conversion cast (unumber) 3 in *((byte*) main::SCREEN + (number) 3) ← (byte~) main::$5 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (word*) main::words#0 ← (word*)(number) $400 +Inlining cast (word*) main::words ← (word*)(number) $400 Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400+(number) 6*(number) $28 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (word*) 1024 @@ -92,25 +91,25 @@ Constant right-side identified [1] (byte*) main::SCREEN ← (byte*)(number) $400 Constant right-side identified [2] (byte~) main::$6 ← (byte) 1 * (const byte) SIZEOF_WORD Constant right-side identified [9] (byte~) main::$7 ← (byte) 2 * (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word*) main::words#0 = (word*) 1024 +Constant (const word*) main::words = (word*) 1024 Constant (const byte*) main::SCREEN = (byte*)$400+6*$28 Constant (const byte) main::$6 = 1*SIZEOF_WORD Constant (const byte) main::$7 = 2*SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification -Converting *(pointer+n) to pointer[n] [4] (word) main::w1#0 ← *((word*~) main::$0) -- *(main::words#0 + main::$6) -Converting *(pointer+n) to pointer[n] [11] (word) main::w2#0 ← *((word*~) main::$3) -- *(main::words#0 + main::$7) +Converting *(pointer+n) to pointer[n] [4] (word) main::w1#0 ← *((word*~) main::$0) -- *(main::words + main::$6) +Converting *(pointer+n) to pointer[n] [11] (word) main::w2#0 ← *((word*~) main::$3) -- *(main::words + main::$7) Successful SSA optimization Pass2InlineDerefIdx Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← (byte~) main::$1 Successful SSA optimization PassNSimplifyExpressionWithZero -Eliminating unused variable (word*~) main::$0 and assignment [0] (word*~) main::$0 ← (const word*) main::words#0 + (const byte) main::$6 -Eliminating unused variable (word*~) main::$3 and assignment [6] (word*~) main::$3 ← (const word*) main::words#0 + (const byte) main::$7 +Eliminating unused variable (word*~) main::$0 and assignment [0] (word*~) main::$0 ← (const word*) main::words + (const byte) main::$6 +Eliminating unused variable (word*~) main::$3 and assignment [6] (word*~) main::$3 ← (const word*) main::words + (const byte) main::$7 Successful SSA optimization PassNEliminateUnusedVars Constant inlined main::$6 = (byte) 1*(const byte) SIZEOF_WORD Constant inlined main::$7 = (byte) 2*(const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantInlining -Consolidated array index constant in *(main::words#0+1*SIZEOF_WORD) +Consolidated array index constant in *(main::words+1*SIZEOF_WORD) Consolidated array index constant in *(main::SCREEN+1) -Consolidated array index constant in *(main::words#0+2*SIZEOF_WORD) +Consolidated array index constant in *(main::words+2*SIZEOF_WORD) Consolidated array index constant in *(main::SCREEN+2) Consolidated array index constant in *(main::SCREEN+3) Successful SSA optimization Pass2ConstantAdditionElimination @@ -141,12 +140,12 @@ FINAL CONTROL FLOW GRAPH (void()) main() main: scope:[main] from @1 - [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) + [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) [5] (byte~) main::$1 ← < (word) main::w1#0 [6] *((const byte*) main::SCREEN) ← (byte~) main::$1 [7] (byte~) main::$2 ← > (word) main::w1#0 [8] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$2 - [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) + [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) [10] (byte~) main::$4 ← < (word) main::w2#0 [11] *((const byte*) main::SCREEN+(byte) 2) ← (byte~) main::$4 [12] (byte~) main::$5 ← > (word) main::w2#0 @@ -167,7 +166,6 @@ VARIABLE REGISTER WEIGHTS (word) main::w1#0 2.0 (word) main::w2 (word) main::w2#0 2.0 -(word*) main::words Initial phi equivalence classes Added variable main::w1#0 to zero page equivalence class [ main::w1#0 ] @@ -224,7 +222,7 @@ main: { .label _5 = 9 .label w1 = 2 .label w2 = 6 - // [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+1*SIZEOF_WORD sta.z w1 lda words+1*SIZEOF_WORD+1 @@ -241,7 +239,7 @@ main: { // [8] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1 lda.z _2 sta SCREEN+1 - // [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+2*SIZEOF_WORD sta.z w2 lda words+2*SIZEOF_WORD+1 @@ -267,10 +265,10 @@ main: { // File Data REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) [ main::w1#0 ] ( main:2 [ main::w1#0 ] ) always clobbers reg byte a +Statement [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) [ main::w1#0 ] ( main:2 [ main::w1#0 ] ) always clobbers reg byte a Statement [5] (byte~) main::$1 ← < (word) main::w1#0 [ main::w1#0 main::$1 ] ( main:2 [ main::w1#0 main::$1 ] ) always clobbers reg byte a Statement [7] (byte~) main::$2 ← > (word) main::w1#0 [ main::$2 ] ( main:2 [ main::$2 ] ) always clobbers reg byte a -Statement [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) [ main::w2#0 ] ( main:2 [ main::w2#0 ] ) always clobbers reg byte a +Statement [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) [ main::w2#0 ] ( main:2 [ main::w2#0 ] ) always clobbers reg byte a Statement [10] (byte~) main::$4 ← < (word) main::w2#0 [ main::w2#0 main::$4 ] ( main:2 [ main::w2#0 main::$4 ] ) always clobbers reg byte a Statement [12] (byte~) main::$5 ← > (word) main::w2#0 [ main::$5 ] ( main:2 [ main::$5 ] ) always clobbers reg byte a Potential registers zp ZP_WORD:2 [ main::w1#0 ] : zp ZP_WORD:2 , @@ -318,7 +316,7 @@ main: { .label SCREEN = $400+6*$28 .label w1 = 2 .label w2 = 4 - // [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+1*SIZEOF_WORD sta.z w1 lda words+1*SIZEOF_WORD+1 @@ -331,7 +329,7 @@ main: { lda.z w1+1 // [8] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta SCREEN+1 - // [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+2*SIZEOF_WORD sta.z w2 lda words+2*SIZEOF_WORD+1 @@ -386,8 +384,7 @@ FINAL SYMBOL TABLE (word) main::w1#0 w1 zp ZP_WORD:2 2.0 (word) main::w2 (word) main::w2#0 w2 zp ZP_WORD:4 2.0 -(word*) main::words -(const word*) main::words#0 words = (word*) 1024 +(const word*) main::words words = (word*) 1024 zp ZP_WORD:2 [ main::w1#0 ] reg byte a [ main::$1 ] @@ -421,7 +418,7 @@ main: { .label w1 = 2 .label w2 = 4 // w1 = *(words+1) - // [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [4] (word) main::w1#0 ← *((const word*) main::words+(byte) 1*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+1*SIZEOF_WORD sta.z w1 lda words+1*SIZEOF_WORD+1 @@ -439,7 +436,7 @@ main: { // [8] *((const byte*) main::SCREEN+(byte) 1) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa sta SCREEN+1 // w2 = *(words+2) - // [9] (word) main::w2#0 ← *((const word*) main::words#0+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 + // [9] (word) main::w2#0 ← *((const word*) main::words+(byte) 2*(const byte) SIZEOF_WORD) -- vwuz1=_deref_pwuc1 lda words+2*SIZEOF_WORD sta.z w2 lda words+2*SIZEOF_WORD+1 diff --git a/src/test/ref/word-pointer-math-0.sym b/src/test/ref/word-pointer-math-0.sym index c92840d7f..003f5e9e4 100644 --- a/src/test/ref/word-pointer-math-0.sym +++ b/src/test/ref/word-pointer-math-0.sym @@ -13,8 +13,7 @@ (word) main::w1#0 w1 zp ZP_WORD:2 2.0 (word) main::w2 (word) main::w2#0 w2 zp ZP_WORD:4 2.0 -(word*) main::words -(const word*) main::words#0 words = (word*) 1024 +(const word*) main::words words = (word*) 1024 zp ZP_WORD:2 [ main::w1#0 ] reg byte a [ main::$1 ] diff --git a/src/test/ref/word-pointer-math-1.log b/src/test/ref/word-pointer-math-1.log index bf6b59a85..e666cd598 100644 --- a/src/test/ref/word-pointer-math-1.log +++ b/src/test/ref/word-pointer-math-1.log @@ -8,9 +8,9 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (word*) main::w1#0 ← ((word*)) (number) $1000 - (word*) main::w2#0 ← ((word*)) (number) $1140 - (word~) main::$1 ← (word*) main::w2#0 - (word*) main::w1#0 + (word*) main::w1 ← ((word*)) (number) $1000 + (word*) main::w2 ← ((word*)) (number) $1140 + (word~) main::$1 ← (word*) main::w2 - (word*) main::w1 (word~) main::$0 ← (word~) main::$1 / (const byte) SIZEOF_WORD (word) main::wd#0 ← (word~) main::$0 (word*) main::SCREEN ← ((word*)) (number) $400 @@ -38,14 +38,12 @@ SYMBOL TABLE SSA (label) main::@return (word*) main::SCREEN (word*) main::w1 -(word*) main::w1#0 (word*) main::w2 -(word*) main::w2#0 (word) main::wd (word) main::wd#0 -Inlining cast (word*) main::w1#0 ← (word*)(number) $1000 -Inlining cast (word*) main::w2#0 ← (word*)(number) $1140 +Inlining cast (word*) main::w1 ← (word*)(number) $1000 +Inlining cast (word*) main::w2 ← (word*)(number) $1140 Inlining cast (word*) main::SCREEN ← (word*)(number) $400 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (word*) 4096 @@ -54,19 +52,19 @@ Simplifying constant pointer cast (word*) 1024 Successful SSA optimization PassNCastSimplification Alias (word) main::wd#0 = (word~) main::$0 Successful SSA optimization Pass2AliasElimination -Constant (const word*) main::w1#0 = (word*) 4096 -Constant (const word*) main::w2#0 = (word*) 4416 +Constant (const word*) main::w1 = (word*) 4096 +Constant (const word*) main::w2 = (word*) 4416 Constant (const word*) main::SCREEN = (word*) 1024 Successful SSA optimization Pass2ConstantIdentification -Constant right-side identified [0] (word~) main::$1 ← (const word*) main::w2#0 - (const word*) main::w1#0 +Constant right-side identified [0] (word~) main::$1 ← (const word*) main::w2 - (const word*) main::w1 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const word) main::$1 = main::w2#0-main::w1#0 +Constant (const word) main::$1 = main::w2-main::w1 Successful SSA optimization Pass2ConstantIdentification Constant right-side identified [0] (word) main::wd#0 ← (const word) main::$1 / (const byte) SIZEOF_WORD Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const word) main::wd#0 = main::$1/SIZEOF_WORD Successful SSA optimization Pass2ConstantIdentification -Constant inlined main::$1 = (const word*) main::w2#0-(const word*) main::w1#0 +Constant inlined main::$1 = (const word*) main::w2-(const word*) main::w1 Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin Adding NOP phi() at start of @1 @@ -104,8 +102,6 @@ main::@return: scope:[main] from main VARIABLE REGISTER WEIGHTS (void()) main() -(word*) main::w1 -(word*) main::w2 (word) main::wd Initial phi equivalence classes @@ -232,12 +228,10 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (const word*) main::SCREEN SCREEN = (word*) 1024 -(word*) main::w1 -(const word*) main::w1#0 w1 = (word*) 4096 -(word*) main::w2 -(const word*) main::w2#0 w2 = (word*) 4416 +(const word*) main::w1 w1 = (word*) 4096 +(const word*) main::w2 w2 = (word*) 4416 (word) main::wd -(const word) main::wd#0 wd = (const word*) main::w2#0-(const word*) main::w1#0/(const byte) SIZEOF_WORD +(const word) main::wd#0 wd = (const word*) main::w2-(const word*) main::w1/(const byte) SIZEOF_WORD diff --git a/src/test/ref/word-pointer-math-1.sym b/src/test/ref/word-pointer-math-1.sym index 220ad4059..08a92d4c4 100644 --- a/src/test/ref/word-pointer-math-1.sym +++ b/src/test/ref/word-pointer-math-1.sym @@ -5,10 +5,8 @@ (void()) main() (label) main::@return (const word*) main::SCREEN SCREEN = (word*) 1024 -(word*) main::w1 -(const word*) main::w1#0 w1 = (word*) 4096 -(word*) main::w2 -(const word*) main::w2#0 w2 = (word*) 4416 +(const word*) main::w1 w1 = (word*) 4096 +(const word*) main::w2 w2 = (word*) 4416 (word) main::wd -(const word) main::wd#0 wd = (const word*) main::w2#0-(const word*) main::w1#0/(const byte) SIZEOF_WORD +(const word) main::wd#0 wd = (const word*) main::w2-(const word*) main::w1/(const byte) SIZEOF_WORD diff --git a/src/test/ref/zpparammin.cfg b/src/test/ref/zpparammin.cfg index 92cbb54dc..bcee1e1c8 100644 --- a/src/test/ref/zpparammin.cfg +++ b/src/test/ref/zpparammin.cfg @@ -22,7 +22,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 [11] (byte~) main::$2 ← (byte) sum::return#0 - [12] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte~) main::$2 + [12] *((const byte*) SCREEN + (byte) main::i#2) ← (byte~) main::$2 [13] (byte) sum2::b#0 ← (byte) main::i#2 + (byte) 1 [14] (byte) sum2::c#0 ← (byte) main::i#2 + (byte) 2 [15] (byte) sum2::a#0 ← (byte) main::i#2 @@ -31,7 +31,7 @@ main::@2: scope:[main] from main::@1 to:main::@3 main::@3: scope:[main] from main::@2 [18] (byte~) main::$5 ← (byte) sum2::return#0 - [19] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← (byte~) main::$5 + [19] *((const byte*) SCREEN2 + (byte) main::i#2) ← (byte~) main::$5 [20] (byte) main::i#1 ← ++ (byte) main::i#2 [21] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return diff --git a/src/test/ref/zpparammin.log b/src/test/ref/zpparammin.log index fd53a4616..2b1799895 100644 --- a/src/test/ref/zpparammin.log +++ b/src/test/ref/zpparammin.log @@ -8,8 +8,8 @@ Culled Empty Block (label) sum2::@1 CONTROL FLOW GRAPH SSA @begin: scope:[] from - (byte*) SCREEN#0 ← ((byte*)) (number) $400 - (byte*) SCREEN2#0 ← ((byte*)) (number) $400+(number) $28 + (byte*) SCREEN ← ((byte*)) (number) $400 + (byte*) SCREEN2 ← ((byte*)) (number) $400+(number) $28 to:@3 (void()) main() @@ -30,7 +30,7 @@ main::@3: scope:[main] from main::@1 (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) (byte) sum::return#3 ← phi( main::@1/(byte) sum::return#0 ) (byte~) main::$2 ← (byte) sum::return#3 - *((byte*) SCREEN#0 + (byte) main::i#3) ← (byte~) main::$2 + *((byte*) SCREEN + (byte) main::i#3) ← (byte~) main::$2 (number~) main::$3 ← (byte) main::i#3 + (number) 1 (number~) main::$4 ← (byte) main::i#3 + (number) 2 (byte) sum2::a#0 ← (byte) main::i#3 @@ -43,7 +43,7 @@ main::@4: scope:[main] from main::@3 (byte) main::i#4 ← phi( main::@3/(byte) main::i#3 ) (byte) sum2::return#3 ← phi( main::@3/(byte) sum2::return#0 ) (byte~) main::$5 ← (byte) sum2::return#3 - *((byte*) SCREEN2#0 + (byte) main::i#4) ← (byte~) main::$5 + *((byte*) SCREEN2 + (byte) main::i#4) ← (byte~) main::$5 (byte) main::i#1 ← (byte) main::i#4 + rangenext(0,$a) (bool~) main::$6 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$6) goto main::@1 @@ -94,9 +94,7 @@ SYMBOL TABLE SSA (label) @begin (label) @end (byte*) SCREEN -(byte*) SCREEN#0 (byte*) SCREEN2 -(byte*) SCREEN2#0 (void()) main() (number~) main::$0 (number~) main::$1 @@ -163,8 +161,8 @@ Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte Adding number conversion cast (unumber) 2 in (number~) main::$4 ← (byte) main::i#3 + (number) 2 Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte) main::i#3 + (unumber)(number) 2 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 -Inlining cast (byte*) SCREEN2#0 ← (byte*)(number) $400+(number) $28 +Inlining cast (byte*) SCREEN ← (byte*)(number) $400 +Inlining cast (byte*) SCREEN2 ← (byte*)(number) $400+(number) $28 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 1024 Simplifying constant integer cast 1 @@ -200,10 +198,10 @@ Identical Phi Values (byte) sum2::c#1 (byte) sum2::c#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) main::$6 [26] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant right-side identified [1] (byte*) SCREEN2#0 ← (byte*)(number) $400+(number) $28 +Constant right-side identified [1] (byte*) SCREEN2 ← (byte*)(number) $400+(number) $28 Successful SSA optimization Pass2ConstantRValueConsolidation -Constant (const byte*) SCREEN#0 = (byte*) 1024 -Constant (const byte*) SCREEN2#0 = (byte*)$400+$28 +Constant (const byte*) SCREEN = (byte*) 1024 +Constant (const byte*) SCREEN2 = (byte*)$400+$28 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value [24] main::i#1 ← ++ main::i#2 to ++ @@ -265,7 +263,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 [11] (byte~) main::$2 ← (byte) sum::return#0 - [12] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte~) main::$2 + [12] *((const byte*) SCREEN + (byte) main::i#2) ← (byte~) main::$2 [13] (byte) sum2::b#0 ← (byte) main::i#2 + (byte) 1 [14] (byte) sum2::c#0 ← (byte) main::i#2 + (byte) 2 [15] (byte) sum2::a#0 ← (byte) main::i#2 @@ -274,7 +272,7 @@ main::@2: scope:[main] from main::@1 to:main::@3 main::@3: scope:[main] from main::@2 [18] (byte~) main::$5 ← (byte) sum2::return#0 - [19] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← (byte~) main::$5 + [19] *((const byte*) SCREEN2 + (byte) main::i#2) ← (byte~) main::$5 [20] (byte) main::i#1 ← ++ (byte) main::i#2 [21] if((byte) main::i#1!=(byte) $b) goto main::@1 to:main::@return @@ -302,8 +300,6 @@ sum::@return: scope:[sum] from sum VARIABLE REGISTER WEIGHTS -(byte*) SCREEN -(byte*) SCREEN2 (void()) main() (byte~) main::$2 22.0 (byte~) main::$5 22.0 @@ -447,7 +443,7 @@ main: { // [11] (byte~) main::$2 ← (byte) sum::return#0 -- vbuz1=vbuz2 lda.z sum.return sta.z _2 - // [12] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuz2 + // [12] *((const byte*) SCREEN + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _2 ldy.z i sta SCREEN,y @@ -474,7 +470,7 @@ main: { // [18] (byte~) main::$5 ← (byte) sum2::return#0 -- vbuz1=vbuz2 lda.z sum2.return sta.z _5 - // [19] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuz2 + // [19] *((const byte*) SCREEN2 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z _5 ldy.z i sta SCREEN2,y @@ -650,7 +646,7 @@ main: { // main::@2 b2: // [11] (byte~) main::$2 ← (byte) sum::return#0 - // [12] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuaa + // [12] *((const byte*) SCREEN + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z i sta SCREEN,y // [13] (byte) sum2::b#0 ← (byte) main::i#2 + (byte) 1 -- vbuaa=vbuz1_plus_1 @@ -670,7 +666,7 @@ main: { // main::@3 b3: // [18] (byte~) main::$5 ← (byte) sum2::return#0 - // [19] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuaa + // [19] *((const byte*) SCREEN2 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z i sta SCREEN2,y // [20] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 @@ -761,10 +757,8 @@ FINAL SYMBOL TABLE (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*)(number) $400+(number) $28 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*)(number) $400+(number) $28 (void()) main() (byte~) main::$2 reg byte a 22.0 (byte~) main::$5 reg byte a 22.0 @@ -863,7 +857,7 @@ main: { // main::@2 // [11] (byte~) main::$2 ← (byte) sum::return#0 // SCREEN[i] = sum(i,i+1,i+2) - // [12] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuaa + // [12] *((const byte*) SCREEN + (byte) main::i#2) ← (byte~) main::$2 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z i sta SCREEN,y // sum2(i,i+1,i+2) @@ -882,7 +876,7 @@ main: { // main::@3 // [18] (byte~) main::$5 ← (byte) sum2::return#0 // SCREEN2[i] = sum2(i,i+1,i+2) - // [19] *((const byte*) SCREEN2#0 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuaa + // [19] *((const byte*) SCREEN2 + (byte) main::i#2) ← (byte~) main::$5 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z i sta SCREEN2,y // for(byte i : 0..10) diff --git a/src/test/ref/zpparammin.sym b/src/test/ref/zpparammin.sym index 1df2074e7..4ed5b73f9 100644 --- a/src/test/ref/zpparammin.sym +++ b/src/test/ref/zpparammin.sym @@ -1,10 +1,8 @@ (label) @1 (label) @begin (label) @end -(byte*) SCREEN -(const byte*) SCREEN#0 SCREEN = (byte*) 1024 -(byte*) SCREEN2 -(const byte*) SCREEN2#0 SCREEN2 = (byte*)(number) $400+(number) $28 +(const byte*) SCREEN SCREEN = (byte*) 1024 +(const byte*) SCREEN2 SCREEN2 = (byte*)(number) $400+(number) $28 (void()) main() (byte~) main::$2 reg byte a 22.0 (byte~) main::$5 reg byte a 22.0 diff --git a/src/test/ref/zpptr.cfg b/src/test/ref/zpptr.cfg index 56e224a64..86d6c87b4 100644 --- a/src/test/ref/zpptr.cfg +++ b/src/test/ref/zpptr.cfg @@ -20,7 +20,7 @@ main::@2: scope:[main] from main::@1 main::@4 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [7] (byte) main::k#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::k#1 ) - [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr#0 + (byte) main::i#4 + [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 [9] (word) main::w#0 ← (word)(byte) main::j#6 [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 diff --git a/src/test/ref/zpptr.log b/src/test/ref/zpptr.log index f3619b708..e96eb28e2 100644 --- a/src/test/ref/zpptr.log +++ b/src/test/ref/zpptr.log @@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA (void()) main() main: scope:[main] from @1 - (byte*) main::zpptr#0 ← ((byte*)) (number) $1000 + (byte*) main::zpptr ← ((byte*)) (number) $1000 (byte) main::j#0 ← (byte) 0 to:main::@1 main::@1: scope:[main] from main main::@5 @@ -23,7 +23,7 @@ main::@3: scope:[main] from main::@2 main::@3 (byte) main::k#2 ← phi( main::@2/(byte) main::k#0 main::@3/(byte) main::k#1 ) (byte) main::j#2 ← phi( main::@2/(byte) main::j#4 main::@3/(byte) main::j#2 ) (byte) main::i#2 ← phi( main::@2/(byte) main::i#4 main::@3/(byte) main::i#2 ) - (byte*~) main::$0 ← (byte*) main::zpptr#0 + (byte) main::i#2 + (byte*~) main::$0 ← (byte*) main::zpptr + (byte) main::i#2 (byte*) main::zpptr2#0 ← (byte*~) main::$0 (word~) main::$1 ← ((word)) (byte) main::j#2 (word) main::w#0 ← (word~) main::$1 @@ -96,12 +96,11 @@ SYMBOL TABLE SSA (word) main::w (word) main::w#0 (byte*) main::zpptr -(byte*) main::zpptr#0 (byte*) main::zpptr2 (byte*) main::zpptr2#0 (byte*) main::zpptr2#1 -Inlining cast (byte*) main::zpptr#0 ← (byte*)(number) $1000 +Inlining cast (byte*) main::zpptr ← (byte*)(number) $1000 Inlining cast (word~) main::$1 ← (word)(byte) main::j#2 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 4096 @@ -121,7 +120,7 @@ Simple Condition (bool~) main::$3 [16] if((byte) main::k#1!=rangelast(0,$a)) got Simple Condition (bool~) main::$4 [20] if((byte) main::i#1!=rangelast(0,$a)) goto main::@2 Simple Condition (bool~) main::$5 [24] if((byte) main::j#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant (const byte*) main::zpptr#0 = (byte*) 4096 +Constant (const byte*) main::zpptr = (byte*) 4096 Constant (const byte) main::j#0 = 0 Constant (const byte) main::i#0 = 0 Constant (const byte) main::k#0 = 0 @@ -199,7 +198,7 @@ main::@2: scope:[main] from main::@1 main::@4 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 [7] (byte) main::k#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::k#1 ) - [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr#0 + (byte) main::i#4 + [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 [9] (word) main::w#0 ← (word)(byte) main::j#6 [10] (byte*) main::zpptr2#1 ← (byte*) main::zpptr2#0 + (word) main::w#0 [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 @@ -232,7 +231,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::k#2 600.5999999999999 (word) main::w (word) main::w#0 2002.0 -(byte*) main::zpptr (byte*) main::zpptr2 (byte*) main::zpptr2#0 1001.0 (byte*) main::zpptr2#1 2002.0 @@ -327,7 +325,7 @@ main: { jmp b3 // main::@3 b3: - // [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr#0 + (byte) main::i#4 -- pbuz1=pbuc1_plus_vbuz2 + // [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr + (byte) main::i#4 -- pbuz1=pbuc1_plus_vbuz2 lda.z i clc adc #