From 8a1dbc36d73d8841e6254900f6630e86042efed0 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Wed, 27 Dec 2017 13:40:55 +0100 Subject: [PATCH] Refactored recursive value replacement into ValueReplacer. Moved VariableReplacer to a simple ValueReplacer. Added test for true inline word constructors. --- .../java/dk/camelot64/kickc/Compiler.java | 2 +- .../kickc/fragment/AsmFragmentManager.java | 49 +- .../camelot64/kickc/passes/AliasReplacer.java | 95 ++ .../passes/Pass1ExtractInlineStrings.java | 18 +- ...ss1GenerateSingleStaticAssignmentForm.java | 20 +- .../Pass2ConstantAdditionElimination.java | 12 +- .../passes/Pass2ConstantIdentification.java | 59 +- .../kickc/passes/Pass2ConstantInlining.java | 8 +- ...ors.java => Pass2FixWordConstructors.java} | 14 +- .../kickc/passes/Pass2SsaOptimization.java | 4 +- .../camelot64/kickc/passes/ValueReplacer.java | 337 ++++ .../kickc/passes/VariableReplacer.java | 394 ----- .../dk/camelot64/kickc/test/TestPrograms.java | 4 + .../dk/camelot64/kickc/test/inline-word.kc | 4 +- .../kickc/test/ref/bitmap-bresenham.log | 429 ++++- .../kickc/test/ref/incrementinarray.log | 34 - .../camelot64/kickc/test/ref/inline-word.log | 60 +- .../dk/camelot64/kickc/test/ref/printmsg.cfg | 8 +- .../dk/camelot64/kickc/test/ref/printmsg.log | 452 ++--- .../dk/camelot64/kickc/test/ref/printmsg.sym | 2 +- .../camelot64/kickc/test/ref/sinus-basic.cfg | 8 +- .../camelot64/kickc/test/ref/sinus-basic.log | 827 +++++---- .../camelot64/kickc/test/ref/sinus-basic.sym | 2 +- .../kickc/test/ref/sinus-sprites.cfg | 8 +- .../kickc/test/ref/sinus-sprites.log | 1477 +++++++++++------ .../kickc/test/ref/sinus-sprites.sym | 2 +- .../camelot64/kickc/test/true-inline-words.kc | 10 + 27 files changed, 2775 insertions(+), 1564 deletions(-) create mode 100644 src/main/java/dk/camelot64/kickc/passes/AliasReplacer.java rename src/main/java/dk/camelot64/kickc/passes/{Pass1FixWordConstructors.java => Pass2FixWordConstructors.java} (82%) create mode 100644 src/main/java/dk/camelot64/kickc/passes/ValueReplacer.java delete mode 100644 src/main/java/dk/camelot64/kickc/passes/VariableReplacer.java create mode 100644 src/main/java/dk/camelot64/kickc/test/true-inline-words.kc diff --git a/src/main/java/dk/camelot64/kickc/Compiler.java b/src/main/java/dk/camelot64/kickc/Compiler.java index b1ddc0ac4..aa15f25a2 100644 --- a/src/main/java/dk/camelot64/kickc/Compiler.java +++ b/src/main/java/dk/camelot64/kickc/Compiler.java @@ -125,7 +125,6 @@ public class Compiler { new Pass1EliminateUncalledProcedures(program).execute(); new Pass1EliminateUnusedVars(program).execute(); new Pass1ExtractInlineStrings(program).execute(); - new Pass1FixWordConstructors(program).execute(); new Pass1EliminateEmptyBlocks(program).execute(); getLog().append("CONTROL FLOW GRAPH"); @@ -181,6 +180,7 @@ public class Compiler { optimizations.add(new Pass2ConditionalJumpSimplification(program)); optimizations.add(new Pass2ConstantIdentification(program)); optimizations.add(new Pass2ConstantAdditionElimination(program)); + optimizations.add(new Pass2FixWordConstructors(program)); pass2OptimizeSSA(optimizations); // Constant inlining optimizations - as the last step to ensure that constant identification has been completed diff --git a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentManager.java b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentManager.java index 5eb9b6233..518216cfd 100644 --- a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentManager.java +++ b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentManager.java @@ -20,7 +20,7 @@ import java.util.regex.Pattern; */ public class AsmFragmentManager { - static boolean verboseFragmentLog = true; + static boolean verboseFragmentLog = false; /** * Cache for fragment files. Maps signature to the parsed file. @@ -155,33 +155,33 @@ public class AsmFragmentManager { synths.add(new FragmentSynthesis("(.*)=_deref_vwuc1(.*)", ".*=.*aa.*", "lda {c1}\n", "$1=vbuaa$2", null, mapC)); synths.add(new FragmentSynthesis("(.*)=_deref_pb(.)z1(.*)", ".*z1.*z1.*|.*=.*aa.*|.*=.*yy.*", "ldy #0\n" + "lda ({z1}),y\n", "$1=vb$2aa$3", null, mapZ)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*|.*c1.*c1.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, mapC)); - synths.add(new FragmentSynthesis("(.*)=(.*c1.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuxx(.*c1.*)", ".*=.*aa.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuyy(.*)", ".*=.*aa.*|.*c1.*c1.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, mapC)); - synths.add(new FragmentSynthesis("(.*)=(.*c1.*)pb(.)c1_derefidx_vbuyy(.*)", ".*=.*aa.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuyy(.*c1.*)", ".*=.*aa.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, null)); - - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuxx(.*)", ".*=.*aa.*|.*c2.*c2.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, mapC3)); - synths.add(new FragmentSynthesis("(.*)=(.*c2.*)pb(.)c2_derefidx_vbuxx(.*)", ".*=.*aa.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuxx(.*c2.*)", ".*=.*aa.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuyy(.*)", ".*=.*aa.*|.*c2.*c2.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, mapC3)); - synths.add(new FragmentSynthesis("(.*)=(.*c2.*)pb(.)c2_derefidx_vbuyy(.*)", ".*=.*aa.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, null)); - synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuyy(.*c2.*)", ".*=.*aa.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, null)); - + // Convert array indexing with A register to X/Y register by prefixing tax/tay (..._derefidx_vbuaa... -> ..._derefidx_vbuxx... /... _derefidx_vbuyy... ) synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuaa(.*)", ".*=.*xx.*", "tax\n", "$1=$2_derefidx_vbuxx$3", null, null)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuaa(.*)", ".*=.*yy.*", "tay\n", "$1=$2_derefidx_vbuyy$3", null, null)); + // Convert array indexing with zero page to x/y register by prefixing ldx z1 / ldy z1 ( ..._derefidx_vbuzn... -> ..._derefidx_vbuxx... / ..._derefidx_vbuyy... ) synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz1(.*)", ".*=.*xx.*|.*z1.*z1.*", "ldx {z1}\n", "$1=$2_derefidx_vbuxx$3", null, mapZ)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz1(.*)", ".*=.*yy.*|.*z1.*z1.*", "ldy {z1}\n", "$1=$2_derefidx_vbuyy$3", null, mapZ)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz2(.*)", ".*=.*xx.*|.*z2.*z2.*", "ldx {z2}\n", "$1=$2_derefidx_vbuxx$3", null, mapZ3)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz2(.*)", ".*=.*yy.*|.*z2.*z2.*", "ldy {z2}\n", "$1=$2_derefidx_vbuyy$3", null, mapZ3)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz3(.*)", ".*=.*yy.*", "ldy {z3}\n", "$1=$2_derefidx_vbuyy$3", null, null)); synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz3(.*)", ".*=.*xx.*", "ldx {z3}\n", "$1=$2_derefidx_vbuxx$3", null, null)); - synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*xx.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z1}\n", mapZ)); synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*yy.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z1}\n", mapZ)); synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*xx.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z2}\n", mapZ)); synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*yy.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z2}\n", mapZ)); + // Convert X/Y-based array indexing of a constant pointer into A-register by prefixing lda cn,x / lda cn,y ( ...pb.c1_derefidx_vbuxx... / ...pb.c1_derefidx_vbuyy... -> ...vb.aa... ) + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*|.*c1.*c1.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, mapC)); + synths.add(new FragmentSynthesis("(.*)=(.*c1.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuxx(.*c1.*)", ".*=.*aa.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuyy(.*)", ".*=.*aa.*|.*c1.*c1.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, mapC)); + synths.add(new FragmentSynthesis("(.*)=(.*c1.*)pb(.)c1_derefidx_vbuyy(.*)", ".*=.*aa.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuyy(.*c1.*)", ".*=.*aa.*", "lda {c1},y\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuxx(.*)", ".*=.*aa.*|.*c2.*c2.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, mapC3)); + synths.add(new FragmentSynthesis("(.*)=(.*c2.*)pb(.)c2_derefidx_vbuxx(.*)", ".*=.*aa.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuxx(.*c2.*)", ".*=.*aa.*", "lda {c2},x\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuyy(.*)", ".*=.*aa.*|.*c2.*c2.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, mapC3)); + synths.add(new FragmentSynthesis("(.*)=(.*c2.*)pb(.)c2_derefidx_vbuyy(.*)", ".*=.*aa.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, null)); + synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c2_derefidx_vbuyy(.*c2.*)", ".*=.*aa.*", "lda {c2},y\n", "$1=$2vb$3aa$4", null, null)); synths.add(new FragmentSynthesis("(.*)=(.*)_vbuxx", ".*=.*[ax][ax].*xx|.*derefidx_vb.xx", "txa\n", "$1=$2_vbuaa", null, null)); synths.add(new FragmentSynthesis("(.*)=(.*)_vbsxx", ".*=.*[ax][ax].*xx|.*derefidx_vb.xx", "txa\n", "$1=$2_vbsaa", null, null)); @@ -229,30 +229,31 @@ public class AsmFragmentManager { synths.add(new FragmentSynthesis("p..z1=(.*)_(sethi|setlo|plus|minus)_(.*)", null, null, "vwuz1=$1_$2_$3", null, null)); synths.add(new FragmentSynthesis("(.*)=p..z(.)_(sethi|setlo|plus|minus)_(.*)", null, null, "$1=vwuz$2_$3_$4", null, null)); + // Use unsigned ASM to synthesize signed ASM ( ...vbs... -> ...vbu... ) synths.add(new FragmentSynthesis("(vbsz.|vbsaa|vbsxx|vbsyy)_(eq|neq)_(vbsz.|vbsc.|vbsaa|vbsxx|vbsyy)_then_(.*)", null, null, "$1_$2_$3_then_$4", null, mapSToU)); synths.add(new FragmentSynthesis("(vbsz.|vbsaa|vbsxx|vbsyy)=(vbsz.|vbsc.|vbsaa|vbsxx|vbsyy)", null, null, "$1=$2", null, mapSToU)); synths.add(new FragmentSynthesis("(vbsz.|vbsaa|vbsxx|vbsyy)=(vbsz.|vbsc.|vbsaa|vbsxx|vbsyy)_(plus|band|bxor|bor)_(vbsz.|csoby.|vbsaa|vbsxx|vbsyy)", null, null, "$1=$2_$3_$4", null, mapSToU)); synths.add(new FragmentSynthesis("(vbsz.|vbsaa|vbsxx|vbsyy)=_(inc|dec)_(vbsz.|vbsc.|vbsaa|vbsxx|vbsyy)", null, null, "$1=_$2_$3", null, mapSToU)); - synths.add(new FragmentSynthesis("(vwsz.)=(vwsz.|vwsc.)", null, null, "$1=$2", null, mapSToU)); synths.add(new FragmentSynthesis("(vwsz.)=(vwsz.|vwsc.)_(plus|band|bxor|bor)_(vwsz.|vwsc.)", null, null, "$1=$2_$3_$4", null, mapSToU)); + synths.add(new FragmentSynthesis("(vbuz.|vbuaa|vbuxx|vbuyy)=_(lo|hi)_vws(z.|c.)", null, null, "$1=_$2_vwu$3", null, mapSToU)); + // Use constant word ASM to synthesize unsigned constant byte ASM ( ...vb.c... -> vw.c... ) synths.add(new FragmentSynthesis("(vwuz.)=(vwuz.)_(plus|minus|band|bxor|bor)_vb.c(.)", null, null, "$1=$2_$3_vwuc$4", null, null)); synths.add(new FragmentSynthesis("(vwuz.)=vb.c(.)_(plus|minus|band|bxor|bor)_(vwuz.)", null, null, "$1=vwuc$2_$3_$4", null, null)); synths.add(new FragmentSynthesis("(vwsz.)=(vwsz.)_(plus|minus|band|bxor|bor)_vb.c(.)", null, null, "$1=$2_$3_vwsc$4", null, null)); synths.add(new FragmentSynthesis("(vwsz.)=vb.c(.)_(plus|minus|band|bxor|bor)_(vwsz.)", null, null, "$1=vwsc$2_$3_$4", null, null)); + // Move constant words to the end of the ASM signature for symmetric operators ( ...vw.c...vw.z... -> ...vw.z...vw.c... ) synths.add(new FragmentSynthesis("(vwuz.)=(vwuc.)_(plus|band|bxor|bor)_(vwuz.)", null, null, "$1=$4_$3_$2", null, null)); synths.add(new FragmentSynthesis("(vwsz.)=(vwsc.)_(plus|band|bxor|bor)_(vwsz.)", null, null, "$1=$4_$3_$2", null, null)); - synths.add(new FragmentSynthesis("(vbuz.|vbuaa|vbuxx|vbuyy)=_(lo|hi)_vws(z.|c.)", null, null, "$1=_$2_vwu$3", null, mapSToU)); + // Use Z1/Z2 ASM to synthesize Z1-only code ( ...z1...z1... -> ...z1...z2... ) + synths.add(new FragmentSynthesis("(v..)z1=(v..)z1_(plus|minus|band|bxor|bor)_(.*)", ".*z2.*", null, "$1z1=$2z2_$3_$4", null, mapZ, false)); + synths.add(new FragmentSynthesis("(v..)z1=(.*)_(plus|minus|band|bxor|bor)_(v..)z1", ".*z2.*", null, "$1z1=$2_$3_$4z2", null, mapZ, false)); + synths.add(new FragmentSynthesis("(v..)z1=_(neg|lo|hi)_(v..)z1", ".*z2.*", null, "$1z1=_$2_$3z2", null, mapZ, false)); - // Use Z1/Z2 ASM to synthesize Z1-only code - synths.add(new FragmentSynthesis("(v..)z1=(v..)z1_(plus|minus|band|bxor|bor)_(.*)", null, null, "$1z1=$2z2_$3_$4", null, mapZ, false)); - synths.add(new FragmentSynthesis("(v..)z1=(.*)_(plus|minus|band|bxor|bor)_(v..)z1", null, null, "$1z1=$2_$3_$4z2", null, mapZ, false)); - synths.add(new FragmentSynthesis("(v..)z1=_(neg|lo|hi)_(v..)z1", null, null, "$1z1=_$2_$3z2", null, mapZ, false)); - - // INC/DEC from +1 / -1 + // Convert INC/DEC to +1/-1 ( ..._inc_xxx... -> ...xxx_plus_1_... / ..._dec_xxx... -> ...xxx_minus_1_... ) synths.add(new FragmentSynthesis("vb(.)aa=_inc_(.*)", null, null, "vb$1aa=$2_plus_1", null, null)); synths.add(new FragmentSynthesis("vb(.)aa=_dec_(.*)", null, null, "vb$1aa=$2_minus_1", null, null)); diff --git a/src/main/java/dk/camelot64/kickc/passes/AliasReplacer.java b/src/main/java/dk/camelot64/kickc/passes/AliasReplacer.java new file mode 100644 index 000000000..b6054351c --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/passes/AliasReplacer.java @@ -0,0 +1,95 @@ +package dk.camelot64.kickc.passes; + +import dk.camelot64.kickc.model.*; + +import java.util.ArrayList; +import java.util.Map; + +/** A {@link ValueReplacer} that replaces symbols with their alias. */ +public class AliasReplacer implements ValueReplacer.Replacer { + + private Map aliases; + + public AliasReplacer(Map aliases) { + this.aliases = aliases; + } + + /** + * Get the alias to use for an RValue. + * Also looks inside any constant values for replacements. + * If a replacement is found the replacement is performed and the new value is returned. If no replacement is found null is returned. + * + * @param rValue The RValue to find an alias for + * @return The alias to use. Null if no alias exists. + */ + public static RValue getReplacement(RValue rValue, Map aliases) { + if (rValue instanceof SymbolRef) { + RValue alias = aliases.get(rValue); + if (alias != null) { + if (alias.equals(rValue)) { + return alias; + } + RValue replacement = getReplacement(alias, aliases); + if (replacement != null) { + return replacement; + } else { + return alias; + } + } + } else if (rValue instanceof ConstantUnary) { + ConstantUnary constantUnary = (ConstantUnary) rValue; + ConstantValue alias = (ConstantValue) getReplacement(constantUnary.getOperand(), aliases); + if (alias != null) { + return new ConstantUnary(constantUnary.getOperator(), alias); + } + } else if (rValue instanceof ConstantBinary) { + ConstantBinary constantBinary = (ConstantBinary) rValue; + ConstantValue aliasLeft = (ConstantValue) getReplacement(constantBinary.getLeft(), aliases); + ConstantValue aliasRight = (ConstantValue) getReplacement(constantBinary.getRight(), aliases); + if (aliasLeft != null || aliasRight != null) { + if (aliasLeft == null) { + aliasLeft = constantBinary.getLeft(); + } + if (aliasRight == null) { + aliasRight = constantBinary.getRight(); + } + return new ConstantBinary(aliasLeft, constantBinary.getOperator(), aliasRight); + } + } else if (rValue instanceof ConstantArray) { + ConstantArray constantArray = (ConstantArray) rValue; + ArrayList replacementList = new ArrayList<>(); + boolean any = false; + for (ConstantValue elemValue : constantArray.getElements()) { + RValue elemReplacement = getReplacement(elemValue, aliases); + if (elemReplacement != null) { + replacementList.add((ConstantValue) elemReplacement); + any = true; + } else { + replacementList.add(elemValue); + } + } + if (any) { + return new ConstantArray(replacementList, constantArray.getElementType()); + } + } + + // No replacement found - return null + return null; + + } + + @Override + /** + * Execute alias replacement on a replaceable value + * @param replaceable The replaceable value + */ + public void execute(ValueReplacer.ReplaceableValue replaceable) { + if (replaceable.get() != null) { + RValue replacement = getReplacement(replaceable.get(), aliases); + if (replacement != null) { + replaceable.set(replacement); + } + } + } + +} diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1ExtractInlineStrings.java b/src/main/java/dk/camelot64/kickc/passes/Pass1ExtractInlineStrings.java index c970eaf10..5c6199f1c 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1ExtractInlineStrings.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1ExtractInlineStrings.java @@ -27,7 +27,7 @@ public class Pass1ExtractInlineStrings extends Pass1Base { int size = parameters.size(); for (int i = 0; i < size; i++) { String parameterName = procedure.getParameterNames().get(i); - execute(new VariableReplacer.ReplacableCallParameter(call, i), blockScope, parameterName); + execute(new ValueReplacer.ReplaceableCallParameter(call, i), blockScope, parameterName); } } else if (statement instanceof StatementAssignment) { StatementAssignment assignment = (StatementAssignment) statement; @@ -39,23 +39,23 @@ public class Pass1ExtractInlineStrings extends Pass1Base { // This will be picked up later as a constant - the temporary constant variable is not needed continue; } - execute(new VariableReplacer.ReplacableRValue1(assignment), blockScope, null); - execute(new VariableReplacer.ReplacableRValue2(assignment), blockScope, null); + execute(new ValueReplacer.ReplaceableRValue1(assignment), blockScope, null); + execute(new ValueReplacer.ReplaceableRValue2(assignment), blockScope, null); } else if (statement instanceof StatementReturn) { - execute(new VariableReplacer.ReplacableReturn((StatementReturn) statement), blockScope, null); + execute(new ValueReplacer.ReplaceableReturn((StatementReturn) statement), blockScope, null); } } } return false; } - private void execute(VariableReplacer.ReplacableValue replacable, Scope blockScope, String nameHint) { - RValue value = replacable.get(); + private void execute(ValueReplacer.ReplaceableValue replaceable, Scope blockScope, String nameHint) { + RValue value = replaceable.get(); if(value instanceof ConstantString) { - ConstantVar strConst = createStringConstantVar(blockScope, (ConstantString) replacable.get(), nameHint); - replacable.set(strConst.getRef()); + ConstantVar strConst = createStringConstantVar(blockScope, (ConstantString) replaceable.get(), nameHint); + replaceable.set(strConst.getRef()); } - for (VariableReplacer.ReplacableValue subValue : replacable.getSubValues()) { + for (ValueReplacer.ReplaceableValue subValue : replaceable.getSubValues()) { execute(subValue, blockScope, nameHint); } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java index 4b4835c9a..67dbe03dc 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java @@ -65,22 +65,22 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { } /** - * Version all variable uses in the replacable value + * Version all variable uses in the replaceable value * - * @param replacableValue The value to version variable usages in + * @param replaceableValue The value to version variable usages in * @param blockVersions Newest version of variables in the block. * @param blockNewPhis New phi functions introduced in the block to create versions of variables. */ private void execute( - VariableReplacer.ReplacableValue replacableValue, + ValueReplacer.ReplaceableValue replaceableValue, Map blockVersions, Map blockNewPhis) { - RValue value = replacableValue.get(); + RValue value = replaceableValue.get(); VariableVersion version = findOrCreateVersion(value, blockVersions, blockNewPhis); if (version != null) { - replacableValue.set(version.getRef()); + replaceableValue.set(version.getRef()); } - for (VariableReplacer.ReplacableValue subValue : replacableValue.getSubValues()) { + for (ValueReplacer.ReplaceableValue subValue : replaceableValue.getSubValues()) { execute(subValue, blockVersions, blockNewPhis); } } @@ -96,12 +96,12 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { Map blockNewPhis = new LinkedHashMap<>(); for (Statement statement : block.getStatements()) { if (statement instanceof StatementReturn) { - execute(new VariableReplacer.ReplacableReturn((StatementReturn) statement), blockVersions, blockNewPhis); + execute(new ValueReplacer.ReplaceableReturn((StatementReturn) statement), blockVersions, blockNewPhis); } else if (statement instanceof StatementAssignment) { StatementAssignment assignment = (StatementAssignment) statement; - execute(new VariableReplacer.ReplacableRValue1(assignment), blockVersions, blockNewPhis); - execute(new VariableReplacer.ReplacableRValue2(assignment), blockVersions, blockNewPhis); - execute(new VariableReplacer.ReplacableLValue(assignment), blockVersions, blockNewPhis); + execute(new ValueReplacer.ReplaceableRValue1(assignment), blockVersions, blockNewPhis); + execute(new ValueReplacer.ReplaceableRValue2(assignment), blockVersions, blockNewPhis); + execute(new ValueReplacer.ReplaceableLValue(assignment), blockVersions, blockNewPhis); // Update map of versions encountered in the block LValue lValue = assignment.getlValue(); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java index 1501dce2f..4909884ff 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java @@ -39,13 +39,13 @@ public class Pass2ConstantAdditionElimination extends Pass2SsaOptimization { if (statement instanceof StatementAssignment) { StatementAssignment assignment = (StatementAssignment) statement; if(assignment.getlValue() instanceof PointerDereferenceIndexed) { - optimized |= optimizePointerDereferenceIndexed(new VariableReplacer.ReplacableLValue(assignment)); + optimized |= optimizePointerDereferenceIndexed(new ValueReplacer.ReplaceableLValue(assignment)); } if(assignment.getrValue1() instanceof PointerDereferenceIndexed) { - optimized |= optimizePointerDereferenceIndexed(new VariableReplacer.ReplacableRValue1(assignment)); + optimized |= optimizePointerDereferenceIndexed(new ValueReplacer.ReplaceableRValue1(assignment)); } if(assignment.getrValue2() instanceof PointerDereferenceIndexed) { - optimized |= optimizePointerDereferenceIndexed(new VariableReplacer.ReplacableRValue2(assignment)); + optimized |= optimizePointerDereferenceIndexed(new ValueReplacer.ReplaceableRValue2(assignment)); } Operator operator = assignment.getOperator(); @@ -62,10 +62,10 @@ public class Pass2ConstantAdditionElimination extends Pass2SsaOptimization { } else if(statement instanceof StatementConditionalJump) { StatementConditionalJump jump = (StatementConditionalJump) statement; if(jump.getrValue1() instanceof PointerDereferenceIndexed) { - optimized |= optimizePointerDereferenceIndexed(new VariableReplacer.ReplacableCondRValue1(jump)); + optimized |= optimizePointerDereferenceIndexed(new ValueReplacer.ReplaceableCondRValue1(jump)); } if(jump.getrValue2() instanceof PointerDereferenceIndexed) { - optimized |= optimizePointerDereferenceIndexed(new VariableReplacer.ReplacableCondRValue2(jump)); + optimized |= optimizePointerDereferenceIndexed(new ValueReplacer.ReplaceableCondRValue2(jump)); } } } @@ -73,7 +73,7 @@ public class Pass2ConstantAdditionElimination extends Pass2SsaOptimization { return optimized; } - private boolean optimizePointerDereferenceIndexed(VariableReplacer.ReplacableValue value) { + private boolean optimizePointerDereferenceIndexed(ValueReplacer.ReplaceableValue value) { PointerDereferenceIndexed pointerDereferenceIndexed = (PointerDereferenceIndexed) value.get(); if(pointerDereferenceIndexed.getPointer() instanceof ConstantValue && pointerDereferenceIndexed.getIndex() instanceof ConstantValue) { ConstantValue ptrConstant = (ConstantValue) pointerDereferenceIndexed.getPointer(); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIdentification.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIdentification.java index a9713ae27..9a8029927 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIdentification.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantIdentification.java @@ -57,8 +57,9 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization { ControlFlowGraphBaseVisitor visitor = new ControlFlowGraphBaseVisitor() { @Override public Void visitAssignment(StatementAssignment assignment) { - if (assignment.getlValue() instanceof VariableRef) { - VariableRef variable = (VariableRef) assignment.getlValue(); + LValue lValue = assignment.getlValue(); + if (lValue instanceof VariableRef) { + VariableRef variable = (VariableRef) lValue; if (assignment.getrValue1() == null && getConstant(assignment.getrValue2()) != null) { if (assignment.getOperator() == null) { // Constant assignment @@ -81,35 +82,39 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization { constants.put(variable, constant); } } else if (assignment.getrValue2() instanceof ValueList && assignment.getOperator() == null && assignment.getrValue1() == null) { - ValueList valueList = (ValueList) assignment.getrValue2(); - List values = valueList.getList(); - boolean allConstant = true; - SymbolType elementType = null; - List elements = new ArrayList<>(); - for (RValue value : values) { - if (value instanceof ConstantValue) { - ConstantValue constantValue = (ConstantValue) value; - SymbolType type = constantValue.getType(getSymbols()); - if (elementType == null) { - elementType = type; - } else { - if (!SymbolTypeInference.typeMatch(type, elementType)) { - throw new RuntimeException("Array type mismatch " + elementType + " does not match " + type + " " + valueList.toString(getProgram())); + if (lValue instanceof VariableRef) { + Variable lVariable = getSymbols().getVariable((VariableRef) lValue); + if (lVariable.getType() instanceof SymbolTypeArray) { + ValueList valueList = (ValueList) assignment.getrValue2(); + List values = valueList.getList(); + boolean allConstant = true; + SymbolType elementType = null; + List elements = new ArrayList<>(); + for (RValue value : values) { + if (value instanceof ConstantValue) { + ConstantValue constantValue = (ConstantValue) value; + SymbolType type = constantValue.getType(getSymbols()); + if (elementType == null) { + elementType = type; + } else { + if (!SymbolTypeInference.typeMatch(type, elementType)) { + throw new RuntimeException("Array type mismatch " + elementType + " does not match " + type + " " + valueList.toString(getProgram())); + } + } + elements.add(constantValue); + } else { + allConstant = false; + elementType = null; + break; } } - elements.add(constantValue); - } else { - allConstant = false; - elementType = null; - break; + if (allConstant && elementType != null) { + ConstantValue constant = new ConstantArray(elements, elementType); + constants.put(variable, constant); + } } } - if (allConstant && elementType != null) { - ConstantValue constant = new ConstantArray(elements, elementType); - constants.put(variable, constant); - } } - } return null; } @@ -164,6 +169,8 @@ public class Pass2ConstantIdentification extends Pass2SsaOptimization { case "<<": case ">>": return new ConstantBinary(c1, operator, c2); + case "w=": + return new ConstantBinary(new ConstantBinary(c1, Operator.MULTIPLY, new ConstantInteger(256)), Operator.PLUS, c2); case "*idx": // Pointer dereference - not constant return null; diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantInlining.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantInlining.java index f74f6ca89..2baff20e5 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantInlining.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantInlining.java @@ -52,11 +52,10 @@ public class Pass2ConstantInlining extends Pass2SsaOptimization { * @param inline The replacements to make */ private void replaceInSymbolTable(Map inline) { - VariableReplacer replacer = new VariableReplacer(inline); Collection allConstants = getProgram().getScope().getAllConstants(true); for (ConstantVar constantVar : allConstants) { ConstantValue constantValue = constantVar.getValue(); - RValue replacement = replacer.getReplacement(constantValue); + RValue replacement = AliasReplacer.getReplacement(constantValue, inline); if(replacement!=null) { constantVar.setValue((ConstantValue) replacement); } @@ -68,13 +67,12 @@ public class Pass2ConstantInlining extends Pass2SsaOptimization { * @param inline The replacements */ private void replaceInValues(Map inline) { - VariableReplacer replacer = new VariableReplacer(inline); boolean replaced = true; while(replaced) { replaced = false; for (ConstantRef constantRef : inline.keySet()) { ConstantValue constantValue = inline.get(constantRef); - ConstantValue replacement = (ConstantValue) replacer.getReplacement(constantValue); + ConstantValue replacement = (ConstantValue) AliasReplacer.getReplacement(constantValue, inline); if (replacement != null) { replaced = true; inline.put(constantRef, replacement); @@ -112,7 +110,7 @@ public class Pass2ConstantInlining extends Pass2SsaOptimization { ConstantValue constantValue = constant.getValue(); if(constantValue instanceof ConstantRef) { if(((ConstantRef) constantValue).isIntermediate()) { - // The value is an intermediate constant - replace all uses of the intermediate with uses of the referer instead. + // The value is an intermediate constant - replace all uses of the intermediate with uses of the referrer instead. aliases.put((ConstantRef) constant.getValue(), constant.getRef()); constant.setValue(programScope.getConstant((ConstantRef) constantValue).getValue()); } else { diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1FixWordConstructors.java b/src/main/java/dk/camelot64/kickc/passes/Pass2FixWordConstructors.java similarity index 82% rename from src/main/java/dk/camelot64/kickc/passes/Pass1FixWordConstructors.java rename to src/main/java/dk/camelot64/kickc/passes/Pass2FixWordConstructors.java index 987b8ebff..ea32cc383 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1FixWordConstructors.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2FixWordConstructors.java @@ -3,17 +3,18 @@ package dk.camelot64.kickc.passes; import dk.camelot64.kickc.model.*; /** - * The syntax for word constructors word w = { b1, b2 }; - * is turned into a binary operator word w = b1 _toword_ b2 ; + * Identifies word constructors { b1, b2 } and replaces + * them with a binary operator word w = b1 w= b2 ; */ -public class Pass1FixWordConstructors extends Pass1Base { +public class Pass2FixWordConstructors extends Pass2SsaOptimization{ - public Pass1FixWordConstructors(Program program) { + public Pass2FixWordConstructors(Program program) { super(program); } @Override - boolean executeStep() { + public boolean optimize() { + boolean optimized = false; ProgramScope programScope = getProgram().getScope(); for (ControlFlowBlock block : getProgram().getGraph().getAllBlocks()) { for (Statement statement : block.getStatements()) { @@ -33,6 +34,7 @@ public class Pass1FixWordConstructors extends Pass1Base { assignment.setOperator(Operator.WORD); assignment.setrValue2(list.getList().get(1)); getLog().append("Fixing word constructor with " + assignment.toString()); + optimized = true; } } } @@ -40,7 +42,7 @@ public class Pass1FixWordConstructors extends Pass1Base { } } } - return false; + return optimized; } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2SsaOptimization.java b/src/main/java/dk/camelot64/kickc/passes/Pass2SsaOptimization.java index 194a173c5..630e2a773 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2SsaOptimization.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2SsaOptimization.java @@ -47,8 +47,8 @@ public abstract class Pass2SsaOptimization { * @param aliases Variables that have alias values. */ public void replaceVariables(final Map aliases) { - VariableReplacer replacer = new VariableReplacer(aliases); - replacer.execute(getGraph()); + AliasReplacer replacer = new AliasReplacer(aliases); + ValueReplacer.executeAll(getGraph(), replacer); } /** diff --git a/src/main/java/dk/camelot64/kickc/passes/ValueReplacer.java b/src/main/java/dk/camelot64/kickc/passes/ValueReplacer.java new file mode 100644 index 000000000..6d8830625 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/passes/ValueReplacer.java @@ -0,0 +1,337 @@ +package dk.camelot64.kickc.passes; + +import dk.camelot64.kickc.model.*; + +import java.util.*; + +/** + * A replacer capable to alias all usages of a variable (or constant var) with a suitable replacement + */ +public class ValueReplacer { + + /** A replacer that receives a replaceable value and has the potential to replace the value or recurse into sub-values. */ + public interface Replacer { + void execute(ReplaceableValue replaceable); + } + + /** + * Execute a replacer on all replaceable values in the program control flow graph + * + * @param graph The program control flow graph + * @param replacer The replacer to execute + */ + public static void executeAll(ControlFlowGraph graph, Replacer replacer) { + for (ControlFlowBlock block : graph.getAllBlocks()) { + for (Statement statement : block.getStatements()) { + if (statement instanceof StatementAssignment) { + executeAll(new ReplaceableLValue((StatementLValue) statement), replacer); + executeAll(new ReplaceableRValue1((StatementAssignment) statement), replacer); + executeAll(new ReplaceableRValue2((StatementAssignment) statement), replacer); + } else if (statement instanceof StatementCall) { + replacer.execute(new ReplaceableLValue((StatementLValue) statement)); + StatementCall call = (StatementCall) statement; + if (call.getParameters() != null) { + int size = call.getParameters().size(); + for (int i = 0; i < size; i++) { + executeAll(new ReplaceableCallParameter(call, i), replacer); + } + } + } else if (statement instanceof StatementConditionalJump) { + executeAll(new ReplaceableCondRValue1((StatementConditionalJump) statement), replacer); + executeAll(new ReplaceableCondRValue2((StatementConditionalJump) statement), replacer); + } else if (statement instanceof StatementReturn) { + executeAll(new ReplaceableReturn((StatementReturn) statement), replacer); + } else if (statement instanceof StatementPhiBlock) { + for (StatementPhiBlock.PhiVariable phiVariable : ((StatementPhiBlock) statement).getPhiVariables()) { + executeAll(new ReplaceablePhiVariable(phiVariable), replacer); + int size = phiVariable.getValues().size(); + for (int i = 0; i < size; i++) { + executeAll(new ReplaceablePhiValue(phiVariable, i), replacer); + } + } + } + } + } + } + + /** + * Execute the a replacer on a replaceable value and all sub-values of the value. + * @param replaceable The replaceable value + * @param replacer The value replacer + */ + public static void executeAll(ReplaceableValue replaceable, Replacer replacer) { + replacer.execute(replaceable); + for (ReplaceableValue subValue : replaceable.getSubValues()) { + executeAll(subValue, replacer); + } + } + + /** + * Interface representing an RValue that can be replaced. + * The value may have sub-values that can also be replaced. + */ + public static abstract class ReplaceableValue { + + public abstract RValue get(); + + public abstract void set(RValue value); + + public Collection getSubValues() { + RValue value = get(); + ArrayList subValues = new ArrayList<>(); + if (value instanceof PointerDereferenceIndexed) { + subValues.add(new ReplaceablePointer((PointerDereference) value)); + subValues.add(new ReplaceablePointerIndex((PointerDereferenceIndexed) value)); + } else if (value instanceof PointerDereferenceSimple) { + subValues.add(new ReplaceablePointer((PointerDereference) value)); + } else if (value instanceof ValueList) { + ValueList valueList = (ValueList) value; + int size = valueList.getList().size(); + for (int i = 0; i < size; i++) { + subValues.add(new ReplaceableListElement(valueList, i)); + } + } + return subValues; + } + + } + + /** + * Replaceable LValue as part of an assignment statement (or a call). + */ + public static class ReplaceableLValue extends ReplaceableValue { + private final StatementLValue statement; + + public ReplaceableLValue(StatementLValue statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getlValue(); + } + + @Override + public void set(RValue value) { + statement.setlValue((LValue) value); + } + + } + + /** + * Replaceable pointer inside a pointer dererence value. + */ + public static class ReplaceablePointer extends ReplaceableValue { + private final PointerDereference pointer; + + ReplaceablePointer(PointerDereference pointer) { + this.pointer = pointer; + } + + @Override + public RValue get() { + return pointer.getPointer(); + } + + @Override + public void set(RValue val) { + pointer.setPointer(val); + } + + } + + public static class ReplaceableListElement extends ReplaceableValue { + private ValueList list; + private int idx; + + public ReplaceableListElement(ValueList list, int idx) { + this.list = list; + this.idx = idx; + } + + @Override + public RValue get() { + return list.getList().get(idx); + } + + @Override + public void set(RValue value) { + list.getList().set(idx, value); + } + + } + + /** + * Replaceable pointer index inside a indexed pointer dererence value. + */ + public static class ReplaceablePointerIndex extends ReplaceableValue { + private final PointerDereferenceIndexed pointer; + + ReplaceablePointerIndex(PointerDereferenceIndexed pointer) { + this.pointer = pointer; + } + + @Override + public RValue get() { + return pointer.getIndex(); + } + + @Override + public void set(RValue val) { + pointer.setIndex(val); + } + + } + + public static class ReplaceableRValue1 extends ReplaceableValue { + private final StatementAssignment statement; + + public ReplaceableRValue1(StatementAssignment statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getrValue1(); + } + + @Override + public void set(RValue value) { + statement.setrValue1(value); + } + } + + public static class ReplaceableRValue2 extends ReplaceableValue { + private final StatementAssignment statement; + + public ReplaceableRValue2(StatementAssignment statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getrValue2(); + } + + @Override + public void set(RValue value) { + statement.setrValue2(value); + } + } + + public static class ReplaceableCallParameter extends ReplaceableValue { + private final StatementCall call; + private final int i; + + public ReplaceableCallParameter(StatementCall call, int i) { + this.call = call; + this.i = i; + } + + @Override + public RValue get() { + return call.getParameters().get(i); + } + + @Override + public void set(RValue value) { + call.getParameters().set(i, value); + } + } + + public static class ReplaceableCondRValue1 extends ReplaceableValue { + private final StatementConditionalJump statement; + + public ReplaceableCondRValue1(StatementConditionalJump statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getrValue1(); + } + + @Override + public void set(RValue value) { + statement.setrValue1(value); + } + } + + public static class ReplaceableCondRValue2 extends ReplaceableValue { + private final StatementConditionalJump statement; + + public ReplaceableCondRValue2(StatementConditionalJump statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getrValue2(); + } + + @Override + public void set(RValue value) { + statement.setrValue2(value); + } + } + + public static class ReplaceableReturn extends ReplaceableValue { + private final StatementReturn statement; + + public ReplaceableReturn(StatementReturn statement) { + this.statement = statement; + } + + @Override + public RValue get() { + return statement.getValue(); + } + + @Override + public void set(RValue value) { + statement.setValue(value); + } + } + + public static class ReplaceablePhiValue extends ReplaceableValue { + private final StatementPhiBlock.PhiVariable phiVariable; + private final int i; + + public ReplaceablePhiValue(StatementPhiBlock.PhiVariable phiVariable, int i) { + this.phiVariable = phiVariable; + this.i = i; + } + + @Override + public RValue get() { + return phiVariable.getValues().get(i).getrValue(); + } + + @Override + public void set(RValue value) { + phiVariable.getValues().get(i).setrValue(value); + } + } + + /** + * Replaceable LValue as part of an assignment statement (or a call). + */ + public static class ReplaceablePhiVariable extends ReplaceableValue { + private final StatementPhiBlock.PhiVariable phiVariable; + + public ReplaceablePhiVariable(StatementPhiBlock.PhiVariable phiVariable) { + this.phiVariable = phiVariable; + } + + @Override + public RValue get() { + return phiVariable.getVariable(); + } + + @Override + public void set(RValue value) { + phiVariable.setVariable((VariableRef) value); + } + + } +} diff --git a/src/main/java/dk/camelot64/kickc/passes/VariableReplacer.java b/src/main/java/dk/camelot64/kickc/passes/VariableReplacer.java deleted file mode 100644 index 17ba18b3c..000000000 --- a/src/main/java/dk/camelot64/kickc/passes/VariableReplacer.java +++ /dev/null @@ -1,394 +0,0 @@ -package dk.camelot64.kickc.passes; - -import dk.camelot64.kickc.model.*; - -import java.util.*; - -/** - * A replacer capable to alias all usages of a variable (or constant var) with a suitable replacement - */ -public class VariableReplacer { - - private Map aliases; - - public VariableReplacer(Map aliases) { - this.aliases = aliases; - } - - public void execute(ControlFlowGraph graph) { - //new GraphReplacer().visitGraph(graph); - for (ControlFlowBlock block : graph.getAllBlocks()) { - for (Statement statement : block.getStatements()) { - if (statement instanceof StatementAssignment) { - execute(new ReplacableLValue((StatementLValue) statement)); - execute(new ReplacableRValue1((StatementAssignment) statement)); - execute(new ReplacableRValue2((StatementAssignment) statement)); - } else if (statement instanceof StatementCall) { - execute(new ReplacableLValue((StatementLValue) statement)); - StatementCall call = (StatementCall) statement; - if(call.getParameters()!=null) { - int size = call.getParameters().size(); - for (int i = 0; i < size; i++) { - execute(new ReplacableCallParameter(call, i)); - } - } - } else if (statement instanceof StatementConditionalJump) { - execute(new ReplacableCondRValue1((StatementConditionalJump) statement)); - execute(new ReplacableCondRValue2((StatementConditionalJump) statement)); - } else if (statement instanceof StatementReturn) { - execute(new ReplacableReturn((StatementReturn) statement)); - } else if (statement instanceof StatementPhiBlock) { - for (StatementPhiBlock.PhiVariable phiVariable : ((StatementPhiBlock) statement).getPhiVariables()) { - execute(new ReplacablePhiVariable(phiVariable)); - int size = phiVariable.getValues().size(); - for (int i = 0; i < size; i++) { - execute(new ReplacablePhiValue(phiVariable, i)); - } - } - } - } - } - } - - /** - * Execute replacements inside a replacable value - and its sub-values. - * @param replacable The replacable value - */ - void execute(ReplacableValue replacable) { - if(replacable.get()!=null) { - RValue replacement = getReplacement(replacable.get()); - if(replacement!=null) { - replacable.set(replacement); - } - for (ReplacableValue subReplacable : replacable.getSubValues()) { - execute(subReplacable); - } - } - } - - /** - * Get the alias to use for an RValue. - * Also looks inside any constant values for replacements. - * If a replacement is found the replacement is performed and the new value is returned. If no replacement is found null is returned. - * - * @param rValue The RValue to find an alias for - * @return The alias to use. Null if no alias exists. - */ - public RValue getReplacement(RValue rValue) { - if (rValue instanceof SymbolRef) { - RValue alias = aliases.get(rValue); - if (alias != null) { - if (alias.equals(rValue)) { - return alias; - } - RValue replacement = getReplacement(alias); - if (replacement != null) { - return replacement; - } else { - return alias; - } - } - } else if (rValue instanceof ConstantUnary) { - ConstantUnary constantUnary = (ConstantUnary) rValue; - ConstantValue alias = (ConstantValue) getReplacement(constantUnary.getOperand()); - if (alias != null) { - return new ConstantUnary(constantUnary.getOperator(), alias); - } - } else if (rValue instanceof ConstantBinary) { - ConstantBinary constantBinary = (ConstantBinary) rValue; - ConstantValue aliasLeft = (ConstantValue) getReplacement(constantBinary.getLeft()); - ConstantValue aliasRight = (ConstantValue) getReplacement(constantBinary.getRight()); - if (aliasLeft != null || aliasRight != null) { - if (aliasLeft == null) { - aliasLeft = constantBinary.getLeft(); - } - if (aliasRight == null) { - aliasRight = constantBinary.getRight(); - } - return new ConstantBinary(aliasLeft, constantBinary.getOperator(), aliasRight); - } - } else if(rValue instanceof ConstantArray) { - ConstantArray constantArray = (ConstantArray) rValue; - ArrayList replacementList = new ArrayList<>(); - boolean any = false; - for (ConstantValue elemValue : constantArray.getElements()) { - RValue elemReplacement = getReplacement(elemValue); - if(elemReplacement!=null) { - replacementList.add((ConstantValue) elemReplacement); - any = true; - } else{ - replacementList.add(elemValue); - } - } - if(any) { - return new ConstantArray(replacementList, constantArray.getElementType()); - } - } - - // No replacement found - return null - return null; - - } - - /** - * Interface representing an RValue that can be replaced. - * The value may have sub-values that can also be replaced. - */ - public static abstract class ReplacableValue { - - public abstract RValue get(); - - public abstract void set(RValue value); - - public Collection getSubValues() { - RValue value = get(); - ArrayList subValues = new ArrayList<>(); - if (value instanceof PointerDereferenceIndexed) { - subValues.add(new ReplacablePointer((PointerDereference) value)); - subValues.add(new ReplacablePointerIndex((PointerDereferenceIndexed) value)); - } else if (value instanceof PointerDereferenceSimple) { - subValues.add(new ReplacablePointer((PointerDereference) value)); - } else if (value instanceof ValueList) { - ValueList valueList = (ValueList) value; - int size = valueList.getList().size(); - for (int i = 0; i < size; i++) { - subValues.add(new ReplacableListElement(valueList, i)); - } - } - return subValues; - } - - } - - /** Replacable LValue as part of an assignment statement (or a call). */ - public static class ReplacableLValue extends ReplacableValue { - private final StatementLValue statement; - - public ReplacableLValue(StatementLValue statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getlValue(); - } - - @Override - public void set(RValue value) { - statement.setlValue((LValue) value); - } - - } - - /** Replacable pointer inside a pointer dererence value. */ - public static class ReplacablePointer extends ReplacableValue { - private final PointerDereference pointer; - - ReplacablePointer(PointerDereference pointer) { - this.pointer = pointer; - } - - @Override - public RValue get() { - return pointer.getPointer(); - } - - @Override - public void set(RValue val) { - pointer.setPointer(val); - } - - } - - public static class ReplacableListElement extends ReplacableValue { - private ValueList list; - private int idx; - - public ReplacableListElement(ValueList list, int idx) { - this.list = list; - this.idx = idx; - } - - @Override - public RValue get() { - return list.getList().get(idx); - } - - @Override - public void set(RValue value) { - list.getList().set(idx, value); - } - - } - - /** Replacable pointer index inside a indexed pointer dererence value. */ - public static class ReplacablePointerIndex extends ReplacableValue { - private final PointerDereferenceIndexed pointer; - - ReplacablePointerIndex(PointerDereferenceIndexed pointer) { - this.pointer = pointer; - } - - @Override - public RValue get() { - return pointer.getIndex(); - } - - @Override - public void set(RValue val) { - pointer.setIndex(val); - } - - } - - public static class ReplacableRValue1 extends ReplacableValue { - private final StatementAssignment statement; - - public ReplacableRValue1(StatementAssignment statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getrValue1(); - } - - @Override - public void set(RValue value) { - statement.setrValue1(value); - } - } - - public static class ReplacableRValue2 extends ReplacableValue { - private final StatementAssignment statement; - - public ReplacableRValue2(StatementAssignment statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getrValue2(); - } - - @Override - public void set(RValue value) { - statement.setrValue2(value); - } - } - - public static class ReplacableCallParameter extends ReplacableValue { - private final StatementCall call; - private final int i; - - public ReplacableCallParameter(StatementCall call, int i) { - this.call = call; - this.i = i; - } - - @Override - public RValue get() { - return call.getParameters().get(i); - } - - @Override - public void set(RValue value) { - call.getParameters().set(i, value); - } - } - - public static class ReplacableCondRValue1 extends ReplacableValue { - private final StatementConditionalJump statement; - - public ReplacableCondRValue1(StatementConditionalJump statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getrValue1(); - } - - @Override - public void set(RValue value) { - statement.setrValue1(value); - } - } - - public static class ReplacableCondRValue2 extends ReplacableValue { - private final StatementConditionalJump statement; - - public ReplacableCondRValue2(StatementConditionalJump statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getrValue2(); - } - - @Override - public void set(RValue value) { - statement.setrValue2(value); - } - } - - public static class ReplacableReturn extends ReplacableValue { - private final StatementReturn statement; - - public ReplacableReturn(StatementReturn statement) { - this.statement = statement; - } - - @Override - public RValue get() { - return statement.getValue(); - } - - @Override - public void set(RValue value) { - statement.setValue(value); - } - } - - public static class ReplacablePhiValue extends ReplacableValue { - private final StatementPhiBlock.PhiVariable phiVariable; - private final int i; - - public ReplacablePhiValue(StatementPhiBlock.PhiVariable phiVariable, int i) { - this.phiVariable = phiVariable; - this.i = i; - } - - @Override - public RValue get() { - return phiVariable.getValues().get(i).getrValue(); - } - - @Override - public void set(RValue value) { - phiVariable.getValues().get(i).setrValue(value); - } - } - - /** Replacable LValue as part of an assignment statement (or a call). */ - public static class ReplacablePhiVariable extends ReplacableValue { - private final StatementPhiBlock.PhiVariable phiVariable; - - public ReplacablePhiVariable(StatementPhiBlock.PhiVariable phiVariable) { - this.phiVariable = phiVariable; - } - - @Override - public RValue get() { - return phiVariable.getVariable(); - } - - @Override - public void set(RValue value) { - phiVariable.setVariable((VariableRef) value); - } - - } - -} diff --git a/src/main/java/dk/camelot64/kickc/test/TestPrograms.java b/src/main/java/dk/camelot64/kickc/test/TestPrograms.java index de63fc154..fb1c6bafc 100644 --- a/src/main/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/main/java/dk/camelot64/kickc/test/TestPrograms.java @@ -22,6 +22,10 @@ public class TestPrograms extends TestCase { helper = new ReferenceHelper("dk/camelot64/kickc/test/ref/"); } + public void testTrueInlineWords() throws IOException, URISyntaxException { + compileAndCompare("true-inline-words"); + } + public void testIncrementInArray() throws IOException, URISyntaxException { compileAndCompare("incrementinarray"); } diff --git a/src/main/java/dk/camelot64/kickc/test/inline-word.kc b/src/main/java/dk/camelot64/kickc/test/inline-word.kc index bc9fbaa0c..81a0ad075 100644 --- a/src/main/java/dk/camelot64/kickc/test/inline-word.kc +++ b/src/main/java/dk/camelot64/kickc/test/inline-word.kc @@ -1,10 +1,10 @@ const byte* SCREEN = $400; void main() { - byte[] his = { >SCREEN, >SCREEN+$100, >SCREEN+$200 }; + byte[] his = { >SCREEN, >SCREEN+$100, >SCREEN+$200 }; // constant array for( byte h: 0..2) { for (byte l: 4..7) { - word w = { his[h], l }; + word w = { his[h], l }; // inline word byte* sc = (byte*)w; *sc = '*'; } diff --git a/src/main/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log b/src/main/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log index 8d9ec7b68..280db073f 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/bitmap-bresenham.log @@ -1135,8 +1135,6 @@ Eliminating unused variable - keeping the call (void~) line_xdyi::$1 Eliminating unused variable - keeping the call (void~) line_xdyd::$1 Eliminating unused variable - keeping the call (void~) line_ydxi::$1 Eliminating unused variable - keeping the call (void~) line_ydxd::$1 -Fixing word constructor with plot::plotter_x ← *(plot_xhi + plot::x) w= *(plot_xlo + plot::x) -Fixing word constructor with plot::plotter_y ← *(plot_yhi + plot::y) w= *(plot_ylo + plot::y) Removing empty block main::@2 Removing empty block @1 Removing empty block lines::@2 @@ -1413,8 +1411,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 return to:@return plot: scope:[plot] from - (word) plot::plotter_x ← *((byte[]) plot_xhi + (byte) plot::x) w= *((byte[]) plot_xlo + (byte) plot::x) - (word) plot::plotter_y ← *((byte[]) plot_yhi + (byte) plot::y) w= *((byte[]) plot_ylo + (byte) plot::y) + (word) plot::plotter_x ← { *((byte[]) plot_xhi + (byte) plot::x), *((byte[]) plot_xlo + (byte) plot::x) } + (word) plot::plotter_y ← { *((byte[]) plot_yhi + (byte) plot::y), *((byte[]) plot_ylo + (byte) plot::y) } (word~) plot::$0 ← (word) plot::plotter_x + (word) plot::plotter_y (byte*) plot::plotter ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter) | *((byte[]) plot_bit + (byte) plot::x) @@ -1835,8 +1833,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 return to:@return plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 - (word) plot::plotter_x ← *((byte[]) plot_xhi + (byte) plot::x) w= *((byte[]) plot_xlo + (byte) plot::x) - (word) plot::plotter_y ← *((byte[]) plot_yhi + (byte) plot::y) w= *((byte[]) plot_ylo + (byte) plot::y) + (word) plot::plotter_x ← { *((byte[]) plot_xhi + (byte) plot::x), *((byte[]) plot_xlo + (byte) plot::x) } + (word) plot::plotter_y ← { *((byte[]) plot_yhi + (byte) plot::y), *((byte[]) plot_ylo + (byte) plot::y) } (word~) plot::$0 ← (word) plot::plotter_x + (word) plot::plotter_y (byte*) plot::plotter ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter) | *((byte[]) plot_bit + (byte) plot::x) @@ -2489,8 +2487,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -3163,8 +3161,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -4425,8 +4423,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -5084,8 +5082,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -5746,8 +5744,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -6312,8 +6310,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -6878,8 +6876,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -7335,8 +7333,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -7756,8 +7754,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((byte[]) plot_xhi#0 + (byte) plot::x#4), *((byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((byte[]) plot_yhi#0 + (byte) plot::y#4), *((byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((byte[]) plot_bit#0 + (byte) plot::x#4) @@ -8155,8 +8153,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -8529,8 +8527,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -8890,8 +8888,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -9248,8 +9246,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -9604,8 +9602,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -9977,8 +9975,8 @@ line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) - (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) - (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word) plot::plotter_x#0 ← { *((const byte[]) plot_xhi#0 + (byte) plot::x#4), *((const byte[]) plot_xlo#0 + (byte) plot::x#4) } + (word) plot::plotter_y#0 ← { *((const byte[]) plot_yhi#0 + (byte) plot::y#4), *((const byte[]) plot_ylo#0 + (byte) plot::y#4) } (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) @@ -10069,6 +10067,363 @@ Multiple usages for variable. Not optimizing sub-constant (byte) init_plot_table Multiple usages for variable. Not optimizing sub-constant (byte) init_plot_tables::y#2 Multiple usages for variable. Not optimizing sub-constant (byte) init_plot_tables::y#2 Multiple usages for variable. Not optimizing sub-constant (byte*) init_plot_tables::yoffs#2 +Fixing word constructor with plot::plotter_x#0 ← *(plot_xhi#0 + plot::x#4) w= *(plot_xlo#0 + plot::x#4) +Fixing word constructor with plot::plotter_y#0 ← *(plot_yhi#0 + plot::y#4) w= *(plot_ylo#0 + plot::y#4) +Succesful SSA optimization Pass2FixWordConstructors +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@10 +main: scope:[main] from @10 + *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word) 0 + *((const byte*) FGCOL#0) ← (byte/signed byte/word/signed word) 0 + *((const byte*) D011#0) ← (const byte) main::$2 + *((const byte*) D018#0) ← (const byte) main::$8 + call init_screen param-assignment + to:main::@3 +main::@3: scope:[main] from main + call init_plot_tables param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@1 +main::@1: scope:[main] from main::@4 main::@5 + call lines param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + if(true) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@5 + return + to:@return +lines: scope:[lines] from main::@1 + to:lines::@1 +lines::@1: scope:[lines] from lines lines::@3 + (byte) lines::l#2 ← phi( lines/(const byte) lines::l#0 lines::@3/(byte) lines::l#1 ) + (byte~) lines::$0 ← (byte) lines::l#2 + (byte~) lines::$1 ← (byte) lines::l#2 + (byte) line::x0#0 ← *((const byte[]) lines_x#0 + (byte) lines::l#2) + (byte) line::x1#0 ← *((const byte[]) lines_x#0+(byte/signed byte/word/signed word) 1 + (byte~) lines::$0) + (byte) line::y0#0 ← *((const byte[]) lines_y#0 + (byte) lines::l#2) + (byte) line::y1#0 ← *((const byte[]) lines_y#0+(byte/signed byte/word/signed word) 1 + (byte~) lines::$1) + call line param-assignment + to:lines::@3 +lines::@3: scope:[lines] from lines::@1 + (byte) lines::l#1 ← ++ (byte) lines::l#2 + if((byte) lines::l#1<(const byte) lines_cnt#0) goto lines::@1 + to:lines::@return +lines::@return: scope:[lines] from lines::@3 + return + to:@return +line: scope:[line] from lines::@1 + if((byte) line::x0#0>=(byte) line::x1#0) goto line::@1 + to:line::@15 +line::@1: scope:[line] from line + (byte) line::xd#0 ← (byte) line::x0#0 - (byte) line::x1#0 + if((byte) line::y0#0>=(byte) line::y1#0) goto line::@9 + to:line::@23 +line::@15: scope:[line] from line + (byte) line::xd#1 ← (byte) line::x1#0 - (byte) line::x0#0 + if((byte) line::y0#0>=(byte) line::y1#0) goto line::@2 + to:line::@16 +line::@2: scope:[line] from line::@15 + (byte) line::yd#0 ← (byte) line::y0#0 - (byte) line::y1#0 + if((byte) line::yd#0>=(byte) line::xd#1) goto line::@6 + to:line::@20 +line::@16: scope:[line] from line::@15 + (byte) line::yd#1 ← (byte) line::y1#0 - (byte) line::y0#0 + if((byte) line::yd#1>=(byte) line::xd#1) goto line::@3 + to:line::@17 +line::@3: scope:[line] from line::@16 + (byte) line_ydxi::y#0 ← (byte) line::y0#0 + (byte) line_ydxi::x#0 ← (byte) line::x0#0 + (byte) line_ydxi::y1#0 ← (byte) line::y1#0 + (byte) line_ydxi::yd#0 ← (byte) line::yd#1 + (byte) line_ydxi::xd#0 ← (byte) line::xd#1 + call line_ydxi param-assignment + to:line::@return +line::@17: scope:[line] from line::@16 + (byte) line_xdyi::x#0 ← (byte) line::x0#0 + (byte) line_xdyi::y#0 ← (byte) line::y0#0 + (byte) line_xdyi::x1#0 ← (byte) line::x1#0 + (byte) line_xdyi::xd#0 ← (byte) line::xd#1 + (byte) line_xdyi::yd#0 ← (byte) line::yd#1 + call line_xdyi param-assignment + to:line::@return +line::@6: scope:[line] from line::@2 + (byte) line_ydxd::y#0 ← (byte) line::y1#0 + (byte) line_ydxd::x#0 ← (byte) line::x1#0 + (byte) line_ydxd::y1#0 ← (byte) line::y0#0 + (byte) line_ydxd::yd#0 ← (byte) line::yd#0 + (byte) line_ydxd::xd#0 ← (byte) line::xd#1 + call line_ydxd param-assignment + to:line::@return +line::@20: scope:[line] from line::@2 + (byte) line_xdyd::x#0 ← (byte) line::x0#0 + (byte) line_xdyd::y#0 ← (byte) line::y0#0 + (byte) line_xdyd::x1#0 ← (byte) line::x1#0 + (byte) line_xdyd::xd#0 ← (byte) line::xd#1 + (byte) line_xdyd::yd#0 ← (byte) line::yd#0 + call line_xdyd param-assignment + to:line::@return +line::@9: scope:[line] from line::@1 + (byte) line::yd#10 ← (byte) line::y0#0 - (byte) line::y1#0 + if((byte) line::yd#10>=(byte) line::xd#0) goto line::@13 + to:line::@27 +line::@23: scope:[line] from line::@1 + (byte) line::yd#3 ← (byte) line::y1#0 - (byte) line::y0#0 + if((byte) line::yd#3>=(byte) line::xd#0) goto line::@10 + to:line::@24 +line::@10: scope:[line] from line::@23 + (byte) line_ydxd::y#1 ← (byte) line::y0#0 + (byte) line_ydxd::x#1 ← (byte) line::x0#0 + (byte) line_ydxd::y1#1 ← (byte) line::y1#0 + (byte) line_ydxd::yd#1 ← (byte) line::yd#3 + (byte) line_ydxd::xd#1 ← (byte) line::xd#0 + call line_ydxd param-assignment + to:line::@return +line::@24: scope:[line] from line::@23 + (byte) line_xdyd::x#1 ← (byte) line::x1#0 + (byte) line_xdyd::y#1 ← (byte) line::y1#0 + (byte) line_xdyd::x1#1 ← (byte) line::x0#0 + (byte) line_xdyd::xd#1 ← (byte) line::xd#0 + (byte) line_xdyd::yd#1 ← (byte) line::yd#3 + call line_xdyd param-assignment + to:line::@return +line::@13: scope:[line] from line::@9 + (byte) line_ydxi::y#1 ← (byte) line::y1#0 + (byte) line_ydxi::x#1 ← (byte) line::x1#0 + (byte) line_ydxi::y1#1 ← (byte) line::y0#0 + (byte) line_ydxi::yd#1 ← (byte) line::yd#10 + (byte) line_ydxi::xd#1 ← (byte) line::xd#0 + call line_ydxi param-assignment + to:line::@return +line::@27: scope:[line] from line::@9 + (byte) line_xdyi::x#1 ← (byte) line::x1#0 + (byte) line_xdyi::y#1 ← (byte) line::y1#0 + (byte) line_xdyi::x1#1 ← (byte) line::x0#0 + (byte) line_xdyi::xd#1 ← (byte) line::xd#0 + (byte) line_xdyi::yd#1 ← (byte) line::yd#10 + call line_xdyi param-assignment + to:line::@return +line::@return: scope:[line] from line::@10 line::@13 line::@17 line::@20 line::@24 line::@27 line::@3 line::@6 + return + to:@return +line_xdyi: scope:[line_xdyi] from line::@17 line::@27 + (byte) line_xdyi::x1#6 ← phi( line::@17/(byte) line_xdyi::x1#0 line::@27/(byte) line_xdyi::x1#1 ) + (byte) line_xdyi::xd#5 ← phi( line::@17/(byte) line_xdyi::xd#0 line::@27/(byte) line_xdyi::xd#1 ) + (byte) line_xdyi::y#5 ← phi( line::@17/(byte) line_xdyi::y#0 line::@27/(byte) line_xdyi::y#1 ) + (byte) line_xdyi::x#6 ← phi( line::@17/(byte) line_xdyi::x#0 line::@27/(byte) line_xdyi::x#1 ) + (byte) line_xdyi::yd#2 ← phi( line::@17/(byte) line_xdyi::yd#0 line::@27/(byte) line_xdyi::yd#1 ) + (byte) line_xdyi::e#0 ← (byte) line_xdyi::yd#2 >> (byte/signed byte/word/signed word) 1 + to:line_xdyi::@1 +line_xdyi::@1: scope:[line_xdyi] from line_xdyi line_xdyi::@2 + (byte) line_xdyi::e#3 ← phi( line_xdyi/(byte) line_xdyi::e#0 line_xdyi::@2/(byte) line_xdyi::e#6 ) + (byte) line_xdyi::y#3 ← phi( line_xdyi/(byte) line_xdyi::y#5 line_xdyi::@2/(byte) line_xdyi::y#6 ) + (byte) line_xdyi::x#3 ← phi( line_xdyi/(byte) line_xdyi::x#6 line_xdyi::@2/(byte) line_xdyi::x#2 ) + (byte) plot::x#0 ← (byte) line_xdyi::x#3 + (byte) plot::y#0 ← (byte) line_xdyi::y#3 + call plot param-assignment + to:line_xdyi::@5 +line_xdyi::@5: scope:[line_xdyi] from line_xdyi::@1 + (byte) line_xdyi::x#2 ← (byte) line_xdyi::x#3 + (byte/signed byte/word/signed word) 1 + (byte) line_xdyi::e#1 ← (byte) line_xdyi::e#3 + (byte) line_xdyi::yd#2 + if((byte) line_xdyi::xd#5>=(byte) line_xdyi::e#1) goto line_xdyi::@2 + to:line_xdyi::@3 +line_xdyi::@2: scope:[line_xdyi] from line_xdyi::@3 line_xdyi::@5 + (byte) line_xdyi::e#6 ← phi( line_xdyi::@3/(byte) line_xdyi::e#2 line_xdyi::@5/(byte) line_xdyi::e#1 ) + (byte) line_xdyi::y#6 ← phi( line_xdyi::@3/(byte) line_xdyi::y#2 line_xdyi::@5/(byte) line_xdyi::y#3 ) + (byte~) line_xdyi::$8 ← (byte) line_xdyi::x1#6 + (byte/signed byte/word/signed word) 1 + if((byte) line_xdyi::x#2<(byte~) line_xdyi::$8) goto line_xdyi::@1 + to:line_xdyi::@return +line_xdyi::@3: scope:[line_xdyi] from line_xdyi::@5 + (byte) line_xdyi::y#2 ← (byte) line_xdyi::y#3 + (byte/signed byte/word/signed word) 1 + (byte) line_xdyi::e#2 ← (byte) line_xdyi::e#1 - (byte) line_xdyi::xd#5 + to:line_xdyi::@2 +line_xdyi::@return: scope:[line_xdyi] from line_xdyi::@2 + return + to:@return +line_xdyd: scope:[line_xdyd] from line::@20 line::@24 + (byte) line_xdyd::x1#6 ← phi( line::@20/(byte) line_xdyd::x1#0 line::@24/(byte) line_xdyd::x1#1 ) + (byte) line_xdyd::xd#5 ← phi( line::@20/(byte) line_xdyd::xd#0 line::@24/(byte) line_xdyd::xd#1 ) + (byte) line_xdyd::y#5 ← phi( line::@20/(byte) line_xdyd::y#0 line::@24/(byte) line_xdyd::y#1 ) + (byte) line_xdyd::x#6 ← phi( line::@20/(byte) line_xdyd::x#0 line::@24/(byte) line_xdyd::x#1 ) + (byte) line_xdyd::yd#2 ← phi( line::@20/(byte) line_xdyd::yd#0 line::@24/(byte) line_xdyd::yd#1 ) + (byte) line_xdyd::e#0 ← (byte) line_xdyd::yd#2 >> (byte/signed byte/word/signed word) 1 + to:line_xdyd::@1 +line_xdyd::@1: scope:[line_xdyd] from line_xdyd line_xdyd::@2 + (byte) line_xdyd::e#3 ← phi( line_xdyd/(byte) line_xdyd::e#0 line_xdyd::@2/(byte) line_xdyd::e#6 ) + (byte) line_xdyd::y#3 ← phi( line_xdyd/(byte) line_xdyd::y#5 line_xdyd::@2/(byte) line_xdyd::y#6 ) + (byte) line_xdyd::x#3 ← phi( line_xdyd/(byte) line_xdyd::x#6 line_xdyd::@2/(byte) line_xdyd::x#2 ) + (byte) plot::x#1 ← (byte) line_xdyd::x#3 + (byte) plot::y#1 ← (byte) line_xdyd::y#3 + call plot param-assignment + to:line_xdyd::@5 +line_xdyd::@5: scope:[line_xdyd] from line_xdyd::@1 + (byte) line_xdyd::x#2 ← (byte) line_xdyd::x#3 + (byte/signed byte/word/signed word) 1 + (byte) line_xdyd::e#1 ← (byte) line_xdyd::e#3 + (byte) line_xdyd::yd#2 + if((byte) line_xdyd::xd#5>=(byte) line_xdyd::e#1) goto line_xdyd::@2 + to:line_xdyd::@3 +line_xdyd::@2: scope:[line_xdyd] from line_xdyd::@3 line_xdyd::@5 + (byte) line_xdyd::e#6 ← phi( line_xdyd::@3/(byte) line_xdyd::e#2 line_xdyd::@5/(byte) line_xdyd::e#1 ) + (byte) line_xdyd::y#6 ← phi( line_xdyd::@3/(byte) line_xdyd::y#2 line_xdyd::@5/(byte) line_xdyd::y#3 ) + (byte~) line_xdyd::$8 ← (byte) line_xdyd::x1#6 + (byte/signed byte/word/signed word) 1 + if((byte) line_xdyd::x#2<(byte~) line_xdyd::$8) goto line_xdyd::@1 + to:line_xdyd::@return +line_xdyd::@3: scope:[line_xdyd] from line_xdyd::@5 + (byte) line_xdyd::y#2 ← (byte) line_xdyd::y#3 - (byte/signed byte/word/signed word) 1 + (byte) line_xdyd::e#2 ← (byte) line_xdyd::e#1 - (byte) line_xdyd::xd#5 + to:line_xdyd::@2 +line_xdyd::@return: scope:[line_xdyd] from line_xdyd::@2 + return + to:@return +line_ydxi: scope:[line_ydxi] from line::@13 line::@3 + (byte) line_ydxi::y1#6 ← phi( line::@13/(byte) line_ydxi::y1#1 line::@3/(byte) line_ydxi::y1#0 ) + (byte) line_ydxi::yd#5 ← phi( line::@13/(byte) line_ydxi::yd#1 line::@3/(byte) line_ydxi::yd#0 ) + (byte) line_ydxi::y#6 ← phi( line::@13/(byte) line_ydxi::y#1 line::@3/(byte) line_ydxi::y#0 ) + (byte) line_ydxi::x#5 ← phi( line::@13/(byte) line_ydxi::x#1 line::@3/(byte) line_ydxi::x#0 ) + (byte) line_ydxi::xd#2 ← phi( line::@13/(byte) line_ydxi::xd#1 line::@3/(byte) line_ydxi::xd#0 ) + (byte) line_ydxi::e#0 ← (byte) line_ydxi::xd#2 >> (byte/signed byte/word/signed word) 1 + to:line_ydxi::@1 +line_ydxi::@1: scope:[line_ydxi] from line_ydxi line_ydxi::@2 + (byte) line_ydxi::e#3 ← phi( line_ydxi/(byte) line_ydxi::e#0 line_ydxi::@2/(byte) line_ydxi::e#6 ) + (byte) line_ydxi::y#3 ← phi( line_ydxi/(byte) line_ydxi::y#6 line_ydxi::@2/(byte) line_ydxi::y#2 ) + (byte) line_ydxi::x#3 ← phi( line_ydxi/(byte) line_ydxi::x#5 line_ydxi::@2/(byte) line_ydxi::x#6 ) + (byte) plot::x#2 ← (byte) line_ydxi::x#3 + (byte) plot::y#2 ← (byte) line_ydxi::y#3 + call plot param-assignment + to:line_ydxi::@5 +line_ydxi::@5: scope:[line_ydxi] from line_ydxi::@1 + (byte) line_ydxi::y#2 ← (byte) line_ydxi::y#3 + (byte/signed byte/word/signed word) 1 + (byte) line_ydxi::e#1 ← (byte) line_ydxi::e#3 + (byte) line_ydxi::xd#2 + if((byte) line_ydxi::yd#5>=(byte) line_ydxi::e#1) goto line_ydxi::@2 + to:line_ydxi::@3 +line_ydxi::@2: scope:[line_ydxi] from line_ydxi::@3 line_ydxi::@5 + (byte) line_ydxi::e#6 ← phi( line_ydxi::@3/(byte) line_ydxi::e#2 line_ydxi::@5/(byte) line_ydxi::e#1 ) + (byte) line_ydxi::x#6 ← phi( line_ydxi::@3/(byte) line_ydxi::x#2 line_ydxi::@5/(byte) line_ydxi::x#3 ) + (byte~) line_ydxi::$8 ← (byte) line_ydxi::y1#6 + (byte/signed byte/word/signed word) 1 + if((byte) line_ydxi::y#2<(byte~) line_ydxi::$8) goto line_ydxi::@1 + to:line_ydxi::@return +line_ydxi::@3: scope:[line_ydxi] from line_ydxi::@5 + (byte) line_ydxi::x#2 ← (byte) line_ydxi::x#3 + (byte/signed byte/word/signed word) 1 + (byte) line_ydxi::e#2 ← (byte) line_ydxi::e#1 - (byte) line_ydxi::yd#5 + to:line_ydxi::@2 +line_ydxi::@return: scope:[line_ydxi] from line_ydxi::@2 + return + to:@return +line_ydxd: scope:[line_ydxd] from line::@10 line::@6 + (byte) line_ydxd::y1#6 ← phi( line::@10/(byte) line_ydxd::y1#1 line::@6/(byte) line_ydxd::y1#0 ) + (byte) line_ydxd::yd#5 ← phi( line::@10/(byte) line_ydxd::yd#1 line::@6/(byte) line_ydxd::yd#0 ) + (byte) line_ydxd::y#6 ← phi( line::@10/(byte) line_ydxd::y#1 line::@6/(byte) line_ydxd::y#0 ) + (byte) line_ydxd::x#5 ← phi( line::@10/(byte) line_ydxd::x#1 line::@6/(byte) line_ydxd::x#0 ) + (byte) line_ydxd::xd#2 ← phi( line::@10/(byte) line_ydxd::xd#1 line::@6/(byte) line_ydxd::xd#0 ) + (byte) line_ydxd::e#0 ← (byte) line_ydxd::xd#2 >> (byte/signed byte/word/signed word) 1 + to:line_ydxd::@1 +line_ydxd::@1: scope:[line_ydxd] from line_ydxd line_ydxd::@2 + (byte) line_ydxd::e#3 ← phi( line_ydxd/(byte) line_ydxd::e#0 line_ydxd::@2/(byte) line_ydxd::e#6 ) + (byte) line_ydxd::y#3 ← phi( line_ydxd/(byte) line_ydxd::y#6 line_ydxd::@2/(byte) line_ydxd::y#2 ) + (byte) line_ydxd::x#3 ← phi( line_ydxd/(byte) line_ydxd::x#5 line_ydxd::@2/(byte) line_ydxd::x#6 ) + (byte) plot::x#3 ← (byte) line_ydxd::x#3 + (byte) plot::y#3 ← (byte) line_ydxd::y#3 + call plot param-assignment + to:line_ydxd::@5 +line_ydxd::@5: scope:[line_ydxd] from line_ydxd::@1 + (byte) line_ydxd::y#2 ← (byte) line_ydxd::y#3 + (byte/signed byte/word/signed word) 1 + (byte) line_ydxd::e#1 ← (byte) line_ydxd::e#3 + (byte) line_ydxd::xd#2 + if((byte) line_ydxd::yd#5>=(byte) line_ydxd::e#1) goto line_ydxd::@2 + to:line_ydxd::@3 +line_ydxd::@2: scope:[line_ydxd] from line_ydxd::@3 line_ydxd::@5 + (byte) line_ydxd::e#6 ← phi( line_ydxd::@3/(byte) line_ydxd::e#2 line_ydxd::@5/(byte) line_ydxd::e#1 ) + (byte) line_ydxd::x#6 ← phi( line_ydxd::@3/(byte) line_ydxd::x#2 line_ydxd::@5/(byte) line_ydxd::x#3 ) + (byte~) line_ydxd::$8 ← (byte) line_ydxd::y1#6 + (byte/signed byte/word/signed word) 1 + if((byte) line_ydxd::y#2<(byte~) line_ydxd::$8) goto line_ydxd::@1 + to:line_ydxd::@return +line_ydxd::@3: scope:[line_ydxd] from line_ydxd::@5 + (byte) line_ydxd::x#2 ← (byte) line_ydxd::x#3 - (byte/signed byte/word/signed word) 1 + (byte) line_ydxd::e#2 ← (byte) line_ydxd::e#1 - (byte) line_ydxd::yd#5 + to:line_ydxd::@2 +line_ydxd::@return: scope:[line_ydxd] from line_ydxd::@2 + return + to:@return +plot: scope:[plot] from line_xdyd::@1 line_xdyi::@1 line_ydxd::@1 line_ydxi::@1 + (byte) plot::y#4 ← phi( line_xdyd::@1/(byte) plot::y#1 line_xdyi::@1/(byte) plot::y#0 line_ydxd::@1/(byte) plot::y#3 line_ydxi::@1/(byte) plot::y#2 ) + (byte) plot::x#4 ← phi( line_xdyd::@1/(byte) plot::x#1 line_xdyi::@1/(byte) plot::x#0 line_ydxd::@1/(byte) plot::x#3 line_ydxi::@1/(byte) plot::x#2 ) + (word) plot::plotter_x#0 ← *((const byte[]) plot_xhi#0 + (byte) plot::x#4) w= *((const byte[]) plot_xlo#0 + (byte) plot::x#4) + (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) + (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 + (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 + (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) + *((byte*) plot::plotter#0) ← (byte~) plot::$1 + to:plot::@return +plot::@return: scope:[plot] from plot + return + to:@return +init_plot_tables: scope:[init_plot_tables] from main::@3 + to:init_plot_tables::@1 +init_plot_tables::@1: scope:[init_plot_tables] from init_plot_tables init_plot_tables::@2 + (byte) init_plot_tables::bits#3 ← phi( init_plot_tables/(const byte) init_plot_tables::bits#0 init_plot_tables::@2/(byte) init_plot_tables::bits#4 ) + (byte) init_plot_tables::x#2 ← phi( init_plot_tables/(const byte) init_plot_tables::x#0 init_plot_tables::@2/(byte) init_plot_tables::x#1 ) + (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte/word/signed word) 248 + *((const byte[]) plot_xlo#0 + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0 + *((const byte[]) plot_xhi#0 + (byte) init_plot_tables::x#2) ← (const byte) init_plot_tables::$1 + *((const byte[]) plot_bit#0 + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3 + (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte/signed byte/word/signed word) 1 + if((byte) init_plot_tables::bits#1!=(byte/signed byte/word/signed word) 0) goto init_plot_tables::@2 + to:init_plot_tables::@5 +init_plot_tables::@2: scope:[init_plot_tables] from init_plot_tables::@1 init_plot_tables::@5 + (byte) init_plot_tables::bits#4 ← phi( init_plot_tables::@1/(byte) init_plot_tables::bits#1 init_plot_tables::@5/(const byte) init_plot_tables::bits#2 ) + (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2 + if((byte) init_plot_tables::x#1!=(byte/signed byte/word/signed word) 0) goto init_plot_tables::@1 + to:init_plot_tables::@6 +init_plot_tables::@5: scope:[init_plot_tables] from init_plot_tables::@1 + to:init_plot_tables::@2 +init_plot_tables::@6: scope:[init_plot_tables] from init_plot_tables::@2 + to:init_plot_tables::@3 +init_plot_tables::@3: scope:[init_plot_tables] from init_plot_tables::@4 init_plot_tables::@6 + (byte*) init_plot_tables::yoffs#2 ← phi( init_plot_tables::@4/(byte*) init_plot_tables::yoffs#4 init_plot_tables::@6/(const byte*) init_plot_tables::yoffs#0 ) + (byte) init_plot_tables::y#2 ← phi( init_plot_tables::@4/(byte) init_plot_tables::y#1 init_plot_tables::@6/(const byte) init_plot_tables::y#0 ) + (byte~) init_plot_tables::$6 ← (byte) init_plot_tables::y#2 & (byte/signed byte/word/signed word) 7 + (byte~) init_plot_tables::$7 ← < (byte*) init_plot_tables::yoffs#2 + (byte~) init_plot_tables::$8 ← (byte~) init_plot_tables::$6 | (byte~) init_plot_tables::$7 + *((const byte[]) plot_ylo#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8 + (byte~) init_plot_tables::$9 ← > (byte*) init_plot_tables::yoffs#2 + *((const byte[]) plot_yhi#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$9 + (byte~) init_plot_tables::$10 ← (byte) init_plot_tables::y#2 & (byte/signed byte/word/signed word) 7 + if((byte~) init_plot_tables::$10!=(byte/signed byte/word/signed word) 7) goto init_plot_tables::@4 + to:init_plot_tables::@7 +init_plot_tables::@4: scope:[init_plot_tables] from init_plot_tables::@3 init_plot_tables::@7 + (byte*) init_plot_tables::yoffs#4 ← phi( init_plot_tables::@3/(byte*) init_plot_tables::yoffs#2 init_plot_tables::@7/(byte*) init_plot_tables::yoffs#1 ) + (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2 + if((byte) init_plot_tables::y#1!=(byte/signed byte/word/signed word) 0) goto init_plot_tables::@3 + to:init_plot_tables::@return +init_plot_tables::@7: scope:[init_plot_tables] from init_plot_tables::@3 + (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (const word/signed word) init_plot_tables::$13 + to:init_plot_tables::@4 +init_plot_tables::@return: scope:[init_plot_tables] from init_plot_tables::@4 + return + to:@return +init_screen: scope:[init_screen] from main + to:init_screen::@1 +init_screen::@1: scope:[init_screen] from init_screen init_screen::@1 + (byte*) init_screen::b#2 ← phi( init_screen/(const byte*) init_screen::b#0 init_screen::@1/(byte*) init_screen::b#1 ) + *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 + (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 + if((byte*) init_screen::b#1!=(const byte*) init_screen::$0) goto init_screen::@1 + to:init_screen::@3 +init_screen::@3: scope:[init_screen] from init_screen::@1 + to:init_screen::@2 +init_screen::@2: scope:[init_screen] from init_screen::@2 init_screen::@3 + (byte*) init_screen::c#2 ← phi( init_screen::@2/(byte*) init_screen::c#1 init_screen::@3/(const byte*) init_screen::c#0 ) + *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 + (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 + if((byte*) init_screen::c#1!=(const byte*) init_screen::$2) goto init_screen::@2 + to:init_screen::@return +init_screen::@return: scope:[init_screen] from init_screen::@2 + return + to:@return +@10: scope:[] from @begin + call main param-assignment + to:@end +@end: scope:[] from @10 + Culled Empty Block (label) main::@4 Not culling empty block because it shares successor with its predecessor. (label) init_plot_tables::@5 Culled Empty Block (label) init_plot_tables::@6 @@ -15163,7 +15518,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:28 [ l Statement [104] (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) [ plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] ) always clobbers reg byte a Statement [105] (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 [ plot::x#4 plot::$0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::$0 ] ) always clobbers reg byte a Statement [106] (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 [ plot::x#4 plot::plotter#0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter#0 ] ) always clobbers reg byte a -Statement [107] (byte~) plotAsm::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) [ plot::plotter#0 plot::$1 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] ) always clobbers reg byte a reg byte y +Statement [107] (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) [ plot::plotter#0 plot::$1 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ lines::l#2 lines::l#1 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ line_ydxi::xd#2 line_ydxi::xd#1 line_ydxi::xd#0 ] Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ line_ydxi::yd#5 line_ydxi::yd#1 line_ydxi::yd#0 ] diff --git a/src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log b/src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log index f94a6c390..a267b4b47 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log @@ -2150,37 +2150,6 @@ Allocated zp ZP_WORD:3 [ line_cursor#6 line_cursor#13 line_cursor#1 ] Allocated zp ZP_WORD:5 [ print_str::str#2 print_str::str#0 ] Allocated zp ZP_WORD:7 [ char_cursor#10 char_cursor#19 char_cursor#25 char_cursor#1 ] Allocated zp ZP_WORD:9 [ print_cls::sc#2 print_cls::sc#1 ] -Attempting fragment synthesis vbuz1=vbuc1 -Succesfully loaded fragment vbuaa=vbuc1 -Succesfully synthesized fragment vbuz1=vbuc1 (from vbuaa=vbuc1) -Attempting fragment synthesis pbuz1=pbuc1 -Succesfully loaded fragment pbuz1=vwuc1 -Succesfully synthesized fragment pbuz1=pbuc1 (from pbuz1=vwuc1) -Attempting fragment synthesis _deref_pbuc1=_inc__deref_pbuc2 -Attempting fragment synthesis _deref_pbuc1=_inc__deref_vwuc2 -Attempting fragment synthesis _deref_vwuc1=_inc__deref_vwuc2 -Attempting fragment synthesis vbuaa=_inc__deref_vwuc1 -Attempting fragment synthesis vbuaa=_deref_vwuc1_plus_1 -Succesfully loaded fragment vbuaa=vbuaa_plus_1 -Succesfully synthesized fragment vbuaa=_deref_vwuc1_plus_1 (from vbuaa=vbuaa_plus_1) -Succesfully synthesized fragment vbuaa=_inc__deref_vwuc1 (from vbuaa=_deref_vwuc1_plus_1) -Succesfully synthesized fragment _deref_vwuc1=_inc__deref_vwuc2 (from vbuaa=_inc__deref_vwuc1) -Succesfully synthesized fragment _deref_pbuc1=_inc__deref_vwuc2 (from _deref_vwuc1=_inc__deref_vwuc2) -Succesfully synthesized fragment _deref_pbuc1=_inc__deref_pbuc2 (from _deref_pbuc1=_inc__deref_vwuc2) -Succesfully loaded fragment vbuz1=_inc_vbuz1 -Succesfully loaded fragment vbuz1_neq_vbuc1_then_la1 -Succesfully loaded fragment pbuz1=pbuz2 -Succesfully loaded fragment pbuz1=pbuz1_plus_vbuc1 -Succesfully loaded fragment pbuz1_lt_pbuz2_then_la1 -Attempting fragment synthesis _deref_pbuz1_neq_vbuc1_then_la1 -Succesfully loaded fragment vbuaa_neq_vbuc1_then_la1 -Succesfully synthesized fragment _deref_pbuz1_neq_vbuc1_then_la1 (from vbuaa_neq_vbuc1_then_la1) -Attempting fragment synthesis _deref_pbuz1=_deref_pbuz2 -Succesfully loaded fragment vbuaa=_deref_pbuz1 -Succesfully synthesized fragment _deref_pbuz1=_deref_pbuz2 (from vbuaa=_deref_pbuz1) -Succesfully loaded fragment pbuz1=_inc_pbuz1 -Succesfully loaded fragment _deref_pbuz1=vbuc1 -Succesfully loaded fragment pbuz1_neq_vwuc1_then_la1 INITIAL ASM //SEG0 Basic Upstart .pc = $801 "Basic" @@ -2399,7 +2368,6 @@ print_cls: { REGISTER UPLIFT POTENTIAL REGISTERS Statement [10] *((const byte[]) txt#0+(byte/signed byte/word/signed word) 1) ← ++ *((const byte[]) txt#0+(byte/signed byte/word/signed word) 1) [ main::i#2 line_cursor#1 ] ( main:2 [ main::i#2 line_cursor#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 ] -Succesfully loaded fragment vbuxx_neq_vbuc1_then_la1 Statement [14] (byte*~) char_cursor#25 ← (byte*) line_cursor#1 [ char_cursor#25 line_cursor#1 main::i#1 ] ( main:2 [ char_cursor#25 line_cursor#1 main::i#1 ] ) always clobbers reg byte a Statement [17] (byte*) line_cursor#1 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ line_cursor#1 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#1 char_cursor#10 ] ) always clobbers reg byte a Statement [18] if((byte*) line_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 [ line_cursor#1 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#1 char_cursor#10 ] ) always clobbers reg byte a @@ -2432,8 +2400,6 @@ Uplift Scope [print_ln] Uplifting [] best 13477 combination zp ZP_WORD:3 [ line_cursor#6 line_cursor#13 line_cursor#1 ] zp ZP_WORD:7 [ char_cursor#10 char_cursor#19 char_cursor#25 char_cursor#1 ] Uplifting [print_str] best 13477 combination zp ZP_WORD:5 [ print_str::str#2 print_str::str#0 ] Uplifting [print_cls] best 13477 combination zp ZP_WORD:9 [ print_cls::sc#2 print_cls::sc#1 ] -Succesfully loaded fragment vbuxx=vbuc1 -Succesfully loaded fragment vbuxx=_inc_vbuxx Uplifting [main] best 13387 combination reg byte x [ main::i#2 main::i#1 ] Uplifting [print_ln] best 13387 combination Coalescing zero page register [ zp ZP_WORD:3 [ line_cursor#6 line_cursor#13 line_cursor#1 ] ] with [ zp ZP_WORD:9 [ print_cls::sc#2 print_cls::sc#1 ] ] diff --git a/src/main/java/dk/camelot64/kickc/test/ref/inline-word.log b/src/main/java/dk/camelot64/kickc/test/ref/inline-word.log index 740d65cc5..7e2d89afb 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/inline-word.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/inline-word.log @@ -1,10 +1,10 @@ const byte* SCREEN = $400; void main() { - byte[] his = { >SCREEN, >SCREEN+$100, >SCREEN+$200 }; + byte[] his = { >SCREEN, >SCREEN+$100, >SCREEN+$200 }; // constant array for( byte h: 0..2) { for (byte l: 4..7) { - word w = { his[h], l }; + word w = { his[h], l }; // inline word byte* sc = (byte*)w; *sc = '*'; } @@ -99,7 +99,6 @@ main::@return: scope:[main] from main::@4 to:@end @end: scope:[] from @1 -Fixing word constructor with main::w ← *(main::his + main::h) w= main::l Removing empty block main::@4 CONTROL FLOW GRAPH @begin: scope:[] from @@ -118,7 +117,7 @@ main::@1: scope:[main] from main main::@3 (byte) main::l ← (byte/signed byte/word/signed word) 4 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - (word) main::w ← *((byte[]) main::his + (byte) main::h) w= (byte) main::l + (word) main::w ← { *((byte[]) main::his + (byte) main::h), (byte) main::l } (byte*~) main::$5 ← ((byte*)) (word) main::w (byte*) main::sc ← (byte*~) main::$5 *((byte*) main::sc) ← (byte) '*' @@ -158,7 +157,7 @@ main::@1: scope:[main] from main main::@3 (byte) main::l ← (byte/signed byte/word/signed word) 4 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - (word) main::w ← *((byte[]) main::his + (byte) main::h) w= (byte) main::l + (word) main::w ← { *((byte[]) main::his + (byte) main::h), (byte) main::l } (byte*~) main::$5 ← ((byte*)) (word) main::w (byte*) main::sc ← (byte*~) main::$5 *((byte*) main::sc) ← (byte) '*' @@ -206,7 +205,7 @@ main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) (byte) main::h#2 ← phi( main::@1/(byte) main::h#4 main::@2/(byte) main::h#2 ) (byte[]) main::his#1 ← phi( main::@1/(byte[]) main::his#2 main::@2/(byte[]) main::his#1 ) - (word) main::w#0 ← *((byte[]) main::his#1 + (byte) main::h#2) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#1 + (byte) main::h#2), (byte) main::l#2 } (byte*~) main::$5 ← ((byte*)) (word) main::w#0 (byte*) main::sc#0 ← (byte*~) main::$5 *((byte*) main::sc#0) ← (byte) '*' @@ -253,7 +252,7 @@ main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) (byte) main::h#2 ← phi( main::@1/(byte) main::h#4 main::@2/(byte) main::h#2 ) (byte[]) main::his#1 ← phi( main::@1/(byte[]) main::his#2 main::@2/(byte[]) main::his#1 ) - (word) main::w#0 ← *((byte[]) main::his#1 + (byte) main::h#2) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#1 + (byte) main::h#2), (byte) main::l#2 } (byte*~) main::$5 ← ((byte*)) (word) main::w#0 (byte*) main::sc#0 ← (byte*~) main::$5 *((byte*) main::sc#0) ← (byte) '*' @@ -342,7 +341,7 @@ main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) (byte) main::h#2 ← phi( main::@1/(byte) main::h#4 main::@2/(byte) main::h#2 ) (byte[]) main::his#1 ← phi( main::@1/(byte[]) main::his#2 main::@2/(byte[]) main::his#1 ) - (word) main::w#0 ← *((byte[]) main::his#1 + (byte) main::h#2) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#1 + (byte) main::h#2), (byte) main::l#2 } (byte*~) main::$5 ← ((byte*)) (word) main::w#0 (byte*) main::sc#0 ← (byte*~) main::$5 *((byte*) main::sc#0) ← (byte) '*' @@ -391,7 +390,7 @@ main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) (byte) main::h#2 ← phi( main::@1/(byte) main::h#4 main::@2/(byte) main::h#2 ) (byte[]) main::his#1 ← phi( main::@1/(byte[]) main::his#2 main::@2/(byte[]) main::his#1 ) - (word) main::w#0 ← *((byte[]) main::his#1 + (byte) main::h#2) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#1 + (byte) main::h#2), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -436,7 +435,7 @@ main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) (byte) main::h#2 ← phi( main::@1/(byte) main::h#4 ) (byte[]) main::his#1 ← phi( main::@1/(byte[]) main::his#2 ) - (word) main::w#0 ← *((byte[]) main::his#1 + (byte) main::h#2) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#1 + (byte) main::h#2), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -479,7 +478,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) - (word) main::w#0 ← *((byte[]) main::his#2 + (byte) main::h#4) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -522,7 +521,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(byte) main::l#0 main::@2/(byte) main::l#1 ) - (word) main::w#0 ← *((byte[]) main::his#2 + (byte) main::h#4) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -561,7 +560,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(const byte) main::l#0 main::@2/(byte) main::l#1 ) - (word) main::w#0 ← *((byte[]) main::his#2 + (byte) main::h#4) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -597,7 +596,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(const byte) main::l#0 main::@2/(byte) main::l#1 ) - (word) main::w#0 ← *((byte[]) main::his#2 + (byte) main::h#4) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -630,7 +629,7 @@ main::@1: scope:[main] from main main::@3 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 (byte) main::l#2 ← phi( main::@1/(const byte) main::l#0 main::@2/(byte) main::l#1 ) - (word) main::w#0 ← *((byte[]) main::his#2 + (byte) main::h#4) w= (byte) main::l#2 + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 *((byte*) main::sc#0) ← (byte) '*' (byte) main::l#1 ← ++ (byte) main::l#2 @@ -651,6 +650,37 @@ main::@return: scope:[main] from main::@3 Constant (const byte[]) main::his#0 = { main::$0, main::$2, main::$4 } Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + to:main::@1 +main::@1: scope:[main] from main main::@3 + (byte) main::h#4 ← phi( main/(const byte) main::h#0 main::@3/(byte) main::h#1 ) + (byte[]) main::his#2 ← phi( main/(const byte[]) main::his#0 main::@3/(byte[]) main::his#2 ) + to:main::@2 +main::@2: scope:[main] from main::@1 main::@2 + (byte) main::l#2 ← phi( main::@1/(const byte) main::l#0 main::@2/(byte) main::l#1 ) + (word) main::w#0 ← { *((byte[]) main::his#2 + (byte) main::h#4), (byte) main::l#2 } + (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 + *((byte*) main::sc#0) ← (byte) '*' + (byte) main::l#1 ← ++ (byte) main::l#2 + if((byte) main::l#1!=(byte/signed byte/word/signed word) 8) goto main::@2 + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte) main::h#1 ← ++ (byte) main::h#4 + if((byte) main::h#1!=(byte/signed byte/word/signed word) 3) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@3 + return + to:@return +@1: scope:[] from @begin + call main param-assignment + to:@end +@end: scope:[] from @1 + +Fixing word constructor with main::w#0 ← *(main::his#2 + main::h#4) w= main::l#2 +Succesful SSA optimization Pass2FixWordConstructors +CONTROL FLOW GRAPH @begin: scope:[] from to:@1 main: scope:[main] from @1 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg index f72398ba6..f28dc2ebf 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg @@ -1,13 +1,13 @@ @begin: scope:[] from [0] phi() [ ] ( ) - to:@6 -@6: scope:[] from @begin + to:@7 +@7: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 [3] phi() [ ] ( ) -main: scope:[main] from @6 +main: scope:[main] from @7 [4] phi() [ ] ( main:2 [ ] ) [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) to:main::@1 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log index 19038c3d4..9b2a86559 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log @@ -52,10 +52,19 @@ void print_char(byte ch) { *(char_cursor++) = ch; } +// Clear the screen +void print_cls() { + for(byte* sc=$0400; sc!=$0400+1000; sc++) { + *sc = ' '; + } +} + + Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor +Adding pre/post-modifier (byte*) print_cls::sc ← ++ (byte*) print_cls::sc PROGRAM (byte*) line_cursor ← (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor @@ -106,6 +115,17 @@ proc (void()) print_char((byte) print_char::ch) print_char::@return: return endproc // print_char() +proc (void()) print_cls() + (byte*) print_cls::sc ← (word/signed word) 1024 +print_cls::@1: + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 +print_cls::@return: + return +endproc // print_cls() (byte[]) msg ← (string) "hello world! @" (byte[]) msg2 ← (string) "hello c64! @" (byte[]) msg3 ← (string) "hello 2017! @" @@ -146,6 +166,12 @@ SYMBOLS (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch +(void()) print_cls() +(word/signed word~) print_cls::$0 +(boolean~) print_cls::$1 +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc (void()) print_ln() (byte*~) print_ln::$0 (boolean~) print_ln::$1 @@ -167,6 +193,7 @@ SYMBOLS (word) print_word::w Promoting word/signed word to byte* in line_cursor ← ((byte*)) 1024 +Promoting word/signed word to byte* in print_cls::sc ← ((byte*)) 1024 INITIAL CONTROL FLOW GRAPH @begin: scope:[] from (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 @@ -243,10 +270,27 @@ print_char::@return: scope:[print_char] from print_char return to:@return @5: scope:[] from @4 + to:@6 +print_cls: scope:[print_cls] from + (byte*) print_cls::sc ← ((byte*)) (word/signed word) 1024 + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + to:print_cls::@2 +print_cls::@2: scope:[print_cls] from print_cls::@1 + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@2 + return + to:@return +@6: scope:[] from @5 (byte[]) msg ← (string) "hello world! @" (byte[]) msg2 ← (string) "hello c64! @" (byte[]) msg3 ← (string) "hello 2017! @" - to:@6 + to:@7 main: scope:[main] from (void~) main::$0 ← call print_str (byte[]) msg (void~) main::$1 ← call print_ln @@ -258,12 +302,13 @@ main: scope:[main] from main::@return: scope:[main] from main return to:@return -@6: scope:[] from @5 +@7: scope:[] from @6 call main to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 Removing unused procedure print_word +Removing unused procedure print_cls Removing unused procedure print_byte Removing unused procedure print_char Eliminating unused variable - keeping the call (void~) main::$0 @@ -280,11 +325,12 @@ Removing empty block @1 Removing empty block @2 Removing empty block @3 Removing empty block @4 +Removing empty block @5 CONTROL FLOW GRAPH @begin: scope:[] from (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@5 + to:@6 print_str: scope:[print_str] from to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 @@ -313,11 +359,11 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg ← (string) "hello world! @" (byte[]) msg2 ← (string) "hello c64! @" (byte[]) msg3 ← (string) "hello 2017! @" - to:@6 + to:@7 main: scope:[main] from call print_str (byte[]) msg call print_ln @@ -329,10 +375,10 @@ main: scope:[main] from main::@return: scope:[main] from main return to:@return -@6: scope:[] from @5 +@7: scope:[] from @6 call main to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 PROCEDURE MODIFY VARIABLE ANALYSIS print_str modifies char_cursor @@ -345,7 +391,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL @begin: scope:[] from (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 @@ -377,12 +423,12 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) char_cursor ← (byte*) char_cursor return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg ← (string) "hello world! @" (byte[]) msg2 ← (string) "hello c64! @" (byte[]) msg3 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 + to:@7 +main: scope:[main] from @7 (byte*) print_str::str ← (byte[]) msg call print_str param-assignment to:main::@1 @@ -419,14 +465,14 @@ main::@return: scope:[main] from main::@6 (byte*) line_cursor ← (byte*) line_cursor return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 (byte*) char_cursor ← (byte*) char_cursor (byte*) line_cursor ← (byte*) line_cursor to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Completing Phi functions... Completing Phi functions... @@ -438,7 +484,7 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor#0 ← (byte*) line_cursor#0 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#6 main::@4/(byte*) char_cursor#8 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -484,19 +530,19 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) char_cursor#4 ← (byte*) char_cursor#16 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) line_cursor#22 ← phi( @begin/(byte*) line_cursor#0 ) (byte*) char_cursor#30 ← phi( @begin/(byte*) char_cursor#0 ) (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 - (byte[]) msg3#5 ← phi( @6/(byte[]) msg3#6 ) - (byte[]) msg2#3 ← phi( @6/(byte[]) msg2#4 ) - (byte*) line_cursor#21 ← phi( @6/(byte*) line_cursor#20 ) - (byte*) char_cursor#27 ← phi( @6/(byte*) char_cursor#28 ) - (byte[]) msg#1 ← phi( @6/(byte[]) msg#2 ) + to:@7 +main: scope:[main] from @7 + (byte[]) msg3#5 ← phi( @7/(byte[]) msg3#6 ) + (byte[]) msg2#3 ← phi( @7/(byte[]) msg2#4 ) + (byte*) line_cursor#21 ← phi( @7/(byte*) line_cursor#20 ) + (byte*) char_cursor#27 ← phi( @7/(byte*) char_cursor#28 ) + (byte[]) msg#1 ← phi( @7/(byte[]) msg#2 ) (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 @@ -553,27 +599,27 @@ main::@return: scope:[main] from main::@6 (byte*) line_cursor#6 ← (byte*) line_cursor#14 return to:@return -@6: scope:[] from @5 - (byte[]) msg3#6 ← phi( @5/(byte[]) msg3#0 ) - (byte[]) msg2#4 ← phi( @5/(byte[]) msg2#0 ) - (byte*) line_cursor#20 ← phi( @5/(byte*) line_cursor#22 ) - (byte*) char_cursor#28 ← phi( @5/(byte*) char_cursor#30 ) - (byte[]) msg#2 ← phi( @5/(byte[]) msg#0 ) - call main param-assignment - to:@7 @7: scope:[] from @6 - (byte*) line_cursor#15 ← phi( @6/(byte*) line_cursor#20 ) - (byte*) char_cursor#24 ← phi( @6/(byte*) char_cursor#28 ) + (byte[]) msg3#6 ← phi( @6/(byte[]) msg3#0 ) + (byte[]) msg2#4 ← phi( @6/(byte[]) msg2#0 ) + (byte*) line_cursor#20 ← phi( @6/(byte*) line_cursor#22 ) + (byte*) char_cursor#28 ← phi( @6/(byte*) char_cursor#30 ) + (byte[]) msg#2 ← phi( @6/(byte[]) msg#0 ) + call main param-assignment + to:@8 +@8: scope:[] from @7 + (byte*) line_cursor#15 ← phi( @7/(byte*) line_cursor#20 ) + (byte*) char_cursor#24 ← phi( @7/(byte*) char_cursor#28 ) (byte*) char_cursor#12 ← (byte*) char_cursor#24 (byte*) line_cursor#7 ← (byte*) line_cursor#15 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN @begin: scope:[] from (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor#0 ← (byte*) line_cursor#0 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#6 main::@4/(byte*) char_cursor#8 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -619,19 +665,19 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 (byte*) char_cursor#4 ← (byte*) char_cursor#16 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) line_cursor#22 ← phi( @begin/(byte*) line_cursor#0 ) (byte*) char_cursor#30 ← phi( @begin/(byte*) char_cursor#0 ) (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 - (byte[]) msg3#5 ← phi( @6/(byte[]) msg3#6 ) - (byte[]) msg2#3 ← phi( @6/(byte[]) msg2#4 ) - (byte*) line_cursor#21 ← phi( @6/(byte*) line_cursor#20 ) - (byte*) char_cursor#27 ← phi( @6/(byte*) char_cursor#28 ) - (byte[]) msg#1 ← phi( @6/(byte[]) msg#2 ) + to:@7 +main: scope:[main] from @7 + (byte[]) msg3#5 ← phi( @7/(byte[]) msg3#6 ) + (byte[]) msg2#3 ← phi( @7/(byte[]) msg2#4 ) + (byte*) line_cursor#21 ← phi( @7/(byte*) line_cursor#20 ) + (byte*) char_cursor#27 ← phi( @7/(byte*) char_cursor#28 ) + (byte[]) msg#1 ← phi( @7/(byte[]) msg#2 ) (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 @@ -688,26 +734,26 @@ main::@return: scope:[main] from main::@6 (byte*) line_cursor#6 ← (byte*) line_cursor#14 return to:@return -@6: scope:[] from @5 - (byte[]) msg3#6 ← phi( @5/(byte[]) msg3#0 ) - (byte[]) msg2#4 ← phi( @5/(byte[]) msg2#0 ) - (byte*) line_cursor#20 ← phi( @5/(byte*) line_cursor#22 ) - (byte*) char_cursor#28 ← phi( @5/(byte*) char_cursor#30 ) - (byte[]) msg#2 ← phi( @5/(byte[]) msg#0 ) - call main param-assignment - to:@7 @7: scope:[] from @6 - (byte*) line_cursor#15 ← phi( @6/(byte*) line_cursor#6 ) - (byte*) char_cursor#24 ← phi( @6/(byte*) char_cursor#11 ) + (byte[]) msg3#6 ← phi( @6/(byte[]) msg3#0 ) + (byte[]) msg2#4 ← phi( @6/(byte[]) msg2#0 ) + (byte*) line_cursor#20 ← phi( @6/(byte*) line_cursor#22 ) + (byte*) char_cursor#28 ← phi( @6/(byte*) char_cursor#30 ) + (byte[]) msg#2 ← phi( @6/(byte[]) msg#0 ) + call main param-assignment + to:@8 +@8: scope:[] from @7 + (byte*) line_cursor#15 ← phi( @7/(byte*) line_cursor#6 ) + (byte*) char_cursor#24 ← phi( @7/(byte*) char_cursor#11 ) (byte*) char_cursor#12 ← (byte*) char_cursor#24 (byte*) line_cursor#7 ← (byte*) line_cursor#15 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 INITIAL SSA SYMBOL TABLE -(label) @5 (label) @6 (label) @7 +(label) @8 (label) @begin (label) @end (byte*) char_cursor @@ -860,7 +906,7 @@ Succesful SSA optimization Pass2AliasElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#18 main::@4/(byte*) char_cursor#20 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -895,17 +941,17 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 - (byte[]) msg3#1 ← phi( @6/(byte[]) msg3#0 ) - (byte[]) msg2#1 ← phi( @6/(byte[]) msg2#0 ) - (byte*) line_cursor#17 ← phi( @6/(byte*) char_cursor#0 ) - (byte*) char_cursor#27 ← phi( @6/(byte*) char_cursor#0 ) - (byte[]) msg#1 ← phi( @6/(byte[]) msg#0 ) + to:@7 +main: scope:[main] from @7 + (byte[]) msg3#1 ← phi( @7/(byte[]) msg3#0 ) + (byte[]) msg2#1 ← phi( @7/(byte[]) msg2#0 ) + (byte*) line_cursor#17 ← phi( @7/(byte*) char_cursor#0 ) + (byte*) char_cursor#27 ← phi( @7/(byte*) char_cursor#0 ) + (byte[]) msg#1 ← phi( @7/(byte[]) msg#0 ) (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 @@ -940,14 +986,14 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 - (byte*) line_cursor#15 ← phi( @6/(byte*) line_cursor#13 ) - (byte*) char_cursor#12 ← phi( @6/(byte*) char_cursor#10 ) + call main param-assignment + to:@8 +@8: scope:[] from @7 + (byte*) line_cursor#15 ← phi( @7/(byte*) line_cursor#13 ) + (byte*) char_cursor#12 ← phi( @7/(byte*) char_cursor#10 ) to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Not aliassing across scopes: print_str::str#6 print_str::str#1 Not aliassing across scopes: char_cursor#29 char_cursor#27 @@ -977,7 +1023,7 @@ Succesful SSA optimization Pass2SelfPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#18 main::@4/(byte*) char_cursor#20 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -1012,17 +1058,17 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 - (byte[]) msg3#1 ← phi( @6/(byte[]) msg3#0 ) - (byte[]) msg2#1 ← phi( @6/(byte[]) msg2#0 ) - (byte*) line_cursor#17 ← phi( @6/(byte*) char_cursor#0 ) - (byte*) char_cursor#27 ← phi( @6/(byte*) char_cursor#0 ) - (byte[]) msg#1 ← phi( @6/(byte[]) msg#0 ) + to:@7 +main: scope:[main] from @7 + (byte[]) msg3#1 ← phi( @7/(byte[]) msg3#0 ) + (byte[]) msg2#1 ← phi( @7/(byte[]) msg2#0 ) + (byte*) line_cursor#17 ← phi( @7/(byte*) char_cursor#0 ) + (byte*) char_cursor#27 ← phi( @7/(byte*) char_cursor#0 ) + (byte[]) msg#1 ← phi( @7/(byte[]) msg#0 ) (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 @@ -1057,14 +1103,14 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 - (byte*) line_cursor#15 ← phi( @6/(byte*) line_cursor#13 ) - (byte*) char_cursor#12 ← phi( @6/(byte*) char_cursor#10 ) + call main param-assignment + to:@8 +@8: scope:[] from @7 + (byte*) line_cursor#15 ← phi( @7/(byte*) line_cursor#13 ) + (byte*) char_cursor#12 ← phi( @7/(byte*) char_cursor#10 ) to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Redundant Phi (byte*) char_cursor#15 (byte*) char_cursor#26 Redundant Phi (byte[]) msg#1 (byte[]) msg#0 @@ -1087,7 +1133,7 @@ Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -1121,12 +1167,12 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 + to:@7 +main: scope:[main] from @7 (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 @@ -1152,19 +1198,19 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Redundant Phi (byte*) char_cursor#26 (byte*) char_cursor#13 Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -1197,12 +1243,12 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 + to:@7 +main: scope:[main] from @7 (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 @@ -1228,12 +1274,12 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Simple Condition (boolean~) print_str::$0 if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 Simple Condition (boolean~) print_ln::$1 if((byte*) line_cursor#1<(byte*) char_cursor#13) goto print_ln::@1 @@ -1241,7 +1287,7 @@ Succesful SSA optimization Pass2ConditionalJumpSimplification CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -1272,12 +1318,12 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@6 -main: scope:[main] from @6 + to:@7 +main: scope:[main] from @7 (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 @@ -1303,12 +1349,12 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Constant (const byte*) char_cursor#0 = ((byte*))1024 Constant (const byte[]) msg#0 = "hello world! @" @@ -1317,7 +1363,7 @@ Constant (const byte[]) msg3#0 = "hello 2017! @" Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) @@ -1348,9 +1394,9 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin - to:@6 -main: scope:[main] from @6 +@6: scope:[] from @begin + to:@7 +main: scope:[main] from @7 (byte*) print_str::str#1 ← (const byte[]) msg#0 call print_str param-assignment to:main::@1 @@ -1376,12 +1422,12 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Constant (const byte*) print_str::str#1 = msg#0 Constant (const byte*) print_str::str#2 = msg2#0 @@ -1389,7 +1435,7 @@ Constant (const byte*) print_str::str#3 = msg3#0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@5 + to:@6 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#1 main::@2/(const byte*) print_str::str#2 main::@4/(const byte*) print_str::str#3 ) @@ -1420,9 +1466,9 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@5: scope:[] from @begin - to:@6 -main: scope:[main] from @6 +@6: scope:[] from @begin + to:@7 +main: scope:[main] from @7 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main @@ -1445,21 +1491,21 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@6: scope:[] from @5 - call main param-assignment - to:@7 @7: scope:[] from @6 + call main param-assignment + to:@8 +@8: scope:[] from @7 to:@end -@end: scope:[] from @7 +@end: scope:[] from @8 Culled Empty Block (label) print_ln::@2 -Culled Empty Block (label) @5 +Culled Empty Block (label) @6 Culled Empty Block (label) main::@6 -Culled Empty Block (label) @7 +Culled Empty Block (label) @8 Succesful SSA optimization Pass2CullEmptyBlocks CONTROL FLOW GRAPH @begin: scope:[] from - to:@6 + to:@7 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#1 main::@2/(const byte*) print_str::str#2 main::@4/(const byte*) print_str::str#3 ) @@ -1488,7 +1534,7 @@ print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@1 return to:@return -main: scope:[main] from @6 +main: scope:[main] from @7 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main @@ -1509,10 +1555,10 @@ main::@5: scope:[main] from main::@4 main::@return: scope:[main] from main::@5 return to:@return -@6: scope:[] from @begin +@7: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 Inlining constant with var siblings (const byte*) print_str::str#1 Inlining constant with var siblings (const byte*) print_str::str#1 @@ -1533,7 +1579,7 @@ Constant inlined print_str::str#1 = (const byte[]) msg#0 Succesful SSA optimization Pass2ConstantInlining CONTROL FLOW GRAPH @begin: scope:[] from - to:@6 + to:@7 print_str: scope:[print_str] from main main::@2 main::@4 (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*) line_cursor#1 main::@4/(byte*) line_cursor#1 ) (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) @@ -1562,7 +1608,7 @@ print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@1 return to:@return -main: scope:[main] from @6 +main: scope:[main] from @7 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main @@ -1583,13 +1629,13 @@ main::@5: scope:[main] from main::@4 main::@return: scope:[main] from main::@5 return to:@return -@6: scope:[] from @begin +@7: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 FINAL SYMBOL TABLE -(label) @6 +(label) @7 (label) @begin (label) @end (byte*) char_cursor @@ -1625,17 +1671,17 @@ FINAL SYMBOL TABLE (byte*) print_str::str#4 (byte*) print_str::str#6 -Block Sequence Planned @begin @6 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_str print_str::@1 print_str::@return print_str::@2 +Block Sequence Planned @begin @7 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_str print_str::@1 print_str::@return print_str::@2 Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) -Block Sequence Planned @begin @6 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_ln::@3 print_str print_str::@1 print_str::@return print_str::@2 +Block Sequence Planned @begin @7 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_ln::@3 print_str print_str::@1 print_str::@return print_str::@2 CONTROL FLOW GRAPH - PHI LIFTED @begin: scope:[] from - to:@6 -@6: scope:[] from @begin + to:@7 +@7: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @6 -main: scope:[main] from @6 +@end: scope:[] from @7 +main: scope:[main] from @7 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main @@ -1698,7 +1744,7 @@ print_str::@2: scope:[print_str] from print_str::@1 to:print_str::@1 Adding NOP phi() at start of @begin -Adding NOP phi() at start of @6 +Adding NOP phi() at start of @7 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -1717,14 +1763,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - LIVE RANGES FOUND @begin: scope:[] from [0] phi() [ ] - to:@6 -@6: scope:[] from @begin + to:@7 +@7: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 [3] phi() [ ] -main: scope:[main] from @6 +main: scope:[main] from @7 [4] phi() [ ] [5] call print_str param-assignment [ char_cursor#13 ] to:main::@1 @@ -1801,9 +1847,9 @@ Coalesced [33] print_str::str#8 ← print_str::str#0 Coalesced [34] char_cursor#34 ← char_cursor#1 Coalesced down to 3 phi equivalence classes Culled Empty Block (label) print_ln::@3 -Block Sequence Planned @begin @6 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_str print_str::@1 print_str::@return print_str::@2 +Block Sequence Planned @begin @7 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_str print_str::@1 print_str::@return print_str::@2 Adding NOP phi() at start of @begin -Adding NOP phi() at start of @6 +Adding NOP phi() at start of @7 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@1 @@ -1819,14 +1865,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - BEFORE EFFECTIVE LIVE RANGES @begin: scope:[] from [0] phi() [ ] - to:@6 -@6: scope:[] from @begin + to:@7 +@7: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 [3] phi() [ ] -main: scope:[main] from @6 +main: scope:[main] from @7 [4] phi() [ ] [5] call print_str param-assignment [ char_cursor#13 ] to:main::@1 @@ -1885,14 +1931,14 @@ print_str::@2: scope:[print_str] from print_str::@1 CONTROL FLOW GRAPH - PHI MEM COALESCED @begin: scope:[] from [0] phi() [ ] ( ) - to:@6 -@6: scope:[] from @begin + to:@7 +@7: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @6 +@end: scope:[] from @7 [3] phi() [ ] ( ) -main: scope:[main] from @6 +main: scope:[main] from @7 [4] phi() [ ] ( main:2 [ ] ) [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) to:main::@1 @@ -1950,22 +1996,22 @@ print_str::@2: scope:[print_str] from print_str::@1 DOMINATORS @begin dominated by @begin -@6 dominated by @begin @6 -@end dominated by @begin @end @6 -main dominated by @begin main @6 -main::@1 dominated by @begin main @6 main::@1 -main::@2 dominated by @begin main @6 main::@1 main::@2 -main::@3 dominated by @begin main @6 main::@1 main::@2 main::@3 -main::@4 dominated by @begin main @6 main::@1 main::@2 main::@3 main::@4 -main::@5 dominated by @begin main @6 main::@1 main::@2 main::@5 main::@3 main::@4 -main::@return dominated by main::@return @begin main @6 main::@1 main::@2 main::@5 main::@3 main::@4 -print_ln dominated by @begin main print_ln @6 main::@1 -print_ln::@1 dominated by print_ln::@1 @begin main print_ln @6 main::@1 -print_ln::@return dominated by print_ln::@1 @begin main print_ln print_ln::@return @6 main::@1 -print_str dominated by @begin main @6 print_str -print_str::@1 dominated by @begin main print_str::@1 @6 print_str -print_str::@return dominated by @begin print_str::@return main print_str::@1 @6 print_str -print_str::@2 dominated by @begin main print_str::@1 print_str::@2 @6 print_str +@7 dominated by @begin @7 +@end dominated by @begin @end @7 +main dominated by @begin main @7 +main::@1 dominated by @begin main @7 main::@1 +main::@2 dominated by @begin main @7 main::@1 main::@2 +main::@3 dominated by @begin main @7 main::@1 main::@2 main::@3 +main::@4 dominated by @begin main @7 main::@1 main::@2 main::@3 main::@4 +main::@5 dominated by @begin main @7 main::@1 main::@2 main::@5 main::@3 main::@4 +main::@return dominated by main::@return @begin main @7 main::@1 main::@2 main::@5 main::@3 main::@4 +print_ln dominated by @begin main print_ln @7 main::@1 +print_ln::@1 dominated by print_ln::@1 @begin main print_ln @7 main::@1 +print_ln::@return dominated by print_ln::@1 @begin main print_ln print_ln::@return @7 main::@1 +print_str dominated by @begin main print_str @7 +print_str::@1 dominated by @begin main print_str::@1 print_str @7 +print_str::@return dominated by @begin print_str::@return main print_str::@1 print_str @7 +print_str::@2 dominated by @begin main print_str::@1 print_str::@2 print_str @7 Found back edge: Loop head: print_ln::@1 tails: print_ln::@1 blocks: null Found back edge: Loop head: print_str::@1 tails: print_str::@2 blocks: null @@ -2032,17 +2078,17 @@ INITIAL ASM msg3: .text "hello 2017! @" //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @6 [phi:@begin->@6] -b6_from_bbegin: - jmp b6 -//SEG4 @6 -b6: +//SEG3 [1] phi from @begin to @7 [phi:@begin->@7] +b7_from_bbegin: + jmp b7 +//SEG4 @7 +b7: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @6 to main [phi:@6->main] -main_from_b6: +//SEG6 [4] phi from @7 to main [phi:@7->main] +main_from_b7: jsr main -//SEG7 [3] phi from @6 to @end [phi:@6->@end] -bend_from_b6: +//SEG7 [3] phi from @7 to @end [phi:@7->@end] +bend_from_b7: jmp bend //SEG8 @end bend: @@ -2246,17 +2292,17 @@ ASSEMBLER BEFORE OPTIMIZATION msg3: .text "hello 2017! @" //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @6 [phi:@begin->@6] -b6_from_bbegin: - jmp b6 -//SEG4 @6 -b6: +//SEG3 [1] phi from @begin to @7 [phi:@begin->@7] +b7_from_bbegin: + jmp b7 +//SEG4 @7 +b7: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @6 to main [phi:@6->main] -main_from_b6: +//SEG6 [4] phi from @7 to main [phi:@7->main] +main_from_b7: jsr main -//SEG7 [3] phi from @6 to @end [phi:@6->@end] -bend_from_b6: +//SEG7 [3] phi from @7 to @end [phi:@7->@end] +bend_from_b7: jmp bend //SEG8 @end bend: @@ -2426,7 +2472,7 @@ print_str: { } ASSEMBLER OPTIMIZATIONS -Removing instruction jmp b6 +Removing instruction jmp b7 Removing instruction jmp bend Removing instruction jmp b1 Removing instruction jmp b2 @@ -2445,9 +2491,9 @@ Replacing label b1_from_b1 with b1 Replacing label b1_from_b1 with b1 Replacing label b1_from_b2 with b1 Removing instruction bbegin: -Removing instruction b6_from_bbegin: -Removing instruction main_from_b6: -Removing instruction bend_from_b6: +Removing instruction b7_from_bbegin: +Removing instruction main_from_b7: +Removing instruction bend_from_b7: Removing instruction b1_from_main: Removing instruction print_ln_from_b1: Removing instruction b3_from_b2: @@ -2459,7 +2505,7 @@ Removing instruction b1_from_b1: Removing instruction b1_from_print_str: Removing instruction b1_from_b2: Succesful ASM optimization Pass5RedundantLabelElimination -Removing instruction b6: +Removing instruction b7: Removing instruction bend: Removing instruction print_str_from_main: Removing instruction b1: @@ -2475,7 +2521,7 @@ Removing instruction breturn: Succesful ASM optimization Pass5UnusedLabelElimination FINAL SYMBOL TABLE -(label) @6 +(label) @7 (label) @begin (label) @end (byte*) char_cursor @@ -2529,12 +2575,12 @@ FINAL CODE msg2: .text "hello c64! @" msg3: .text "hello 2017! @" //SEG2 @begin -//SEG3 [1] phi from @begin to @6 [phi:@begin->@6] -//SEG4 @6 +//SEG3 [1] phi from @begin to @7 [phi:@begin->@7] +//SEG4 @7 //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @6 to main [phi:@6->main] +//SEG6 [4] phi from @7 to main [phi:@7->main] jsr main -//SEG7 [3] phi from @6 to @end [phi:@6->@end] +//SEG7 [3] phi from @7 to @end [phi:@7->@end] //SEG8 @end //SEG9 main main: { diff --git a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym index 16aa445f6..24d0b04a6 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym @@ -1,4 +1,4 @@ -(label) @6 +(label) @7 (label) @begin (label) @end (byte*) char_cursor diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg index 7529cf110..24a5c6a2e 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg @@ -1,13 +1,13 @@ @begin: scope:[] from [0] phi() [ ] ( ) - to:@33 -@33: scope:[] from @begin + to:@34 +@34: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 [3] phi() [ ] ( ) -main: scope:[main] from @33 +main: scope:[main] from @34 [4] phi() [ ] ( main:2 [ ] ) [5] call setFAC param-assignment [ ] ( main:2 [ ] ) to:main::@3 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log index 33984d72a..a4d1ada32 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log @@ -61,10 +61,19 @@ void print_char(byte ch) { *(char_cursor++) = ch; } +// Clear the screen +void print_cls() { + for(byte* sc=$0400; sc!=$0400+1000; sc++) { + *sc = ' '; + } +} + + Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor +Adding pre/post-modifier (byte*) print_cls::sc ← ++ (byte*) print_cls::sc Importing basic-floats // Library wrapping the BASIC floating point functions // See https://www.c64-wiki.com/wiki/Floating_point_arithmetic @@ -393,6 +402,17 @@ proc (void()) print_char((byte) print_char::ch) print_char::@return: return endproc // print_char() +proc (void()) print_cls() + (byte*) print_cls::sc ← (word/signed word) 1024 +print_cls::@1: + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 +print_cls::@return: + return +endproc // print_cls() (byte*) memLo ← (byte/word/signed word) 254 (byte*) memHi ← (byte/word/signed word) 255 proc (void()) prepareMEM((byte*) prepareMEM::mem) @@ -652,6 +672,12 @@ SYMBOLS (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch +(void()) print_cls() +(word/signed word~) print_cls::$0 +(boolean~) print_cls::$1 +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc (void()) print_ln() (byte*~) print_ln::$0 (boolean~) print_ln::$1 @@ -714,6 +740,7 @@ SYMBOLS (label) tanFAC::@return Promoting word/signed word to byte* in line_cursor ← ((byte*)) 1024 +Promoting word/signed word to byte* in print_cls::sc ← ((byte*)) 1024 Promoting byte/word/signed word to byte* in memLo ← ((byte*)) 254 Promoting byte/word/signed word to byte* in memHi ← ((byte*)) 255 Promoting word to byte* in main::f_2pi ← ((byte*)) 58085 @@ -793,9 +820,26 @@ print_char::@return: scope:[print_char] from print_char return to:@return @5: scope:[] from @4 + to:@6 +print_cls: scope:[print_cls] from + (byte*) print_cls::sc ← ((byte*)) (word/signed word) 1024 + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + to:print_cls::@2 +print_cls::@2: scope:[print_cls] from print_cls::@1 + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@2 + return + to:@return +@6: scope:[] from @5 (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 - to:@6 + to:@7 prepareMEM: scope:[prepareMEM] from (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem *((byte*) memLo) ← (byte~) prepareMEM::$0 @@ -805,8 +849,8 @@ prepareMEM: scope:[prepareMEM] from prepareMEM::@return: scope:[prepareMEM] from prepareMEM return to:@return -@6: scope:[] from @5 - to:@7 +@7: scope:[] from @6 + to:@8 setFAC: scope:[setFAC] from (byte*~) setFAC::$0 ← ((byte*)) (word) setFAC::w (void~) setFAC::$1 ← call prepareMEM (byte*~) setFAC::$0 @@ -815,8 +859,8 @@ setFAC: scope:[setFAC] from setFAC::@return: scope:[setFAC] from setFAC return to:@return -@7: scope:[] from @6 - to:@8 +@8: scope:[] from @7 + to:@9 getFAC: scope:[getFAC] from asm { jsr$b1aasty$festa$ff } (word) getFAC::w ← { *((byte*) memHi), *((byte*) memLo) } @@ -828,24 +872,24 @@ getFAC::@return: scope:[getFAC] from getFAC getFAC::@1 to:@return getFAC::@1: scope:[getFAC] from to:getFAC::@return -@8: scope:[] from @7 - to:@9 +@9: scope:[] from @8 + to:@10 setARGtoFAC: scope:[setARGtoFAC] from asm { jsr$bc0f } to:setARGtoFAC::@return setARGtoFAC::@return: scope:[setARGtoFAC] from setARGtoFAC return to:@return -@9: scope:[] from @8 - to:@10 +@10: scope:[] from @9 + to:@11 setFACtoARG: scope:[setFACtoARG] from asm { jsr$bbfc } to:setFACtoARG::@return setFACtoARG::@return: scope:[setFACtoARG] from setFACtoARG return to:@return -@10: scope:[] from @9 - to:@11 +@11: scope:[] from @10 + to:@12 setMEMtoFAC: scope:[setMEMtoFAC] from (void~) setMEMtoFAC::$0 ← call prepareMEM (byte*) setMEMtoFAC::mem asm { ldx$feldy$ffjsr$bbd4 } @@ -853,8 +897,8 @@ setMEMtoFAC: scope:[setMEMtoFAC] from setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC return to:@return -@11: scope:[] from @10 - to:@12 +@12: scope:[] from @11 + to:@13 setFACtoMEM: scope:[setFACtoMEM] from (void~) setFACtoMEM::$0 ← call prepareMEM (byte*) setFACtoMEM::mem asm { lda$feldy$ffjsr$bba2 } @@ -862,24 +906,24 @@ setFACtoMEM: scope:[setFACtoMEM] from setFACtoMEM::@return: scope:[setFACtoMEM] from setFACtoMEM return to:@return -@12: scope:[] from @11 - to:@13 +@13: scope:[] from @12 + to:@14 setFACtoPIhalf: scope:[setFACtoPIhalf] from asm { lda#$e0ldy#$e2jsr$bba2 } to:setFACtoPIhalf::@return setFACtoPIhalf::@return: scope:[setFACtoPIhalf] from setFACtoPIhalf return to:@return -@13: scope:[] from @12 - to:@14 +@14: scope:[] from @13 + to:@15 setFACto2PI: scope:[setFACto2PI] from asm { lda#$e5ldy#$e2jsr$bba2 } to:setFACto2PI::@return setFACto2PI::@return: scope:[setFACto2PI] from setFACto2PI return to:@return -@14: scope:[] from @13 - to:@15 +@15: scope:[] from @14 + to:@16 setARGtoMEM: scope:[setARGtoMEM] from (void~) setARGtoMEM::$0 ← call prepareMEM (byte*) setARGtoMEM::mem asm { lda$feldy$ffjsr$ba8c } @@ -887,8 +931,8 @@ setARGtoMEM: scope:[setARGtoMEM] from setARGtoMEM::@return: scope:[setARGtoMEM] from setARGtoMEM return to:@return -@15: scope:[] from @14 - to:@16 +@16: scope:[] from @15 + to:@17 addMEMtoFAC: scope:[addMEMtoFAC] from (void~) addMEMtoFAC::$0 ← call prepareMEM (byte*) addMEMtoFAC::mem asm { lda$feldy$ffjsr$b867 } @@ -896,16 +940,16 @@ addMEMtoFAC: scope:[addMEMtoFAC] from addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC return to:@return -@16: scope:[] from @15 - to:@17 +@17: scope:[] from @16 + to:@18 addARGtoFAC: scope:[addARGtoFAC] from asm { jsr$b86a } to:addARGtoFAC::@return addARGtoFAC::@return: scope:[addARGtoFAC] from addARGtoFAC return to:@return -@17: scope:[] from @16 - to:@18 +@18: scope:[] from @17 + to:@19 subFACfromMEM: scope:[subFACfromMEM] from (void~) subFACfromMEM::$0 ← call prepareMEM (byte*) subFACfromMEM::mem asm { lda$feldy$ffjsr$b850 } @@ -913,16 +957,16 @@ subFACfromMEM: scope:[subFACfromMEM] from subFACfromMEM::@return: scope:[subFACfromMEM] from subFACfromMEM return to:@return -@18: scope:[] from @17 - to:@19 +@19: scope:[] from @18 + to:@20 subFACfromARG: scope:[subFACfromARG] from asm { jsr$b853 } to:subFACfromARG::@return subFACfromARG::@return: scope:[subFACfromARG] from subFACfromARG return to:@return -@19: scope:[] from @18 - to:@20 +@20: scope:[] from @19 + to:@21 divMEMbyFAC: scope:[divMEMbyFAC] from (void~) divMEMbyFAC::$0 ← call prepareMEM (byte*) divMEMbyFAC::mem asm { lda$feldy$ffjsr$bb0f } @@ -930,8 +974,8 @@ divMEMbyFAC: scope:[divMEMbyFAC] from divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC return to:@return -@20: scope:[] from @19 - to:@21 +@21: scope:[] from @20 + to:@22 mulFACbyMEM: scope:[mulFACbyMEM] from (void~) mulFACbyMEM::$0 ← call prepareMEM (byte*) mulFACbyMEM::mem asm { lda$feldy$ffjsr$ba28 } @@ -939,8 +983,8 @@ mulFACbyMEM: scope:[mulFACbyMEM] from mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM return to:@return -@21: scope:[] from @20 - to:@22 +@22: scope:[] from @21 + to:@23 pwrMEMbyFAC: scope:[pwrMEMbyFAC] from (void~) pwrMEMbyFAC::$0 ← call prepareMEM (byte*) pwrMEMbyFAC::mem asm { lda$feldy$ffjsr$bf78 } @@ -948,88 +992,88 @@ pwrMEMbyFAC: scope:[pwrMEMbyFAC] from pwrMEMbyFAC::@return: scope:[pwrMEMbyFAC] from pwrMEMbyFAC return to:@return -@22: scope:[] from @21 - to:@23 +@23: scope:[] from @22 + to:@24 intFAC: scope:[intFAC] from asm { jsr$bccc } to:intFAC::@return intFAC::@return: scope:[intFAC] from intFAC return to:@return -@23: scope:[] from @22 - to:@24 +@24: scope:[] from @23 + to:@25 sinFAC: scope:[sinFAC] from asm { jsr$e26b } to:sinFAC::@return sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@24: scope:[] from @23 - to:@25 +@25: scope:[] from @24 + to:@26 cosFAC: scope:[cosFAC] from asm { jsr$e264 } to:cosFAC::@return cosFAC::@return: scope:[cosFAC] from cosFAC return to:@return -@25: scope:[] from @24 - to:@26 +@26: scope:[] from @25 + to:@27 tanFAC: scope:[tanFAC] from asm { jsr$e2b4 } to:tanFAC::@return tanFAC::@return: scope:[tanFAC] from tanFAC return to:@return -@26: scope:[] from @25 - to:@27 +@27: scope:[] from @26 + to:@28 atnFAC: scope:[atnFAC] from asm { jsr$e303 } to:atnFAC::@return atnFAC::@return: scope:[atnFAC] from atnFAC return to:@return -@27: scope:[] from @26 - to:@28 +@28: scope:[] from @27 + to:@29 sqrFAC: scope:[sqrFAC] from asm { jsr$bf71 } to:sqrFAC::@return sqrFAC::@return: scope:[sqrFAC] from sqrFAC return to:@return -@28: scope:[] from @27 - to:@29 +@29: scope:[] from @28 + to:@30 expFAC: scope:[expFAC] from asm { jsr$bfed } to:expFAC::@return expFAC::@return: scope:[expFAC] from expFAC return to:@return -@29: scope:[] from @28 - to:@30 +@30: scope:[] from @29 + to:@31 logFAC: scope:[logFAC] from asm { jsr$b9ea } to:logFAC::@return logFAC::@return: scope:[logFAC] from logFAC return to:@return -@30: scope:[] from @29 - to:@31 +@31: scope:[] from @30 + to:@32 divFACby10: scope:[divFACby10] from asm { jsr$bafe } to:divFACby10::@return divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -@31: scope:[] from @30 - to:@32 +@32: scope:[] from @31 + to:@33 mulFACby10: scope:[mulFACby10] from asm { jsr$bae2 } to:mulFACby10::@return mulFACby10::@return: scope:[mulFACby10] from mulFACby10 return to:@return -@32: scope:[] from @31 - to:@33 +@33: scope:[] from @32 + to:@34 main: scope:[main] from (byte[]) main::f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } @@ -1061,12 +1105,13 @@ main::@2: scope:[main] from main::@1 main::@return: scope:[main] from main::@2 return to:@return -@33: scope:[] from @32 +@34: scope:[] from @33 call main to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 Removing unused procedure print_str +Removing unused procedure print_cls Removing unused procedure setARGtoFAC Removing unused procedure setFACtoARG Removing unused procedure setFACtoMEM @@ -1107,15 +1152,14 @@ Eliminating unused variable - keeping the call (void~) main::$10 Eliminating unused variable - keeping the call (void~) main::$11 Eliminating unused variable - keeping the call (void~) main::$13 Eliminating unused variable - keeping the call (void~) main::$14 -Fixing word constructor with getFAC::w ← *(memHi) w= *(memLo) Removing empty block @1 Removing empty block @2 Removing empty block @3 Removing empty block @4 -Removing empty block @6 +Removing empty block @5 Removing empty block @7 -Removing empty block getFAC::@1 Removing empty block @8 +Removing empty block getFAC::@1 Removing empty block @9 Removing empty block @10 Removing empty block @11 @@ -1140,12 +1184,13 @@ Removing empty block @29 Removing empty block @30 Removing empty block @31 Removing empty block @32 +Removing empty block @33 Removing empty block main::@2 CONTROL FLOW GRAPH @begin: scope:[] from (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@5 + to:@6 print_ln: scope:[print_ln] from to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -1186,10 +1231,10 @@ print_char: scope:[print_char] from print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem *((byte*) memLo) ← (byte~) prepareMEM::$0 @@ -1209,7 +1254,7 @@ setFAC::@return: scope:[setFAC] from setFAC to:@return getFAC: scope:[getFAC] from asm { jsr$b1aasty$festa$ff } - (word) getFAC::w ← *((byte*) memHi) w= *((byte*) memLo) + (word) getFAC::w ← { *((byte*) memHi), *((byte*) memLo) } (word) getFAC::return ← (word) getFAC::w to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -1285,10 +1330,10 @@ main::@1: scope:[main] from main main::@1 main::@return: scope:[main] from main::@1 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 PROCEDURE MODIFY VARIABLE ANALYSIS print_ln modifies line_cursor @@ -1303,7 +1348,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL @begin: scope:[] from (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -1365,10 +1410,10 @@ print_char::@return: scope:[print_char] from print_char (byte*) char_cursor ← (byte*) char_cursor return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem *((byte*) memLo) ← (byte~) prepareMEM::$0 @@ -1391,7 +1436,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w ← *((byte*) memHi) w= *((byte*) memLo) + (word) getFAC::w ← { *((byte*) memHi), *((byte*) memLo) } (word) getFAC::return ← (word) getFAC::w to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -1450,7 +1495,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 (byte[]) main::f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi ← ((byte*)) (word) 58085 @@ -1523,14 +1568,14 @@ main::@return: scope:[main] from main::@16 (byte*) line_cursor ← (byte*) line_cursor return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 (byte*) char_cursor ← (byte*) char_cursor (byte*) line_cursor ← (byte*) line_cursor to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Completing Phi functions... Completing Phi functions... @@ -1552,7 +1597,7 @@ CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor#0 ← (byte*) line_cursor#0 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 (byte*) char_cursor#29 ← phi( main::@15/(byte*) char_cursor#11 ) (byte*) line_cursor#12 ← phi( main::@15/(byte*) line_cursor#13 ) @@ -1636,12 +1681,12 @@ print_char::@return: scope:[print_char] from print_char (byte*) char_cursor#10 ← (byte*) char_cursor#24 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) line_cursor#16 ← phi( @begin/(byte*) line_cursor#0 ) (byte*) char_cursor#35 ← phi( @begin/(byte*) char_cursor#0 ) (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -1666,7 +1711,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::w#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } (word) getFAC::return#0 ← (word) getFAC::w#0 to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -1730,9 +1775,9 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 - (byte*) line_cursor#29 ← phi( @33/(byte*) line_cursor#14 ) - (byte*) char_cursor#47 ← phi( @33/(byte*) char_cursor#33 ) +main: scope:[main] from @34 + (byte*) line_cursor#29 ← phi( @34/(byte*) line_cursor#14 ) + (byte*) char_cursor#47 ← phi( @34/(byte*) char_cursor#33 ) (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -1880,24 +1925,24 @@ main::@return: scope:[main] from main::@16 (byte*) line_cursor#4 ← (byte*) line_cursor#10 return to:@return -@33: scope:[] from @5 - (byte*) line_cursor#14 ← phi( @5/(byte*) line_cursor#16 ) - (byte*) char_cursor#33 ← phi( @5/(byte*) char_cursor#35 ) +@34: scope:[] from @6 + (byte*) line_cursor#14 ← phi( @6/(byte*) line_cursor#16 ) + (byte*) char_cursor#33 ← phi( @6/(byte*) char_cursor#35 ) call main param-assignment - to:@34 -@34: scope:[] from @33 - (byte*) line_cursor#11 ← phi( @33/(byte*) line_cursor#14 ) - (byte*) char_cursor#28 ← phi( @33/(byte*) char_cursor#33 ) + to:@35 +@35: scope:[] from @34 + (byte*) line_cursor#11 ← phi( @34/(byte*) line_cursor#14 ) + (byte*) char_cursor#28 ← phi( @34/(byte*) char_cursor#33 ) (byte*) char_cursor#14 ← (byte*) char_cursor#28 (byte*) line_cursor#5 ← (byte*) line_cursor#11 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN @begin: scope:[] from (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor#0 ← (byte*) line_cursor#0 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 (byte*) char_cursor#29 ← phi( main::@15/(byte*) char_cursor#11 ) (byte*) line_cursor#12 ← phi( main::@15/(byte*) line_cursor#13 ) @@ -1981,12 +2026,12 @@ print_char::@return: scope:[print_char] from print_char (byte*) char_cursor#10 ← (byte*) char_cursor#24 return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) line_cursor#16 ← phi( @begin/(byte*) line_cursor#0 ) (byte*) char_cursor#35 ← phi( @begin/(byte*) char_cursor#0 ) (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -2011,7 +2056,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::w#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } (word) getFAC::return#0 ← (word) getFAC::w#0 to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -2075,9 +2120,9 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 - (byte*) line_cursor#29 ← phi( @33/(byte*) line_cursor#14 ) - (byte*) char_cursor#47 ← phi( @33/(byte*) char_cursor#33 ) +main: scope:[main] from @34 + (byte*) line_cursor#29 ← phi( @34/(byte*) line_cursor#14 ) + (byte*) char_cursor#47 ← phi( @34/(byte*) char_cursor#33 ) (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -2226,23 +2271,23 @@ main::@return: scope:[main] from main::@16 (byte*) line_cursor#4 ← (byte*) line_cursor#10 return to:@return -@33: scope:[] from @5 - (byte*) line_cursor#14 ← phi( @5/(byte*) line_cursor#16 ) - (byte*) char_cursor#33 ← phi( @5/(byte*) char_cursor#35 ) +@34: scope:[] from @6 + (byte*) line_cursor#14 ← phi( @6/(byte*) line_cursor#16 ) + (byte*) char_cursor#33 ← phi( @6/(byte*) char_cursor#35 ) call main param-assignment - to:@34 -@34: scope:[] from @33 - (byte*) line_cursor#11 ← phi( @33/(byte*) line_cursor#4 ) - (byte*) char_cursor#28 ← phi( @33/(byte*) char_cursor#13 ) + to:@35 +@35: scope:[] from @34 + (byte*) line_cursor#11 ← phi( @34/(byte*) line_cursor#4 ) + (byte*) char_cursor#28 ← phi( @34/(byte*) char_cursor#13 ) (byte*) char_cursor#14 ← (byte*) char_cursor#28 (byte*) line_cursor#5 ← (byte*) line_cursor#11 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 INITIAL SSA SYMBOL TABLE -(label) @33 (label) @34 -(label) @5 +(label) @35 +(label) @6 (label) @begin (label) @end (void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) @@ -2567,7 +2612,7 @@ Succesful SSA optimization Pass2AliasElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 (byte*) char_cursor#29 ← phi( main::@15/(byte*) char_cursor#11 ) (byte*) line_cursor#12 ← phi( main::@15/(byte*) line_cursor#13 ) @@ -2630,10 +2675,10 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -2657,7 +2702,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -2718,9 +2763,9 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 - (byte*) line_cursor#26 ← phi( @33/(byte*) char_cursor#0 ) - (byte*) char_cursor#44 ← phi( @33/(byte*) char_cursor#0 ) +main: scope:[main] from @34 + (byte*) line_cursor#26 ← phi( @34/(byte*) char_cursor#0 ) + (byte*) char_cursor#44 ← phi( @34/(byte*) char_cursor#0 ) (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -2795,14 +2840,14 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 - (byte*) line_cursor#11 ← phi( @33/(byte*) line_cursor#10 ) - (byte*) char_cursor#14 ← phi( @33/(byte*) char_cursor#12 ) + to:@35 +@35: scope:[] from @34 + (byte*) line_cursor#11 ← phi( @34/(byte*) line_cursor#10 ) + (byte*) char_cursor#14 ← phi( @34/(byte*) char_cursor#12 ) to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Not aliassing across scopes: line_cursor#12 line_cursor#13 Not aliassing across scopes: char_cursor#29 char_cursor#11 @@ -2850,7 +2895,7 @@ Succesful SSA optimization Pass2SelfPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 (byte*) char_cursor#29 ← phi( main::@15/(byte*) char_cursor#11 ) (byte*) line_cursor#12 ← phi( main::@15/(byte*) line_cursor#13 ) @@ -2913,10 +2958,10 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -2940,7 +2985,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -3001,9 +3046,9 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 - (byte*) line_cursor#26 ← phi( @33/(byte*) char_cursor#0 ) - (byte*) char_cursor#44 ← phi( @33/(byte*) char_cursor#0 ) +main: scope:[main] from @34 + (byte*) line_cursor#26 ← phi( @34/(byte*) char_cursor#0 ) + (byte*) char_cursor#44 ← phi( @34/(byte*) char_cursor#0 ) (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -3078,14 +3123,14 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 - (byte*) line_cursor#11 ← phi( @33/(byte*) line_cursor#10 ) - (byte*) char_cursor#14 ← phi( @33/(byte*) char_cursor#12 ) + to:@35 +@35: scope:[] from @34 + (byte*) line_cursor#11 ← phi( @34/(byte*) line_cursor#10 ) + (byte*) char_cursor#14 ← phi( @34/(byte*) char_cursor#12 ) to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Redundant Phi (byte*) line_cursor#12 (byte*) line_cursor#13 Redundant Phi (byte*) char_cursor#29 (byte*) char_cursor#11 @@ -3111,7 +3156,7 @@ Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -3165,10 +3210,10 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -3192,7 +3237,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -3251,7 +3296,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -3321,12 +3366,12 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Simple Condition (boolean~) print_ln::$1 if((byte*) line_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 Simple Condition (boolean~) main::$15 if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 @@ -3334,7 +3379,7 @@ Succesful SSA optimization Pass2ConditionalJumpSimplification CONTROL FLOW GRAPH @begin: scope:[] from (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -3387,10 +3432,10 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin +@6: scope:[] from @begin (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@33 + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -3414,7 +3459,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -3473,7 +3518,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 (byte[]) main::f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) main::f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte*) main::f_2pi#0 ← ((byte*)) (word) 58085 @@ -3542,12 +3587,12 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Constant (const byte*) char_cursor#0 = ((byte*))1024 Constant (const byte[]) print_byte::hextab#0 = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' } @@ -3562,7 +3607,7 @@ Constant (const word) setFAC::w#2 = 25 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -3614,8 +3659,8 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin - to:@33 +@6: scope:[] from @begin + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -3639,7 +3684,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -3698,7 +3743,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -3761,12 +3806,12 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Constant (const byte*) setMEMtoFAC::mem#0 = main::f_127#0 Constant (const byte*) mulFACbyMEM::mem#0 = main::f_2pi#0 @@ -3777,7 +3822,7 @@ Constant (const byte*) addMEMtoFAC::mem#0 = main::f_127#0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -3829,8 +3874,8 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin - to:@33 +@6: scope:[] from @begin + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -3854,7 +3899,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from main::@13 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -3913,7 +3958,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -3970,19 +4015,19 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Constant (const byte*) prepareMEM::mem#2 = addMEMtoFAC::mem#0 Constant (const byte*) prepareMEM::mem#3 = divMEMbyFAC::mem#0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@5 + to:@6 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -4034,8 +4079,210 @@ print_char: scope:[print_char] from print_byte print_byte::@1 print_char::@return: scope:[print_char] from print_char return to:@return -@5: scope:[] from @begin - to:@33 +@6: scope:[] from @begin + to:@34 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC + (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(const byte*) prepareMEM::mem#2 divMEMbyFAC/(const byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#5 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@8 + (word) setFAC::w#3 ← phi( main/(const word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@8/(const word) setFAC::w#2 ) + (byte*) prepareMEM::mem#0 ← ((byte*)) (word) setFAC::w#3 + call prepareMEM param-assignment + to:setFAC::@1 +setFAC::@1: scope:[setFAC] from setFAC + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC::@1 + return + to:@return +getFAC: scope:[getFAC] from main::@13 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@4 main::@7 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@4/(const byte*) setMEMtoFAC::mem#0 main::@7/(const byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@12 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@9 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@11 main::@6 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@11/(const byte*) mulFACbyMEM::mem#1 main::@6/(const byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@10 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +divFACby10: scope:[divFACby10] from main::@3 + asm { jsr$bafe } + to:divFACby10::@return +divFACby10::@return: scope:[divFACby10] from divFACby10 + return + to:@return +main: scope:[main] from @34 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call divFACby10 param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + call setMEMtoFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@4 + to:main::@1 +main::@1: scope:[main] from main::@16 main::@5 + (byte*) line_cursor#13 ← phi( main::@16/(byte*) line_cursor#1 main::@5/(const byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@16/(byte*) line_cursor#1 main::@5/(const byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@16/(byte) main::i#1 main::@5/(const byte) main::i#0 ) + (word) setFAC::w#1 ← ((word)) (byte) main::i#10 + call setFAC param-assignment + to:main::@6 +main::@6: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setMEMtoFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call setFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call divMEMbyFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call sinFAC param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call mulFACbyMEM param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call addMEMtoFAC param-assignment + to:main::@13 +main::@13: scope:[main] from main::@12 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@14 +main::@14: scope:[main] from main::@13 + (word) print_word::w#0 ← (word) getFAC::return#2 + call print_word param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + call print_ln param-assignment + to:main::@16 +main::@16: scope:[main] from main::@15 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@16 + return + to:@return +@34: scope:[] from @6 + call main param-assignment + to:@35 +@35: scope:[] from @34 + to:@end +@end: scope:[] from @35 + +Fixing word constructor with getFAC::return#0 ← *(memHi#0) w= *(memLo#0) +Succesful SSA optimization Pass2FixWordConstructors +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@6 +print_ln: scope:[print_ln] from main::@15 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) line_cursor#1 ) + (byte*) line_cursor#1 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + if((byte*) line_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@14 + (byte) print_byte::b#0 ← > (word) print_word::w#0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte) print_byte::b#1 ← < (word) print_word::w#0 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte) print_char::ch#0 ← *((const byte[]) print_byte::hextab#0 + (byte~) print_byte::$0) + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte) print_char::ch#1 ← *((const byte[]) print_byte::hextab#0 + (byte~) print_byte::$2) + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +@6: scope:[] from @begin + to:@34 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(const byte*) prepareMEM::mem#2 divMEMbyFAC/(const byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -4116,7 +4363,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -4173,23 +4420,23 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @5 +@34: scope:[] from @6 call main param-assignment - to:@34 -@34: scope:[] from @33 + to:@35 +@35: scope:[] from @34 to:@end -@end: scope:[] from @34 +@end: scope:[] from @35 Culled Empty Block (label) print_ln::@2 Culled Empty Block (label) print_word::@2 Culled Empty Block (label) print_byte::@2 -Culled Empty Block (label) @5 +Culled Empty Block (label) @6 Culled Empty Block (label) main::@5 -Culled Empty Block (label) @34 +Culled Empty Block (label) @35 Succesful SSA optimization Pass2CullEmptyBlocks CONTROL FLOW GRAPH @begin: scope:[] from - to:@33 + to:@34 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -4315,7 +4562,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -4370,10 +4617,10 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @begin +@34: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 Not aliassing across scopes: line_cursor#6 line_cursor#13 Not aliassing across scopes: print_byte::b#2 print_byte::b#0 @@ -4436,7 +4683,7 @@ Constant inlined setFAC::w#0 = (word/signed word) 1275 Succesful SSA optimization Pass2ConstantInlining CONTROL FLOW GRAPH @begin: scope:[] from - to:@33 + to:@34 print_ln: scope:[print_ln] from main::@15 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -4562,7 +4809,7 @@ divFACby10: scope:[divFACby10] from main::@3 divFACby10::@return: scope:[divFACby10] from divFACby10 return to:@return -main: scope:[main] from @33 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -4617,13 +4864,13 @@ main::@16: scope:[main] from main::@15 main::@return: scope:[main] from main::@16 return to:@return -@33: scope:[] from @begin +@34: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 FINAL SYMBOL TABLE -(label) @33 +(label) @34 (label) @begin (label) @end (void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) @@ -4733,18 +4980,18 @@ FINAL SYMBOL TABLE (void()) sinFAC() (label) sinFAC::@return -Block Sequence Planned @begin @33 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return +Block Sequence Planned @begin @34 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return Added new block during phi lifting main::@17(between main::@16 and main::@1) Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) -Block Sequence Planned @begin @33 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return main::@17 print_ln print_ln::@1 print_ln::@return print_ln::@3 print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return +Block Sequence Planned @begin @34 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return main::@17 print_ln print_ln::@1 print_ln::@return print_ln::@3 print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return CONTROL FLOW GRAPH - PHI LIFTED @begin: scope:[] from - to:@33 -@33: scope:[] from @begin + to:@34 +@34: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @33 -main: scope:[main] from @33 +@end: scope:[] from @34 +main: scope:[main] from @34 call setFAC param-assignment to:main::@3 main::@3: scope:[main] from main @@ -4947,7 +5194,7 @@ divFACby10::@return: scope:[divFACby10] from divFACby10 to:@return Adding NOP phi() at start of @begin -Adding NOP phi() at start of @33 +Adding NOP phi() at start of @34 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -5002,14 +5249,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - LIVE RANGES FOUND @begin: scope:[] from [0] phi() [ ] - to:@33 -@33: scope:[] from @begin + to:@34 +@34: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 [3] phi() [ ] -main: scope:[main] from @33 +main: scope:[main] from @34 [4] phi() [ ] [5] call setFAC param-assignment [ ] to:main::@3 @@ -5245,9 +5492,9 @@ Coalesced [99] prepareMEM::mem#7 ← prepareMEM::mem#0 Coalesced [105] prepareMEM::mem#8 ← prepareMEM::mem#1 Coalesced down to 9 phi equivalence classes Culled Empty Block (label) print_ln::@3 -Block Sequence Planned @begin @33 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return main::@17 print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return +Block Sequence Planned @begin @34 @end main main::@3 main::@4 main::@1 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@16 main::@return main::@17 print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return divFACby10 divFACby10::@return Adding NOP phi() at start of @begin -Adding NOP phi() at start of @33 +Adding NOP phi() at start of @34 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -5292,14 +5539,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - BEFORE EFFECTIVE LIVE RANGES @begin: scope:[] from [0] phi() [ ] - to:@33 -@33: scope:[] from @begin + to:@34 +@34: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 [3] phi() [ ] -main: scope:[main] from @33 +main: scope:[main] from @34 [4] phi() [ ] [5] call setFAC param-assignment [ ] to:main::@3 @@ -5501,14 +5748,14 @@ divFACby10::@return: scope:[divFACby10] from divFACby10 CONTROL FLOW GRAPH - PHI MEM COALESCED @begin: scope:[] from [0] phi() [ ] ( ) - to:@33 -@33: scope:[] from @begin + to:@34 +@34: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @33 +@end: scope:[] from @34 [3] phi() [ ] ( ) -main: scope:[main] from @33 +main: scope:[main] from @34 [4] phi() [ ] ( main:2 [ ] ) [5] call setFAC param-assignment [ ] ( main:2 [ ] ) to:main::@3 @@ -5709,59 +5956,59 @@ divFACby10::@return: scope:[divFACby10] from divFACby10 DOMINATORS @begin dominated by @begin -@33 dominated by @33 @begin -@end dominated by @end @33 @begin -main dominated by main @33 @begin -main::@3 dominated by main main::@3 @33 @begin -main::@4 dominated by main main::@3 main::@4 @33 @begin -main::@1 dominated by main main::@1 main::@3 main::@4 @33 @begin -main::@6 dominated by main main::@1 main::@6 main::@3 main::@4 @33 @begin -main::@7 dominated by main::@7 main main::@1 main::@6 main::@3 main::@4 @33 @begin -main::@8 dominated by main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin -main::@9 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin -main::@10 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@10 -main::@11 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 -main::@12 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@12 -main::@13 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@13 main::@12 -main::@14 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@13 main::@12 main::@14 -main::@15 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 -main::@16 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@16 main::@13 main::@12 main::@15 main::@14 -main::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@return main::@11 main::@10 main::@16 main::@13 main::@12 main::@15 main::@14 -main::@17 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@17 main::@16 main::@13 main::@12 main::@15 main::@14 -print_ln dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 -print_ln::@1 dominated by main::@9 print_ln::@1 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 -print_ln::@return dominated by main::@9 print_ln::@1 main::@7 main::@8 main print_ln::@return main::@1 main::@6 main::@3 main::@4 @33 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 -print_word dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 main::@13 main::@12 main::@14 -print_word::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin print_word::@1 main::@11 main::@10 main::@13 main::@12 main::@14 -print_word::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin print_word::@return print_word::@1 main::@11 main::@10 main::@13 main::@12 main::@14 -print_byte dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 -print_byte::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 main::@14 -print_byte::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @33 @begin print_byte::@return print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 main::@14 -print_char dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@6 main::@3 main::@4 @33 @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 -print_char::@return dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@6 main::@3 main::@4 @33 print_char::@return @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 -getFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin getFAC main::@11 main::@10 main::@13 main::@12 -getFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin getFAC main::@11 main::@10 main::@13 main::@12 getFAC::@return -addMEMtoFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin addMEMtoFAC main::@11 main::@10 main::@12 -addMEMtoFAC::@1 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 main::@12 -addMEMtoFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 addMEMtoFAC::@return main::@12 -prepareMEM dominated by main @33 @begin prepareMEM -prepareMEM::@return dominated by main @33 @begin prepareMEM::@return prepareMEM -mulFACbyMEM dominated by main mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @33 @begin -mulFACbyMEM::@1 dominated by main mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @33 @begin mulFACbyMEM::@1 -mulFACbyMEM::@return dominated by main mulFACbyMEM::@return mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @33 @begin mulFACbyMEM::@1 -sinFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin sinFAC main::@10 -sinFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin sinFAC sinFAC::@return main::@10 -divMEMbyFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin divMEMbyFAC -divMEMbyFAC::@1 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin divMEMbyFAC::@1 divMEMbyFAC -divMEMbyFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @33 @begin divMEMbyFAC::@1 divMEMbyFAC divMEMbyFAC::@return -setFAC dominated by main @33 @begin setFAC -setFAC::@1 dominated by main @33 @begin setFAC setFAC::@1 -setFAC::@return dominated by setFAC::@return main @33 @begin setFAC setFAC::@1 -setMEMtoFAC dominated by main main::@3 main::@4 @33 @begin setMEMtoFAC -setMEMtoFAC::@1 dominated by main main::@3 main::@4 @33 @begin setMEMtoFAC setMEMtoFAC::@1 -setMEMtoFAC::@return dominated by main main::@3 main::@4 @33 @begin setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return -divFACby10 dominated by main main::@3 @33 @begin divFACby10 -divFACby10::@return dominated by divFACby10::@return main main::@3 @33 @begin divFACby10 +@34 dominated by @34 @begin +@end dominated by @end @34 @begin +main dominated by main @34 @begin +main::@3 dominated by main main::@3 @34 @begin +main::@4 dominated by main main::@3 main::@4 @34 @begin +main::@1 dominated by main main::@1 main::@3 main::@4 @34 @begin +main::@6 dominated by main main::@1 main::@6 main::@3 main::@4 @34 @begin +main::@7 dominated by main::@7 main main::@1 main::@6 main::@3 main::@4 @34 @begin +main::@8 dominated by main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin +main::@9 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin +main::@10 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@10 +main::@11 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 +main::@12 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@12 +main::@13 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@13 main::@12 +main::@14 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@13 main::@12 main::@14 +main::@15 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +main::@16 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@16 main::@13 main::@12 main::@15 main::@14 +main::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@return main::@11 main::@10 main::@16 main::@13 main::@12 main::@15 main::@14 +main::@17 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@17 main::@16 main::@13 main::@12 main::@15 main::@14 +print_ln dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +print_ln::@1 dominated by main::@9 print_ln::@1 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +print_ln::@return dominated by main::@9 print_ln::@1 main::@7 main::@8 main print_ln::@return main::@1 main::@6 main::@3 main::@4 @34 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +print_word dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 main::@13 main::@12 main::@14 +print_word::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin print_word::@1 main::@11 main::@10 main::@13 main::@12 main::@14 +print_word::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin print_word::@return print_word::@1 main::@11 main::@10 main::@13 main::@12 main::@14 +print_byte dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 +print_byte::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 main::@14 +print_byte::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@6 main::@3 main::@4 @34 @begin print_byte::@return print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 main::@14 +print_char dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@6 main::@3 main::@4 @34 @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 +print_char::@return dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@6 main::@3 main::@4 @34 print_char::@return @begin main::@11 main::@10 print_byte main::@13 main::@12 main::@14 +getFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin getFAC main::@11 main::@10 main::@13 main::@12 +getFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin getFAC main::@11 main::@10 main::@13 main::@12 getFAC::@return +addMEMtoFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin addMEMtoFAC main::@11 main::@10 main::@12 +addMEMtoFAC::@1 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 main::@12 +addMEMtoFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 addMEMtoFAC::@return main::@12 +prepareMEM dominated by main @34 @begin prepareMEM +prepareMEM::@return dominated by main @34 @begin prepareMEM::@return prepareMEM +mulFACbyMEM dominated by main mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @34 @begin +mulFACbyMEM::@1 dominated by main mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @34 @begin mulFACbyMEM::@1 +mulFACbyMEM::@return dominated by main mulFACbyMEM::@return mulFACbyMEM main::@1 main::@6 main::@3 main::@4 @34 @begin mulFACbyMEM::@1 +sinFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin sinFAC main::@10 +sinFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin sinFAC sinFAC::@return main::@10 +divMEMbyFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin divMEMbyFAC +divMEMbyFAC::@1 dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin divMEMbyFAC::@1 divMEMbyFAC +divMEMbyFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@6 main::@3 main::@4 @34 @begin divMEMbyFAC::@1 divMEMbyFAC divMEMbyFAC::@return +setFAC dominated by main @34 @begin setFAC +setFAC::@1 dominated by main @34 @begin setFAC setFAC::@1 +setFAC::@return dominated by setFAC::@return main @34 @begin setFAC setFAC::@1 +setMEMtoFAC dominated by main main::@3 main::@4 @34 @begin setMEMtoFAC +setMEMtoFAC::@1 dominated by main main::@3 main::@4 @34 @begin setMEMtoFAC setMEMtoFAC::@1 +setMEMtoFAC::@return dominated by main main::@3 main::@4 @34 @begin setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return +divFACby10 dominated by main main::@3 @34 @begin divFACby10 +divFACby10::@return dominated by divFACby10::@return main main::@3 @34 @begin divFACby10 Found back edge: Loop head: main::@1 tails: main::@17 blocks: null Found back edge: Loop head: print_ln::@1 tails: print_ln::@1 blocks: null @@ -5922,17 +6169,17 @@ INITIAL ASM .label char_cursor = 7 //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @33 [phi:@begin->@33] -b33_from_bbegin: - jmp b33 -//SEG4 @33 -b33: +//SEG3 [1] phi from @begin to @34 [phi:@begin->@34] +b34_from_bbegin: + jmp b34 +//SEG4 @34 +b34: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @33 to main [phi:@33->main] -main_from_b33: +//SEG6 [4] phi from @34 to main [phi:@34->main] +main_from_b34: jsr main -//SEG7 [3] phi from @33 to @end [phi:@33->@end] -bend_from_b33: +//SEG7 [3] phi from @34 to @end [phi:@34->@end] +bend_from_b34: jmp bend //SEG8 @end bend: @@ -6575,17 +6822,17 @@ ASSEMBLER BEFORE OPTIMIZATION .label char_cursor = 5 //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @33 [phi:@begin->@33] -b33_from_bbegin: - jmp b33 -//SEG4 @33 -b33: +//SEG3 [1] phi from @begin to @34 [phi:@begin->@34] +b34_from_bbegin: + jmp b34 +//SEG4 @34 +b34: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @33 to main [phi:@33->main] -main_from_b33: +//SEG6 [4] phi from @34 to main [phi:@34->main] +main_from_b34: jsr main -//SEG7 [3] phi from @33 to @end [phi:@33->@end] -bend_from_b33: +//SEG7 [3] phi from @34 to @end [phi:@34->@end] +bend_from_b34: jmp bend //SEG8 @end bend: @@ -7077,7 +7324,7 @@ divFACby10: { } ASSEMBLER OPTIMIZATIONS -Removing instruction jmp b33 +Removing instruction jmp b34 Removing instruction jmp bend Removing instruction jmp b3 Removing instruction jmp b4 @@ -7119,9 +7366,9 @@ Succesful ASM optimization Pass5NextJumpElimination Replacing label b1_from_b1 with b1 Replacing label b1_from_b1 with b1 Removing instruction bbegin: -Removing instruction b33_from_bbegin: -Removing instruction main_from_b33: -Removing instruction bend_from_b33: +Removing instruction b34_from_bbegin: +Removing instruction main_from_b34: +Removing instruction bend_from_b34: Removing instruction b3_from_main: Removing instruction b4_from_b3: Removing instruction setMEMtoFAC_from_b4: @@ -7144,7 +7391,7 @@ Removing instruction print_ln_from_b15: Removing instruction b1_from_print_ln: Removing instruction b1_from_b1: Succesful ASM optimization Pass5RedundantLabelElimination -Removing instruction b33: +Removing instruction b34: Removing instruction bend: Removing instruction setFAC_from_main: Removing instruction b3: @@ -7196,7 +7443,7 @@ Removing instruction breturn: Succesful ASM optimization Pass5UnusedLabelElimination FINAL SYMBOL TABLE -(label) @33 +(label) @34 (label) @begin (label) @end (void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) @@ -7330,12 +7577,12 @@ FINAL CODE .label line_cursor = 3 .label char_cursor = 5 //SEG2 @begin -//SEG3 [1] phi from @begin to @33 [phi:@begin->@33] -//SEG4 @33 +//SEG3 [1] phi from @begin to @34 [phi:@begin->@34] +//SEG4 @34 //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @33 to main [phi:@33->main] +//SEG6 [4] phi from @34 to main [phi:@34->main] jsr main -//SEG7 [3] phi from @33 to @end [phi:@33->@end] +//SEG7 [3] phi from @34 to @end [phi:@34->@end] //SEG8 @end //SEG9 main main: { diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym index 8a7b15aa3..ff7c77a49 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym @@ -1,4 +1,4 @@ -(label) @33 +(label) @34 (label) @begin (label) @end (void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.cfg b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.cfg index 4446691d6..fee7feeb0 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.cfg +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.cfg @@ -1,13 +1,13 @@ @begin: scope:[] from [0] phi() [ ] ( ) - to:@42 -@42: scope:[] from @begin + to:@43 +@43: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 [3] phi() [ ] ( ) -main: scope:[main] from @42 +main: scope:[main] from @43 [4] phi() [ ] ( main:2 [ ] ) [5] call init param-assignment [ ] ( main:2 [ ] ) to:main::@2 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.log b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.log index a8f138445..e61a4764d 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.log @@ -559,10 +559,19 @@ void print_char(byte ch) { *(char_cursor++) = ch; } +// Clear the screen +void print_cls() { + for(byte* sc=$0400; sc!=$0400+1000; sc++) { + *sc = ' '; + } +} + + Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor +Adding pre/post-modifier (byte*) print_cls::sc ← ++ (byte*) print_cls::sc Adding pre/post-modifier (byte*) clear_screen::sc ← ++ (byte*) clear_screen::sc Adding pre/post-modifier (byte) progress_idx ← ++ (byte) progress_idx Adding pre/post-modifier (byte*) progress_cursor ← ++ (byte*) progress_cursor @@ -802,6 +811,17 @@ proc (void()) print_char((byte) print_char::ch) print_char::@return: return endproc // print_char() +proc (void()) print_cls() + (byte*) print_cls::sc ← (word/signed word) 1024 +print_cls::@1: + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 +print_cls::@return: + return +endproc // print_cls() (byte*) SCREEN ← (word/signed word) 1024 (byte) sinlen_x ← (byte/word/signed word) 221 (byte[]) sintab_x ← (word/signed word) 4096 @@ -1305,6 +1325,12 @@ SYMBOLS (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch +(void()) print_cls() +(word/signed word~) print_cls::$0 +(boolean~) print_cls::$1 +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc (void()) print_ln() (byte*~) print_ln::$0 (boolean~) print_ln::$1 @@ -1404,6 +1430,7 @@ Promoting word to byte* in COLS ← ((byte*)) 55296 Promoting byte/word/signed word to byte* in memLo ← ((byte*)) 254 Promoting byte/word/signed word to byte* in memHi ← ((byte*)) 255 Promoting word/signed word to byte* in line_cursor ← ((byte*)) 1024 +Promoting word/signed word to byte* in print_cls::sc ← ((byte*)) 1024 Promoting word/signed word to byte* in SCREEN ← ((byte*)) 1024 Promoting word/signed word to byte[] in sintab_x ← ((byte*)) 4096 Promoting word/signed word to byte[] in sintab_y ← ((byte*)) 4352 @@ -1741,13 +1768,30 @@ print_char::@return: scope:[print_char] from print_char return to:@return @32: scope:[] from @31 + to:@33 +print_cls: scope:[print_cls] from + (byte*) print_cls::sc ← ((byte*)) (word/signed word) 1024 + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (word/signed word~) print_cls::$0 ← (word/signed word) 1024 + (word/signed word) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (word/signed word~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + to:print_cls::@2 +print_cls::@2: scope:[print_cls] from print_cls::@1 + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@2 + return + to:@return +@33: scope:[] from @32 (byte*) SCREEN ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x ← (byte/word/signed word) 221 (byte[]) sintab_x ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y ← (byte/word/signed word) 197 (byte[]) sintab_y ← ((byte*)) (word/signed word) 4352 (byte[]) sprites ← ((byte*)) (word/signed word) 8192 - to:@33 + to:@34 main: scope:[main] from (void~) main::$0 ← call init to:main::@1 @@ -1766,8 +1810,8 @@ main::@4: scope:[main] from main::@3 main::@return: scope:[main] from main::@4 return to:@return -@33: scope:[] from @32 - to:@34 +@34: scope:[] from @33 + to:@35 init: scope:[init] from (void~) init::$0 ← call clear_screen (byte) init::i ← (byte/signed byte/word/signed word) 0 @@ -1793,8 +1837,8 @@ init::@2: scope:[init] from init::@1 init::@return: scope:[init] from init::@2 return to:@return -@34: scope:[] from @33 - to:@35 +@35: scope:[] from @34 + to:@36 clear_screen: scope:[clear_screen] from (byte*) clear_screen::sc ← (byte*) SCREEN to:clear_screen::@1 @@ -1810,10 +1854,10 @@ clear_screen::@2: scope:[clear_screen] from clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@2 return to:@return -@35: scope:[] from @34 +@36: scope:[] from @35 (byte*) progress_cursor ← (byte*) SCREEN (byte) progress_idx ← (byte/signed byte/word/signed word) 0 - to:@36 + to:@37 progress_init: scope:[progress_init] from (byte*) progress_cursor ← (byte*) progress_init::line (byte) progress_idx ← (byte/signed byte/word/signed word) 0 @@ -1821,8 +1865,8 @@ progress_init: scope:[progress_init] from progress_init::@return: scope:[progress_init] from progress_init return to:@return -@36: scope:[] from @35 - to:@37 +@37: scope:[] from @36 + to:@38 progress_inc: scope:[progress_inc] from (byte[]) progress_inc::progress_chars ← { (byte/signed byte/word/signed word) 32, (byte/signed byte/word/signed word) 101, (byte/signed byte/word/signed word) 116, (byte/signed byte/word/signed word) 117, (byte/signed byte/word/signed word) 97, (byte/word/signed word) 246, (byte/word/signed word) 231, (byte/word/signed word) 234, (byte/word/signed word) 224 } (byte) progress_idx ← ++ (byte) progress_idx @@ -1841,10 +1885,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @36 +@38: scope:[] from @37 (byte) sin_idx_x ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y ← (byte/signed byte/word/signed word) 0 - to:@38 + to:@39 anim: scope:[anim] from *((byte*) BORDERCOL) ← ++ *((byte*) BORDERCOL) (byte) anim::xidx ← (byte) sin_idx_x @@ -1917,8 +1961,8 @@ anim::@10: scope:[anim] from anim::@4 anim::@return: scope:[anim] from anim::@5 return to:@return -@38: scope:[] from @37 - to:@39 +@39: scope:[] from @38 + to:@40 place_sprites: scope:[place_sprites] from *((byte*) SPRITES_ENABLE) ← (byte/signed byte/word/signed word) 127 *((byte*) SPRITES_EXPAND_X) ← (byte/signed byte/word/signed word) 127 @@ -1955,8 +1999,8 @@ place_sprites::@2: scope:[place_sprites] from place_sprites::@1 place_sprites::@return: scope:[place_sprites] from place_sprites::@2 return to:@return -@39: scope:[] from @38 - to:@40 +@40: scope:[] from @39 + to:@41 gen_sprites: scope:[gen_sprites] from (byte[]) gen_sprites::cml ← (string) "camelot" (byte*) gen_sprites::spr ← (byte[]) sprites @@ -1975,8 +2019,8 @@ gen_sprites::@2: scope:[gen_sprites] from gen_sprites::@1 gen_sprites::@return: scope:[gen_sprites] from gen_sprites::@2 return to:@return -@40: scope:[] from @39 - to:@41 +@41: scope:[] from @40 + to:@42 gen_chargen_sprite: scope:[gen_chargen_sprite] from (word~) gen_chargen_sprite::$0 ← ((word)) (byte) gen_chargen_sprite::ch (word~) gen_chargen_sprite::$1 ← (word~) gen_chargen_sprite::$0 << (byte/signed byte/word/signed word) 3 @@ -2048,8 +2092,8 @@ gen_chargen_sprite::@10: scope:[gen_chargen_sprite] from gen_chargen_sprite::@9 gen_chargen_sprite::@return: scope:[gen_chargen_sprite] from gen_chargen_sprite::@10 return to:@return -@41: scope:[] from @40 - to:@42 +@42: scope:[] from @41 + to:@43 gen_sintab: scope:[gen_sintab] from (byte[]) gen_sintab::f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } (byte[]) gen_sintab::f_min ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } @@ -2095,10 +2139,10 @@ gen_sintab::@2: scope:[gen_sintab] from gen_sintab::@1 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@2 return to:@return -@42: scope:[] from @41 +@43: scope:[] from @42 call main to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Removing unused procedure setFACtoARG Removing unused procedure setFACtoMEM @@ -2120,6 +2164,7 @@ Removing unused procedure mulFACby10 Removing unused procedure print_str Removing unused procedure print_ln Removing unused procedure print_word +Removing unused procedure print_cls Removing unused procedure print_byte Removing unused procedure print_char Eliminating unused variable (byte*) SPRITES_PRIORITY and assignment [8] (byte*) SPRITES_PRIORITY ← ((byte*)) (word) 53275 @@ -2168,7 +2213,6 @@ Eliminating unused variable - keeping the call (void~) gen_sintab::$21 Eliminating unused variable - keeping the call (void~) gen_sintab::$22 Eliminating unused variable - keeping the call (void~) gen_sintab::$25 Eliminating unused variable (byte*) line_cursor and assignment [46] (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 -Fixing word constructor with getFAC::w ← *(memHi) w= *(memLo) Removing empty block @1 Removing empty block @2 Removing empty block getFAC::@1 @@ -2201,17 +2245,18 @@ Removing empty block @28 Removing empty block @29 Removing empty block @30 Removing empty block @31 +Removing empty block @32 Removing empty block main::@4 -Removing empty block @33 Removing empty block @34 +Removing empty block @35 Removing empty block clear_screen::@2 -Removing empty block @36 -Removing empty block @38 -Removing empty block place_sprites::@2 +Removing empty block @37 Removing empty block @39 -Removing empty block gen_sprites::@2 +Removing empty block place_sprites::@2 Removing empty block @40 +Removing empty block gen_sprites::@2 Removing empty block @41 +Removing empty block @42 Removing empty block gen_sintab::@2 CONTROL FLOW GRAPH @begin: scope:[] from @@ -2229,7 +2274,7 @@ CONTROL FLOW GRAPH (byte*) COLS ← ((byte*)) (word) 55296 (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem *((byte*) memLo) ← (byte~) prepareMEM::$0 @@ -2249,7 +2294,7 @@ setFAC::@return: scope:[setFAC] from setFAC to:@return getFAC: scope:[getFAC] from asm { jsr$b1aasty$festa$ff } - (word) getFAC::w ← *((byte*) memHi) w= *((byte*) memLo) + (word) getFAC::w ← { *((byte*) memHi), *((byte*) memLo) } (word) getFAC::return ← (word) getFAC::w to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -2302,14 +2347,14 @@ sinFAC: scope:[sinFAC] from sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x ← (byte/word/signed word) 221 (byte[]) sintab_x ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y ← (byte/word/signed word) 197 (byte[]) sintab_y ← ((byte*)) (word/signed word) 4352 (byte[]) sprites ← ((byte*)) (word/signed word) 8192 - to:@35 + to:@36 main: scope:[main] from call init to:main::@2 @@ -2364,10 +2409,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte*) progress_cursor ← (byte*) SCREEN (byte) progress_idx ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from (byte*) progress_cursor ← (byte*) progress_init::line (byte) progress_idx ← (byte/signed byte/word/signed word) 0 @@ -2393,10 +2438,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from *((byte*) BORDERCOL) ← ++ *((byte*) BORDERCOL) (byte) anim::xidx ← (byte) sin_idx_x @@ -2633,10 +2678,10 @@ gen_sintab::@1: scope:[gen_sintab] from gen_sintab gen_sintab::@1 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@1 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 PROCEDURE MODIFY VARIABLE ANALYSIS main modifies progress_cursor @@ -2670,7 +2715,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL (byte*) COLS ← ((byte*)) (word) 55296 (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem *((byte*) memLo) ← (byte~) prepareMEM::$0 @@ -2693,7 +2738,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w ← *((byte*) memHi) w= *((byte*) memLo) + (word) getFAC::w ← { *((byte*) memHi), *((byte*) memLo) } (word) getFAC::return ← (word) getFAC::w to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -2758,15 +2803,15 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x ← (byte/word/signed word) 221 (byte[]) sintab_x ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y ← (byte/word/signed word) 197 (byte[]) sintab_y ← ((byte*)) (word/signed word) 4352 (byte[]) sprites ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -2868,10 +2913,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte*) progress_cursor ← (byte*) SCREEN (byte) progress_idx ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_cursor ← (byte*) progress_init::line (byte) progress_idx ← (byte/signed byte/word/signed word) 0 @@ -2901,10 +2946,10 @@ progress_inc::@return: scope:[progress_inc] from progress_inc::@1 (byte*) progress_cursor ← (byte*) progress_cursor return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 *((byte*) BORDERCOL) ← ++ *((byte*) BORDERCOL) (byte) anim::xidx ← (byte) sin_idx_x @@ -3210,16 +3255,16 @@ gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 (byte*) progress_cursor ← (byte*) progress_cursor return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 (byte*) progress_cursor ← (byte*) progress_cursor (byte) progress_idx ← (byte) progress_idx (byte) sin_idx_x ← (byte) sin_idx_x (byte) sin_idx_y ← (byte) sin_idx_y to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Completing Phi functions... Completing Phi functions... @@ -3260,7 +3305,7 @@ CONTROL FLOW GRAPH SSA (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -3285,7 +3330,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::w#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } (word) getFAC::return#0 ← (word) getFAC::w#0 to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -3355,19 +3400,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#24 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#26 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) progress_cursor#35 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#24 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#26 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) progress_cursor#35 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -3519,10 +3564,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte*) progress_cursor#7 ← (byte*) SCREEN#0 (byte) progress_idx#7 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#8 ← (byte*) progress_init::line#2 @@ -3562,12 +3607,12 @@ progress_inc::@return: scope:[progress_inc] from progress_inc::@1 (byte*) progress_cursor#11 ← (byte*) progress_cursor#25 return to:@return -@37: scope:[] from @35 - (byte) progress_idx#39 ← phi( @35/(byte) progress_idx#7 ) - (byte*) progress_cursor#39 ← phi( @35/(byte*) progress_cursor#7 ) +@38: scope:[] from @36 + (byte) progress_idx#39 ← phi( @36/(byte) progress_idx#7 ) + (byte*) progress_cursor#39 ← phi( @36/(byte*) progress_cursor#7 ) (byte) sin_idx_x#2 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#2 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -4194,24 +4239,24 @@ gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 (byte*) progress_cursor#13 ← (byte*) progress_cursor#27 return to:@return -@42: scope:[] from @37 - (byte) sin_idx_y#17 ← phi( @37/(byte) sin_idx_y#2 ) - (byte) sin_idx_x#16 ← phi( @37/(byte) sin_idx_x#2 ) - (byte) progress_idx#35 ← phi( @37/(byte) progress_idx#39 ) - (byte*) progress_cursor#35 ← phi( @37/(byte*) progress_cursor#39 ) +@43: scope:[] from @38 + (byte) sin_idx_y#17 ← phi( @38/(byte) sin_idx_y#2 ) + (byte) sin_idx_x#16 ← phi( @38/(byte) sin_idx_x#2 ) + (byte) progress_idx#35 ← phi( @38/(byte) progress_idx#39 ) + (byte*) progress_cursor#35 ← phi( @38/(byte*) progress_cursor#39 ) call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#29 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#28 ← phi( @42/(byte*) progress_cursor#35 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#29 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#28 ← phi( @43/(byte*) progress_cursor#35 ) (byte*) progress_cursor#14 ← (byte*) progress_cursor#28 (byte) progress_idx#15 ← (byte) progress_idx#29 (byte) sin_idx_x#6 ← (byte) sin_idx_x#12 (byte) sin_idx_y#6 ← (byte) sin_idx_y#12 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN @begin: scope:[] from @@ -4229,7 +4274,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -4254,7 +4299,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::w#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } (word) getFAC::return#0 ← (word) getFAC::w#0 to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -4324,19 +4369,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#24 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#26 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) progress_cursor#35 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#24 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#26 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) progress_cursor#35 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -4488,10 +4533,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte*) progress_cursor#7 ← (byte*) SCREEN#0 (byte) progress_idx#7 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#8 ← (byte*) progress_init::line#2 @@ -4531,12 +4576,12 @@ progress_inc::@return: scope:[progress_inc] from progress_inc::@1 (byte*) progress_cursor#11 ← (byte*) progress_cursor#25 return to:@return -@37: scope:[] from @35 - (byte) progress_idx#39 ← phi( @35/(byte) progress_idx#7 ) - (byte*) progress_cursor#39 ← phi( @35/(byte*) progress_cursor#7 ) +@38: scope:[] from @36 + (byte) progress_idx#39 ← phi( @36/(byte) progress_idx#7 ) + (byte*) progress_cursor#39 ← phi( @36/(byte*) progress_cursor#7 ) (byte) sin_idx_x#2 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#2 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -5164,31 +5209,31 @@ gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 (byte*) progress_cursor#13 ← (byte*) progress_cursor#27 return to:@return -@42: scope:[] from @37 - (byte) sin_idx_y#17 ← phi( @37/(byte) sin_idx_y#2 ) - (byte) sin_idx_x#16 ← phi( @37/(byte) sin_idx_x#2 ) - (byte) progress_idx#35 ← phi( @37/(byte) progress_idx#39 ) - (byte*) progress_cursor#35 ← phi( @37/(byte*) progress_cursor#39 ) +@43: scope:[] from @38 + (byte) sin_idx_y#17 ← phi( @38/(byte) sin_idx_y#2 ) + (byte) sin_idx_x#16 ← phi( @38/(byte) sin_idx_x#2 ) + (byte) progress_idx#35 ← phi( @38/(byte) progress_idx#39 ) + (byte*) progress_cursor#35 ← phi( @38/(byte*) progress_cursor#39 ) call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#1 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#1 ) - (byte) progress_idx#29 ← phi( @42/(byte) progress_idx#1 ) - (byte*) progress_cursor#28 ← phi( @42/(byte*) progress_cursor#1 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#1 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#1 ) + (byte) progress_idx#29 ← phi( @43/(byte) progress_idx#1 ) + (byte*) progress_cursor#28 ← phi( @43/(byte*) progress_cursor#1 ) (byte*) progress_cursor#14 ← (byte*) progress_cursor#28 (byte) progress_idx#15 ← (byte) progress_idx#29 (byte) sin_idx_x#6 ← (byte) sin_idx_x#12 (byte) sin_idx_y#6 ← (byte) sin_idx_y#12 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 INITIAL SSA SYMBOL TABLE -(label) @32 -(label) @35 -(label) @37 -(label) @42 +(label) @33 +(label) @36 +(label) @38 (label) @43 +(label) @44 (label) @begin (label) @end (byte*) BORDERCOL @@ -6020,7 +6065,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -6045,7 +6090,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::w#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::w#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } (word) getFAC::return#0 ← (word) getFAC::w#0 to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC @@ -6115,19 +6160,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#24 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#26 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) progress_cursor#35 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#24 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#26 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) progress_cursor#35 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -6279,10 +6324,10 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte*) progress_cursor#7 ← (byte*) SCREEN#0 (byte) progress_idx#7 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#8 ← (byte*) progress_init::line#2 @@ -6321,12 +6366,12 @@ progress_inc::@return: scope:[progress_inc] from progress_inc::@1 (byte*) progress_cursor#11 ← (byte*) progress_cursor#25 return to:@return -@37: scope:[] from @35 - (byte) progress_idx#39 ← phi( @35/(byte) progress_idx#7 ) - (byte*) progress_cursor#39 ← phi( @35/(byte*) progress_cursor#7 ) +@38: scope:[] from @36 + (byte) progress_idx#39 ← phi( @36/(byte) progress_idx#7 ) + (byte*) progress_cursor#39 ← phi( @36/(byte*) progress_cursor#7 ) (byte) sin_idx_x#2 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#2 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -6948,24 +6993,24 @@ gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 (byte*) progress_cursor#13 ← (byte*) progress_cursor#27 return to:@return -@42: scope:[] from @37 - (byte) sin_idx_y#17 ← phi( @37/(byte) sin_idx_y#2 ) - (byte) sin_idx_x#16 ← phi( @37/(byte) sin_idx_x#2 ) - (byte) progress_idx#35 ← phi( @37/(byte) progress_idx#39 ) - (byte*) progress_cursor#35 ← phi( @37/(byte*) progress_cursor#39 ) +@43: scope:[] from @38 + (byte) sin_idx_y#17 ← phi( @38/(byte) sin_idx_y#2 ) + (byte) sin_idx_x#16 ← phi( @38/(byte) sin_idx_x#2 ) + (byte) progress_idx#35 ← phi( @38/(byte) progress_idx#39 ) + (byte*) progress_cursor#35 ← phi( @38/(byte*) progress_cursor#39 ) call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#1 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#1 ) - (byte) progress_idx#29 ← phi( @42/(byte) progress_idx#1 ) - (byte*) progress_cursor#28 ← phi( @42/(byte*) progress_cursor#1 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#1 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#1 ) + (byte) progress_idx#29 ← phi( @43/(byte) progress_idx#1 ) + (byte*) progress_cursor#28 ← phi( @43/(byte*) progress_cursor#1 ) (byte*) progress_cursor#14 ← (byte*) progress_cursor#28 (byte) progress_idx#15 ← (byte) progress_idx#29 (byte) sin_idx_x#6 ← (byte) sin_idx_x#12 (byte) sin_idx_y#6 ← (byte) sin_idx_y#12 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Not aliassing across scopes: prepareMEM::mem#5 prepareMEM::mem#2 Not aliassing across scopes: setFAC::w#5 setFAC::w#0 @@ -7176,7 +7221,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -7200,7 +7245,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -7267,19 +7312,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#21 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#23 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) SCREEN#0 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#21 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#23 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) SCREEN#0 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -7384,9 +7429,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -7416,10 +7461,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -7786,16 +7831,16 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#0 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#0 ) - (byte) progress_idx#15 ← phi( @42/(byte) progress_idx#1 ) - (byte*) progress_cursor#14 ← phi( @42/(byte*) progress_cursor#1 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#0 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#0 ) + (byte) progress_idx#15 ← phi( @43/(byte) progress_idx#1 ) + (byte*) progress_cursor#14 ← phi( @43/(byte*) progress_cursor#1 ) to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Not aliassing across scopes: prepareMEM::mem#5 prepareMEM::mem#2 Not aliassing across scopes: setFAC::w#5 setFAC::w#0 @@ -7910,7 +7955,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -7934,7 +7979,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -8001,19 +8046,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#21 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#23 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) SCREEN#0 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#21 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#23 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) SCREEN#0 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -8118,9 +8163,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -8150,10 +8195,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -8493,16 +8538,16 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#0 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#0 ) - (byte) progress_idx#15 ← phi( @42/(byte) progress_idx#1 ) - (byte*) progress_cursor#14 ← phi( @42/(byte*) progress_cursor#1 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#0 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#0 ) + (byte) progress_idx#15 ← phi( @43/(byte) progress_idx#1 ) + (byte*) progress_cursor#14 ← phi( @43/(byte*) progress_cursor#1 ) to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Not aliassing across scopes: prepareMEM::mem#5 prepareMEM::mem#2 Not aliassing across scopes: setFAC::w#5 setFAC::w#0 @@ -8619,7 +8664,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -8643,7 +8688,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -8710,19 +8755,19 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 - (byte) sin_idx_y#21 ← phi( @42/(byte) sin_idx_y#17 ) - (byte) sin_idx_x#23 ← phi( @42/(byte) sin_idx_x#16 ) - (byte) progress_idx#30 ← phi( @42/(byte) progress_idx#35 ) - (byte*) progress_cursor#29 ← phi( @42/(byte*) SCREEN#0 ) + to:@36 +main: scope:[main] from @43 + (byte) sin_idx_y#21 ← phi( @43/(byte) sin_idx_y#17 ) + (byte) sin_idx_x#23 ← phi( @43/(byte) sin_idx_x#16 ) + (byte) progress_idx#30 ← phi( @43/(byte) progress_idx#35 ) + (byte*) progress_cursor#29 ← phi( @43/(byte*) SCREEN#0 ) call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -8827,9 +8872,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -8859,10 +8904,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 (byte) sin_idx_y#9 ← phi( main::@3/(byte) sin_idx_y#13 ) (byte) sin_idx_x#9 ← phi( main::@3/(byte) sin_idx_x#13 ) @@ -9202,16 +9247,16 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 - (byte) sin_idx_y#12 ← phi( @42/(byte) sin_idx_y#0 ) - (byte) sin_idx_x#12 ← phi( @42/(byte) sin_idx_x#0 ) - (byte) progress_idx#15 ← phi( @42/(byte) progress_idx#1 ) - (byte*) progress_cursor#14 ← phi( @42/(byte*) progress_cursor#1 ) + to:@44 +@44: scope:[] from @43 + (byte) sin_idx_y#12 ← phi( @43/(byte) sin_idx_y#0 ) + (byte) sin_idx_x#12 ← phi( @43/(byte) sin_idx_x#0 ) + (byte) progress_idx#15 ← phi( @43/(byte) progress_idx#1 ) + (byte*) progress_cursor#14 ← phi( @43/(byte*) progress_cursor#1 ) to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Redundant Phi (byte*) progress_cursor#29 (byte*) SCREEN#0 Redundant Phi (byte) progress_idx#30 (byte) progress_idx#35 @@ -9279,7 +9324,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -9303,7 +9348,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -9370,15 +9415,15 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -9465,9 +9510,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -9495,10 +9540,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -9817,12 +9862,12 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Redundant Phi (byte) progress_idx#54 (byte) progress_idx#23 Redundant Phi (byte*) progress_cursor#54 (byte*) progress_cursor#22 @@ -9843,7 +9888,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -9867,7 +9912,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -9934,15 +9979,15 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -10029,9 +10074,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -10059,10 +10104,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -10379,12 +10424,12 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Simple Condition (boolean~) main::$1 if(*((byte*) RASTER#0)!=(byte/word/signed word) 255) goto main::@2 Simple Condition (boolean~) init::$2 if((byte) init::i#1!=(byte/signed byte/word/signed word) 40) goto init::@1 @@ -10420,7 +10465,7 @@ CONTROL FLOW GRAPH (byte*) COLS#0 ← ((byte*)) (word) 55296 (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -10444,7 +10489,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((byte*) memHi#0) w= *((byte*) memLo#0) + (word) getFAC::return#0 ← { *((byte*) memHi#0), *((byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -10511,15 +10556,15 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin +@33: scope:[] from @begin (byte*) SCREEN#0 ← ((byte*)) (word/signed word) 1024 (byte) sinlen_x#0 ← (byte/word/signed word) 221 (byte[]) sintab_x#0 ← ((byte*)) (word/signed word) 4096 (byte) sinlen_y#0 ← (byte/word/signed word) 197 (byte[]) sintab_y#0 ← ((byte*)) (word/signed word) 4352 (byte[]) sprites#0 ← ((byte*)) (word/signed word) 8192 - to:@35 -main: scope:[main] from @42 + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -10603,9 +10648,9 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 +@36: scope:[] from @33 (byte) progress_idx#35 ← (byte/signed byte/word/signed word) 0 - to:@37 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -10632,10 +10677,10 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 +@38: scope:[] from @36 (byte) sin_idx_x#16 ← (byte/signed byte/word/signed word) 0 (byte) sin_idx_y#17 ← (byte/signed byte/word/signed word) 0 - to:@42 + to:@43 anim: scope:[anim] from main::@3 *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -10939,12 +10984,12 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Constant (const byte*) PROCPORT#0 = ((byte*))1 Constant (const byte*) CHARGEN#0 = ((byte*))53248 @@ -11008,7 +11053,7 @@ Constant (const byte) gen_sintab::i#0 = 0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -11032,7 +11077,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -11099,9 +11144,9 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin - to:@35 -main: scope:[main] from @42 +@33: scope:[] from @begin + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -11180,8 +11225,8 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 - to:@37 +@36: scope:[] from @33 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(byte*) progress_init::line#0 init::@7/(byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -11205,8 +11250,8 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 - to:@42 +@38: scope:[] from @36 + to:@43 anim: scope:[anim] from main::@3 *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -11482,12 +11527,12 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Constant (const byte*) progress_init::line#0 = SCREEN#0 Constant (const byte*) gen_sintab::sintab#0 = sintab_x#0 @@ -11514,7 +11559,7 @@ Constant (const byte*) addMEMtoFAC::mem#1 = gen_sintab::f_min#0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -11538,7 +11583,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -11605,9 +11650,9 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin - to:@35 -main: scope:[main] from @42 +@33: scope:[] from @begin + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -11678,8 +11723,8 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 - to:@37 +@36: scope:[] from @33 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(const byte*) progress_init::line#0 init::@7/(const byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -11703,8 +11748,8 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 - to:@42 +@38: scope:[] from @36 + to:@43 anim: scope:[anim] from main::@3 *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -11966,18 +12011,18 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Constant (const byte) place_sprites::spr_id#0 = ((byte))place_sprites::$1 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -12001,7 +12046,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -12068,9 +12113,9 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin - to:@35 -main: scope:[main] from @42 +@33: scope:[] from @begin + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -12141,8 +12186,8 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 - to:@37 +@36: scope:[] from @33 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(const byte*) progress_init::line#0 init::@7/(const byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -12166,8 +12211,8 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 - to:@42 +@38: scope:[] from @36 + to:@43 anim: scope:[anim] from main::@3 *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -12428,12 +12473,12 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Multiple usages for variable. Not optimizing sub-constant (byte) init::i#2 Multiple usages for variable. Not optimizing sub-constant (byte) init::i#2 @@ -12445,7 +12490,7 @@ Multiple usages for variable. Not optimizing sub-constant (byte*) gen_chargen_sp Succesful SSA optimization Pass2ConstantAdditionElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@32 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -12469,7 +12514,7 @@ setFAC::@return: scope:[setFAC] from setFAC::@1 to:@return getFAC: scope:[getFAC] from gen_sintab::@21 asm { jsr$b1aasty$festa$ff } - (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + (word) getFAC::return#0 ← { *((const byte*) memHi#0), *((const byte*) memLo#0) } to:getFAC::@return getFAC::@return: scope:[getFAC] from getFAC return @@ -12536,9 +12581,9 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -@32: scope:[] from @begin - to:@35 -main: scope:[main] from @42 +@33: scope:[] from @begin + to:@36 +main: scope:[main] from @43 call init param-assignment to:main::@5 main::@5: scope:[main] from main @@ -12609,8 +12654,8 @@ clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 clear_screen::@return: scope:[clear_screen] from clear_screen::@1 return to:@return -@35: scope:[] from @32 - to:@37 +@36: scope:[] from @33 + to:@38 progress_init: scope:[progress_init] from init::@5 init::@7 (byte*) progress_init::line#2 ← phi( init::@5/(const byte*) progress_init::line#0 init::@7/(const byte*) progress_init::line#1 ) (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 @@ -12634,8 +12679,8 @@ progress_inc::@2: scope:[progress_inc] from progress_inc progress_inc::@return: scope:[progress_inc] from progress_inc::@1 return to:@return -@37: scope:[] from @35 - to:@42 +@38: scope:[] from @36 + to:@43 anim: scope:[anim] from main::@3 *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) (byte) anim::xidx#0 ← (byte) sin_idx_x#13 @@ -12896,33 +12941,22 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @37 +@43: scope:[] from @38 call main param-assignment - to:@43 -@43: scope:[] from @42 + to:@44 +@44: scope:[] from @43 to:@end -@end: scope:[] from @43 +@end: scope:[] from @44 Multiple usages for variable. Not optimizing sub-constant (byte) init::i#2 Multiple usages for variable. Not optimizing sub-constant (byte) place_sprites::spr_x#2 Multiple usages for variable. Not optimizing sub-constant (byte*) gen_sprites::spr#2 Multiple usages for variable. Not optimizing sub-constant (byte*) gen_chargen_sprite::sprite#4 -Culled Empty Block (label) @32 -Culled Empty Block (label) main::@5 -Culled Empty Block (label) main::@1 -Culled Empty Block (label) init::@3 -Culled Empty Block (label) init::@10 -Culled Empty Block (label) @35 -Culled Empty Block (label) @37 -Not culling empty block because it shares successor with its predecessor. (label) anim::@9 -Not culling empty block because it shares successor with its predecessor. (label) anim::@10 -Not culling empty block because it shares successor with its predecessor. (label) gen_chargen_sprite::@6 -Culled Empty Block (label) gen_sintab::@13 -Culled Empty Block (label) @43 -Succesful SSA optimization Pass2CullEmptyBlocks +Fixing word constructor with getFAC::return#0 ← *(memHi#0) w= *(memLo#0) +Succesful SSA optimization Pass2FixWordConstructors CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@33 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -13013,7 +13047,480 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +@33: scope:[] from @begin + to:@36 +main: scope:[main] from @43 + call init param-assignment + to:main::@5 +main::@5: scope:[main] from main + to:main::@2 +main::@1: scope:[main] from main::@6 + to:main::@2 +main::@2: scope:[main] from main::@1 main::@2 main::@5 + (byte) sin_idx_y#13 ← phi( main::@1/(byte) sin_idx_y#11 main::@5/(const byte) sin_idx_y#17 ) + (byte) sin_idx_x#13 ← phi( main::@1/(byte) sin_idx_x#11 main::@5/(const byte) sin_idx_x#16 ) + if(*((const byte*) RASTER#0)!=(byte/word/signed word) 255) goto main::@2 + to:main::@3 +main::@3: scope:[main] from main::@2 + call anim param-assignment + to:main::@6 +main::@6: scope:[main] from main::@3 + if(true) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@6 + return + to:@return +init: scope:[init] from main + call clear_screen param-assignment + to:init::@3 +init::@3: scope:[init] from init + 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/(const byte) init::i#0 ) + *((const byte*) COLS#0 + (byte) init::i#2) ← (byte/signed byte/word/signed word) 0 + (byte~) init::$1 ← (byte) init::i#2 + *((const byte*) COLS#0+(byte/signed byte/word/signed word) 40 + (byte~) init::$1) ← (byte/signed byte/word/signed word) 11 + (byte) init::i#1 ← ++ (byte) init::i#2 + if((byte) init::i#1!=(byte/signed byte/word/signed word) 40) goto init::@1 + to:init::@2 +init::@2: scope:[init] from init::@1 + call place_sprites param-assignment + to:init::@4 +init::@4: scope:[init] from init::@2 + call gen_sprites param-assignment + to:init::@5 +init::@5: scope:[init] from init::@4 + call progress_init param-assignment + to:init::@6 +init::@6: scope:[init] from init::@5 + call gen_sintab param-assignment + to:init::@7 +init::@7: scope:[init] from init::@6 + call progress_init param-assignment + to:init::@8 +init::@8: scope:[init] from init::@7 + call gen_sintab param-assignment + to:init::@9 +init::@9: scope:[init] from init::@8 + call clear_screen param-assignment + to:init::@10 +init::@10: scope:[init] from init::@9 + to:init::@return +init::@return: scope:[init] from init::@10 + return + to:@return +clear_screen: scope:[clear_screen] from init init::@9 + to:clear_screen::@1 +clear_screen::@1: scope:[clear_screen] from clear_screen clear_screen::@1 + (byte*) clear_screen::sc#2 ← phi( clear_screen/(const byte*) clear_screen::sc#0 clear_screen::@1/(byte*) clear_screen::sc#1 ) + *((byte*) clear_screen::sc#2) ← (byte) ' ' + (byte*) clear_screen::sc#1 ← ++ (byte*) clear_screen::sc#2 + if((byte*) clear_screen::sc#1<(const byte*) clear_screen::$0) goto clear_screen::@1 + to:clear_screen::@return +clear_screen::@return: scope:[clear_screen] from clear_screen::@1 + return + to:@return +@36: scope:[] from @33 + to:@38 +progress_init: scope:[progress_init] from init::@5 init::@7 + (byte*) progress_init::line#2 ← phi( init::@5/(const byte*) progress_init::line#0 init::@7/(const byte*) progress_init::line#1 ) + (byte*) progress_cursor#22 ← (byte*) progress_init::line#2 + to:progress_init::@return +progress_init::@return: scope:[progress_init] from progress_init + return + to:@return +progress_inc: scope:[progress_inc] from gen_sintab::@22 + (byte) progress_idx#10 ← ++ (byte) progress_idx#34 + if((byte) progress_idx#10!=(byte/signed byte/word/signed word) 8) goto progress_inc::@1 + to:progress_inc::@2 +progress_inc::@1: scope:[progress_inc] from progress_inc progress_inc::@2 + (byte*) progress_cursor#11 ← phi( progress_inc/(byte*) progress_cursor#34 progress_inc::@2/(byte*) progress_cursor#10 ) + (byte) progress_idx#12 ← phi( progress_inc/(byte) progress_idx#10 progress_inc::@2/(const byte) progress_idx#11 ) + *((byte*) progress_cursor#11) ← *((const byte[]) progress_inc::progress_chars#0 + (byte) progress_idx#12) + to:progress_inc::@return +progress_inc::@2: scope:[progress_inc] from progress_inc + *((byte*) progress_cursor#34) ← *((const byte[]) progress_inc::progress_chars#0+(byte/signed byte/word/signed word) 8) + (byte*) progress_cursor#10 ← ++ (byte*) progress_cursor#34 + to:progress_inc::@1 +progress_inc::@return: scope:[progress_inc] from progress_inc::@1 + return + to:@return +@38: scope:[] from @36 + to:@43 +anim: scope:[anim] from main::@3 + *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) + (byte) anim::xidx#0 ← (byte) sin_idx_x#13 + (byte) anim::yidx#0 ← (byte) sin_idx_y#13 + to:anim::@1 +anim::@1: scope:[anim] from anim anim::@3 + (byte) anim::j#2 ← phi( anim/(const byte) anim::j#0 anim::@3/(byte) anim::j#1 ) + (byte) anim::yidx#3 ← phi( anim/(byte) anim::yidx#0 anim::@3/(byte) anim::yidx#6 ) + (byte) anim::j2#3 ← phi( anim/(const byte) anim::j2#0 anim::@3/(byte) anim::j2#2 ) + (byte) anim::x_msb#2 ← phi( anim/(const byte) anim::x_msb#0 anim::@3/(byte) anim::x_msb#1 ) + (byte) anim::xidx#3 ← phi( anim/(byte) anim::xidx#0 anim::@3/(byte) anim::xidx#5 ) + (word) anim::x#0 ← (const word) anim::$0 + *((const byte[]) sintab_x#0 + (byte) anim::xidx#3) + (byte~) anim::$2 ← (byte) anim::x_msb#2 << (byte/signed byte/word/signed word) 1 + (byte~) anim::$3 ← > (word) anim::x#0 + (byte) anim::x_msb#1 ← (byte~) anim::$2 | (byte~) anim::$3 + (byte~) anim::$5 ← < (word) anim::x#0 + *((const byte*) SPRITES_XPOS#0 + (byte) anim::j2#3) ← (byte~) anim::$5 + *((const byte*) SPRITES_YPOS#0 + (byte) anim::j2#3) ← *((const byte[]) sintab_y#0 + (byte) anim::yidx#3) + (byte) anim::xidx#1 ← (byte) anim::xidx#3 + (byte/signed byte/word/signed word) 10 + if((byte) anim::xidx#1<(const byte) sinlen_x#0) goto anim::@2 + to:anim::@6 +anim::@2: scope:[anim] from anim::@1 anim::@6 + (byte) anim::xidx#5 ← phi( anim::@1/(byte) anim::xidx#1 anim::@6/(byte) anim::xidx#2 ) + (byte) anim::yidx#1 ← (byte) anim::yidx#3 + (byte/signed byte/word/signed word) 8 + if((byte) anim::yidx#1<(const byte) sinlen_y#0) goto anim::@3 + to:anim::@7 +anim::@6: scope:[anim] from anim::@1 + (byte) anim::xidx#2 ← (byte) anim::xidx#1 - (const byte) sinlen_x#0 + to:anim::@2 +anim::@3: scope:[anim] from anim::@2 anim::@7 + (byte) anim::yidx#6 ← phi( anim::@2/(byte) anim::yidx#1 anim::@7/(byte) anim::yidx#2 ) + (byte) anim::j2#1 ← -- (byte) anim::j2#3 + (byte) anim::j2#2 ← -- (byte) anim::j2#1 + (byte) anim::j#1 ← ++ (byte) anim::j#2 + if((byte) anim::j#1!=(byte/signed byte/word/signed word) 7) goto anim::@1 + to:anim::@8 +anim::@7: scope:[anim] from anim::@2 + (byte) anim::yidx#2 ← (byte) anim::yidx#1 - (const byte) sinlen_y#0 + to:anim::@3 +anim::@8: scope:[anim] from anim::@3 + *((const byte*) SPRITES_XMSB#0) ← (byte) anim::x_msb#1 + (byte) sin_idx_x#3 ← ++ (byte) sin_idx_x#13 + if((byte) sin_idx_x#3<(const byte) sinlen_x#0) goto anim::@4 + to:anim::@9 +anim::@4: scope:[anim] from anim::@8 anim::@9 + (byte) sin_idx_x#11 ← phi( anim::@8/(byte) sin_idx_x#3 anim::@9/(const byte) sin_idx_x#4 ) + (byte) sin_idx_y#3 ← ++ (byte) sin_idx_y#13 + if((byte) sin_idx_y#3<(const byte) sinlen_y#0) goto anim::@5 + to:anim::@10 +anim::@9: scope:[anim] from anim::@8 + to:anim::@4 +anim::@5: scope:[anim] from anim::@10 anim::@4 + (byte) sin_idx_y#11 ← phi( anim::@10/(const byte) sin_idx_y#4 anim::@4/(byte) sin_idx_y#3 ) + *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0) + to:anim::@return +anim::@10: scope:[anim] from anim::@4 + to:anim::@5 +anim::@return: scope:[anim] from anim::@5 + return + to:@return +place_sprites: scope:[place_sprites] from init::@2 + *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word) 127 + *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word) 127 + *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word) 127 + to:place_sprites::@1 +place_sprites::@1: scope:[place_sprites] from place_sprites place_sprites::@1 + (byte) place_sprites::col#2 ← phi( place_sprites/(const byte) place_sprites::col#0 place_sprites::@1/(byte) place_sprites::col#1 ) + (byte) place_sprites::j2#3 ← phi( place_sprites/(const byte) place_sprites::j2#0 place_sprites::@1/(byte) place_sprites::j2#2 ) + (byte) place_sprites::spr_x#2 ← phi( place_sprites/(const byte) place_sprites::spr_x#0 place_sprites::@1/(byte) place_sprites::spr_x#1 ) + (byte) place_sprites::j#2 ← phi( place_sprites/(const byte) place_sprites::j#0 place_sprites::@1/(byte) place_sprites::j#1 ) + (byte) place_sprites::spr_id#2 ← phi( place_sprites/(const byte) place_sprites::spr_id#0 place_sprites::@1/(byte) place_sprites::spr_id#1 ) + *((const byte*) place_sprites::sprites_ptr#0 + (byte) place_sprites::j#2) ← (byte) place_sprites::spr_id#2 + (byte) place_sprites::spr_id#1 ← ++ (byte) place_sprites::spr_id#2 + *((const byte*) SPRITES_XPOS#0 + (byte) place_sprites::j2#3) ← (byte) place_sprites::spr_x#2 + *((const byte*) SPRITES_YPOS#0 + (byte) place_sprites::j2#3) ← (byte/signed byte/word/signed word) 80 + *((const byte*) SPRITES_COLS#0 + (byte) place_sprites::j#2) ← (byte) place_sprites::col#2 + (byte) place_sprites::spr_x#1 ← (byte) place_sprites::spr_x#2 + (byte/signed byte/word/signed word) 32 + (byte) place_sprites::col#1 ← (byte) place_sprites::col#2 ^ (const byte) place_sprites::$4 + (byte) place_sprites::j2#1 ← ++ (byte) place_sprites::j2#3 + (byte) place_sprites::j2#2 ← ++ (byte) place_sprites::j2#1 + (byte) place_sprites::j#1 ← ++ (byte) place_sprites::j#2 + if((byte) place_sprites::j#1!=(byte/signed byte/word/signed word) 7) goto place_sprites::@1 + to:place_sprites::@return +place_sprites::@return: scope:[place_sprites] from place_sprites::@1 + return + to:@return +gen_sprites: scope:[gen_sprites] from init::@4 + to:gen_sprites::@1 +gen_sprites::@1: scope:[gen_sprites] from gen_sprites gen_sprites::@3 + (byte*) gen_sprites::spr#2 ← phi( gen_sprites/(const byte*) gen_sprites::spr#0 gen_sprites::@3/(byte*) gen_sprites::spr#1 ) + (byte) gen_sprites::i#2 ← phi( gen_sprites/(const byte) gen_sprites::i#0 gen_sprites::@3/(byte) gen_sprites::i#1 ) + (byte) gen_chargen_sprite::ch#0 ← *((const byte[]) gen_sprites::cml#0 + (byte) gen_sprites::i#2) + (byte*) gen_chargen_sprite::sprite#0 ← (byte*) gen_sprites::spr#2 + call gen_chargen_sprite param-assignment + to:gen_sprites::@3 +gen_sprites::@3: scope:[gen_sprites] from gen_sprites::@1 + (byte*) gen_sprites::spr#1 ← (byte*) gen_sprites::spr#2 + (byte/signed byte/word/signed word) 64 + (byte) gen_sprites::i#1 ← ++ (byte) gen_sprites::i#2 + if((byte) gen_sprites::i#1!=(byte/signed byte/word/signed word) 7) goto gen_sprites::@1 + to:gen_sprites::@return +gen_sprites::@return: scope:[gen_sprites] from gen_sprites::@3 + return + to:@return +gen_chargen_sprite: scope:[gen_chargen_sprite] from gen_sprites::@1 + (word~) gen_chargen_sprite::$0 ← ((word)) (byte) gen_chargen_sprite::ch#0 + (word~) gen_chargen_sprite::$1 ← (word~) gen_chargen_sprite::$0 << (byte/signed byte/word/signed word) 3 + (byte*) gen_chargen_sprite::chargen#0 ← (const byte*) CHARGEN#0 + (word~) gen_chargen_sprite::$1 + asm { sei } + *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word) 50 + to:gen_chargen_sprite::@1 +gen_chargen_sprite::@1: scope:[gen_chargen_sprite] from gen_chargen_sprite gen_chargen_sprite::@9 + (byte*) gen_chargen_sprite::sprite#11 ← phi( gen_chargen_sprite/(byte*) gen_chargen_sprite::sprite#0 gen_chargen_sprite::@9/(byte*) gen_chargen_sprite::sprite#2 ) + (byte) gen_chargen_sprite::y#2 ← phi( gen_chargen_sprite/(const byte) gen_chargen_sprite::y#0 gen_chargen_sprite::@9/(byte) gen_chargen_sprite::y#1 ) + (byte*) gen_chargen_sprite::chargen#1 ← phi( gen_chargen_sprite/(byte*) gen_chargen_sprite::chargen#0 gen_chargen_sprite::@9/(byte*) gen_chargen_sprite::chargen#7 ) + (byte) gen_chargen_sprite::bits#0 ← *((byte*) gen_chargen_sprite::chargen#1 + (byte) gen_chargen_sprite::y#2) + to:gen_chargen_sprite::@2 +gen_chargen_sprite::@2: scope:[gen_chargen_sprite] from gen_chargen_sprite::@1 gen_chargen_sprite::@8 + (byte*) gen_chargen_sprite::chargen#7 ← phi( gen_chargen_sprite::@1/(byte*) gen_chargen_sprite::chargen#1 gen_chargen_sprite::@8/(byte*) gen_chargen_sprite::chargen#7 ) + (byte) gen_chargen_sprite::y#10 ← phi( gen_chargen_sprite::@1/(byte) gen_chargen_sprite::y#2 gen_chargen_sprite::@8/(byte) gen_chargen_sprite::y#10 ) + (byte) gen_chargen_sprite::x#6 ← phi( gen_chargen_sprite::@1/(const byte) gen_chargen_sprite::x#0 gen_chargen_sprite::@8/(byte) gen_chargen_sprite::x#1 ) + (byte*) gen_chargen_sprite::sprite#10 ← phi( gen_chargen_sprite::@1/(byte*) gen_chargen_sprite::sprite#11 gen_chargen_sprite::@8/(byte*) gen_chargen_sprite::sprite#4 ) + (byte) gen_chargen_sprite::s_gen_cnt#4 ← phi( gen_chargen_sprite::@1/(const byte) gen_chargen_sprite::s_gen_cnt#0 gen_chargen_sprite::@8/(byte) gen_chargen_sprite::s_gen_cnt#5 ) + (byte) gen_chargen_sprite::s_gen#5 ← phi( gen_chargen_sprite::@1/(const byte) gen_chargen_sprite::s_gen#0 gen_chargen_sprite::@8/(byte) gen_chargen_sprite::s_gen#6 ) + (byte) gen_chargen_sprite::bits#2 ← phi( gen_chargen_sprite::@1/(byte) gen_chargen_sprite::bits#0 gen_chargen_sprite::@8/(byte) gen_chargen_sprite::bits#1 ) + (byte~) gen_chargen_sprite::$3 ← (byte) gen_chargen_sprite::bits#2 & (byte/word/signed word) 128 + if((byte~) gen_chargen_sprite::$3==(byte/signed byte/word/signed word) 0) goto gen_chargen_sprite::@3 + to:gen_chargen_sprite::@6 +gen_chargen_sprite::@3: scope:[gen_chargen_sprite] from gen_chargen_sprite::@2 gen_chargen_sprite::@6 + (byte) gen_chargen_sprite::c#3 ← phi( gen_chargen_sprite::@2/(const byte) gen_chargen_sprite::c#0 gen_chargen_sprite::@6/(const byte) gen_chargen_sprite::c#1 ) + to:gen_chargen_sprite::@4 +gen_chargen_sprite::@6: scope:[gen_chargen_sprite] from gen_chargen_sprite::@2 + to:gen_chargen_sprite::@3 +gen_chargen_sprite::@4: scope:[gen_chargen_sprite] from gen_chargen_sprite::@3 gen_chargen_sprite::@5 + (byte*) gen_chargen_sprite::sprite#3 ← phi( gen_chargen_sprite::@3/(byte*) gen_chargen_sprite::sprite#10 gen_chargen_sprite::@5/(byte*) gen_chargen_sprite::sprite#4 ) + (byte) gen_chargen_sprite::b#2 ← phi( gen_chargen_sprite::@3/(const byte) gen_chargen_sprite::b#0 gen_chargen_sprite::@5/(byte) gen_chargen_sprite::b#1 ) + (byte) gen_chargen_sprite::s_gen_cnt#3 ← phi( gen_chargen_sprite::@3/(byte) gen_chargen_sprite::s_gen_cnt#4 gen_chargen_sprite::@5/(byte) gen_chargen_sprite::s_gen_cnt#5 ) + (byte) gen_chargen_sprite::s_gen#3 ← phi( gen_chargen_sprite::@3/(byte) gen_chargen_sprite::s_gen#5 gen_chargen_sprite::@5/(byte) gen_chargen_sprite::s_gen#6 ) + (byte~) gen_chargen_sprite::$6 ← (byte) gen_chargen_sprite::s_gen#3 << (byte/signed byte/word/signed word) 1 + (byte) gen_chargen_sprite::s_gen#1 ← (byte~) gen_chargen_sprite::$6 | (byte) gen_chargen_sprite::c#3 + (byte) gen_chargen_sprite::s_gen_cnt#1 ← ++ (byte) gen_chargen_sprite::s_gen_cnt#3 + if((byte) gen_chargen_sprite::s_gen_cnt#1!=(byte/signed byte/word/signed word) 8) goto gen_chargen_sprite::@5 + to:gen_chargen_sprite::@7 +gen_chargen_sprite::@5: scope:[gen_chargen_sprite] from gen_chargen_sprite::@4 gen_chargen_sprite::@7 + (byte*) gen_chargen_sprite::sprite#4 ← phi( gen_chargen_sprite::@4/(byte*) gen_chargen_sprite::sprite#3 gen_chargen_sprite::@7/(byte*) gen_chargen_sprite::sprite#1 ) + (byte) gen_chargen_sprite::s_gen_cnt#5 ← phi( gen_chargen_sprite::@4/(byte) gen_chargen_sprite::s_gen_cnt#1 gen_chargen_sprite::@7/(const byte) gen_chargen_sprite::s_gen_cnt#2 ) + (byte) gen_chargen_sprite::s_gen#6 ← phi( gen_chargen_sprite::@4/(byte) gen_chargen_sprite::s_gen#1 gen_chargen_sprite::@7/(const byte) gen_chargen_sprite::s_gen#2 ) + (byte) gen_chargen_sprite::b#1 ← ++ (byte) gen_chargen_sprite::b#2 + if((byte) gen_chargen_sprite::b#1!=(byte/signed byte/word/signed word) 3) goto gen_chargen_sprite::@4 + to:gen_chargen_sprite::@8 +gen_chargen_sprite::@7: scope:[gen_chargen_sprite] from gen_chargen_sprite::@4 + *((byte*) gen_chargen_sprite::sprite#3 + (byte/signed byte/word/signed word) 0) ← (byte) gen_chargen_sprite::s_gen#1 + *((byte*) gen_chargen_sprite::sprite#3 + (byte/signed byte/word/signed word) 3) ← (byte) gen_chargen_sprite::s_gen#1 + *((byte*) gen_chargen_sprite::sprite#3 + (byte/signed byte/word/signed word) 6) ← (byte) gen_chargen_sprite::s_gen#1 + (byte*) gen_chargen_sprite::sprite#1 ← ++ (byte*) gen_chargen_sprite::sprite#3 + to:gen_chargen_sprite::@5 +gen_chargen_sprite::@8: scope:[gen_chargen_sprite] from gen_chargen_sprite::@5 + (byte) gen_chargen_sprite::bits#1 ← (byte) gen_chargen_sprite::bits#2 << (byte/signed byte/word/signed word) 1 + (byte) gen_chargen_sprite::x#1 ← ++ (byte) gen_chargen_sprite::x#6 + if((byte) gen_chargen_sprite::x#1!=(byte/signed byte/word/signed word) 8) goto gen_chargen_sprite::@2 + to:gen_chargen_sprite::@9 +gen_chargen_sprite::@9: scope:[gen_chargen_sprite] from gen_chargen_sprite::@8 + (byte*) gen_chargen_sprite::sprite#2 ← (byte*) gen_chargen_sprite::sprite#4 + (byte/signed byte/word/signed word) 6 + (byte) gen_chargen_sprite::y#1 ← ++ (byte) gen_chargen_sprite::y#10 + if((byte) gen_chargen_sprite::y#1!=(byte/signed byte/word/signed word) 8) goto gen_chargen_sprite::@1 + to:gen_chargen_sprite::@10 +gen_chargen_sprite::@10: scope:[gen_chargen_sprite] from gen_chargen_sprite::@9 + *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word) 55 + asm { cli } + to:gen_chargen_sprite::@return +gen_chargen_sprite::@return: scope:[gen_chargen_sprite] from gen_chargen_sprite::@10 + return + to:@return +gen_sintab: scope:[gen_sintab] from init::@6 init::@8 + (byte*) gen_sintab::sintab#12 ← phi( init::@6/(const byte*) gen_sintab::sintab#0 init::@8/(const byte*) gen_sintab::sintab#1 ) + (byte) gen_sintab::length#10 ← phi( init::@6/(const byte) gen_sintab::length#0 init::@8/(const byte) gen_sintab::length#1 ) + (byte) gen_sintab::min#2 ← phi( init::@6/(const byte) gen_sintab::min#0 init::@8/(const byte) gen_sintab::min#1 ) + (byte) gen_sintab::max#2 ← phi( init::@6/(const byte) gen_sintab::max#0 init::@8/(const byte) gen_sintab::max#1 ) + (word) setFAC::w#0 ← ((word)) (byte) gen_sintab::max#2 + call setFAC param-assignment + to:gen_sintab::@3 +gen_sintab::@3: scope:[gen_sintab] from gen_sintab + call setARGtoFAC param-assignment + to:gen_sintab::@4 +gen_sintab::@4: scope:[gen_sintab] from gen_sintab::@3 + asm { lda#0ldx#0ldy#0 } + (word) setFAC::w#1 ← ((word)) (byte) gen_sintab::min#2 + call setFAC param-assignment + to:gen_sintab::@5 +gen_sintab::@5: scope:[gen_sintab] from gen_sintab::@4 + call setMEMtoFAC param-assignment + to:gen_sintab::@6 +gen_sintab::@6: scope:[gen_sintab] from gen_sintab::@5 + call subFACfromARG param-assignment + to:gen_sintab::@7 +gen_sintab::@7: scope:[gen_sintab] from gen_sintab::@6 + call setMEMtoFAC param-assignment + to:gen_sintab::@8 +gen_sintab::@8: scope:[gen_sintab] from gen_sintab::@7 + call setFAC param-assignment + to:gen_sintab::@9 +gen_sintab::@9: scope:[gen_sintab] from gen_sintab::@8 + call divMEMbyFAC param-assignment + to:gen_sintab::@10 +gen_sintab::@10: scope:[gen_sintab] from gen_sintab::@9 + call setMEMtoFAC param-assignment + to:gen_sintab::@11 +gen_sintab::@11: scope:[gen_sintab] from gen_sintab::@10 + call addMEMtoFAC param-assignment + to:gen_sintab::@12 +gen_sintab::@12: scope:[gen_sintab] from gen_sintab::@11 + call setMEMtoFAC param-assignment + to:gen_sintab::@13 +gen_sintab::@13: scope:[gen_sintab] from gen_sintab::@12 + to:gen_sintab::@1 +gen_sintab::@1: scope:[gen_sintab] from gen_sintab::@13 gen_sintab::@23 + (byte*) progress_cursor#34 ← phi( gen_sintab::@13/(byte*) progress_cursor#22 gen_sintab::@23/(byte*) progress_cursor#11 ) + (byte) progress_idx#34 ← phi( gen_sintab::@13/(const byte) progress_idx#23 gen_sintab::@23/(byte) progress_idx#12 ) + (byte) gen_sintab::i#10 ← phi( gen_sintab::@13/(const byte) gen_sintab::i#0 gen_sintab::@23/(byte) gen_sintab::i#1 ) + (word) setFAC::w#3 ← ((word)) (byte) gen_sintab::i#10 + call setFAC param-assignment + to:gen_sintab::@14 +gen_sintab::@14: scope:[gen_sintab] from gen_sintab::@1 + call mulFACbyMEM param-assignment + to:gen_sintab::@15 +gen_sintab::@15: scope:[gen_sintab] from gen_sintab::@14 + call setMEMtoFAC param-assignment + to:gen_sintab::@16 +gen_sintab::@16: scope:[gen_sintab] from gen_sintab::@15 + (word) setFAC::w#4 ← ((word)) (byte) gen_sintab::length#10 + call setFAC param-assignment + to:gen_sintab::@17 +gen_sintab::@17: scope:[gen_sintab] from gen_sintab::@16 + call divMEMbyFAC param-assignment + to:gen_sintab::@18 +gen_sintab::@18: scope:[gen_sintab] from gen_sintab::@17 + call sinFAC param-assignment + to:gen_sintab::@19 +gen_sintab::@19: scope:[gen_sintab] from gen_sintab::@18 + call mulFACbyMEM param-assignment + to:gen_sintab::@20 +gen_sintab::@20: scope:[gen_sintab] from gen_sintab::@19 + call addMEMtoFAC param-assignment + to:gen_sintab::@21 +gen_sintab::@21: scope:[gen_sintab] from gen_sintab::@20 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:gen_sintab::@22 +gen_sintab::@22: scope:[gen_sintab] from gen_sintab::@21 + (word~) gen_sintab::$23 ← (word) getFAC::return#2 + (byte~) gen_sintab::$24 ← ((byte)) (word~) gen_sintab::$23 + *((byte*) gen_sintab::sintab#12 + (byte) gen_sintab::i#10) ← (byte~) gen_sintab::$24 + call progress_inc param-assignment + to:gen_sintab::@23 +gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 + (byte) gen_sintab::i#1 ← ++ (byte) gen_sintab::i#10 + if((byte) gen_sintab::i#1<(byte) gen_sintab::length#10) goto gen_sintab::@1 + to:gen_sintab::@return +gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 + return + to:@return +@43: scope:[] from @38 + call main param-assignment + to:@44 +@44: scope:[] from @43 + to:@end +@end: scope:[] from @44 + +Culled Empty Block (label) @33 +Culled Empty Block (label) main::@5 +Culled Empty Block (label) main::@1 +Culled Empty Block (label) init::@3 +Culled Empty Block (label) init::@10 +Culled Empty Block (label) @36 +Culled Empty Block (label) @38 +Not culling empty block because it shares successor with its predecessor. (label) anim::@9 +Not culling empty block because it shares successor with its predecessor. (label) anim::@10 +Not culling empty block because it shares successor with its predecessor. (label) gen_chargen_sprite::@6 +Culled Empty Block (label) gen_sintab::@13 +Culled Empty Block (label) @44 +Succesful SSA optimization Pass2CullEmptyBlocks +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@43 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC + (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#5 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setFAC: scope:[setFAC] from gen_sintab gen_sintab::@1 gen_sintab::@16 gen_sintab::@4 gen_sintab::@8 + (word) setFAC::w#5 ← phi( gen_sintab/(word) setFAC::w#0 gen_sintab::@1/(word) setFAC::w#3 gen_sintab::@16/(word) setFAC::w#4 gen_sintab::@4/(word) setFAC::w#1 gen_sintab::@8/(const word) setFAC::w#2 ) + (byte*) prepareMEM::mem#0 ← ((byte*)) (word) setFAC::w#5 + call prepareMEM param-assignment + to:setFAC::@1 +setFAC::@1: scope:[setFAC] from setFAC + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC::@1 + return + to:@return +getFAC: scope:[getFAC] from gen_sintab::@21 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::return#0 ← *((const byte*) memHi#0) w= *((const byte*) memLo#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +setARGtoFAC: scope:[setARGtoFAC] from gen_sintab::@3 + asm { jsr$bc0f } + to:setARGtoFAC::@return +setARGtoFAC::@return: scope:[setARGtoFAC] from setARGtoFAC + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from gen_sintab::@10 gen_sintab::@12 gen_sintab::@15 gen_sintab::@5 gen_sintab::@7 + (byte*) setMEMtoFAC::mem#5 ← phi( gen_sintab::@10/(const byte*) setMEMtoFAC::mem#2 gen_sintab::@12/(const byte*) setMEMtoFAC::mem#3 gen_sintab::@15/(const byte*) setMEMtoFAC::mem#4 gen_sintab::@5/(const byte*) setMEMtoFAC::mem#0 gen_sintab::@7/(const byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#5 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from gen_sintab::@11 gen_sintab::@20 + (byte*) addMEMtoFAC::mem#2 ← phi( gen_sintab::@11/(const byte*) addMEMtoFAC::mem#0 gen_sintab::@20/(const byte*) addMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#2 ← (byte*) addMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +subFACfromARG: scope:[subFACfromARG] from gen_sintab::@6 + asm { jsr$b853 } + to:subFACfromARG::@return +subFACfromARG::@return: scope:[subFACfromARG] from subFACfromARG + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from gen_sintab::@17 gen_sintab::@9 + (byte*) divMEMbyFAC::mem#2 ← phi( gen_sintab::@17/(const byte*) divMEMbyFAC::mem#1 gen_sintab::@9/(const byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) divMEMbyFAC::mem#2 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from gen_sintab::@14 gen_sintab::@19 + (byte*) mulFACbyMEM::mem#2 ← phi( gen_sintab::@14/(const byte*) mulFACbyMEM::mem#0 gen_sintab::@19/(const byte*) mulFACbyMEM::mem#1 ) + (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from gen_sintab::@18 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -13357,10 +13864,10 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Not culling empty block because it shares successor with its predecessor. (label) anim::@9 Not culling empty block because it shares successor with its predecessor. (label) anim::@10 @@ -13386,7 +13893,7 @@ Alias (byte) init::i#2 = (byte~) init::$1 Succesful SSA optimization Pass2AliasElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -13477,7 +13984,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -13820,10 +14327,10 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Not aliassing across scopes: prepareMEM::mem#5 prepareMEM::mem#2 Not aliassing across scopes: setFAC::w#5 setFAC::w#0 @@ -13847,7 +14354,7 @@ Self Phi Eliminated (byte*) gen_chargen_sprite::chargen#7 Succesful SSA optimization Pass2SelfPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -13938,7 +14445,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -14281,17 +14788,17 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Redundant Phi (byte) gen_chargen_sprite::y#10 (byte) gen_chargen_sprite::y#2 Redundant Phi (byte*) gen_chargen_sprite::chargen#7 (byte*) gen_chargen_sprite::chargen#1 Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -14382,7 +14889,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -14723,10 +15230,10 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Multiple usages for variable. Not optimizing sub-constant (byte) place_sprites::spr_x#2 Multiple usages for variable. Not optimizing sub-constant (byte*) gen_sprites::spr#2 @@ -14755,7 +15262,7 @@ Self Phi Eliminated (byte*) gen_chargen_sprite::chargen#1 Succesful SSA optimization Pass2SelfPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -14846,7 +15353,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -15187,16 +15694,16 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Redundant Phi (byte*) gen_chargen_sprite::chargen#1 (byte*) gen_chargen_sprite::chargen#0 Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -15287,7 +15794,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -15627,10 +16134,10 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 Multiple usages for variable. Not optimizing sub-constant (byte) place_sprites::spr_x#2 Multiple usages for variable. Not optimizing sub-constant (byte*) gen_sprites::spr#2 @@ -15822,7 +16329,7 @@ Constant inlined anim::j2#0 = (byte/signed byte/word/signed word) 12 Succesful SSA optimization Pass2ConstantInlining CONTROL FLOW GRAPH @begin: scope:[] from - to:@42 + to:@43 prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setFAC setMEMtoFAC (byte*) prepareMEM::mem#5 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#2 divMEMbyFAC/(byte*) prepareMEM::mem#3 mulFACbyMEM/(byte*) prepareMEM::mem#4 setFAC/(byte*) prepareMEM::mem#0 setMEMtoFAC/(byte*) prepareMEM::mem#1 ) (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 @@ -15913,7 +16420,7 @@ sinFAC: scope:[sinFAC] from gen_sintab::@18 sinFAC::@return: scope:[sinFAC] from sinFAC return to:@return -main: scope:[main] from @42 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@6 @@ -16253,13 +16760,13 @@ gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 gen_sintab::@return: scope:[gen_sintab] from gen_sintab::@23 return to:@return -@42: scope:[] from @begin +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 FINAL SYMBOL TABLE -(label) @42 +(label) @43 (label) @begin (label) @end (byte*) BORDERCOL @@ -16575,7 +17082,7 @@ FINAL SYMBOL TABLE (void()) subFACfromARG() (label) subFACfromARG::@return -Block Sequence Planned @begin @42 @end main main::@2 main::@3 main::@6 main::@return anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@9 anim::@4 anim::@10 anim::@5 anim::@return init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return clear_screen clear_screen::@1 clear_screen::@return gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return place_sprites place_sprites::@1 place_sprites::@return +Block Sequence Planned @begin @43 @end main main::@2 main::@3 main::@6 main::@return anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@9 anim::@4 anim::@10 anim::@5 anim::@return init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return clear_screen clear_screen::@1 clear_screen::@return gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return place_sprites place_sprites::@1 place_sprites::@return Added new block during phi lifting main::@7(between main::@6 and main::@2) Added new block during phi lifting anim::@11(between anim::@3 and anim::@1) Added new block during phi lifting anim::@12(between anim::@1 and anim::@2) @@ -16592,15 +17099,15 @@ Added new block during phi lifting gen_chargen_sprite::@12(between gen_chargen_s Added new block during phi lifting gen_chargen_sprite::@13(between gen_chargen_sprite::@5 and gen_chargen_sprite::@4) Added new block during phi lifting gen_chargen_sprite::@14(between gen_chargen_sprite::@4 and gen_chargen_sprite::@5) Added new block during phi lifting place_sprites::@3(between place_sprites::@1 and place_sprites::@1) -Block Sequence Planned @begin @42 @end main main::@2 main::@3 main::@6 main::@return main::@7 anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@9 anim::@4 anim::@10 anim::@5 anim::@return anim::@15 anim::@14 anim::@11 anim::@13 anim::@12 init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return init::@11 clear_screen clear_screen::@1 clear_screen::@return clear_screen::@3 gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return gen_sintab::@24 progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return progress_inc::@3 getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_sprites::@4 gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return gen_chargen_sprite::@11 gen_chargen_sprite::@12 gen_chargen_sprite::@13 gen_chargen_sprite::@14 place_sprites place_sprites::@1 place_sprites::@return place_sprites::@3 +Block Sequence Planned @begin @43 @end main main::@2 main::@3 main::@6 main::@return main::@7 anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@9 anim::@4 anim::@10 anim::@5 anim::@return anim::@15 anim::@14 anim::@11 anim::@13 anim::@12 init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return init::@11 clear_screen clear_screen::@1 clear_screen::@return clear_screen::@3 gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return gen_sintab::@24 progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return progress_inc::@3 getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_sprites::@4 gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return gen_chargen_sprite::@11 gen_chargen_sprite::@12 gen_chargen_sprite::@13 gen_chargen_sprite::@14 place_sprites place_sprites::@1 place_sprites::@return place_sprites::@3 CONTROL FLOW GRAPH - PHI LIFTED @begin: scope:[] from - to:@42 -@42: scope:[] from @begin + to:@43 +@43: scope:[] from @begin call main param-assignment to:@end -@end: scope:[] from @42 -main: scope:[main] from @42 +@end: scope:[] from @43 +main: scope:[main] from @43 call init param-assignment to:main::@2 main::@2: scope:[main] from main main::@2 main::@7 @@ -17125,7 +17632,7 @@ place_sprites::@3: scope:[place_sprites] from place_sprites::@1 to:place_sprites::@1 Adding NOP phi() at start of @begin -Adding NOP phi() at start of @42 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -17225,14 +17732,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - LIVE RANGES FOUND @begin: scope:[] from [0] phi() [ ] - to:@42 -@42: scope:[] from @begin + to:@43 +@43: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 [3] phi() [ ] -main: scope:[main] from @42 +main: scope:[main] from @43 [4] phi() [ ] [5] call init param-assignment [ ] to:main::@2 @@ -17870,9 +18377,9 @@ Culled Empty Block (label) gen_chargen_sprite::@12 Culled Empty Block (label) gen_chargen_sprite::@13 Culled Empty Block (label) gen_chargen_sprite::@14 Culled Empty Block (label) place_sprites::@3 -Block Sequence Planned @begin @42 @end main main::@2 main::@3 main::@6 main::@return anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@4 anim::@5 anim::@return anim::@15 anim::@14 init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return clear_screen clear_screen::@1 clear_screen::@return gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return place_sprites place_sprites::@1 place_sprites::@return +Block Sequence Planned @begin @43 @end main main::@2 main::@3 main::@6 main::@return anim anim::@1 anim::@6 anim::@2 anim::@7 anim::@3 anim::@8 anim::@4 anim::@5 anim::@return anim::@15 anim::@14 init init::@1 init::@2 init::@4 init::@5 init::@6 init::@7 init::@8 init::@9 init::@return clear_screen clear_screen::@1 clear_screen::@return gen_sintab gen_sintab::@3 gen_sintab::@4 gen_sintab::@5 gen_sintab::@6 gen_sintab::@7 gen_sintab::@8 gen_sintab::@9 gen_sintab::@10 gen_sintab::@11 gen_sintab::@12 gen_sintab::@1 gen_sintab::@14 gen_sintab::@15 gen_sintab::@16 gen_sintab::@17 gen_sintab::@18 gen_sintab::@19 gen_sintab::@20 gen_sintab::@21 gen_sintab::@22 gen_sintab::@23 gen_sintab::@return progress_inc progress_inc::@2 progress_inc::@1 progress_inc::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@1 setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return subFACfromARG subFACfromARG::@return setARGtoFAC setARGtoFAC::@return progress_init progress_init::@return gen_sprites gen_sprites::@1 gen_sprites::@3 gen_sprites::@return gen_chargen_sprite gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite::@7 gen_chargen_sprite::@5 gen_chargen_sprite::@8 gen_chargen_sprite::@9 gen_chargen_sprite::@10 gen_chargen_sprite::@return place_sprites place_sprites::@1 place_sprites::@return Adding NOP phi() at start of @begin -Adding NOP phi() at start of @42 +Adding NOP phi() at start of @43 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@3 @@ -17955,14 +18462,14 @@ Propagating live ranges... CONTROL FLOW GRAPH - BEFORE EFFECTIVE LIVE RANGES @begin: scope:[] from [0] phi() [ ] - to:@42 -@42: scope:[] from @begin + to:@43 +@43: scope:[] from @begin [1] phi() [ ] [2] call main param-assignment [ ] to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 [3] phi() [ ] -main: scope:[main] from @42 +main: scope:[main] from @43 [4] phi() [ ] [5] call init param-assignment [ ] to:main::@2 @@ -18426,14 +18933,14 @@ place_sprites::@return: scope:[place_sprites] from place_sprites::@1 CONTROL FLOW GRAPH - PHI MEM COALESCED @begin: scope:[] from [0] phi() [ ] ( ) - to:@42 -@42: scope:[] from @begin + to:@43 +@43: scope:[] from @begin [1] phi() [ ] ( ) [2] call main param-assignment [ ] ( ) to:@end -@end: scope:[] from @42 +@end: scope:[] from @43 [3] phi() [ ] ( ) -main: scope:[main] from @42 +main: scope:[main] from @43 [4] phi() [ ] ( main:2 [ ] ) [5] call init param-assignment [ ] ( main:2 [ ] ) to:main::@2 @@ -18896,111 +19403,111 @@ place_sprites::@return: scope:[place_sprites] from place_sprites::@1 DOMINATORS @begin dominated by @begin -@42 dominated by @begin @42 -@end dominated by @end @begin @42 -main dominated by main @begin @42 -main::@2 dominated by main::@2 main @begin @42 -main::@3 dominated by main::@2 main::@3 main @begin @42 -main::@6 dominated by main::@2 main::@6 main::@3 main @begin @42 -main::@return dominated by main::@2 main::@6 main::@3 main::@return main @begin @42 -anim dominated by main::@2 main::@3 anim main @begin @42 -anim::@1 dominated by main::@2 main::@3 anim anim::@1 main @begin @42 -anim::@6 dominated by main::@2 main::@3 anim anim::@6 anim::@1 main @begin @42 -anim::@2 dominated by main::@2 main::@3 anim anim::@2 anim::@1 main @begin @42 -anim::@7 dominated by main::@2 main::@3 anim anim::@2 anim::@1 anim::@7 main @begin @42 -anim::@3 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 main @begin @42 -anim::@8 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@8 main @begin @42 -anim::@4 dominated by main::@2 main::@3 anim anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @42 -anim::@5 dominated by main::@2 main::@3 anim anim::@5 anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @42 -anim::@return dominated by main::@2 main::@3 anim anim::@5 anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 anim::@return main @begin @42 -anim::@15 dominated by main::@2 main::@3 anim anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @42 anim::@15 -anim::@14 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@8 main @begin @42 anim::@14 -init dominated by init main @begin @42 -init::@1 dominated by init main @begin init::@1 @42 -init::@2 dominated by init main @begin init::@2 init::@1 @42 -init::@4 dominated by init main @begin init::@2 init::@1 init::@4 @42 -init::@5 dominated by init main @begin init::@2 init::@1 init::@5 init::@4 @42 -init::@6 dominated by init main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 -init::@7 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 @42 -init::@8 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@8 @42 -init::@9 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@9 init::@8 @42 -init::@return dominated by init main @begin init::@return init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@9 init::@8 @42 -clear_screen dominated by init clear_screen main @begin @42 -clear_screen::@1 dominated by init clear_screen main @begin @42 clear_screen::@1 -clear_screen::@return dominated by init clear_screen main @begin @42 clear_screen::@1 clear_screen::@return -gen_sintab dominated by init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 -gen_sintab::@3 dominated by init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@4 dominated by init gen_sintab main gen_sintab::@4 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@5 dominated by init gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@6 dominated by init gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@7 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@8 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@9 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@10 dominated by gen_sintab::@10 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@11 dominated by gen_sintab::@10 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@12 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -gen_sintab::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@14 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@15 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@15 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@16 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@17 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@17 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@18 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@19 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@20 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@20 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@21 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@22 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@23 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@23 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -gen_sintab::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@23 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 gen_sintab::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -progress_inc dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -progress_inc::@2 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@2 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -progress_inc::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -progress_inc::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 progress_inc::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -getFAC dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 getFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -getFAC::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 getFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 getFAC::@return -addMEMtoFAC dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -addMEMtoFAC::@1 dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC::@1 addMEMtoFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -addMEMtoFAC::@return dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC::@1 addMEMtoFAC addMEMtoFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -prepareMEM dominated by init prepareMEM gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 -prepareMEM::@return dominated by init prepareMEM gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 prepareMEM::@return -mulFACbyMEM dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -mulFACbyMEM::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 mulFACbyMEM::@1 gen_sintab::@3 gen_sintab::@1 -mulFACbyMEM::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM::@return mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 mulFACbyMEM::@1 gen_sintab::@3 gen_sintab::@1 -sinFAC dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init sinFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -sinFAC::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init sinFAC sinFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 gen_sintab::@1 -divMEMbyFAC dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 divMEMbyFAC gen_sintab::@3 -divMEMbyFAC::@1 dominated by init divMEMbyFAC::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 divMEMbyFAC gen_sintab::@3 -divMEMbyFAC::@return dominated by init divMEMbyFAC::@1 divMEMbyFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 divMEMbyFAC gen_sintab::@3 -setFAC dominated by init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 -setFAC::@1 dominated by init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 setFAC::@1 -setFAC::@return dominated by setFAC::@return init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 setFAC::@1 -setMEMtoFAC dominated by init setMEMtoFAC gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -setMEMtoFAC::@1 dominated by init setMEMtoFAC setMEMtoFAC::@1 gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -setMEMtoFAC::@return dominated by init setMEMtoFAC setMEMtoFAC::@1 gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 setMEMtoFAC::@return gen_sintab::@3 -subFACfromARG dominated by init subFACfromARG gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -subFACfromARG::@return dominated by init subFACfromARG gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 subFACfromARG::@return gen_sintab::@3 -setARGtoFAC dominated by setARGtoFAC init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -setARGtoFAC::@return dominated by setARGtoFAC init gen_sintab main setARGtoFAC::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @42 gen_sintab::@3 -progress_init dominated by init progress_init main @begin init::@2 init::@1 init::@5 init::@4 @42 -progress_init::@return dominated by init progress_init main @begin init::@2 init::@1 init::@5 init::@4 @42 progress_init::@return -gen_sprites dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @42 -gen_sprites::@1 dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_sprites::@3 dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 gen_sprites::@3 -gen_sprites::@return dominated by init main gen_sprites::@return @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 gen_sprites::@3 -gen_chargen_sprite dominated by init gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@1 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@2 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@6 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@3 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@4 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@7 dominated by init gen_chargen_sprite::@7 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@5 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@8 dominated by init gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@9 dominated by init gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@10 dominated by init gen_chargen_sprite::@10 gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -gen_chargen_sprite::@return dominated by init gen_chargen_sprite::@10 gen_chargen_sprite::@return gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @42 gen_sprites::@1 -place_sprites dominated by init main @begin init::@2 init::@1 @42 place_sprites -place_sprites::@1 dominated by init place_sprites::@1 main @begin init::@2 init::@1 @42 place_sprites -place_sprites::@return dominated by init place_sprites::@return place_sprites::@1 main @begin init::@2 init::@1 @42 place_sprites +@43 dominated by @begin @43 +@end dominated by @end @begin @43 +main dominated by main @begin @43 +main::@2 dominated by main::@2 main @begin @43 +main::@3 dominated by main::@2 main::@3 main @begin @43 +main::@6 dominated by main::@2 main::@6 main::@3 main @begin @43 +main::@return dominated by main::@2 main::@6 main::@3 main::@return main @begin @43 +anim dominated by main::@2 main::@3 anim main @begin @43 +anim::@1 dominated by main::@2 main::@3 anim anim::@1 main @begin @43 +anim::@6 dominated by main::@2 main::@3 anim anim::@6 anim::@1 main @begin @43 +anim::@2 dominated by main::@2 main::@3 anim anim::@2 anim::@1 main @begin @43 +anim::@7 dominated by main::@2 main::@3 anim anim::@2 anim::@1 anim::@7 main @begin @43 +anim::@3 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 main @begin @43 +anim::@8 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@8 main @begin @43 +anim::@4 dominated by main::@2 main::@3 anim anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @43 +anim::@5 dominated by main::@2 main::@3 anim anim::@5 anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @43 +anim::@return dominated by main::@2 main::@3 anim anim::@5 anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 anim::@return main @begin @43 +anim::@15 dominated by main::@2 main::@3 anim anim::@4 anim::@3 anim::@2 anim::@1 anim::@8 main @begin @43 anim::@15 +anim::@14 dominated by main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@8 main @begin @43 anim::@14 +init dominated by init main @begin @43 +init::@1 dominated by init main @begin init::@1 @43 +init::@2 dominated by init main @begin init::@2 init::@1 @43 +init::@4 dominated by init main @begin init::@2 init::@1 init::@4 @43 +init::@5 dominated by init main @begin init::@2 init::@1 init::@5 init::@4 @43 +init::@6 dominated by init main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 +init::@7 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 @43 +init::@8 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@8 @43 +init::@9 dominated by init main @begin init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@9 init::@8 @43 +init::@return dominated by init main @begin init::@return init::@2 init::@1 init::@7 init::@6 init::@5 init::@4 init::@9 init::@8 @43 +clear_screen dominated by init clear_screen main @begin @43 +clear_screen::@1 dominated by init clear_screen main @begin @43 clear_screen::@1 +clear_screen::@return dominated by init clear_screen main @begin @43 clear_screen::@1 clear_screen::@return +gen_sintab dominated by init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 +gen_sintab::@3 dominated by init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@4 dominated by init gen_sintab main gen_sintab::@4 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@5 dominated by init gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@6 dominated by init gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@7 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@8 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@9 dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@10 dominated by gen_sintab::@10 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@11 dominated by gen_sintab::@10 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@12 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +gen_sintab::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@14 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@15 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@15 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@16 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@17 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@17 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@18 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@19 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@20 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@20 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@21 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@22 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@23 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@23 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +gen_sintab::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@23 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 gen_sintab::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +progress_inc dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +progress_inc::@2 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@2 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +progress_inc::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +progress_inc::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 progress_inc gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 gen_sintab::@22 progress_inc::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 progress_inc::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +getFAC dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 getFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +getFAC::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 gen_sintab::@19 init gen_sintab::@21 gen_sintab::@20 getFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 getFAC::@return +addMEMtoFAC dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +addMEMtoFAC::@1 dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC::@1 addMEMtoFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +addMEMtoFAC::@return dominated by gen_sintab::@10 gen_sintab::@11 init addMEMtoFAC::@1 addMEMtoFAC addMEMtoFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +prepareMEM dominated by init prepareMEM gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 +prepareMEM::@return dominated by init prepareMEM gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 prepareMEM::@return +mulFACbyMEM dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +mulFACbyMEM::@1 dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 mulFACbyMEM::@1 gen_sintab::@3 gen_sintab::@1 +mulFACbyMEM::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 mulFACbyMEM::@return mulFACbyMEM init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 mulFACbyMEM::@1 gen_sintab::@3 gen_sintab::@1 +sinFAC dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init sinFAC gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +sinFAC::@return dominated by gen_sintab::@10 gen_sintab::@12 gen_sintab::@11 gen_sintab::@14 gen_sintab::@16 gen_sintab::@15 gen_sintab::@18 gen_sintab::@17 init sinFAC sinFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 gen_sintab::@1 +divMEMbyFAC dominated by init gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 divMEMbyFAC gen_sintab::@3 +divMEMbyFAC::@1 dominated by init divMEMbyFAC::@1 gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 divMEMbyFAC gen_sintab::@3 +divMEMbyFAC::@return dominated by init divMEMbyFAC::@1 divMEMbyFAC::@return gen_sintab gen_sintab::@6 gen_sintab::@7 main gen_sintab::@4 gen_sintab::@5 gen_sintab::@8 gen_sintab::@9 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 divMEMbyFAC gen_sintab::@3 +setFAC dominated by init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 +setFAC::@1 dominated by init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 setFAC::@1 +setFAC::@return dominated by setFAC::@return init setFAC gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 setFAC::@1 +setMEMtoFAC dominated by init setMEMtoFAC gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +setMEMtoFAC::@1 dominated by init setMEMtoFAC setMEMtoFAC::@1 gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +setMEMtoFAC::@return dominated by init setMEMtoFAC setMEMtoFAC::@1 gen_sintab main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 setMEMtoFAC::@return gen_sintab::@3 +subFACfromARG dominated by init subFACfromARG gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +subFACfromARG::@return dominated by init subFACfromARG gen_sintab gen_sintab::@6 main gen_sintab::@4 gen_sintab::@5 @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 subFACfromARG::@return gen_sintab::@3 +setARGtoFAC dominated by setARGtoFAC init gen_sintab main @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +setARGtoFAC::@return dominated by setARGtoFAC init gen_sintab main setARGtoFAC::@return @begin init::@2 init::@1 init::@6 init::@5 init::@4 @43 gen_sintab::@3 +progress_init dominated by init progress_init main @begin init::@2 init::@1 init::@5 init::@4 @43 +progress_init::@return dominated by init progress_init main @begin init::@2 init::@1 init::@5 init::@4 @43 progress_init::@return +gen_sprites dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @43 +gen_sprites::@1 dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_sprites::@3 dominated by init main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 gen_sprites::@3 +gen_sprites::@return dominated by init main gen_sprites::@return @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 gen_sprites::@3 +gen_chargen_sprite dominated by init gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@1 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@2 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@6 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@6 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@3 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@4 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@7 dominated by init gen_chargen_sprite::@7 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@5 dominated by init gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@8 dominated by init gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@9 dominated by init gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@10 dominated by init gen_chargen_sprite::@10 gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +gen_chargen_sprite::@return dominated by init gen_chargen_sprite::@10 gen_chargen_sprite::@return gen_chargen_sprite::@9 gen_chargen_sprite::@8 gen_chargen_sprite::@1 gen_chargen_sprite::@2 gen_chargen_sprite::@5 gen_chargen_sprite::@3 gen_chargen_sprite::@4 gen_chargen_sprite main @begin gen_sprites init::@2 init::@1 init::@4 @43 gen_sprites::@1 +place_sprites dominated by init main @begin init::@2 init::@1 @43 place_sprites +place_sprites::@1 dominated by init place_sprites::@1 main @begin init::@2 init::@1 @43 place_sprites +place_sprites::@return dominated by init place_sprites::@return place_sprites::@1 main @begin init::@2 init::@1 @43 place_sprites Found back edge: Loop head: main::@2 tails: main::@2 blocks: null Found back edge: Loop head: main::@2 tails: main::@6 blocks: null @@ -19485,17 +19992,17 @@ INITIAL ASM .label sin_idx_y = 3 //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @42 [phi:@begin->@42] -b42_from_bbegin: - jmp b42 -//SEG4 @42 -b42: +//SEG3 [1] phi from @begin to @43 [phi:@begin->@43] +b43_from_bbegin: + jmp b43 +//SEG4 @43 +b43: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @42 to main [phi:@42->main] -main_from_b42: +//SEG6 [4] phi from @43 to main [phi:@43->main] +main_from_b43: jsr main -//SEG7 [3] phi from @42 to @end [phi:@42->@end] -bend_from_b42: +//SEG7 [3] phi from @43 to @end [phi:@43->@end] +bend_from_b43: jmp bend //SEG8 @end bend: @@ -21264,17 +21771,17 @@ ASSEMBLER BEFORE OPTIMIZATION .label sin_idx_y = 3 //SEG2 @begin bbegin: -//SEG3 [1] phi from @begin to @42 [phi:@begin->@42] -b42_from_bbegin: - jmp b42 -//SEG4 @42 -b42: +//SEG3 [1] phi from @begin to @43 [phi:@begin->@43] +b43_from_bbegin: + jmp b43 +//SEG4 @43 +b43: //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @42 to main [phi:@42->main] -main_from_b42: +//SEG6 [4] phi from @43 to main [phi:@43->main] +main_from_b43: jsr main -//SEG7 [3] phi from @42 to @end [phi:@42->@end] -bend_from_b42: +//SEG7 [3] phi from @43 to @end [phi:@43->@end] +bend_from_b43: jmp bend //SEG8 @end bend: @@ -22571,7 +23078,7 @@ place_sprites: { } ASSEMBLER OPTIMIZATIONS -Removing instruction jmp b42 +Removing instruction jmp b43 Removing instruction jmp bend Removing instruction jmp b2 Removing instruction jmp b3 @@ -22691,9 +23198,9 @@ Replacing label b2_from_b8 with b2 Replacing label b1_from_b9 with b1 Replacing label b1_from_b1 with b1 Removing instruction bbegin: -Removing instruction b42_from_bbegin: -Removing instruction main_from_b42: -Removing instruction bend_from_b42: +Removing instruction b43_from_bbegin: +Removing instruction main_from_b43: +Removing instruction bend_from_b43: Removing instruction b2_from_b6: Removing instruction b3_from_b2: Removing instruction b1_from_b3: @@ -22760,7 +23267,7 @@ Removing instruction b4_from_b5: Removing instruction b5_from_b4: Removing instruction b1_from_b1: Succesful ASM optimization Pass5RedundantLabelElimination -Removing instruction b42: +Removing instruction b43: Removing instruction bend: Removing instruction init_from_main: Removing instruction b2_from_main: @@ -22888,7 +23395,7 @@ Removing instruction jmp b2 Succesful ASM optimization Pass5NextJumpElimination FINAL SYMBOL TABLE -(label) @42 +(label) @43 (label) @begin (label) @end (byte*) BORDERCOL @@ -23261,12 +23768,12 @@ FINAL CODE .label sin_idx_x = 2 .label sin_idx_y = 3 //SEG2 @begin -//SEG3 [1] phi from @begin to @42 [phi:@begin->@42] -//SEG4 @42 +//SEG3 [1] phi from @begin to @43 [phi:@begin->@43] +//SEG4 @43 //SEG5 [2] call main param-assignment [ ] ( ) -//SEG6 [4] phi from @42 to main [phi:@42->main] +//SEG6 [4] phi from @43 to main [phi:@43->main] jsr main -//SEG7 [3] phi from @42 to @end [phi:@42->@end] +//SEG7 [3] phi from @43 to @end [phi:@43->@end] //SEG8 @end //SEG9 main main: { diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.sym b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.sym index c0e287536..2b5ee4c32 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.sym +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-sprites.sym @@ -1,4 +1,4 @@ -(label) @42 +(label) @43 (label) @begin (label) @end (byte*) BORDERCOL diff --git a/src/main/java/dk/camelot64/kickc/test/true-inline-words.kc b/src/main/java/dk/camelot64/kickc/test/true-inline-words.kc new file mode 100644 index 000000000..bb2077811 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/true-inline-words.kc @@ -0,0 +1,10 @@ + +void main() { + byte[] bs = { 'c', 'm' }; // constant byte array + byte b = 4; // constant byte + word w = { b, 0 }; // constant inline word + word w2 = { 1, 1 } + w; // constant inline word inside expression + byte* sc = w2; // implicit cast to (byte*) + *sc = bs[0]; +} +